Commit d278dc7b by huangjy

fix::删除房间后,需将设备与房间的关系也一起删掉

parent 344d6a51
...@@ -11,12 +11,14 @@ import com.makeit.dto.platform.space.PlatRoomQueryDTO; ...@@ -11,12 +11,14 @@ import com.makeit.dto.platform.space.PlatRoomQueryDTO;
import com.makeit.dto.platform.workstation.WorkStationQueryDTO; import com.makeit.dto.platform.workstation.WorkStationQueryDTO;
import com.makeit.entity.platform.space.PlatBed; import com.makeit.entity.platform.space.PlatBed;
import com.makeit.entity.platform.space.PlatRoom; import com.makeit.entity.platform.space.PlatRoom;
import com.makeit.entity.platform.space.PlatRoomBedDevice;
import com.makeit.entity.platform.space.PlatSpace; import com.makeit.entity.platform.space.PlatSpace;
import com.makeit.enums.CodeMessageEnum; import com.makeit.enums.CodeMessageEnum;
import com.makeit.enums.CommonEnum; import com.makeit.enums.CommonEnum;
import com.makeit.exception.BusinessException; import com.makeit.exception.BusinessException;
import com.makeit.mapper.platform.space.PlatRoomMapper; import com.makeit.mapper.platform.space.PlatRoomMapper;
import com.makeit.service.platform.space.PlatBedService; import com.makeit.service.platform.space.PlatBedService;
import com.makeit.service.platform.space.PlatRoomBedDeviceService;
import com.makeit.service.platform.space.PlatRoomService; import com.makeit.service.platform.space.PlatRoomService;
import com.makeit.service.platform.space.PlatSpaceService; import com.makeit.service.platform.space.PlatSpaceService;
import com.makeit.utils.data.convert.BeanDtoVoUtils; import com.makeit.utils.data.convert.BeanDtoVoUtils;
...@@ -46,6 +48,8 @@ public class PlatRoomServiceImpl extends ServiceImpl<PlatRoomMapper, PlatRoom> i ...@@ -46,6 +48,8 @@ public class PlatRoomServiceImpl extends ServiceImpl<PlatRoomMapper, PlatRoom> i
private PlatBedService platBedService; private PlatBedService platBedService;
@Autowired @Autowired
private PlatSpaceService platSpaceService; private PlatSpaceService platSpaceService;
@Autowired
private PlatRoomBedDeviceService platRoomBedDeviceService;
private void checkName(PlatRoom platRoom){ private void checkName(PlatRoom platRoom){
...@@ -121,6 +125,9 @@ public class PlatRoomServiceImpl extends ServiceImpl<PlatRoomMapper, PlatRoom> i ...@@ -121,6 +125,9 @@ public class PlatRoomServiceImpl extends ServiceImpl<PlatRoomMapper, PlatRoom> i
//删除床位 //删除床位
platBedService.remove(new QueryWrapper<PlatBed>().lambda() platBedService.remove(new QueryWrapper<PlatBed>().lambda()
.in(PlatBed::getRoomId, ids)); .in(PlatBed::getRoomId, ids));
platRoomBedDeviceService.remove(new QueryWrapper<PlatRoomBedDevice>().lambda()
.in(PlatRoomBedDevice::getRoomId, ids));
} }
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment