|
@@ -450,8 +450,14 @@ public class RoomBedServiceImpl extends MPJBaseServiceImpl<RoomBedMapper, RoomBe
|
|
|
updateWrapper.setSql("student_user_id = null");
|
|
|
updateWrapper.setSql("is_check_in = 0");
|
|
|
|
|
|
- RoomBed roomBed = roomBedMapper.selectOne(new QueryWrapper<RoomBed>().lambda().eq(RoomBed::getStudentUserId, dto.getStudentUserId()));
|
|
|
- roomBedMapper.update(roomBed, updateWrapper);
|
|
|
+ List<Long> roomIds = new ArrayList<>();
|
|
|
+
|
|
|
+ List<RoomBed> roomBedList = roomBedMapper.selectList(new QueryWrapper<RoomBed>().lambda().eq(RoomBed::getStudentUserId, dto.getStudentUserId()));
|
|
|
+ for (RoomBed roomBed : roomBedList) {
|
|
|
+ roomBedMapper.update(roomBed, updateWrapper);
|
|
|
+ roomIds.add(roomBed.getRoomId());
|
|
|
+ }
|
|
|
+
|
|
|
//再把学生保存到新的床位
|
|
|
roomBedMapper.updateById(new RoomBed(){{
|
|
|
setId(dto.getBedId());
|
|
@@ -459,8 +465,7 @@ public class RoomBedServiceImpl extends MPJBaseServiceImpl<RoomBedMapper, RoomBe
|
|
|
}});
|
|
|
|
|
|
//如果寝室的人是多个班级,将混合寝室改为是
|
|
|
- List<Long> roomIds = new ArrayList<>();
|
|
|
- roomIds.add(roomBed.getRoomId());
|
|
|
+
|
|
|
List<RoomClassCountVo> classCountVoList = roomMapper.getRoomClassCount(roomIds);
|
|
|
for (RoomClassCountVo roomClassCountVo : classCountVoList) {
|
|
|
if(roomClassCountVo.getClassCount() > 1){
|