Prechádzať zdrojové kódy

床位分配,只分配在读学生

dzx 1 rok pred
rodič
commit
bf1ee15599

+ 10 - 2
src/main/java/com/xjrsoft/module/room/service/impl/RoomBedServiceImpl.java

@@ -423,7 +423,11 @@ public class RoomBedServiceImpl extends MPJBaseServiceImpl<RoomBedMapper, RoomBe
         List<StudentPayStatusVo> studentPayStatusVoList = roomBedMapper.getStudentPayStatus(distributeRoomBedDto);
         Map<Long, Integer> payStatusMap = new HashMap<>();
         for (StudentPayStatusVo statusVo : studentPayStatusVoList) {
-            payStatusMap.put(statusVo.getId(), statusVo.getPayStatus());
+            Integer payStatus = 0;
+            if(statusVo.getPayStatus() != null){
+                payStatus = statusVo.getPayStatus();
+            }
+            payStatusMap.put(statusVo.getId(), payStatus);
         }
         for (BaseClass classOne : classList) {
             List<AdjustBedClassStudentPageVo> studentList = new ArrayList<>();
@@ -431,7 +435,11 @@ public class RoomBedServiceImpl extends MPJBaseServiceImpl<RoomBedMapper, RoomBe
                 if(!classOne.getId().toString().equals(adjustBedClassStudentPageVo.getClassId())){
                     continue;
                 }
-                adjustBedClassStudentPageVo.setPayStatus(payStatusMap.get(Long.valueOf(adjustBedClassStudentPageVo.getUserId())));
+                Integer payStatus = payStatusMap.get(Long.valueOf(adjustBedClassStudentPageVo.getUserId()));
+                if(payStatus == null){
+                    payStatus = 0;
+                }
+                adjustBedClassStudentPageVo.setPayStatus(payStatus);
                 studentList.add(adjustBedClassStudentPageVo);
             }
             if(studentList.isEmpty()){