|
|
@@ -41,6 +41,7 @@ import com.xjrsoft.module.room.vo.NoBedStudentPageVo;
|
|
|
import com.xjrsoft.module.room.vo.RoomBedExcelVo;
|
|
|
import com.xjrsoft.module.room.vo.RoomBedPageVo;
|
|
|
import com.xjrsoft.module.room.vo.RoomClassCountVo;
|
|
|
+import com.xjrsoft.module.room.vo.StudentPayStatusVo;
|
|
|
import com.xjrsoft.module.student.entity.BaseStudent;
|
|
|
import com.xjrsoft.module.student.entity.BaseStudentSchoolRoll;
|
|
|
import com.xjrsoft.module.student.mapper.BaseStudentMapper;
|
|
|
@@ -260,6 +261,11 @@ public class RoomBedServiceImpl extends MPJBaseServiceImpl<RoomBedMapper, RoomBe
|
|
|
return roomBedMapper.getDistributeRoomBedInfo(page, dto);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 分配床位
|
|
|
+ * @param dto
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@Override
|
|
|
public Boolean distributeRoomBed(DistributeRoomBedDto dto) {
|
|
|
List<Room> roomList = roomMapper.selectList(new QueryWrapper<Room>().lambda().in(Room::getId, dto.getRoomIds()));
|
|
|
@@ -274,6 +280,12 @@ public class RoomBedServiceImpl extends MPJBaseServiceImpl<RoomBedMapper, RoomBe
|
|
|
int i = 0;
|
|
|
Map<Long, Integer> classDistributeBedNumber = new HashMap<>();
|
|
|
Map<Long, Integer> classStudent = new HashMap<>();
|
|
|
+ //查询学生住宿费缴费状态
|
|
|
+ List<StudentPayStatusVo> studentPayStatus = roomBedMapper.getStudentPayStatus(dto);
|
|
|
+ Map<Long, Integer> payStatusMap = new HashMap<>();
|
|
|
+ for (StudentPayStatusVo payStatus : studentPayStatus) {
|
|
|
+ payStatusMap.put(payStatus.getId(), payStatus.getPayStatus());
|
|
|
+ }
|
|
|
for (String genderNumber : genderSet) {
|
|
|
//根据性别查询出所有空床位信息
|
|
|
List<RoomBed> bedInfoList = roomBedMapper.selectList(
|
|
|
@@ -302,7 +314,19 @@ public class RoomBedServiceImpl extends MPJBaseServiceImpl<RoomBedMapper, RoomBe
|
|
|
);
|
|
|
//已分配床位数
|
|
|
int distributeBedNumber = 0;
|
|
|
- for (BaseStudent studentInfoVo : studentList) {
|
|
|
+ //先分配已缴费的,再分配未交费的,把已缴费的学生排序到一起
|
|
|
+ List<BaseStudent> studentOrderList = new ArrayList<>();
|
|
|
+ for (BaseStudent baseStudent : studentList) {
|
|
|
+ if(payStatusMap.get(baseStudent.getUserId()) == 1){
|
|
|
+ studentOrderList.add(baseStudent);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (BaseStudent baseStudent : studentList) {
|
|
|
+ if(payStatusMap.get(baseStudent.getUserId()) == null || payStatusMap.get(baseStudent.getUserId()) == 0){
|
|
|
+ studentOrderList.add(baseStudent);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (BaseStudent studentInfoVo : studentOrderList) {
|
|
|
if(i >= bedInfoList.size()){
|
|
|
continue;
|
|
|
}
|