From 64726cd810150632af459c0724290acb681cfe77 Mon Sep 17 00:00:00 2001 From: yinq Date: Thu, 11 Jan 2024 09:50:39 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E6=94=B9=E4=B8=8B=E8=BE=BE?= =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../production/domain/ProductPlanInfo.java | 33 +++++++- .../impl/ProductPlanInfoServiceImpl.java | 80 ++++++++++++------- .../production/ProductPlanInfoMapper.xml | 11 ++- 3 files changed, 91 insertions(+), 33 deletions(-) diff --git a/aucma-production/src/main/java/com/aucma/production/domain/ProductPlanInfo.java b/aucma-production/src/main/java/com/aucma/production/domain/ProductPlanInfo.java index 11ba0aa..6c9be92 100644 --- a/aucma-production/src/main/java/com/aucma/production/domain/ProductPlanInfo.java +++ b/aucma-production/src/main/java/com/aucma/production/domain/ProductPlanInfo.java @@ -58,17 +58,29 @@ public class ProductPlanInfo extends BaseEntity { @Excel(name = "物料名称") private String materialName; + /** + * 产线编号 + */ + @Excel(name = "产线编号") + private String productLineCode; + + /** + * 产线名称 + */ + @Excel(name = "产线名称") + private String productLineName; + /** * 计划工位编号 */ @Excel(name = "计划工位编号") - private String productLineCode; + private String stationCode; /** * 计划工位名称 */ @Excel(name = "计划工位名称") - private String productLineName; + private String stationName; /** * 计划数量 @@ -128,6 +140,23 @@ public class ProductPlanInfo extends BaseEntity { @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") private Date updatedTime; + + public String getStationCode() { + return stationCode; + } + + public void setStationCode(String stationCode) { + this.stationCode = stationCode; + } + + public String getStationName() { + return stationName; + } + + public void setStationName(String stationName) { + this.stationName = stationName; + } + public String getProductLineName() { return productLineName; } 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 36c2c10..15a831d 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 @@ -130,36 +130,60 @@ public class ProductPlanInfoServiceImpl implements IProductPlanInfoService { if (baseBomInfoList.size() == 0) { throw new ServiceException("生产BOM信息不完整,请先维护生产BOM信息!"); } - bomInfo.setIsPlanToStation(null); - List baseBomInfos = baseBomInfoService.selectBaseBomInfoList(bomInfo); + BaseBomInfo bom = new BaseBomInfo(); + bom.setAncestors(baseOrderInfo.getMaterialCode()); + List 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); diff --git a/aucma-production/src/main/resources/mapper/production/ProductPlanInfoMapper.xml b/aucma-production/src/main/resources/mapper/production/ProductPlanInfoMapper.xml index 6fd0663..981c5e4 100644 --- a/aucma-production/src/main/resources/mapper/production/ProductPlanInfoMapper.xml +++ b/aucma-production/src/main/resources/mapper/production/ProductPlanInfoMapper.xml @@ -12,7 +12,9 @@ - + + + @@ -33,8 +35,10 @@ pp.saleorder_linenumber, pp.material_code, pp.material_name, - pp.productline_code, + pl.PRODUCT_LINE_CODE productLineCode, pl.PRODUCT_LINE_NAME productLineName, + st.PRODUCT_LINE_CODE stationCode, + st.PRODUCT_LINE_NAME stationName, pp.plan_amount, pp.complete_amount, pp.begin_time, @@ -45,7 +49,8 @@ pp.updated_by, pp.updated_time from product_planinfo pp - left join BASE_PRODUCTLINE pl on pl.PRODUCT_LINE_CODE = pp.productline_code + left join BASE_PRODUCTLINE st on st.PRODUCT_LINE_CODE = pp.productline_code + left join BASE_PRODUCTLINE pl on pl.PRODUCT_LINE_CODE = st.PARENT_ID