Sfoglia il codice sorgente

新增 孢子仪载玻片培养液信息修改接口

zhaiyifei 1 anno fa
parent
commit
c0f25ea8aa

+ 6 - 0
src/main/java/com/yunfeiyun/agmp/iotm/device/bzy/controller/IotDeviceBzyController.java

@@ -284,6 +284,12 @@ public class IotDeviceBzyController extends BaseController {
         util.exportExcel(response, list, "设备数据");
     }
 
+    // 编辑拓展信息
+    @RequestMapping("/ext/edit")
+    public AjaxResult editExtInfo(@RequestBody IotDevice iotDevice) {
+        return toAjax(iIotDeviceService.updateIotDeviceExtInfo(iotDevice));
+    }
+
 //
 
 //

+ 2 - 0
src/main/java/com/yunfeiyun/agmp/iotm/web/mapper/IotDeviceMapper.java

@@ -67,4 +67,6 @@ public interface IotDeviceMapper
     List<IotDeviceListResVo> selectIotDeviceListByType(IotDeviceListReqVo reqVo);
 
     int setConnNullByDevBids(List<IotDevice> iotDeviceList);
+
+    public int updateIotDeviceExtInfo(IotDevice iotDevice);
 }

+ 2 - 0
src/main/java/com/yunfeiyun/agmp/iotm/web/service/IIotDeviceService.java

@@ -72,4 +72,6 @@ public interface IIotDeviceService {
 
     public String checkIotDeviceExist(String devtypeBid, String[] devCode);
 
+    public int updateIotDeviceExtInfo(IotDevice iotDevice);
+
 }

+ 16 - 0
src/main/java/com/yunfeiyun/agmp/iotm/web/service/impl/IotDeviceServiceImpl.java

@@ -395,4 +395,20 @@ public class IotDeviceServiceImpl implements IIotDeviceService
         }
         return null;
     }
+
+    @Override
+    public int updateIotDeviceExtInfo(IotDevice iotDevice) {
+        String devBid = iotDevice.getDevBid();
+        String extInfo = iotDevice.getExtInfo();
+        if(StringUtils.isEmpty(devBid) || StringUtils.isEmpty(extInfo)){
+            throw new IotBizException(ErrorCode.INVALID_PARAMETER.getCode(),"参数不合法");
+        }
+        IotDevice updateIotDevice = selectIotDeviceByDevBid(devBid);
+        if(updateIotDevice == null){
+            throw new IotBizException(ErrorCode.INVALID_PARAMETER.getCode(),"设备不存在");
+        }
+        updateIotDevice.setExtInfo(iotDevice.getExtInfo());
+        updateIotDevice.setDevUpdateddate(DateUtils.dateTimeNow());
+        return iotDeviceMapper.updateIotDeviceExtInfo(iotDevice);
+    }
 }

+ 4 - 0
src/main/resources/mapper/IotDeviceMapper.xml

@@ -352,6 +352,10 @@
         </foreach>
     </update>
 
+    <update id="updateIotDeviceExtInfo">
+        update IotDevice set extInfo = #{extInfo} where devBid = #{devBid}
+    </update>
+
     <delete id="deleteIotDeviceByDevBid" parameterType="String">
         update IotDevice set devDelstatus = '1'
         where devBid = #{devBid} and devDelstatus = '0'