外协订单转厂内审批逻辑修改

liweidong
zangzhipeng 3 days ago
parent 90803bb7f6
commit ec056055bb
  1. 26
      blade-service/blade-desk/src/main/java/org/springblade/desk/produce/service/impl/WorkOrderRunServiceImpl.java

@ -413,6 +413,14 @@ public class WorkOrderRunServiceImpl extends BaseServiceImpl<WorkOrderRunMapper,
for (WorkPlanRun wpr : wprList) { for (WorkPlanRun wpr : wprList) {
wp = workPlanMapper.selectOne(new LambdaQueryWrapper<WorkPlan>() wp = workPlanMapper.selectOne(new LambdaQueryWrapper<WorkPlan>()
.eq(WorkPlan::getId, wpr.getWpId())); .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()) { if (!wpr.getHandle()) {
continue; continue;
@ -422,18 +430,18 @@ public class WorkOrderRunServiceImpl extends BaseServiceImpl<WorkOrderRunMapper,
if (nextWorkPlan == null) { if (nextWorkPlan == null) {
throw new ServiceException("未找到下道工序,工序ID:" + wp.getNextWpId()); throw new ServiceException("未找到下道工序,工序ID:" + wp.getNextWpId());
} }
BsProcessSetEntity bsProcessSetEntity = processSetMapper.selectOne(new LambdaQueryWrapper<BsProcessSetEntity>() // BsProcessSetEntity bsProcessSetEntity = processSetMapper.selectOne(new LambdaQueryWrapper<BsProcessSetEntity>()
.eq(BsProcessSetEntity::getId, nextWorkPlan.getPpsId())); // .eq(BsProcessSetEntity::getId, nextWorkPlan.getPpsId()));
if (nextWorkPlan.getMakeTeam() != null && bsProcessSetEntity != null && !"1".equalsIgnoreCase(bsProcessSetEntity.getIsDispatch())) { // if (nextWorkPlan.getMakeTeam() != null && bsProcessSetEntity != null && !"1".equalsIgnoreCase(bsProcessSetEntity.getIsDispatch())) {
teamSet = teamSetMapper.selectOne(new LambdaQueryWrapper<TeamSet>() // teamSet = teamSetMapper.selectOne(new LambdaQueryWrapper<TeamSet>()
.eq(TeamSet::getId, nextWorkPlan.getMakeTeam())); // .eq(TeamSet::getId, nextWorkPlan.getMakeTeam()));
} // }
wp.setMakeTeam(teamSet == null ? null : teamSet.getId()); // wp.setMakeTeam(teamSet == null ? null : teamSet.getId());
// 工序信息重置,重新排产
wp.setOem(null); wp.setOem(null);
wp.setPlanStartTime(null);
wp.setUnqualifiedQty(0d); wp.setUnqualifiedQty(0d);
wp.setWorkQty(0d); wp.setWorkQty(0d);
wp.setPlanEndTime(null);
wp.setSubsidiaryTeam(null); wp.setSubsidiaryTeam(null);
wp.setOem("0"); wp.setOem("0");
wp.setCaId(wpr.getCaId()); wp.setCaId(wpr.getCaId());

Loading…
Cancel
Save