From 0add4db4758eeea5c4dc7836c114a72684fb6785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=8E?= <125556714+Topfunplus@users.noreply.github.com> Date: Fri, 23 May 2025 10:45:40 +0800 Subject: [PATCH 1/2] =?UTF-8?q?refactor(mes):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E5=92=8C=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E6=94=B6=E8=B4=A7=E5=8D=95=E7=9A=84=20MES=20=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在销售订单同步中添加了对 BIP --- .../ic/m45/sign/rule/PurchaseReceiptRuleMES.java | 4 ++-- .../AfterApprovingSynchronizeRuleMES.java | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ic/src/private/nc/bs/ic/m45/sign/rule/PurchaseReceiptRuleMES.java b/ic/src/private/nc/bs/ic/m45/sign/rule/PurchaseReceiptRuleMES.java index 05b17d6..2928af6 100644 --- a/ic/src/private/nc/bs/ic/m45/sign/rule/PurchaseReceiptRuleMES.java +++ b/ic/src/private/nc/bs/ic/m45/sign/rule/PurchaseReceiptRuleMES.java @@ -177,8 +177,8 @@ public class PurchaseReceiptRuleMES implements IRule { String supplyId = transferCodeByPk(SupplierVO.getDefaultTableName(), SupplierVO.CODE, SupplierVO.PK_SUPPLIER, head.getCvendorid()); data.put("supplyId", supplyId); - // ID - ȷӳ - data.put("currency", null); + // - ȷӳ + data.put("currency", "CNY"); //ʣ data.put("rate", 1); // 㷽ʽ - ĬΪ"S"(ת) diff --git a/so/src/private/nc/bs/so/m30/rule/approve/AfterApprovingSynchronizeRuleMES.java b/so/src/private/nc/bs/so/m30/rule/approve/AfterApprovingSynchronizeRuleMES.java index 3c8ada3..67db0b0 100644 --- a/so/src/private/nc/bs/so/m30/rule/approve/AfterApprovingSynchronizeRuleMES.java +++ b/so/src/private/nc/bs/so/m30/rule/approve/AfterApprovingSynchronizeRuleMES.java @@ -3,6 +3,7 @@ package nc.bs.so.m30.rule.approve; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import nc.bs.dao.BaseDAO; +import nc.bs.framework.common.InvocationInfoProxy; import nc.bs.framework.common.NCLocator; import nc.bs.logging.Log; import nc.impl.pubapp.pattern.rule.IRule; @@ -45,9 +46,16 @@ public class AfterApprovingSynchronizeRuleMES implements IRule { @Override public void process(SaleOrderVO[] saleOrderVOs) { + // ʼHTTP󹤾 + IHttpPostOtherSys httpPostOtherSys = NCLocator.getInstance().lookup(IHttpPostOtherSys.class); try { - // ʼHTTP󹤾 - IHttpPostOtherSys httpPostOtherSys = NCLocator.getInstance().lookup(IHttpPostOtherSys.class); +// String code = InvocationInfoProxy.getInstance().getUserCode(); + // ǰԱBIPʱ ֱreturn ͬMESҵ߼ +// if (code != null && code.equals("BIP")) { +// obmlog.debug("AfterApprovingSynchronizeRuleMES-ǰԱBIP"); +// return; +// } + if (saleOrderVOs == null || saleOrderVOs.length == 0) { obmlog.debug("AfterApprovingSynchronizeRuleMES-ûҪ۶"); return; @@ -140,6 +148,7 @@ public class AfterApprovingSynchronizeRuleMES implements IRule { if (bodys != null) { for (SaleOrderBVO body : bodys) { JSONObject detailItem = new JSONObject(); + detailItem.put("productNum", head.getVbillcode()); // ֶҪֶ // dreceivedate UFDate dreceivedate = body.getDreceivedate(); @@ -187,7 +196,8 @@ public class AfterApprovingSynchronizeRuleMES implements IRule { detailItem.put("deliveryDate", dsenddate1 != null ? dsenddate1.toString().substring(0, 10) : null); // DZֶΪnull detailItem.put("productNum", null); - detailItem.put("factoryId", null); + // ݵ¹˾֯ + detailItem.put("factoryId", transferCodeByPk(SalesOrgVO.getDefaultTableName(), SalesOrgVO.CODE, SalesOrgVO.PK_SALESORG, head.getPk_org())); detailItem.put("customMtId", null); detailItem.put("customNo", null); detailItem.put("customSN", null); From 7b0d64895dcde190435fbee8541a7cbc19ddb361 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=8E?= <125556714+Topfunplus@users.noreply.github.com> Date: Thu, 29 May 2025 08:49:21 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat(SO):=20=E5=90=8C=E6=AD=A5=E9=94=80?= =?UTF-8?q?=E5=94=AE=E8=AE=A2=E5=8D=95=E6=97=B6=E6=96=B0=E5=A2=9E=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E7=B1=BB=E5=9E=8B=E7=BC=96=E7=A0=81=E5=92=8C=E4=B8=BB?= =?UTF-8?q?=E9=94=AE=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 AfterApprovingSynchronizeRuleMES 类中添加了三个新的字段属性: -销售订单交易类型编码 (SXZF19) - 销售订单主键 (SXZF20) - 销售订单子表主键 (SXZF21) - 这些新属性将增强与 MES 系统的同步信息,提高数据集成的准确性 --- .../approve/AfterApprovingSynchronizeRuleMES.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/so/src/private/nc/bs/so/m30/rule/approve/AfterApprovingSynchronizeRuleMES.java b/so/src/private/nc/bs/so/m30/rule/approve/AfterApprovingSynchronizeRuleMES.java index 67db0b0..3ee3d47 100644 --- a/so/src/private/nc/bs/so/m30/rule/approve/AfterApprovingSynchronizeRuleMES.java +++ b/so/src/private/nc/bs/so/m30/rule/approve/AfterApprovingSynchronizeRuleMES.java @@ -208,7 +208,22 @@ public class AfterApprovingSynchronizeRuleMES implements IRule { // к property.put("propertyFiled", "SXZF15"); property.put("propertyValue", body.getCsaleorderbid()); + // ֶ ۶ͱ + JSONObject property1 = new JSONObject(); + JSONObject property2 = new JSONObject(); + JSONObject property3 = new JSONObject(); + property1.put("propertyFiled", "SXZF19"); + property1.put("propertyValue", head.getVtrantypecode()); // ͱ + // ۶ + property2.put("propertyFiled", "SXZF20"); + property2.put("propertyValue", head.getCsaleorderid()); // ͷ +// // ۶ӱ +// property3.put("propertyFiled", "SXZF21"); +// property3.put("propertyValue", body.getCsaleorderbid()); // properties.add(property); + properties.add(property1); + properties.add(property2); + properties.add(property3); detailItem.put("properties", properties); details.add(detailItem); }