|
|
@@ -185,6 +185,9 @@ public class RoomBedServiceImpl extends MPJBaseServiceImpl<RoomBedMapper, RoomBe
|
|
|
if(allStayMaleCountMap.get(record.getId()) != null){
|
|
|
maleCount = allStayMaleCountMap.get(record.getId()) - (allArrangedMaleCountMap.get(record.getId()) == null ? 0 : allArrangedMaleCountMap.get(record.getId()));
|
|
|
}
|
|
|
+ if(maleCount < 0){
|
|
|
+ maleCount = 0;
|
|
|
+ }
|
|
|
record.setMaleCount(maleCount);
|
|
|
needCout = allStayMaleCountMap.get(record.getId());
|
|
|
if(allArrangedMaleCountMap.get(record.getId()) != null){
|
|
|
@@ -195,6 +198,9 @@ public class RoomBedServiceImpl extends MPJBaseServiceImpl<RoomBedMapper, RoomBe
|
|
|
if(allStayFemaleCountMap.get(record.getId()) != null){
|
|
|
femaleCount = allStayFemaleCountMap.get(record.getId()) - (allArrangedFemaleCountMap.get(record.getId()) == null ? 0 : allArrangedFemaleCountMap.get(record.getId()));
|
|
|
}
|
|
|
+ if(femaleCount < 0){
|
|
|
+ femaleCount = 0;
|
|
|
+ }
|
|
|
record.setFemaleCount(femaleCount);
|
|
|
needCout = femaleCount;
|
|
|
if(allArrangedFemaleCountMap.get(record.getId()) != null){
|
|
|
@@ -208,10 +214,16 @@ public class RoomBedServiceImpl extends MPJBaseServiceImpl<RoomBedMapper, RoomBe
|
|
|
if(allStayMaleCountMap.get(record.getId()) != null){
|
|
|
maleCount = allStayMaleCountMap.get(record.getId()) - (allArrangedMaleCountMap.get(record.getId()) == null ? 0 : allArrangedMaleCountMap.get(record.getId()));
|
|
|
}
|
|
|
+ if(maleCount < 0){
|
|
|
+ maleCount = 0;
|
|
|
+ }
|
|
|
record.setMaleCount(maleCount);
|
|
|
if(allStayFemaleCountMap.get(record.getId()) != null){
|
|
|
femaleCount = allStayFemaleCountMap.get(record.getId()) - (allArrangedFemaleCountMap.get(record.getId()) == null ? 0 : allArrangedFemaleCountMap.get(record.getId()));
|
|
|
}
|
|
|
+ if(femaleCount < 0){
|
|
|
+ femaleCount = 0;
|
|
|
+ }
|
|
|
record.setFemaleCount(femaleCount);
|
|
|
}
|
|
|
if(needCout == null){
|
|
|
@@ -261,13 +273,15 @@ public class RoomBedServiceImpl extends MPJBaseServiceImpl<RoomBedMapper, RoomBe
|
|
|
Map<Long, Integer> classDistributeBedNumber = new HashMap<>();
|
|
|
Map<Long, Integer> classStudent = new HashMap<>();
|
|
|
for (Integer genderNumber : genderSet) {
|
|
|
- //根据性别查询出所有床位信息
|
|
|
+ //根据性别查询出所有空床位信息
|
|
|
List<RoomBed> bedInfoList = roomBedMapper.selectList(
|
|
|
new MPJLambdaWrapper<RoomBed>()
|
|
|
.select(RoomBed::getId)
|
|
|
.select(RoomBed.class, x -> VoToColumnUtil.fieldsToColumns(RoomBed.class).contains(x.getProperty()))
|
|
|
.innerJoin(Room.class, Room::getId, RoomBed::getRoomId)
|
|
|
.eq(Room::getGender, genderMap.get(genderNumber))
|
|
|
+ .isNull(RoomBed::getStudentUserId)
|
|
|
+ .eq(RoomBed::getIsCheckIn, 0)
|
|
|
.in(RoomBed::getRoomId, dto.getRoomIds())
|
|
|
);
|
|
|
|