|
|
|
@ -245,6 +245,15 @@ public class YieldOrderServiceImpl extends BaseServiceImpl<YieldOrderMapper, Yie |
|
|
|
} |
|
|
|
} |
|
|
|
yieldOrder.setValidationResult(YieldOrderEnum.VALIDATION_RESULT_PASS.getCode()); |
|
|
|
yieldOrder.setValidationResult(YieldOrderEnum.VALIDATION_RESULT_PASS.getCode()); |
|
|
|
this.updateById(yieldOrder); |
|
|
|
this.updateById(yieldOrder); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(yieldOrder.getValidationResult().equals(YieldOrderEnum.VALIDATION_RESULT_PASS.getCode()) && |
|
|
|
|
|
|
|
yieldOrder.getReceiveStatus().equals(YieldOrderEnum.RECEIVE_STATUS_YES.getCode())){ |
|
|
|
|
|
|
|
//订单状态为验证完成并且已接收 进行分派
|
|
|
|
|
|
|
|
boolean result = this.verifyYieldOrderResource(yieldOrder); |
|
|
|
|
|
|
|
if(!result){ |
|
|
|
|
|
|
|
throw new ServiceException("分派异常请及时处理"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return "校验成功"; |
|
|
|
return "校验成功"; |
|
|
|
@ -1205,14 +1214,22 @@ public class YieldOrderServiceImpl extends BaseServiceImpl<YieldOrderMapper, Yie |
|
|
|
String errMsg = MessageFormat.format("子件{}未编制!", dsPartSub.getPartCode()); |
|
|
|
String errMsg = MessageFormat.format("子件{}未编制!", dsPartSub.getPartCode()); |
|
|
|
throw new BusinessException(errMsg); |
|
|
|
throw new BusinessException(errMsg); |
|
|
|
} |
|
|
|
} |
|
|
|
Integer yieldType = YieldOrderEnum.YIELD_TYPE_6.getCode(); |
|
|
|
Integer yieldType = null; |
|
|
|
if (DsPartConstant.SIN_TER_TYPE_KT.equals(dsPartSub.getSinTerType())) { |
|
|
|
if (DsPartConstant.SIN_TER_TYPE_KT.equals(dsPartSub.getSinTerType())) { |
|
|
|
yieldType = YieldOrderEnum.YIELD_TYPE_4.getCode(); |
|
|
|
yieldType = YieldOrderEnum.YIELD_TYPE_4.getCode(); |
|
|
|
} else if (DsPartConstant.SIN_TER_TYPE_CZ.equals(dsPartSub.getSinTerType())) { |
|
|
|
} else if (DsPartConstant.SIN_TER_TYPE_CZ.equals(dsPartSub.getSinTerType())) { |
|
|
|
yieldType = YieldOrderEnum.YIELD_TYPE_5.getCode(); |
|
|
|
yieldType = YieldOrderEnum.YIELD_TYPE_5.getCode(); |
|
|
|
|
|
|
|
}else if (DsPartConstant.SIN_TER_TYPE_BLB.equals(dsPartSub.getSinTerType())) { |
|
|
|
|
|
|
|
yieldType = YieldOrderEnum.YIELD_TYPE_3.getCode(); |
|
|
|
|
|
|
|
} else if (DsPartConstant.SIN_TER_TYPE_SMM.equals(dsPartSub.getSinTerType())) { |
|
|
|
|
|
|
|
yieldType = YieldOrderEnum.YIELD_TYPE_6.getCode(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(null == yieldType){ |
|
|
|
|
|
|
|
//如果子件类型为空 或者是其他 不生成子件订单 直接跳过
|
|
|
|
|
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
//非石墨模子件,面积不允许为空
|
|
|
|
//非石墨模子件,面积不允许为空
|
|
|
|
if (!yieldType.equals(YieldOrderEnum.YIELD_TYPE_6) && dsPart.getArea() == null) { |
|
|
|
if (!yieldType.equals(YieldOrderEnum.YIELD_TYPE_6.getCode()) && dsPart.getArea() == null) { |
|
|
|
String errMsg = "非石墨模子件面积为空无法创建生产订单!"; |
|
|
|
String errMsg = "非石墨模子件面积为空无法创建生产订单!"; |
|
|
|
throw new BusinessException(errMsg); |
|
|
|
throw new BusinessException(errMsg); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1253,6 +1270,8 @@ public class YieldOrderServiceImpl extends BaseServiceImpl<YieldOrderMapper, Yie |
|
|
|
subYield.setYieldType(yieldType); |
|
|
|
subYield.setYieldType(yieldType); |
|
|
|
subYield.setEntrustDept("热表分厂"); |
|
|
|
subYield.setEntrustDept("热表分厂"); |
|
|
|
subYield.setBusinessType(-1); |
|
|
|
subYield.setBusinessType(-1); |
|
|
|
|
|
|
|
//记录父订单的id
|
|
|
|
|
|
|
|
subYield.setParentYoId(yieldOrder.getId()); |
|
|
|
// 父件订单中无接收人信息时, 以当前人为接收人
|
|
|
|
// 父件订单中无接收人信息时, 以当前人为接收人
|
|
|
|
if (yieldOrder.getReceiveUser() == null) { |
|
|
|
if (yieldOrder.getReceiveUser() == null) { |
|
|
|
subYield.setReceiveUser(receiveUser); |
|
|
|
subYield.setReceiveUser(receiveUser); |
|
|
|
@ -1267,6 +1286,13 @@ public class YieldOrderServiceImpl extends BaseServiceImpl<YieldOrderMapper, Yie |
|
|
|
} |
|
|
|
} |
|
|
|
this.save(subYield); |
|
|
|
this.save(subYield); |
|
|
|
idList.add(subYield.getId()); |
|
|
|
idList.add(subYield.getId()); |
|
|
|
|
|
|
|
//烧结类型生产订单【玻璃饼下发状态】默认状态为【未下发】,
|
|
|
|
|
|
|
|
// 生成子件玻璃饼订单后变更为【已下发】;
|
|
|
|
|
|
|
|
// 其他类型生产订单的【玻璃饼下发状态】显示空
|
|
|
|
|
|
|
|
if(yieldType.equals(YieldOrderEnum.YIELD_TYPE_3.getCode())){ |
|
|
|
|
|
|
|
yieldOrder.setGlassBiscuitStatus(YieldOrder.GLASS_BISCUIT_ISSUED); |
|
|
|
|
|
|
|
this.updateById(yieldOrder); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(CollectionUtils.isNotEmpty(idList)){ |
|
|
|
if(CollectionUtils.isNotEmpty(idList)){ |
|
|
|
//生成的烧结子订单也需要进行合规性校验,另起线程异步执行
|
|
|
|
//生成的烧结子订单也需要进行合规性校验,另起线程异步执行
|
|
|
|
|