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..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 @@ -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); // 其他非必填字段设为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); @@ -198,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); }