From 5200e620b872951d2fa473449335c08914087130 Mon Sep 17 00:00:00 2001 From: lihao Date: Wed, 5 Nov 2025 08:44:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E6=96=99=E8=AE=A1=E5=88=92=E6=8E=A8?= =?UTF-8?q?=E9=80=81ims=E5=A2=9E=E5=8A=A0=E5=AD=97=E6=AE=B5=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8D=95=E6=8D=AE=E7=B1=BB=E5=9E=8B=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rule/AfterApproveRuleHighpressureIms.java | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/mmpac/src/private/nc/bs/mmpac/pickm/bp/rule/AfterApproveRuleHighpressureIms.java b/mmpac/src/private/nc/bs/mmpac/pickm/bp/rule/AfterApproveRuleHighpressureIms.java index 0c2b83b5..aec0ca46 100644 --- a/mmpac/src/private/nc/bs/mmpac/pickm/bp/rule/AfterApproveRuleHighpressureIms.java +++ b/mmpac/src/private/nc/bs/mmpac/pickm/bp/rule/AfterApproveRuleHighpressureIms.java @@ -116,7 +116,9 @@ public class AfterApproveRuleHighpressureIms implements IRule { logger.info("备料计划组织编码"+ orgCode +"非目标同步组织,跳过同步,备料单号:"+headVO.getVbillcode()+""); continue; } - + if (!checkIfVtrantypecode(headVO.getVsourcebilltype(), configParams)) { + continue; + } // 3. 构建主表数据(JSON → Map,添加到列表) JSONObject mainJson = buildMainJsonObject(headVO); List> mainMapList = JsonUtil.jsonObjectToListMap(mainJson); @@ -143,7 +145,19 @@ public class AfterApproveRuleHighpressureIms implements IRule { } } - + private boolean checkIfVtrantypecode(String vtrantypecode, Map configParams) throws BusinessException { + String targetCode = configParams.get("vtrantypecode"); + if (targetCode == null || nc.vo.am.common.util.StringUtils.isEmpty(targetCode)) { + throw new BusinessException("未配置生产订单交易类型组织参数"); + } + String[] orgItem = targetCode.split(","); + for (String orgCode : orgItem) { + if (!orgCode.isEmpty() && orgCode.equals(vtrantypecode)) { + return false; + } + } + return true; + } private void pushIms(List> mainDataList, List> detailDataList, String targetCpickmid) throws BusinessException { // 1. 关键参数校验 if (targetCpickmid == null || targetCpickmid.trim().isEmpty()) { @@ -321,6 +335,7 @@ public class AfterApproveRuleHighpressureIms implements IRule { detailJson.put("nplanoutastnum", itemVO.getNplanoutastnum() != null ? itemVO.getNplanoutastnum().doubleValue() : null); // 计划出库数量 detailJson.put("nplanoutnum", itemVO.getNplanoutnum() != null ? itemVO.getNplanoutnum().doubleValue() : null);// 计划出库主数量 detailJson.put("vbdef22", itemVO.getVbdef20()); // 是否备件 + detailJson.put("nunituseastnum",itemVO.getNunituseastnum() != null ? itemVO.getNunituseastnum().toString() : null); return detailJson; } @@ -384,7 +399,7 @@ public class AfterApproveRuleHighpressureIms implements IRule { String[] detailFields = { "cpickm_bid", "cpickmid", "pk_org", "vbillcode", "vrowno", "fitemtype", "fitemsource", "cbmaterialvid", "cbunitid", "cbastunitid", "vbchangerate", "nquotastnum", - "nplanoutastnum", "nplanoutnum", "vbdef22" + "nplanoutastnum", "nplanoutnum", "vbdef22","nunituseastnum" }; String fieldStr = String.join(", ", detailFields); StringBuilder valuesSb = new StringBuilder(); @@ -465,7 +480,7 @@ public class AfterApproveRuleHighpressureIms implements IRule { String[] detailFields = { "cpickmid", "pk_org", "vbillcode", "vrowno", "fitemtype", "fitemsource", "cbmaterialvid", "cbunitid", "cbastunitid", "vbchangerate", "nquotastnum", - "nplanoutastnum", "nplanoutnum", "vbdef22" + "nplanoutastnum", "nplanoutnum", "vbdef22","nunituseastnum" }; // 循环更新每条子表数据