Przeglądaj źródła

第二版,安装bug

suntianwu 3 lat temu
rodzic
commit
a93077026d

+ 2 - 2
src/main/java/com/care/common/entity/CareRoomGate.java

@@ -63,8 +63,8 @@ public class CareRoomGate implements Serializable {
 
 
     @ApiModelProperty("高(m)")
-    @TableField("HIGHT")
-    private Double hight;
+    @TableField("HEIGHT")
+    private Double height;
 
     @ApiModelProperty("mqtt返回配置结果")
     @TableField("ACK")

+ 19 - 1
src/main/java/com/care/installation/service/RoomService.java

@@ -120,8 +120,20 @@ public class RoomService {
     }
 
     public Boolean saveRoomSensor(RoomSensorVO vo) {
+        if (StringUtils.isEmpty(vo.getRoomId())){
+            return false;
+        }
+
         CareRoomSensor careRoomSensor = new CareRoomSensor();
         BeanUtil.copyProperties(vo,careRoomSensor);
+
+        QueryWrapper<CareRoomSensor> queryWrapper = new QueryWrapper<>();
+        queryWrapper.lambda().eq(CareRoomSensor::getRoomId,careRoomSensor.getRoomId());
+        CareRoomSensor careRoomSensorDb = this.careRoomSensorService.getOne(queryWrapper);
+        if(careRoomSensorDb != null ){
+            careRoomSensor.setId(careRoomSensorDb.getId());
+        }
+
         if (careRoomSensor.getId() != null) {  //修改
             careRoomSensor.setModifyTime(new Date());
             return this.careRoomSensorService.updateById(careRoomSensor);
@@ -160,6 +172,9 @@ public class RoomService {
     }
 
     public Boolean saveRoomGate(RoomGateVO vo) {
+        if (StringUtils.isEmpty(vo.getRoomId())){
+            return false;
+        }
         CareRoomGate careRoomGate = new CareRoomGate();
         BeanUtil.copyProperties(vo,careRoomGate);
         if (careRoomGate.getId() != null) {  //修改
@@ -207,6 +222,9 @@ public class RoomService {
     }
 
     public Boolean saveRoomRegion(RoomRegionVO vo) {
+        if (StringUtils.isEmpty(vo.getRoomId())){
+            return false;
+        }
         CareRoomRegion careRoomRegion = new CareRoomRegion();
         BeanUtil.copyProperties(vo,careRoomRegion);
         if (careRoomRegion.getId() != null) {  //修改
@@ -374,7 +392,7 @@ public class RoomService {
 
             item.put("entranceLength",roomGateVO.getLength());
             item.put("width",roomGateVO.getWidth());
-            item.put("hight",roomGateVO.getHight());
+            item.put("hight",roomGateVO.getHeight());
             items.add(item);
         });
         msg.put("roomEntranceVOS",items);

+ 1 - 1
src/main/java/com/care/installation/vo/RoomGateVO.java

@@ -44,7 +44,7 @@ public class RoomGateVO implements Serializable {
 
 
     @ApiModelProperty("高(m)")
-    private Double hight;
+    private Double height;
 
     @ApiModelProperty("mqtt返回配置结果")
     private String ack;