From 1e33573e5e46e4ffea92684ad13def78c0532211 Mon Sep 17 00:00:00 2001 From: mzr Date: Fri, 24 Oct 2025 11:39:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=90=E6=96=99=E5=87=BA=E5=BA=93=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=90=8C=E6=AD=A5-=E7=94=A8=E5=8F=8B=E6=9D=8E?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ic/m4d/APIMaterialOutMaintainImpl.java | 38 +++++++++++++++---- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/ic/src/private/nccloud/api/impl/ic/m4d/APIMaterialOutMaintainImpl.java b/ic/src/private/nccloud/api/impl/ic/m4d/APIMaterialOutMaintainImpl.java index 8448eff7..b862503c 100644 --- a/ic/src/private/nccloud/api/impl/ic/m4d/APIMaterialOutMaintainImpl.java +++ b/ic/src/private/nccloud/api/impl/ic/m4d/APIMaterialOutMaintainImpl.java @@ -27,7 +27,6 @@ import nc.vo.ic.pub.define.ICPubMetaNameConst; import nc.vo.mmpac.pickm.entity.AggPickmVO; import nc.vo.mmpac.pickm.entity.PickmItemVO; import nc.vo.pub.BusinessException; -import nc.vo.pub.ISuperVO; import nc.vo.pub.VOStatus; import nc.vo.pub.lang.UFDouble; import nc.vo.scmpub.check.billvalidate.BillVOsCheckRule; @@ -39,7 +38,6 @@ import nccloud.api.impl.ic.m4d.fill.MaterialOutSaveFillValue; import nccloud.api.impl.ic.m4d.fill.MaterialOutUpdateFillValue; import nccloud.api.impl.ic.pub.check.CheckProhibitUpdateFields; import nccloud.api.uapbd.wms.utils.IWmsSyncUtils; -import nccloud.baseapp.core.log.NCCForUAPLogger; import nccloud.openapi.ic.util.ICAPILocationVOUtils; import nccloud.openapi.scmpub.pub.TransferCodeToPKTool; import nccloud.openapi.scmpub.pub.TransferMapToVOTool; @@ -91,7 +89,7 @@ public class APIMaterialOutMaintainImpl implements IAPIMaterialOutMaintain { // if (isSpecialCase) { // processPickingPlanSpecialLogic(vos); // } - // 其他数据填充 + //其他数据填充 new MaterialOutSaveFillValue().setDefaultValue(vos); IMaterialOutMaintainAPI materialOut = NCLocator.getInstance().lookup(IMaterialOutMaintainAPI.class); @@ -123,7 +121,7 @@ public class APIMaterialOutMaintainImpl implements IAPIMaterialOutMaintain { // if (isSpecialCase) { // processPickingPlanSpecialLogic(vos); // } - // 其他数据填充 + //其他数据填充 new MaterialOutSaveFillValue().setDefaultValue(vos); IMaterialOutMaintainAPI materialOut = NCLocator.getInstance().lookup(IMaterialOutMaintainAPI.class); @@ -247,7 +245,7 @@ public class APIMaterialOutMaintainImpl implements IAPIMaterialOutMaintain { roigBvo.setAttributeValue(battr, newBvo.getAttributeValue(battr)); bfields.add(battr); } - // 设置货位序列号孙表,把原来的孙表删除,修改的货位置为新增 + //设置货位序列号孙表,把原来的孙表删除,修改的货位置为新增 if (null != newBvo.getLocationVOs()) { List allloc = new ArrayList(); if (null != deleteLoc && null != deleteLoc.get(roigBvo.getCgeneralbid())) { @@ -264,7 +262,7 @@ public class APIMaterialOutMaintainImpl implements IAPIMaterialOutMaintain { } // 翻译货位 ICAPILocationVOUtils.translate(materialOutVOs); - // 其他数据填充 + //其他数据填充 new MaterialOutUpdateFillValue().setDefaultValue(materialOutVOs, bfields); } } @@ -274,8 +272,34 @@ public class APIMaterialOutMaintainImpl implements IAPIMaterialOutMaintain { ICBillType.MaterialOut.getCode()); tool.doBeforeInsert(materialOutVOs); - MaterialOutVO[] updateVOS = NCLocator.getInstance().lookup(IMaterialOutMaintain.class).update(materialOutVOs, originBills); IWmsSyncUtils utils = NCLocator.getInstance().lookup(IWmsSyncUtils.class); + //2025年10月15日14点25分--重新覆盖单据转换规则转换的项目字段--wms对接公司存在备料计划与材料出库明细项目字段不一致情况--star + if (utils != null && utils.isWMS()) { + //获取originBill里表体的主键和项目字段形成Map,再遍历materialOutVOs去替换明细的项目 + Map originProjectMap = new HashMap<>(); + for (MaterialOutVO originBill : originBills) { + MaterialOutBodyVO[] originBodys = originBill.getBodys(); + if (originBodys != null) { + for (MaterialOutBodyVO originBody : originBodys) { + originProjectMap.put(originBody.getCgeneralbid(), originBody.getCprojectid()); + } + } + } + + for (MaterialOutVO materialOutVO : materialOutVOs) { + MaterialOutBodyVO[] bodyVOs = materialOutVO.getBodys(); + if (bodyVOs != null) { + for (MaterialOutBodyVO bodyVO : bodyVOs) { + String projectId = originProjectMap.get(bodyVO.getCgeneralbid()); + if (projectId != null) { + bodyVO.setCprojectid(projectId); + } + } + } + } + } + //2025年10月15日14点25分--重新覆盖单据转换规则转换的项目字段--wms对接公司存在备料计划与材料出库明细项目字段不一致情况--end + MaterialOutVO[] updateVOS = NCLocator.getInstance().lookup(IMaterialOutMaintain.class).update(materialOutVOs, originBills); // 如果是WMS系统 则自动签字 if (utils != null && utils.isWMS()) { log.info("当前是WMS系统用户,自动签字");