|
|
|
|
@ -413,6 +413,14 @@ public class WorkOrderRunServiceImpl extends BaseServiceImpl<WorkOrderRunMapper, |
|
|
|
|
for (WorkPlanRun wpr : wprList) { |
|
|
|
|
wp = workPlanMapper.selectOne(new LambdaQueryWrapper<WorkPlan>() |
|
|
|
|
.eq(WorkPlan::getId, wpr.getWpId())); |
|
|
|
|
|
|
|
|
|
// 如果是外协工序,且未报工,清空班组和时间,便于排产
|
|
|
|
|
if (wp.getStatus().compareTo(WorkPlan.STATUS_WORK_OK) < 0) { |
|
|
|
|
wp.setMakeTeam(null); |
|
|
|
|
wp.setPlanStartTime(null); |
|
|
|
|
wp.setPlanEndTime(null); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//如果不是勾选工序不处理
|
|
|
|
|
if (!wpr.getHandle()) { |
|
|
|
|
continue; |
|
|
|
|
@ -422,18 +430,18 @@ public class WorkOrderRunServiceImpl extends BaseServiceImpl<WorkOrderRunMapper, |
|
|
|
|
if (nextWorkPlan == null) { |
|
|
|
|
throw new ServiceException("未找到下道工序,工序ID:" + wp.getNextWpId()); |
|
|
|
|
} |
|
|
|
|
BsProcessSetEntity bsProcessSetEntity = processSetMapper.selectOne(new LambdaQueryWrapper<BsProcessSetEntity>() |
|
|
|
|
.eq(BsProcessSetEntity::getId, nextWorkPlan.getPpsId())); |
|
|
|
|
if (nextWorkPlan.getMakeTeam() != null && bsProcessSetEntity != null && !"1".equalsIgnoreCase(bsProcessSetEntity.getIsDispatch())) { |
|
|
|
|
teamSet = teamSetMapper.selectOne(new LambdaQueryWrapper<TeamSet>() |
|
|
|
|
.eq(TeamSet::getId, nextWorkPlan.getMakeTeam())); |
|
|
|
|
} |
|
|
|
|
wp.setMakeTeam(teamSet == null ? null : teamSet.getId()); |
|
|
|
|
// BsProcessSetEntity bsProcessSetEntity = processSetMapper.selectOne(new LambdaQueryWrapper<BsProcessSetEntity>()
|
|
|
|
|
// .eq(BsProcessSetEntity::getId, nextWorkPlan.getPpsId()));
|
|
|
|
|
// if (nextWorkPlan.getMakeTeam() != null && bsProcessSetEntity != null && !"1".equalsIgnoreCase(bsProcessSetEntity.getIsDispatch())) {
|
|
|
|
|
// teamSet = teamSetMapper.selectOne(new LambdaQueryWrapper<TeamSet>()
|
|
|
|
|
// .eq(TeamSet::getId, nextWorkPlan.getMakeTeam()));
|
|
|
|
|
// }
|
|
|
|
|
// wp.setMakeTeam(teamSet == null ? null : teamSet.getId());
|
|
|
|
|
|
|
|
|
|
// 工序信息重置,重新排产
|
|
|
|
|
wp.setOem(null); |
|
|
|
|
wp.setPlanStartTime(null); |
|
|
|
|
wp.setUnqualifiedQty(0d); |
|
|
|
|
wp.setWorkQty(0d); |
|
|
|
|
wp.setPlanEndTime(null); |
|
|
|
|
wp.setSubsidiaryTeam(null); |
|
|
|
|
wp.setOem("0"); |
|
|
|
|
wp.setCaId(wpr.getCaId()); |
|
|
|
|
|