|
@@ -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);
|