|
|
|
|
@ -413,7 +413,7 @@ public class YieldOrderCraftServiceImpl extends BaseServiceImpl<YieldOrderCraftM |
|
|
|
|
for (YieldOrderCraft orderCraft : orderCrafts) { |
|
|
|
|
Long centerId = orderCraft.getWorkCenterId(); |
|
|
|
|
// 判定是否是特殊工序
|
|
|
|
|
BsProcessSetEntity processSet = processSetService.selectBsProcessSetByProcessCode(orderCraft.getProcessCode()); |
|
|
|
|
BsProcessSetEntity processSet = processSetService.getById(orderCraft.getPpsId()); |
|
|
|
|
if (Func.isNotEmpty(processSet) && Func.isNotBlank(processSet.getTeam())) { |
|
|
|
|
BsTeamSetEntity teamSetEntity = teamSetService.selectByTeamName(processSet.getTeam()); |
|
|
|
|
if (Func.isNotEmpty(teamSetEntity)) { |
|
|
|
|
@ -431,7 +431,7 @@ public class YieldOrderCraftServiceImpl extends BaseServiceImpl<YieldOrderCraftM |
|
|
|
|
orderCraft.setWorkCenterId(centerId); |
|
|
|
|
}else{ |
|
|
|
|
if(workCenter == null){ |
|
|
|
|
throw new BusinessException("工艺" + orderCraft.getCaId() + "未查询到对应作业中心"); |
|
|
|
|
throw new ServiceException("工艺" + orderCraft.getCaId() + "未查询到对应作业中心"); |
|
|
|
|
} |
|
|
|
|
orderCraft.setWorkCenterId(workCenter.getId()); |
|
|
|
|
} |
|
|
|
|
@ -596,16 +596,27 @@ public class YieldOrderCraftServiceImpl extends BaseServiceImpl<YieldOrderCraftM |
|
|
|
|
//开始循环生产订单中组合的工艺能力key集合,主工艺能力之前的全部分配到此外协商
|
|
|
|
|
for (Long key : keys) { |
|
|
|
|
//验证工艺能力
|
|
|
|
|
oemAbility = oemCraftAbilityService.findBsOemAbility(oemCustomer.getId(), key); |
|
|
|
|
if (oemAbility == null) { |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
// oemAbility = oemCraftAbilityService.findBsOemAbility(oemCustomer.getId(), key);
|
|
|
|
|
// if (oemAbility == null) {
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
rtnList.addAll(craftAbilityMap.get(key)); |
|
|
|
|
} |
|
|
|
|
// 开始分派到外协商
|
|
|
|
|
WorkCenter workCenter; |
|
|
|
|
for (YieldOrderCraft orderCraft : rtnList) { |
|
|
|
|
orderCraft.setOcId(oemCustomer.getId()); |
|
|
|
|
orderCraft.setIsOutsource(Boolean.TRUE); |
|
|
|
|
BsProcessSetEntity processSet = processSetService.getById(orderCraft.getPpsId()); |
|
|
|
|
if (processSet != null && "1".equals(processSet.getIsDispatch())) { |
|
|
|
|
workCenter = workCenterService.getOne(Wrappers.<WorkCenter>lambdaQuery().apply("INSTR(',' || CRAFT_ABILITY_ID || ',', ',' || {0} || ',') > 0", orderCraft.getCaId())); |
|
|
|
|
if (workCenter == null) { |
|
|
|
|
throw new ServiceException("工艺" + orderCraft.getCaId() + "未查询到对应作业中心"); |
|
|
|
|
} |
|
|
|
|
orderCraft.setWorkCenterId(workCenter.getId()); |
|
|
|
|
orderCraft.setIsOutsource(Boolean.FALSE); |
|
|
|
|
} else { |
|
|
|
|
orderCraft.setOcId(oemCustomer.getId()); |
|
|
|
|
orderCraft.setIsOutsource(Boolean.TRUE); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 更新主工序工艺能力日产能信息
|
|
|
|
|
|