diff --git a/src/main/java/com/wms/entity/app/vo/WorkFlowVo.java b/src/main/java/com/wms/entity/app/vo/WorkFlowVo.java index 18986cc..2ea253c 100644 --- a/src/main/java/com/wms/entity/app/vo/WorkFlowVo.java +++ b/src/main/java/com/wms/entity/app/vo/WorkFlowVo.java @@ -6,6 +6,7 @@ import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import java.math.BigDecimal; +import java.time.LocalDate; import java.time.LocalDateTime; /** @@ -88,4 +89,19 @@ public class WorkFlowVo { */ @JsonProperty("opUser") private String opUser; + /** + * 机器类型 + */ + @JsonProperty("machineType") + private Integer machineType; + /** + * 计划日期 + */ + @JsonProperty("planDate") + private LocalDate planDate; + /** + * 大盒子号 + */ + @JsonProperty("bigBox") + private String bigBox; } diff --git a/src/main/java/com/wms/service/business/serviceImplements/WorkServiceImplements.java b/src/main/java/com/wms/service/business/serviceImplements/WorkServiceImplements.java index b951fca..d22c192 100644 --- a/src/main/java/com/wms/service/business/serviceImplements/WorkServiceImplements.java +++ b/src/main/java/com/wms/service/business/serviceImplements/WorkServiceImplements.java @@ -523,33 +523,54 @@ public class WorkServiceImplements implements IWorkService { // 获取当天所有的装载机工作 List thisDayMWLWorks = new ArrayList<>(); findWorks("", thisDayMWLWorks, "MWL", currentWorkDate); - if (!thisDayMWLWorks.isEmpty()) { - allFlows.addAll(thisDayMWLWorks); - } else { - System.out.println("查询MWL为空"); - } // 获取到当天所有的平地机工作 List thisDayMGWorks = new ArrayList<>(); + // 需要合并第二天的平地机工作 + List nextDayMGWorks = new ArrayList<>(); findWorks("", thisDayMGWorks, "NOT_MWL", currentWorkDate); if (!thisDayMGWorks.isEmpty()) { - allFlows.addAll(thisDayMGWorks); // 查询配置是否需要合并第二天的配置 String ifMergeTomorrow = configMap.get(ConfigMapKeyEnum.IF_MERGE_TOMORROW.getConfigKey()); if (!StringUtils.isEmpty(ifMergeTomorrow) && ifMergeTomorrow.equals("1")) { - // 需要合并第二天的平地机工作 - List nextDayMGWorks = new ArrayList<>(); // 获取下一个工作日 LocalDate nextWorkDate = nextWorkDate(currentWorkDate); if (nextWorkDate != null && nextWorkDate.isAfter(currentWorkDate)) { findWorks("", nextDayMGWorks, "NOT_MWL", nextWorkDate); } + } + } + // 获取工作优先级 + String workPriority = configMap.get(ConfigMapKeyEnum.WORK_PRIORITY.getConfigKey()); + if (!StringUtils.isEmpty(workPriority) && workPriority.equals("1")) { + // 先平地机再装载机 + if (!thisDayMGWorks.isEmpty()) { + allFlows.addAll(thisDayMGWorks); if (!nextDayMGWorks.isEmpty()) { // 添加第二天的平地机工作进汇总 allFlows.addAll(nextDayMGWorks); } + } else { + List oldMgWorkFlows = workFlowService.list(new LambdaQueryWrapper() + .eq(WorkFlow::getMachineType, 2)); + if (!thisDayMWLWorks.isEmpty() && oldMgWorkFlows.isEmpty()) { + allFlows.addAll(thisDayMWLWorks); + } } } else { - System.out.println("查询MG为空"); + // 先装载机再平地机 + if (!thisDayMWLWorks.isEmpty()) { + allFlows.addAll(thisDayMWLWorks); + } else { + List oldMwlWorkFlows = workFlowService.list(new LambdaQueryWrapper() + .eq(WorkFlow::getMachineType, 1)); + if (!thisDayMGWorks.isEmpty() && oldMwlWorkFlows.isEmpty()) { + allFlows.addAll(thisDayMGWorks); + if (!nextDayMGWorks.isEmpty()) { + // 添加第二天的平地机工作进汇总 + allFlows.addAll(nextDayMGWorks); + } + } + } } if (!allFlows.isEmpty()) { // 处理这些工作流