|
|
@@ -236,9 +236,9 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
/**
|
|
|
* 获取大屏显示的有异常的设备
|
|
|
* 1:显示字段为true的进行显示
|
|
|
- * 2:有报修的都要显示
|
|
|
- * 3:红色:非计划性维修的设备
|
|
|
- * 黄色:计划性维修的设备
|
|
|
+ * 2:颜色优先级:黄 > 红 > 蓝,一台设备只显示一种颜色
|
|
|
+ * 黄色:有待接收/维修中/转派审批中/委外维修中报修单的设备,报修单提交验收或完成后恢复
|
|
|
+ * 红色:停机(停用中)且没有进行中报修单的设备
|
|
|
* 蓝色:正常的设备
|
|
|
*
|
|
|
* @param model
|
|
|
@@ -250,41 +250,37 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
// 选择所有显示的设备
|
|
|
List<SbInfoScreenDetailVO> sbInfoList = selectScreenDetailVOList(model);
|
|
|
|
|
|
- // 判断是否有待分配的报修记录,也就是新增的报修
|
|
|
+ // 判断是否有还没修好的报修记录:待接收、维修中、转派审批中、委外维修中
|
|
|
List<String> ids = sbInfoList.stream().map(SbInfoScreenDetailVO::getId).collect(Collectors.toList());
|
|
|
Weekend<RepairApplicationForm> weekendRepair = new Weekend<>(RepairApplicationForm.class);
|
|
|
WeekendCriteria<RepairApplicationForm, Object> weekendCriteria = weekendRepair.weekendCriteria();
|
|
|
List<Integer> statusList = new ArrayList<Integer>();
|
|
|
statusList.add(RepairApplicationFormStatusEnum.NOT_ALLOCATED.getValue());
|
|
|
statusList.add(RepairApplicationFormStatusEnum.PROCESSING.getValue());
|
|
|
+ statusList.add(RepairApplicationFormStatusEnum.TRANSFER_APPROVAL.getValue());
|
|
|
+ statusList.add(RepairApplicationFormStatusEnum.ENTRUST_REPAIR.getValue());
|
|
|
if (CollectionUtil.isNotEmpty(ids)) {
|
|
|
weekendCriteria.andIn(RepairApplicationForm::getSbId, ids);
|
|
|
}
|
|
|
weekendCriteria.andIn(RepairApplicationForm::getStatus, statusList);
|
|
|
List<RepairApplicationForm> repairList = repairApplicationFormMapper.selectByExample(weekendRepair);
|
|
|
+ // 有进行中报修单的设备id,这些设备统一显示黄色,不再按报修类别区分
|
|
|
+ Set<String> repairSbIds = new HashSet<String>();
|
|
|
+ for (RepairApplicationForm repair : repairList) {
|
|
|
+ if (repair.getSbId() != null) {
|
|
|
+ repairSbIds.add(repair.getSbId());
|
|
|
+ }
|
|
|
+ }
|
|
|
List<SbInfoScreenDetailVO> normalSbInfoList = new ArrayList<SbInfoScreenDetailVO>();
|
|
|
List<SbInfoScreenDetailVO> repairSbInfoListYellow = new ArrayList<SbInfoScreenDetailVO>();
|
|
|
- List<SbInfoScreenDetailVO> repairSbInfoListRed = new ArrayList<SbInfoScreenDetailVO>();
|
|
|
+ List<SbInfoScreenDetailVO> stopSbInfoListRed = 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) {
|
|
|
- if (findRepair.getCategory() == null
|
|
|
- || findRepair.getCategory().equals(RepairApplicationFormCategoryEnum.PLAN.getValue())) {
|
|
|
- repairSbInfoListYellow.add(sbInfo);
|
|
|
- } else {
|
|
|
- repairSbInfoListRed.add(sbInfo);
|
|
|
- }
|
|
|
+ // 颜色优先级:黄(有进行中报修单)> 红(停机)> 蓝(正常)
|
|
|
+ if (repairSbIds.contains(sbInfo.getId())) {
|
|
|
+ repairSbInfoListYellow.add(sbInfo);
|
|
|
+ } else if (SbInfoStatusEnum.IN_STOP.getValue().equals(sbInfo.getStatus())) {
|
|
|
+ stopSbInfoListRed.add(sbInfo);
|
|
|
} else {
|
|
|
normalSbInfoList.add(sbInfo);
|
|
|
}
|
|
|
@@ -301,8 +297,9 @@ public class SbInfoServiceImpl extends BaseServiceImpl<SbInfoMapper, SbInfo, SbI
|
|
|
if (CollectionUtil.isNotEmpty(repairSbInfoListYellow)) {
|
|
|
vo.setRepairSbInfoListYellow(splitList(item.getTargetId(), repairSbInfoListYellow));
|
|
|
}
|
|
|
- if (CollectionUtil.isNotEmpty(repairSbInfoListRed)) {
|
|
|
- vo.setRepairSbInfoListRed(splitList(item.getTargetId(), repairSbInfoListRed));
|
|
|
+ if (CollectionUtil.isNotEmpty(stopSbInfoListRed)) {
|
|
|
+ // 前端沿用红色列表字段,内容改为停机设备
|
|
|
+ vo.setRepairSbInfoListRed(splitList(item.getTargetId(), stopSbInfoListRed));
|
|
|
}
|
|
|
if (CollectionUtil.isNotEmpty(normalSbInfoList)) {
|
|
|
vo.setNormalSbInfoList(splitList(item.getTargetId(), normalSbInfoList));
|