|
|
|
@ -130,36 +130,60 @@ public class ProductPlanInfoServiceImpl implements IProductPlanInfoService {
|
|
|
|
|
if (baseBomInfoList.size() == 0) {
|
|
|
|
|
throw new ServiceException("生产BOM信息不完整,请先维护生产BOM信息!");
|
|
|
|
|
}
|
|
|
|
|
bomInfo.setIsPlanToStation(null);
|
|
|
|
|
List<BaseBomInfo> baseBomInfos = baseBomInfoService.selectBaseBomInfoList(bomInfo);
|
|
|
|
|
BaseBomInfo bom = new BaseBomInfo();
|
|
|
|
|
bom.setAncestors(baseOrderInfo.getMaterialCode());
|
|
|
|
|
List<BaseBomInfo> baseBomInfos = baseBomInfoService.selectBaseBomInfoList(bom);
|
|
|
|
|
try {
|
|
|
|
|
for (BaseBomInfo baseBomInfo : baseBomInfos) {
|
|
|
|
|
if (baseBomInfo.getMaterialType().equals(MaterialConstants.BOX_MATERIAL_TYPE)) {
|
|
|
|
|
ProductPlanInfo planInfo = new ProductPlanInfo();
|
|
|
|
|
planInfo.setPlanCode(PlanCodeUtils.getPlanCode());
|
|
|
|
|
planInfo.setOrderCode(orderCode);
|
|
|
|
|
planInfo.setSaleOrderCode(saleOrderCode);
|
|
|
|
|
planInfo.setSaleorderLinenumber(saleOrderLineNumber);
|
|
|
|
|
planInfo.setMaterialCode(baseBomInfo.getMaterialCode());
|
|
|
|
|
planInfo.setMaterialName(baseBomInfo.getMaterialName());
|
|
|
|
|
planInfo.setProductLineCode("1002");
|
|
|
|
|
planInfo.setPlanAmount(baseBomInfo.getStandardAmount().longValue() * orderAmount.longValue());
|
|
|
|
|
this.insertProductPlanInfo(planInfo);
|
|
|
|
|
planInfo.setPlanCode(PlanCodeUtils.getPlanCode());
|
|
|
|
|
planInfo.setProductLineCode("1005");
|
|
|
|
|
this.insertProductPlanInfo(planInfo);
|
|
|
|
|
//一线
|
|
|
|
|
if (StringUtils.isNotEmpty(baseOrderInfo.getWorkCenterCode()) && baseOrderInfo.getWorkCenterCode().equals("3101")) {
|
|
|
|
|
for (BaseBomInfo baseBomInfo : baseBomInfos) {
|
|
|
|
|
if (baseBomInfo.getMaterialType().equals(MaterialConstants.BOX_MATERIAL_TYPE)) {
|
|
|
|
|
ProductPlanInfo planInfo = new ProductPlanInfo();
|
|
|
|
|
planInfo.setPlanCode(PlanCodeUtils.getPlanCode());
|
|
|
|
|
planInfo.setOrderCode(orderCode);
|
|
|
|
|
planInfo.setSaleOrderCode(saleOrderCode);
|
|
|
|
|
planInfo.setSaleorderLinenumber(saleOrderLineNumber);
|
|
|
|
|
planInfo.setMaterialCode(baseBomInfo.getMaterialCode());
|
|
|
|
|
planInfo.setMaterialName(baseBomInfo.getMaterialName());
|
|
|
|
|
planInfo.setProductLineCode("1105");//箱体发泡
|
|
|
|
|
planInfo.setPlanAmount(baseBomInfo.getStandardAmount().longValue() * orderAmount.longValue());
|
|
|
|
|
this.insertProductPlanInfo(planInfo);
|
|
|
|
|
planInfo.setPlanCode(PlanCodeUtils.getPlanCode());
|
|
|
|
|
planInfo.setProductLineCode("1109");//成品下线扫描
|
|
|
|
|
this.insertProductPlanInfo(planInfo);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (baseBomInfo.getMaterialType().equals(MaterialConstants.COAMING_MATERIAL_TYPE)) {
|
|
|
|
|
ProductPlanInfo plan = new ProductPlanInfo();
|
|
|
|
|
plan.setPlanCode(PlanCodeUtils.getPlanCode());
|
|
|
|
|
plan.setProductLineCode("1001");
|
|
|
|
|
plan.setOrderCode(orderCode);
|
|
|
|
|
plan.setSaleOrderCode(saleOrderCode);
|
|
|
|
|
plan.setSaleorderLinenumber(saleOrderLineNumber);
|
|
|
|
|
plan.setMaterialCode(baseBomInfo.getMaterialCode());
|
|
|
|
|
plan.setMaterialName(baseBomInfo.getMaterialName());
|
|
|
|
|
plan.setPlanAmount(baseBomInfo.getStandardAmount().longValue() * orderAmount.longValue());
|
|
|
|
|
this.insertProductPlanInfo(plan);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(baseOrderInfo.getWorkCenterCode()) && baseOrderInfo.getWorkCenterCode().equals("3103")) {
|
|
|
|
|
for (BaseBomInfo baseBomInfo : baseBomInfos) {
|
|
|
|
|
if (baseBomInfo.getMaterialType().equals(MaterialConstants.COAMING_MATERIAL_TYPE)) {
|
|
|
|
|
ProductPlanInfo plan = new ProductPlanInfo();
|
|
|
|
|
plan.setPlanCode(PlanCodeUtils.getPlanCode());
|
|
|
|
|
plan.setProductLineCode("1001");// 前/后板自动成型
|
|
|
|
|
plan.setOrderCode(orderCode);
|
|
|
|
|
plan.setSaleOrderCode(saleOrderCode);
|
|
|
|
|
plan.setSaleorderLinenumber(saleOrderLineNumber);
|
|
|
|
|
plan.setMaterialCode(baseBomInfo.getMaterialCode());
|
|
|
|
|
plan.setMaterialName(baseBomInfo.getMaterialName());
|
|
|
|
|
plan.setPlanAmount(baseBomInfo.getStandardAmount().longValue() * orderAmount.longValue());
|
|
|
|
|
this.insertProductPlanInfo(plan);
|
|
|
|
|
}
|
|
|
|
|
if (baseBomInfo.getMaterialType().equals(MaterialConstants.BOX_MATERIAL_TYPE)) {
|
|
|
|
|
ProductPlanInfo planInfo = new ProductPlanInfo();
|
|
|
|
|
planInfo.setPlanCode(PlanCodeUtils.getPlanCode());
|
|
|
|
|
planInfo.setOrderCode(orderCode);
|
|
|
|
|
planInfo.setSaleOrderCode(saleOrderCode);
|
|
|
|
|
planInfo.setSaleorderLinenumber(saleOrderLineNumber);
|
|
|
|
|
planInfo.setMaterialCode(baseBomInfo.getMaterialCode());
|
|
|
|
|
planInfo.setMaterialName(baseBomInfo.getMaterialName());
|
|
|
|
|
planInfo.setProductLineCode("1005");// 箱体发泡
|
|
|
|
|
planInfo.setPlanAmount(baseBomInfo.getStandardAmount().longValue() * orderAmount.longValue());
|
|
|
|
|
this.insertProductPlanInfo(planInfo);
|
|
|
|
|
planInfo.setPlanCode(PlanCodeUtils.getPlanCode());
|
|
|
|
|
planInfo.setProductLineCode("1006");// 泡后库
|
|
|
|
|
this.insertProductPlanInfo(planInfo);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
baseOrderInfo.setIsRelease(0L);
|
|
|
|
|