From 18d2fd8bbfc7828ceca4c27c54339cda8cdf7e49 Mon Sep 17 00:00:00 2001 From: mzr Date: Tue, 16 Sep 2025 20:02:45 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E6=96=99=E6=8E=A8=E8=89=BE=E6=99=AEME?= =?UTF-8?q?S-=E7=89=A9=E6=96=99=E7=B1=BB=E5=9E=8B=E8=B5=8B=E5=80=BC?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../listener/MaterialToEpicMesListener.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/uapbd/src/private/nccloud/api/uapbd/material/listener/MaterialToEpicMesListener.java b/uapbd/src/private/nccloud/api/uapbd/material/listener/MaterialToEpicMesListener.java index 4a361de..94432cc 100644 --- a/uapbd/src/private/nccloud/api/uapbd/material/listener/MaterialToEpicMesListener.java +++ b/uapbd/src/private/nccloud/api/uapbd/material/listener/MaterialToEpicMesListener.java @@ -13,10 +13,12 @@ import nc.bs.logging.Log; import nc.bs.trade.business.HYPubBO; import nc.bs.uapbd.util.MyHelper; import nc.bs.uapbd.util.ThirdPartyPostRequestUtil; +import nc.jdbc.framework.processor.ColumnProcessor; import nc.jdbc.framework.processor.MapProcessor; import nc.vo.bd.material.MaterialVO; import nc.vo.bd.material.marbasclass.MarBasClassVO; import nc.vo.bd.material.stock.MaterialStockVO; +import nc.vo.fi.pub.SqlUtils; import nc.vo.org.OrgVO; import nc.vo.pub.BusinessException; @@ -183,11 +185,22 @@ public class MaterialToEpicMesListener implements IBusinessListener { } private String getGoodsType(String pkMaterial) throws BusinessException { + String targetCode = configParams.get("dldzOrg"); + String[] orgItem = targetCode.split(","); + String inStr = SqlUtils.getInStr("b.code", orgItem, Boolean.TRUE); // 物料-库存信息-物料类型 DR=分销补货;FR=工厂补货;MR=制造件;PR=采购件;OT=委外件;ET=其他 - // mes物料类型 制造1 其它0 + // mes物料类型 制造1 其它0(ERP多个组织中如果有一个是制造件就传1) String mesType = "0"; - String martype = MyHelper.transferField(MaterialStockVO.getDefaultTableName(), MaterialStockVO.MARTYPE, MaterialStockVO.PK_MATERIAL, pkMaterial); - if ("MR".equals(martype)) { + // String martype = MyHelper.transferField(MaterialStockVO.getDefaultTableName(), MaterialStockVO.MARTYPE, MaterialStockVO.PK_MATERIAL, pkMaterial); + String countSql = "SELECT count(1)" + + " FROM bd_materialstock a" + + " LEFT JOIN org_stockorg b ON a.pk_org = b.pk_stockorg" + + " WHERE a.dr = 0 AND a.martype = 'MR' " + + " AND a.pk_material = '[pkMaterial]'" + + " AND " + inStr; + countSql = countSql.replace("[pkMaterial]", pkMaterial); + Integer num = (Integer) new BaseDAO().executeQuery(countSql, new ColumnProcessor()); + if (num > 0) { mesType = "1"; } return mesType;