From 5600f4a391f4a887d610fe56b3d46cf07d87fc5e Mon Sep 17 00:00:00 2001 From: mzr Date: Sat, 23 Aug 2025 11:15:59 +0800 Subject: [PATCH] =?UTF-8?q?feat(so):=20=E5=90=8C=E6=AD=A5=20CLM=20?= =?UTF-8?q?=E5=90=88=E5=90=8C=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E7=B4=AF?= =?UTF-8?q?=E8=AE=A1=E6=95=B0=E9=87=8F=20-=20=E6=96=B0=E5=A2=9E=E9=94=80?= =?UTF-8?q?=E5=94=AE=E8=AE=A2=E5=8D=95=E7=B4=AF=E8=AE=A1=E5=87=BA=E5=BA=93?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E5=9B=9E=E5=86=99=E5=8A=9F=E8=83=BD=20-=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E7=B4=AF?= =?UTF-8?q?=E8=AE=A1=E5=BC=80=E7=A5=A8=E6=95=B0=E9=87=8F=E5=9B=9E=E5=86=99?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=20-=20=E6=96=B0=E5=A2=9E=E9=94=80=E5=94=AE?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=B4=AF=E8=AE=A1=E9=80=80=E8=B4=A7=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E5=9B=9E=E5=86=99=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../so/m30/ic/m4c/Rewrite30For4CImpl.java | 190 ++++++++++++++++++ .../so/m30/so/m32/Rewrite30For32Impl.java | 148 ++++++++++++++ .../so/m30/so/m33/Rewrite30For33Impl.java | 2 +- .../RewriteSaleOrderByWitdrawImpl.java | 115 +++++++++++ .../so/m30arrange/Rewrite30ArrangeImpl.java | 2 +- .../nc/pubimpl/so/rule/SyncClmNumRule.java | 36 +++- 6 files changed, 486 insertions(+), 7 deletions(-) create mode 100644 so/src/private/nc/pubimpl/so/m30/ic/m4c/Rewrite30For4CImpl.java create mode 100644 so/src/private/nc/pubimpl/so/m30/so/m32/Rewrite30For32Impl.java create mode 100644 so/src/private/nc/pubimpl/so/m30/so/withdraw/RewriteSaleOrderByWitdrawImpl.java diff --git a/so/src/private/nc/pubimpl/so/m30/ic/m4c/Rewrite30For4CImpl.java b/so/src/private/nc/pubimpl/so/m30/ic/m4c/Rewrite30For4CImpl.java new file mode 100644 index 0000000..3e385c1 --- /dev/null +++ b/so/src/private/nc/pubimpl/so/m30/ic/m4c/Rewrite30For4CImpl.java @@ -0,0 +1,190 @@ +package nc.pubimpl.so.m30.ic.m4c; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; + +import com.yonyou.cloud.ncc.NCCSagas; + +import nc.bs.so.m30.plugin.ServicePlugInPoint; +import nc.bs.so.m30.rule.credit.RenovateARByBidsBeginRule; +import nc.bs.so.m30.rule.credit.RenovateARByBidsEndRule; +import nc.impl.pubapp.env.BSContext; +import nc.impl.pubapp.pattern.data.view.ViewQuery; +import nc.impl.pubapp.pattern.data.view.ViewUpdate; +import nc.impl.pubapp.pattern.pub.LockOperator; +import nc.impl.pubapp.pattern.rule.processer.AroundProcesser; +import nc.itf.scmpub.reference.uap.group.SysInitGroupQuery; +import nc.itf.so.m30.compensate.ISaleOrderSagasCompensate; +import nc.pubimpl.so.m30.ic.m4c.rule.Rewrite35WhenOutNumChange; +import nc.pubimpl.so.m30.ic.m4c.rule.Rewrite38WhenOutNumChange; +import nc.pubimpl.so.m30.ic.m4c.rule.RewriteExchangeOutRule; +import nc.pubimpl.so.m30.ic.m4c.rule.RewriteOPCOutNumRule; +import nc.pubimpl.so.m30.ic.m4c.rule.RewriteOutNumRule; +import nc.pubimpl.so.m30.ic.m4c.rule.RewriteOutStateRule; +import nc.pubimpl.so.m30.ic.m4c.rule.RewritePriceNumRule; +import nc.pubimpl.so.m30.ic.m4c.rule.RewriteSetNumRule; +import nc.pubimpl.so.m30.ic.m4c.rule.RewriteToleranceCheck; +import nc.pubimpl.so.m30.ic.m4c.rule.RewriteZ3ByRowStateRule; +import nc.pubimpl.so.rule.SyncClmNumRule; +import nc.pubitf.so.m30.ic.m4c.IRewrite30For4C; +import nc.pubitf.so.m30.ic.m4c.Rewrite4CPara; +import nc.vo.credit.engrossmaintain.pub.action.M30EngrossAction; +import nc.vo.pub.BusinessException; +import nc.vo.pub.lang.UFBoolean; +import nc.vo.pubapp.pattern.exception.ExceptionUtils; +import nc.vo.pubapp.pattern.log.TimeLog; +import nc.vo.so.m30.entity.SaleOrderBVO; +import nc.vo.so.m30.entity.SaleOrderViewVO; +import nc.vo.so.pub.util.SOSagasConst; + +/** + * 出库回写销售订单累计出库数量实现 + *

+ * 本类主要完成以下功能: + * + *

+ * + * @version 6.0 + * @author 刘志伟 + * @time 2010-7-12 下午04:50:48 + */ +public class Rewrite30For4CImpl implements IRewrite30For4C { + + @Override + public void rewrite30NumFor4C(Rewrite4CPara[] paras) throws BusinessException { + try { + //埋补偿 + Map paraMap = new HashMap(); + paraMap.put(SOSagasConst.OPERATER, SOSagasConst.REERITE30NUMFOR4CI); + paraMap.put(SOSagasConst.PARAS,paras); + NCCSagas.compensate(ISaleOrderSagasCompensate.class, paraMap); + this.rewrite(paras); + } + catch (RuntimeException ex) { + ExceptionUtils.marsh(ex); + } + } + + private void addRule(AroundProcesser processer, + SaleOrderViewVO[] views) throws BusinessException { + // -------- 执行前规则 ---------------- + + // 先检查出库容差范围 + new RewriteToleranceCheck().process(views); + processer.addBeforeRule(new RewriteOutNumRule()); + processer.addBeforeRule(new RewriteExchangeOutRule()); + // 执行前最后设置累计出库数量 + processer.addBeforeRule(new RewriteSetNumRule()); + processer.addBeforeRule(new Rewrite35WhenOutNumChange()); + // 设置销售价格限量促销执行量 jilu for 恒安限量促销 + processer.addBeforeRule(new RewritePriceNumRule()); + // end + // 更新信用调用前(必须放在前后rule最内层,防止和状态信用调用嵌套) + processer.addBeforeRule(new RenovateARByBidsBeginRule( + M30EngrossAction.M30OutReWrite)); + + // -------- 执行后规则 ---------------- + + // 更新信用调用后(必须放在前后rule最内层,防止和状态信用调用嵌套) + processer.addAfterRule(new RenovateARByBidsEndRule( + M30EngrossAction.M30OutReWrite)); + //回写预订单累计出库数量 + processer.addAfterRule(new Rewrite38WhenOutNumChange()); + + // 为了通知StateCalculateUtil.isAutoTransitInvoiceOpen是自动回写调用的,而非行手工打开 + // 此处非常别扭,作为临时处理,以后版本对状态机的使用重新考虑 + BSContext.getInstance().setSession(Rewrite30For4CImpl.class.getName(), + UFBoolean.TRUE); + // 回写电子销售:累计出库数量 + if(SysInitGroupQuery.isOPCEnabled()){ + processer.addAfterRule(new RewriteOPCOutNumRule()); + } + processer.addAfterRule(new RewriteOutStateRule()); + + // 回写销售订单数量时,如果订单行关闭还要回写上游合同 + processer.addAfterRule(new RewriteZ3ByRowStateRule()); + + // 同步CLM合同销售订单-累计出库数量 + processer.addAfterRule(new SyncClmNumRule("ntotaloutnum")); + + } + + private String[] lockBills(Map index) { + int size = index.size(); + String[] bids = new String[size]; + bids = index.keySet().toArray(bids); + LockOperator locker = new LockOperator(); + String message = + nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("4006011_0", + "04006011-0180")/*@res "库存销售出库单回写销售订单累计出库数量,锁销售订单表体失败"*/; + locker.lock(bids, message); + return bids; + } + + private Map prepareParams(Rewrite4CPara[] paras) { + Map index = new HashMap(); + for (Rewrite4CPara para : paras) { + index.put(para.getCsaleorderbid(), para); + } + return index; + } + + private SaleOrderViewVO[] query(Map index) { + String[] ids = this.lockBills(index); + ViewQuery bo = + new ViewQuery(SaleOrderViewVO.class); + bo.setSharedHead(true); + + SaleOrderViewVO[] views = bo.query(ids); + if (views.length != index.size()) { + String message = + nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("4006011_0", + "04006011-0171")/*@res "出现并发,请重新查询销售订单"*/; + ExceptionUtils.wrappBusinessException(message); + } + return views; + } + + private void rewrite(Rewrite4CPara[] paras) throws BusinessException { + TimeLog.logStart(); + Map index = this.prepareParams(paras); + // 此处设置session变量,以避免程序到处传递 + BSContext.getInstance().setSession(Rewrite4CPara.class.getName(), index); + TimeLog.info("并处理参数"); /*-=notranslate=-*/ + + TimeLog.logStart(); + SaleOrderViewVO[] views = this.query(index); + TimeLog.info("查询销售订单表体"); /*-=notranslate=-*/ + + AroundProcesser processer = + new AroundProcesser( + ServicePlugInPoint.rewrite30NumFor4C); + this.addRule(processer, views); + + TimeLog.logStart(); + processer.before(views); + TimeLog.info("写数据库前执行业务规则"); /*-=notranslate=-*/ + + TimeLog.logStart(); + String[] names = new String[] { + SaleOrderBVO.NTOTALNOTOUTNUM, SaleOrderBVO.NTOTALOUTNUM + }; + ViewUpdate bo = new ViewUpdate(); + views = bo.update(views, SaleOrderBVO.class, names); + TimeLog.info("更新数据库"); /*-=notranslate=-*/ + + TimeLog.logStart(); + processer.after(views); + TimeLog.info("写数据库后执行业务规则"); /*-=notranslate=-*/ + + // 此处释放session变量,以免浪费内存 + BSContext.getInstance().removeSession(Rewrite4CPara.class.getName()); + BSContext.getInstance().removeSession(Rewrite30For4CImpl.class.getName()); + } + +} diff --git a/so/src/private/nc/pubimpl/so/m30/so/m32/Rewrite30For32Impl.java b/so/src/private/nc/pubimpl/so/m30/so/m32/Rewrite30For32Impl.java new file mode 100644 index 0000000..a21f79f --- /dev/null +++ b/so/src/private/nc/pubimpl/so/m30/so/m32/Rewrite30For32Impl.java @@ -0,0 +1,148 @@ +package nc.pubimpl.so.m30.so.m32; + +import java.util.HashMap; +import java.util.Map; + +import nc.bs.so.m30.plugin.ServicePlugInPoint; +import nc.bs.so.m30.rule.credit.RenovateARByBidsBeginRule; +import nc.bs.so.m30.rule.credit.RenovateARByBidsEndRule; +import nc.impl.pubapp.env.BSContext; +import nc.impl.pubapp.pattern.data.view.ViewQuery; +import nc.impl.pubapp.pattern.data.view.ViewUpdate; +import nc.impl.pubapp.pattern.pub.LockOperator; +import nc.impl.pubapp.pattern.rule.processer.AroundProcesser; +import nc.pubimpl.so.m30.so.m32.rule.RewriteInvoiceStateRule; +import nc.pubimpl.so.m30.so.m32.rule.RewriteSetNumRule; +import nc.pubimpl.so.m30.so.m32.rule.RewriteToleranceCheck; +import nc.pubimpl.so.rule.SyncClmNumRule; +import nc.pubitf.so.m30.so.m32.IRewrite30For32; +import nc.pubitf.so.m30.so.m32.Rewrite32Para; +import nc.vo.credit.engrossmaintain.pub.action.M30EngrossAction; +import nc.vo.pub.BusinessException; +import nc.vo.pubapp.pattern.exception.ExceptionUtils; +import nc.vo.pubapp.pattern.log.TimeLog; +import nc.vo.so.m30.entity.SaleOrderBVO; +import nc.vo.so.m30.entity.SaleOrderViewVO; + +/** + * 销售发票回写销售订单服务接口实现类。 + * + * @author 刘志伟 + * @since 6.0 + * @time 2010-01-28 下午13:49:07 + */ +public class Rewrite30For32Impl implements IRewrite30For32 { + + @Override + public void rewrite30NumFor32(Rewrite32Para[] paras) throws BusinessException { + try { + this.rewrite(paras); + } + catch (RuntimeException ex) { + ExceptionUtils.marsh(ex); + } + } + + private void addRule(AroundProcesser processer, + SaleOrderViewVO[] views) throws BusinessException { + // -------- 执行前规则 ---------------- + + // 最先检查开票数量 + new RewriteToleranceCheck().process(views); + // 执行前最后设置开票数量 + processer.addBeforeRule(new RewriteSetNumRule()); + + // -------- 执行后规则 ---------------- + + // 执行后开票状态规则 + processer.addAfterRule(new RewriteInvoiceStateRule()); + + // 同步CLM合同销售订单-累计开票数量 + processer.addAfterRule(new SyncClmNumRule("ntotalinvoicenum")); + + } + + private String[] lockBills(Map index) { + int size = index.size(); + String[] bids = new String[size]; + bids = index.keySet().toArray(bids); + LockOperator locker = new LockOperator(); + String message = nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("4006011_0","04006011-0186")/*@res "销售发票回写销售订单累计开票数量,锁销售订单表体失败"*/; + locker.lock(bids, message); + return bids; + } + + private Map prepareParams(Rewrite32Para[] paras) { + Map index = new HashMap(); + for (Rewrite32Para para : paras) { + index.put(para.getCsaleorderbid(), para); + } + return index; + } + + private SaleOrderViewVO[] query(Map index) { + String[] ids = this.lockBills(index); + ViewQuery bo = + new ViewQuery(SaleOrderViewVO.class); + bo.setSharedHead(true); + + SaleOrderViewVO[] views = bo.query(ids); + if (views.length != index.size()) { + String message = nc.vo.ml.NCLangRes4VoTransl.getNCLangRes().getStrByID("4006011_0","04006011-0171")/*@res "出现并发,请重新查询销售订单"*/; + ExceptionUtils.wrappBusinessException(message); + } + return views; + } + + private void rewrite(Rewrite32Para[] paras) throws BusinessException { + TimeLog.logStart(); + Map index = this.prepareParams(paras); + // 此处设置session变量,以避免程序到处传递 + BSContext.getInstance().setSession(Rewrite32Para.class.getName(), index); + TimeLog.info("并处理参数"); /*-=notranslate=-*/ + + TimeLog.logStart(); + SaleOrderViewVO[] views = this.query(index); + TimeLog.info("查询销售订单表体"); /*-=notranslate=-*/ + + AroundProcesser processer = + new AroundProcesser( + ServicePlugInPoint.rewrite30NumFor32); + this.addRule(processer, views); + + TimeLog.logStart(); + processer.before(views); + TimeLog.info("写数据库前执行业务规则"); /*-=notranslate=-*/ + + TimeLog.logStart(); + String[] names = new String[] { + SaleOrderBVO.NTOTALINVOICENUM + }; + ViewUpdate bo = new ViewUpdate(); + views = bo.update(views, SaleOrderBVO.class, names); + TimeLog.info("更新数据库"); /*-=notranslate=-*/ + + TimeLog.logStart(); + processer.after(views); + TimeLog.info("写数据库后执行业务规则"); /*-=notranslate=-*/ + + // 此处释放session变量,以免浪费内存 + BSContext.getInstance().removeSession(Rewrite32Para.class.getName()); + } + + @Override + public void rewirte30ForCredit(Rewrite32Para[] paras) throws BusinessException { + Map index = this.prepareParams(paras); + SaleOrderViewVO[] views = this.query(index); + AroundProcesser processer = new AroundProcesser( + ServicePlugInPoint.rewrite30NumFor32); + processer + .addBeforeRule(new RenovateARByBidsBeginRule(M30EngrossAction.M30InvoiceReWrite)); + processer + .addAfterRule(new RenovateARByBidsEndRule(M30EngrossAction.M30InvoiceReWrite)); + processer.before(views); + processer.after(views); + + } + +} \ No newline at end of file diff --git a/so/src/private/nc/pubimpl/so/m30/so/m33/Rewrite30For33Impl.java b/so/src/private/nc/pubimpl/so/m30/so/m33/Rewrite30For33Impl.java index 46297cd..a20fb71 100644 --- a/so/src/private/nc/pubimpl/so/m30/so/m33/Rewrite30For33Impl.java +++ b/so/src/private/nc/pubimpl/so/m30/so/m33/Rewrite30For33Impl.java @@ -209,7 +209,7 @@ public class Rewrite30For33Impl implements IRewrite30For33 { // -------------------------------------- // 更新信用调用后 processer.addAfterRule(new RenovateARByBidsEndRule(engrossAction)); - // 同步CLM合同销售订单 + // 同步CLM合同销售订单-累计确认应收金额 processer.addAfterRule(new SyncClmNumRule("ntotalarmny")); } diff --git a/so/src/private/nc/pubimpl/so/m30/so/withdraw/RewriteSaleOrderByWitdrawImpl.java b/so/src/private/nc/pubimpl/so/m30/so/withdraw/RewriteSaleOrderByWitdrawImpl.java new file mode 100644 index 0000000..76c2b2b --- /dev/null +++ b/so/src/private/nc/pubimpl/so/m30/so/withdraw/RewriteSaleOrderByWitdrawImpl.java @@ -0,0 +1,115 @@ +// +// Source code recreated from a .class file by IntelliJ IDEA +// (powered by FernFlower decompiler) +// + +package nc.pubimpl.so.m30.so.withdraw; + +import java.util.HashMap; +import java.util.Map; +import nc.bs.so.m30.plugin.ServicePlugInPoint; +import nc.bs.so.m30.rule.maintainprocess.NullRule; +import nc.bs.so.m30.rule.maintainprocess.RewriteReturnNumRule; +import nc.bs.so.m30.rule.rewrite.m30.CheckWithdrawNumRule; +import nc.impl.pubapp.env.BSContext; +import nc.impl.pubapp.pattern.data.view.ViewQuery; +import nc.impl.pubapp.pattern.data.view.ViewUpdate; +import nc.impl.pubapp.pattern.rule.IRule; +import nc.impl.pubapp.pattern.rule.processer.AroundProcesser; +import nc.pubimpl.so.rule.SyncClmNumRule; +import nc.pubitf.so.m30.so.withdraw.IRewriteSaleOrderByWithdraw; +import nc.pubitf.so.m30.so.withdraw.Rewrite30Para; +import nc.vo.ml.NCLangRes4VoTransl; +import nc.vo.pub.BusinessException; +import nc.vo.pub.lang.UFDouble; +import nc.vo.pubapp.pattern.exception.ExceptionUtils; +import nc.vo.pubapp.pattern.log.TimeLog; +import nc.vo.pubapp.pattern.pub.MathTool; +import nc.vo.so.m30.entity.SaleOrderBVO; +import nc.vo.so.m30.entity.SaleOrderViewVO; + +public class RewriteSaleOrderByWitdrawImpl implements IRewriteSaleOrderByWithdraw { + public RewriteSaleOrderByWitdrawImpl() { + } + + public void rewrite30NumForWithdraw(Rewrite30Para[] paras) throws BusinessException { + try { + this.rewrite(paras); + } catch (RuntimeException ex) { + ExceptionUtils.marsh(ex); + } + + } + + private void addAfterRule(AroundProcesser processer) { + processer.addAfterRule(new NullRule()); + processer.addAfterRule(new RewriteReturnNumRule()); + // 同步CLM合同销售订单-累计退货主数量 + processer.addAfterRule(new SyncClmNumRule("ntotalreturnnum")); + } + + private void addBeforeRule(AroundProcesser processer) { + IRule rule = new CheckWithdrawNumRule(); + processer.addBeforeRule(rule); + } + + private Map prepareParams(Rewrite30Para[] paras) { + Map index = new HashMap(); + + for(Rewrite30Para para : paras) { + index.put(para.getCsaleorderbid(), para); + } + + return index; + } + + private SaleOrderViewVO[] query(Map index) { + String[] ids = (String[])index.keySet().toArray(new String[0]); + ViewQuery bo = new ViewQuery(SaleOrderViewVO.class); + bo.setSharedHead(true); + SaleOrderViewVO[] views = (SaleOrderViewVO[])bo.query(ids); + if (views.length != index.size()) { + String message = NCLangRes4VoTransl.getNCLangRes().getStrByID("4006011_0", "04006011-0171"); + ExceptionUtils.wrappBusinessException(message); + } + + return views; + } + + private void rewrite(Rewrite30Para[] paras) { + TimeLog.logStart(); + Map index = this.prepareParams(paras); + TimeLog.logStart(); + SaleOrderViewVO[] views = this.query(index); + TimeLog.info("查询销售订单表体"); + BSContext.getInstance().setSession(Rewrite30Para.class.getName(), index); + AroundProcesser processer = new AroundProcesser(ServicePlugInPoint.rewrite30NumForWithdraw); + + for(SaleOrderViewVO viewvo : views) { + this.setRewiteNum(viewvo, index); + } + + TimeLog.logStart(); + this.addBeforeRule(processer); + processer.before(views); + TimeLog.info("调用回写动作前插入点"); + TimeLog.logStart(); + String[] names = new String[]{"ntotalreturnnum"}; + ViewUpdate bo = new ViewUpdate(); + views = (SaleOrderViewVO[])bo.update(views, SaleOrderBVO.class, names); + TimeLog.info("更新数据库"); + TimeLog.logStart(); + this.addAfterRule(processer); + processer.after(views); + TimeLog.info("调用回写动作后插入点"); + BSContext.getInstance().removeSession(Rewrite30Para.class.getName()); + } + + private void setRewiteNum(SaleOrderViewVO vo, Map index) { + SaleOrderBVO body = vo.getBody(); + Rewrite30Para para = (Rewrite30Para)index.get(body.getCsaleorderbid()); + UFDouble ntotalreturnnum = body.getNtotalreturnnum(); + ntotalreturnnum = MathTool.sub(ntotalreturnnum, para.getNnum()); + body.setNtotalreturnnum(ntotalreturnnum); + } +} diff --git a/so/src/private/nc/pubimpl/so/m30arrange/Rewrite30ArrangeImpl.java b/so/src/private/nc/pubimpl/so/m30arrange/Rewrite30ArrangeImpl.java index 4d04973..be12821 100644 --- a/so/src/private/nc/pubimpl/so/m30arrange/Rewrite30ArrangeImpl.java +++ b/so/src/private/nc/pubimpl/so/m30arrange/Rewrite30ArrangeImpl.java @@ -64,7 +64,7 @@ public class Rewrite30ArrangeImpl implements IRewrite30For20, IRewrite30For21, processer.addBeforeRule(new RewriteCheckArrangeNumRule()); processer.addBeforeRule(new RewriteSetNumRule()); if (MMBillType.ProduceOrder.getCode().equals(srctype.getCode()) || MMBillType.LsProduceOrder.getCode().equals(srctype.getCode())) { - // 同步CLM合同销售订单 + // 同步CLM合同销售订单-累计安排生产订单主数量 processer.addAfterRule(new SyncClmNumRule("narrangemonum")); } } diff --git a/so/src/private/nc/pubimpl/so/rule/SyncClmNumRule.java b/so/src/private/nc/pubimpl/so/rule/SyncClmNumRule.java index bd3e089..634db22 100644 --- a/so/src/private/nc/pubimpl/so/rule/SyncClmNumRule.java +++ b/so/src/private/nc/pubimpl/so/rule/SyncClmNumRule.java @@ -38,9 +38,9 @@ public class SyncClmNumRule implements IRule { if (StringUtils.isEmpty(vdef9) || StringUtils.isEmpty(vbdef11)) { continue; } - // 累计安排生产订单主数量 - UFDouble narrangemonum = body.getNarrangemonum(); - if ("narrangemonum".equals(flag) && narrangemonum == null) { + // 累计开票主数量 + UFDouble ntotalinvoicenum = body.getNtotalinvoicenum(); + if ("ntotalinvoicenum".equals(flag) && ntotalinvoicenum == null) { continue; } // 累计确认应收金额 @@ -48,17 +48,43 @@ public class SyncClmNumRule implements IRule { if ("ntotalarmny".equals(flag) && ntotalarmny == null) { continue; } + // 累计出库数量 + UFDouble ntotaloutnum = body.getNtotaloutnum(); + if ("ntotaloutnum".equals(flag) && ntotaloutnum == null) { + continue; + } + // 累计安排生产订单主数量 + UFDouble narrangemonum = body.getNarrangemonum(); + if ("narrangemonum".equals(flag) && narrangemonum == null) { + continue; + } + // 累计退货主数量 + UFDouble ntotalreturnnum = body.getNtotalreturnnum(); + if ("ntotalreturnnum".equals(flag) && ntotalreturnnum == null) { + continue; + } + JSONObject oneJson = new JSONObject(); List> bodyList = new ArrayList<>(); Map bodyMap = new HashMap<>(); bodyMap.put("id", vbdef11); - if (narrangemonum != null) { - bodyMap.put("narrangemonum", narrangemonum.toString()); + + if (ntotalinvoicenum != null) { + bodyMap.put("billQty", ntotalinvoicenum.toString()); } if (ntotalarmny != null) { bodyMap.put("totalAccrued", ntotalarmny.toString()); } + if (ntotaloutnum != null) { + bodyMap.put("totalOutQty", ntotaloutnum.toString()); + } + if (narrangemonum != null) { + bodyMap.put("narrangemonum", narrangemonum.toString()); + } + if (ntotalreturnnum != null) { + bodyMap.put("ntotalreturnnum", ntotalreturnnum.toString()); + } bodyList.add(bodyMap);