From 4116e087538330e90aa09fbd1c942dd89418d206 Mon Sep 17 00:00:00 2001 From: yinq Date: Wed, 13 Dec 2023 15:52:01 +0800 Subject: [PATCH] =?UTF-8?q?update=20-=20=E7=94=9F=E4=BA=A7=E8=AE=A1?= =?UTF-8?q?=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ProductPlanInfoServiceImpl.java | 52 ++++++++++++++----- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/aucma-production/src/main/java/com/aucma/production/service/impl/ProductPlanInfoServiceImpl.java b/aucma-production/src/main/java/com/aucma/production/service/impl/ProductPlanInfoServiceImpl.java index 18fd671..e2a789d 100644 --- a/aucma-production/src/main/java/com/aucma/production/service/impl/ProductPlanInfoServiceImpl.java +++ b/aucma-production/src/main/java/com/aucma/production/service/impl/ProductPlanInfoServiceImpl.java @@ -5,6 +5,7 @@ import java.util.List; import com.aucma.base.domain.BaseOrderInfo; import com.aucma.base.service.IBaseOrderInfoService; +import com.aucma.base.utils.MaterialConstants; import com.aucma.common.exception.ServiceException; import com.aucma.common.exception.base.BaseException; import com.aucma.common.utils.DateUtils; @@ -139,23 +140,46 @@ public class ProductPlanInfoServiceImpl implements IProductPlanInfoService if (baseBomInfoList.size() == 0){ throw new BaseException("请先维护生产BOM信息!"); } + for (BaseBomInfo baseBomInfo : baseBomInfoList) { + 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); + + BaseBomInfo bomInfo1 = new BaseBomInfo(); + bomInfo1.setParentId(baseBomInfo.getMaterialCode()); + List baseBomInfos = baseBomInfoService.selectBaseBomInfoList(bomInfo1); + for (BaseBomInfo info : baseBomInfos) { + if (info.getMaterialType().equals(MaterialConstants.COAMING_MATERIAL_TYPE)){ + planInfo.setPlanCode(PlanCodeUtils.getPlanCode()); + planInfo.setOrderCode(orderCode); + planInfo.setSaleOrderCode(saleOrderCode); + planInfo.setSaleorderLinenumber(saleOrderLineNumber); + planInfo.setMaterialCode(info.getMaterialCode()); + planInfo.setMaterialName(info.getMaterialName()); + planInfo.setProductLineCode("1001"); + planInfo.setPlanAmount(baseBomInfo.getStandardAmount().longValue() * orderAmount.longValue()); + this.insertProductPlanInfo(planInfo); + } + } + } + } //-- 若一个工单可下达多计划:则需要根据工单编号和物料编号去重 + //检查生产BOM是否满足下计划条件 - baseBomInfoService.checkBomInfo(baseBomInfoList); - //维护生产计划 - for (BaseBomInfo baseBomInfo : baseBomInfoList) { - 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(baseBomInfo.getProductLineCode()); - planInfo.setPlanAmount(baseBomInfo.getStandardAmount() * orderAmount.longValue()); - this.insertProductPlanInfo(planInfo); - } +// baseBomInfoService.checkBomInfo(baseBomInfoList); + baseOrderInfo.setIsRelease(0L); baseOrderInfoService.updateBaseOrderInfo(baseOrderInfo); } catch (Exception e) {