xiongchao il y a 3 ans
Parent
commit
e7532ac2f2

+ 1 - 1
platform-dao/src/main/java/com/platform/dao/entity/repair/RepairApplicationForm.java

@@ -53,7 +53,7 @@ public class RepairApplicationForm implements Serializable {
     @Transient
     private String sbCph;
     /**
-     * 是否停机: 1-是 2-否
+     * 是否计划性维修: 1-是 0-否
      */
     private Integer needStop;
     /**

+ 12 - 1
platform-dao/src/main/java/com/platform/dao/vo/sb/SbInfoScreenVO.java

@@ -24,5 +24,16 @@ import java.util.List;
 @EqualsAndHashCode(callSuper = true)
 public class SbInfoScreenVO extends BaseVO implements Serializable {
     private List<SbInfoScreenDetailVO> normalSbInfoList;
-    private List<SbInfoScreenDetailVO> repairSbInfoList;
+    /**
+     * 非计划性报修 红色
+     *
+     */
+    private List<SbInfoScreenDetailVO> repairSbInfoListRed;
+    /**
+     * 计划性报修 黃色
+     *
+     */
+    private List<SbInfoScreenDetailVO> repairSbInfoListYellow;
+
+
 }

+ 18 - 5
platform-service/src/main/java/com/platform/service/sb/impl/SbInfoServiceImpl.java

@@ -225,23 +225,33 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
         List<String> ids = sbInfoList.stream().map(SbInfoScreenDetailVO::getId).collect(Collectors.toList());
         Weekend<RepairApplicationForm> weekendRepair = new Weekend<>(RepairApplicationForm.class);
         WeekendCriteria<RepairApplicationForm, Object> weekendCriteria = weekendRepair.weekendCriteria();
-        weekendCriteria.andIn(RepairApplicationForm::getSbId, ids).andEqualTo(RepairApplicationForm::getStatus, RepairApplicationFormStatusEnum.NOT_ALLOCATED.getValue());
+        List<Integer> statusList = new ArrayList<Integer>();
+        statusList.add(RepairApplicationFormStatusEnum.NOT_ALLOCATED.getValue());
+        statusList.add(RepairApplicationFormStatusEnum.PROCESSING.getValue());
+        weekendCriteria.andIn(RepairApplicationForm::getSbId, ids).andIn(RepairApplicationForm::getStatus, statusList);
         List<RepairApplicationForm> repairList = repairApplicationFormMapper.selectByExample(weekendRepair);
         List<SbInfoScreenDetailVO> normalSbInfoList = new ArrayList<SbInfoScreenDetailVO>();
-        List<SbInfoScreenDetailVO> repairSbInfoList = new ArrayList<SbInfoScreenDetailVO>();
+        List<SbInfoScreenDetailVO> repairSbInfoListYellow = new ArrayList<SbInfoScreenDetailVO>();
+        List<SbInfoScreenDetailVO> repairSbInfoListRed = new ArrayList<SbInfoScreenDetailVO>();
         if(CollectionUtil.isNotEmpty(sbInfoList)) {
             for (SbInfoScreenDetailVO sbInfo : sbInfoList) {
                 boolean find = false;
+                RepairApplicationForm findRepair = null;
                 if(CollectionUtil.isNotEmpty(repairList)) {
                     for (RepairApplicationForm repair : repairList) {
                         if (repair.getSbId().equals(sbInfo.getId())) {
                             find = true;
+                            findRepair = repair;
                             break;
                         }
                     }
                 }
                 if (find) {
-                    repairSbInfoList.add(sbInfo);
+                    if(findRepair.getNeedStop().equals(YesNoEnum.YES.getValue())){
+                        repairSbInfoListYellow.add(sbInfo);
+                    }else{
+                        repairSbInfoListRed.add(sbInfo);
+                    }
                 } else {
                     if(sbInfo.getLevel() != null && !sbInfo.getLevel().equals(SbInfoLevelEnum.C.getValue())){
                         normalSbInfoList.add(sbInfo);
@@ -250,8 +260,11 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
             }
         }
         SbInfoScreenVO vo = new SbInfoScreenVO();
-        if(CollectionUtil.isNotEmpty(repairSbInfoList)){
-            vo.setRepairSbInfoList(repairSbInfoList);
+        if(CollectionUtil.isNotEmpty(repairSbInfoListYellow)){
+            vo.setRepairSbInfoListYellow(repairSbInfoListYellow);
+        }
+        if(CollectionUtil.isNotEmpty(repairSbInfoListRed)){
+            vo.setRepairSbInfoListRed(repairSbInfoListRed);
         }
         if(CollectionUtil.isNotEmpty(normalSbInfoList)){
             vo.setNormalSbInfoList(normalSbInfoList);