|
|
|
|
@ -440,30 +440,10 @@ public class WorkOrderRunServiceImpl extends BaseServiceImpl<WorkOrderRunMapper, |
|
|
|
|
wp.setSubsidiaryTeam(null); |
|
|
|
|
wp.setOem("0"); |
|
|
|
|
wp.setCaId(wpr.getCaId()); |
|
|
|
|
wp.setOcId(null); |
|
|
|
|
wpList.add(wp); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 转厂内审批通过后,将第一道外协工序之后所有工序的 加工班组/计划开始时间/计划结束时间 置空
|
|
|
|
|
if (!wpList.isEmpty()) { |
|
|
|
|
WorkPlan firstInternalPlan = wpList.stream() |
|
|
|
|
.min(Comparator.comparing(WorkPlan::getOrders)).get(); |
|
|
|
|
List<WorkPlan> allPlans = workPlanMapper.selectList( |
|
|
|
|
new LambdaQueryWrapper<WorkPlan>().eq(WorkPlan::getWoId, wo.getId())); |
|
|
|
|
List<WorkPlan> tailPlans = new ArrayList<>(); |
|
|
|
|
for (WorkPlan plan : allPlans) { |
|
|
|
|
if (plan.getOrders().compareTo(firstInternalPlan.getOrders()) > 0 |
|
|
|
|
&& wpList.stream().noneMatch(w -> w.getId().equals(plan.getId()))) { |
|
|
|
|
plan.setMakeTeam(null); |
|
|
|
|
plan.setPlanStartTime(null); |
|
|
|
|
plan.setPlanEndTime(null); |
|
|
|
|
tailPlans.add(plan); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (!tailPlans.isEmpty()) { |
|
|
|
|
workPlanMapper.updateById(tailPlans); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (wpList.isEmpty()) { |
|
|
|
|
throw new ServiceException("未选择转回工序,请走外协交件流程!"); |
|
|
|
|
} |
|
|
|
|
@ -510,13 +490,6 @@ public class WorkOrderRunServiceImpl extends BaseServiceImpl<WorkOrderRunMapper, |
|
|
|
|
int days = ProcessCycleEnum.BC_TYPE_CYCLE_HEAT.getValue(); |
|
|
|
|
Date date = DateUtil.plusDays(wo.getSendDownTime(), days); |
|
|
|
|
wo.setPlanEndDate(DateUtil.format(date, DateUtil.PATTERN_DATETIME)); |
|
|
|
|
// 转厂内审批通过,清除是否外协和外协商
|
|
|
|
|
wo.setOem("0"); |
|
|
|
|
wo.setOcId(null); |
|
|
|
|
wo.setOemOut("0"); |
|
|
|
|
workOrderMapper.updateById(wo); |
|
|
|
|
|
|
|
|
|
wo = workOrderMapper.selectById(wo.getId()); |
|
|
|
|
|
|
|
|
|
//更改订单调度员和计划员
|
|
|
|
|
TeamSet makeTeam = teamSetMapper.selectById(wo.getTsId()); |
|
|
|
|
@ -550,6 +523,9 @@ public class WorkOrderRunServiceImpl extends BaseServiceImpl<WorkOrderRunMapper, |
|
|
|
|
} |
|
|
|
|
//修改生产订单状态为已收回待排产
|
|
|
|
|
yo.setStatus(YieldOrderEnum.STATUS_OUTSOURCING_WAITING.getCode()); |
|
|
|
|
|
|
|
|
|
// 更新车间作业计划
|
|
|
|
|
workPlanMapper.updateById(wpList); |
|
|
|
|
} |
|
|
|
|
} else if (WorkOrderRun.RUN_TYPE_3.equals(workOrderRun.getRunType())) { |
|
|
|
|
//验证同工单下的车间订单
|
|
|
|
|
|