public Boolean erpUnAudit(WorkOrderErpUnAuditDto workOrderErpUnAuditDto) { List<WorkOrderErpUnAuditDto.ModelDTO> listWorkOrderErpUnAuditDto = workOrderErpUnAuditDto.getModel(); List<String> billNos = listWorkOrderErpUnAuditDto.stream().map(vo -> vo.getFBillNo()).collect(Collectors.toList()); if (CollectionUtils.isEmpty(billNos)) return true; List<WorkOrderProductionPlan> workOrderProductionPlans = workOrderProductionPlanMapper.selectList(Wrappers.lambdaQuery(WorkOrderProductionPlan.class).in(WorkOrderProductionPlan::getBillNo, billNos)); if (CollectionUtils.isEmpty(workOrderProductionPlans)) return true; List<String> onlyNos = workOrderProductionPlans.stream().map(vo -> vo.getOnlyNo()).collect(Collectors.toList()); if (CollectionUtils.isEmpty(onlyNos)) return true; List<TerminalProductPlan> terminalProductPlanList = terminalProductPlanMapper.selectList(Wrappers.lambdaQuery(TerminalProductPlan.class).in(TerminalProductPlan::getPlanId, onlyNos).isNotNull(TerminalProductPlan::getStartDate));//注意:发送机器后,终端会上传一条WorkState=0,StartDate=Null数据 if (CollectionUtils.isEmpty(terminalProductPlanList)) { getWorkInfoToMachine(workOrderProductionPlans); workOrderProductionPlanMapper.delete(Wrappers.lambdaQuery(WorkOrderProductionPlan.class).in(WorkOrderProductionPlan::getBillNo, billNos)); return true; } List<TerminalProductPlan> terminalProductPlans = terminalProductPlanList.stream().filter(vo -> vo.getWorkState() != 0).collect(Collectors.toList()); if (CollectionUtils.isNotEmpty(terminalProductPlans)) return false; getPlanInfoToMachine(terminalProductPlans); terminalProductPlanMapper.delete(Wrappers.lambdaQuery(TerminalProductPlan.class).in(TerminalProductPlan::getPlanId, onlyNos)); workOrderProductionPlanMapper.delete(Wrappers.lambdaQuery(WorkOrderProductionPlan.class).in(WorkOrderProductionPlan::getBillNo, billNos)); return true; }
标签:Wrappers,TerminalProductPlan,return,List,vo,WorkOrderProductionPlan,Java,备忘,Lamb From: https://www.cnblogs.com/chengeng/p/18370909