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" }; // 循环更新每条子表数据