From b2bc10147f411368d5738e73bbce6b692a84d7a2 Mon Sep 17 00:00:00 2001 From: mzr Date: Fri, 28 Mar 2025 08:36:59 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E4=BF=AE?= =?UTF-8?q?=E8=AE=A2-=E8=87=AA=E5=AE=9A=E4=B9=89=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=8F=96=E5=80=BC=E8=B0=83=E6=95=B4=E5=92=8C=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=89=A9=E6=96=99=E8=A1=8C=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/so/m30/APISaleOrderMaitainImpl.java | 52 ++++++++++++++++--- 1 file changed, 44 insertions(+), 8 deletions(-) diff --git a/so/src/private/nccloud/api/impl/so/m30/APISaleOrderMaitainImpl.java b/so/src/private/nccloud/api/impl/so/m30/APISaleOrderMaitainImpl.java index b6df87b..f0e226d 100644 --- a/so/src/private/nccloud/api/impl/so/m30/APISaleOrderMaitainImpl.java +++ b/so/src/private/nccloud/api/impl/so/m30/APISaleOrderMaitainImpl.java @@ -2,7 +2,9 @@ package nccloud.api.impl.so.m30; import nc.bd.itf.tools.BFPubTools; import nc.bs.dao.BaseDAO; +import nc.bs.dao.DAOException; import nc.bs.framework.common.NCLocator; +import nc.bs.trade.business.HYSuperDMO; import nc.itf.fi.pub.Currency; import nc.itf.scmpub.reference.uap.pf.PfServiceScmUtil; import nc.itf.so.m30.self.ISaleOrderMaintain; @@ -11,6 +13,7 @@ import nc.itf.uap.pf.IPFBusiAction; import nc.jdbc.framework.processor.ColumnProcessor; import nc.jdbc.framework.processor.MapProcessor; import nc.pubitf.so.m30.api.ISaleOrderQueryAPI; +import nc.vo.bd.defdoc.DefdocVO; import nc.vo.ml.NCLangRes4VoTransl; import nc.vo.pub.BusinessException; import nc.vo.pub.VOStatus; @@ -280,15 +283,20 @@ public class APISaleOrderMaitainImpl implements IAPISaleOrderMaitain { // Set delBids = findOtherBids(bipVo.getChildrenVO(), vo.getChildrenVO()); // 设置单据状态 hvo.setStatus(VOStatus.UPDATED); + + Map bvoMap = new HashMap<>(); + for (SaleOrderBVO saleOrderBVO : bipVo.getChildrenVO()) { + bvoMap.put(saleOrderBVO.getCsaleorderbid(), saleOrderBVO); + } + // 比较combinBillVOs中的BVO和vos中的BVO for (SaleOrderBVO bvo : vo.getChildrenVO()) { bvo.setStatus(VOStatus.UPDATED); - // 设置删除的物料行的状态 - for (SaleOrderBVO bipBVO : bipVo.getChildrenVO()) { - if (bvo.getCsaleorderbid().equals(bipBVO.getCsaleorderbid()) && (1 == bipBVO.getDr())) { - bvo.setStatus(VOStatus.DELETED); - NCCForUAPLogger.debug("findDeletedBids:" + VOStatus.DELETED + ",csaleorderbid = " + bvo.getCsaleorderbid()); - } + // 设置删除的物料行的状态,在bip传的数据中找不到 + String csaleorderbid = bvo.getCsaleorderbid(); + if (bvoMap.get(csaleorderbid) == null) { + bvo.setStatus(VOStatus.DELETED); + NCCForUAPLogger.debug("findDeletedBids:" + VOStatus.DELETED + ",csaleorderbid = " + csaleorderbid); } } // 更新 combinBillVO 中的字段为 vos 中的值 @@ -516,16 +524,44 @@ public class APISaleOrderMaitainImpl implements IAPISaleOrderMaitain { setMaterl(targetBVO); } // 自定义项赋值 - targetBVO.setVbdef1(sourceBVO.getVbdef1());// 合同编号 - targetBVO.setVbdef5(sourceBVO.getVbdef5());// 合同销售订单号 + String vbdef1 = sourceBVO.getVbdef1();// 合同编号 + Map defList = getDefList("zdy-001"); + targetBVO.setVbdef1(defList.getOrDefault(vbdef1, "")); + String vbdef5 = sourceBVO.getVbdef5();// 合同销售订单号 + defList.clear(); + defList = getDefList("BIP-ddh"); + targetBVO.setVbdef5(defList.getOrDefault(vbdef5, "")); targetBVO.setVbdef10(sourceBVO.getVbdef10());// 项目名称 targetBVO.setVbdef13(sourceBVO.getVbdef13());// 国网行项目号 + NCCForUAPLogger.debug(String.format( + "cmaterialvid = [%S], vbdef1 = [%S], vbdef5 = [%S], vbdef10 = [%S], vbdef13 = [%S]", + cmaterialvid, targetBVO.getVbdef1(), targetBVO.getVbdef5(), targetBVO.getVbdef10(), targetBVO.getVbdef13())); } } } } + /** + * 获取自定义项信息 + */ + private Map getDefList(String code) { + Map map = new HashMap(); + String strWhere = " pk_defdoclist in (select pk_defdoclist from bd_defdoclist where code='" + code + "' and dr=0 ) and dr = 0"; + try { + DefdocVO[] defdocVOs = (DefdocVO[]) new HYSuperDMO().queryByWhereClause(DefdocVO.class, strWhere); + if (defdocVOs != null && defdocVOs.length > 0) { + for (DefdocVO defdocVO : defdocVOs) { + map.put(defdocVO.getCode().trim(), defdocVO.getPk_defdoc()); + } + } + } catch (DAOException e) { + e.printStackTrace(); + } + return map; + + } + @Override public SaleOrderVO[] modify(SaleOrderHistoryVO[] vos) throws BusinessException {