Эх сурвалжийг харах

更改设备线路类型注释

hechunping 2 жил өмнө
parent
commit
5b714d174c

+ 3 - 2
device-api-service/src/main/java/com/xy/service/DeviceInfoServiceImpl.java

@@ -161,8 +161,9 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
         //绑定线路,更换线路
         if(DeviceInfoDto.UPDATE_LINE_UPDATE.equals(updateLine.getType())){
             DeviceInfo deviceInfo = new DeviceInfo();
+            deviceInfo.setPlaceLineId(updateLine.getPlaceLineId());
             luw.in(DeviceInfo::getDeviceId,updateLine.getDeviceIds());
-            baseMapper.update(deviceInfo.setPlaceLineId(updateLine.getPlaceLineId()),luw);
+            baseMapper.update(deviceInfo,luw);
         }
         //删除线路
         if(DeviceInfoDto.UPDATE_LINE_DEL.equals(updateLine.getType())) {
@@ -170,8 +171,8 @@ public class DeviceInfoServiceImpl extends ServiceImpl<DeviceInfoMapper, DeviceI
             luw.set(DeviceInfo::getPlaceLineId, null);
             baseMapper.update(null, luw);
         }
+        //解绑线路 设置线路ID为null
         if(DeviceInfoDto.UPDATE_LINE_CLEAR.equals(updateLine.getType())) {
-            //解绑线路 设置线路ID为null
             luw.in(DeviceInfo::getDeviceId, updateLine.getDeviceIds());
             luw.set(DeviceInfo::getPlaceLineId, null);
             baseMapper.update(null, luw);

+ 21 - 12
device-api/src/main/java/com/xy/dto/DeviceInfoDto.java

@@ -15,7 +15,19 @@ import java.util.List;
 @Data
 @Accessors(chain = true)
 public class DeviceInfoDto {
-    public final static String UPDATE_LINE_DEL = "del", UPDATE_LINE_UPDATE = "update" , UPDATE_LINE_CLEAR = "clear";
+    /**
+     * 删除线路时指定 传入 wherePlaceLineId
+     */
+    public final static String UPDATE_LINE_DEL = "del";
+    /**
+     * 更新线路时指定 传入 deviceIds、placeLineId
+     */
+    public final static String UPDATE_LINE_UPDATE = "update";
+    /**
+     * 解绑线路时指定 传入 deviceIds
+     */
+    public final static String UPDATE_LINE_CLEAR = "clear";
+
     @Data
     @Accessors(chain = true)
     public static class Obj {
@@ -38,11 +50,11 @@ public class DeviceInfoDto {
     @Accessors
     public static class UpdateLine {
         @NotNull(message = "更新类型")
-        @ApiModelProperty(value = "更新类型",required = true)
+        @ApiModelProperty(value = "更新类型", required = true)
         private String type;
 
         @NotNull(message = "商户id不能为空")
-        @ApiModelProperty(value = "商户id",required = true)
+        @ApiModelProperty(value = "商户id", required = true)
         private Long mercId;
 
         @ApiModelProperty("设备id集合")
@@ -108,6 +120,12 @@ public class DeviceInfoDto {
 
         @ApiModelProperty("附近最大距离,单位:米")
         private Integer nearby;
+        @ApiModelProperty(value = "系统信息", hidden = true)
+        private DeviceSysinfoDto.Vo deviceSysinfo;
+        @ApiModelProperty(value = "状态信息", hidden = true)
+        private DeviceStatusDto.Vo deviceStatus;
+        @ApiModelProperty(value = "注册信息", hidden = true)
+        private DeviceRegisterDto.Vo deviceRegister;
 
         public String getBeginActiveTime() {
             return beginActiveTime == null ? null : DataTime.toString(beginActiveTime.atTime(0, 0, 0));
@@ -116,15 +134,6 @@ public class DeviceInfoDto {
         public String getEndActiveTime() {
             return endActiveTime == null ? null : DataTime.toString(endActiveTime.atTime(23, 59, 59));
         }
-
-        @ApiModelProperty(value = "系统信息", hidden = true)
-        private DeviceSysinfoDto.Vo deviceSysinfo;
-
-        @ApiModelProperty(value = "状态信息", hidden = true)
-        private DeviceStatusDto.Vo deviceStatus;
-
-        @ApiModelProperty(value = "注册信息", hidden = true)
-        private DeviceRegisterDto.Vo deviceRegister;
     }
 
     @Data