From 163d854acee33f356e3328c6c205e1f0d6761ccc Mon Sep 17 00:00:00 2001 From: houyi <1398559711@qq.com> Date: Wed, 12 Nov 2025 17:01:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=9F=E5=88=9D=E7=B1=BB=E5=9E=8B=E7=9A=84?= =?UTF-8?q?=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E3=80=81=E6=B5=81=E7=A8=8B?= =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=AE=A2=E5=8D=95=E4=BB=A5=E5=8F=8A=E5=A4=87?= =?UTF-8?q?=E6=96=99=E8=AE=A1=E5=88=92=E4=B8=8D=E6=8E=A8MES=EF=BC=8C?= =?UTF-8?q?=E5=85=B6=E4=BD=99=E7=B1=BB=E5=9E=8B=E7=9A=84=E5=8D=95=E6=8D=AE?= =?UTF-8?q?=E6=8E=A8MES?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rule/AfterApproveRuleHighpressureMes.java | 21 +++++++++++++++- .../AfterApproveSyncHighpressureMesRule.java | 21 +++++++++++++++- .../rule/AfterPickmRuleHighpressureRule.java | 19 ++++++++++++++ .../pickm/service/SyncGyMesPickmUtil.java | 19 ++++++++++++++ .../rule/approve/AfterSoSyncRuleGyMes.java | 25 ++++++++++++++++--- 5 files changed, 100 insertions(+), 5 deletions(-) diff --git a/mmpac/src/private/nc/bs/mmpac/pickm/bp/rule/AfterApproveRuleHighpressureMes.java b/mmpac/src/private/nc/bs/mmpac/pickm/bp/rule/AfterApproveRuleHighpressureMes.java index a42a2d08..1a3610d3 100644 --- a/mmpac/src/private/nc/bs/mmpac/pickm/bp/rule/AfterApproveRuleHighpressureMes.java +++ b/mmpac/src/private/nc/bs/mmpac/pickm/bp/rule/AfterApproveRuleHighpressureMes.java @@ -86,6 +86,11 @@ public class AfterApproveRuleHighpressureMes implements IRule { if ("55A3-0002".equals(sourcebilltype.get("pk_billtypecode"))) { continue; } + // 期初类型的单据不推MES,其余类型推MES + String billType = pickmHeadVO.getVbusitype(); + if (checkBillType(billType, configParams)) { + continue; + } JSONObject singleObj = new JSONObject(); // 创建子项数组 JSONArray contentArray = new JSONArray(); @@ -93,7 +98,7 @@ public class AfterApproveRuleHighpressureMes implements IRule { String saleDef = pickmHeadVO.getVdef19() == null ? "" : pickmHeadVO.getVdef19(); if (!saleDef.equals("Y")) { // 更新自定义项19为“Y” - String sql = "update mm_pickm set vdef19 = '" + "Y" + "' where vbillcode = '" + pickmHeadVO.getVbillcode() + "'"; + String sql = "update mm_pickm set vdef19 = 'Y' where cpickmid = '" + pickmHeadVO.getCpickmid() + "'"; baseDAO.executeUpdate(sql); singleObj.put("materialPreparationPlanNumber", pickmHeadVO.getVbillcode());// 备料计划单号 @@ -339,4 +344,18 @@ public class AfterApproveRuleHighpressureMes implements IRule { return map; } + private boolean checkBillType(String code, Map configParams) throws BusinessException { + String targetCode = configParams.get("vbusitype"); + if (targetCode == null || nc.vo.am.common.util.StringUtils.isEmpty(targetCode)) { + throw new BusinessException("未配置单据类型参数"); + } + String[] types = targetCode.split(","); + for (String type : types) { + if (!type.isEmpty() && type.equals(code)) { + return true; + } + } + return false; + } + } diff --git a/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterApproveSyncHighpressureMesRule.java b/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterApproveSyncHighpressureMesRule.java index 8e150bc4..5baabcbf 100644 --- a/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterApproveSyncHighpressureMesRule.java +++ b/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterApproveSyncHighpressureMesRule.java @@ -72,12 +72,17 @@ public class AfterApproveSyncHighpressureMesRule implements IRule { for (PMOAggVO vo : useVOs) { PMOHeadVO pmoHeadVO = vo.getParentVO(); PMOItemVO[] itemVOS = vo.getChildrenVO(); - // 判断物料的业务单元是否是箱变公司,不是则跳过 + // 判断物料的业务单元是否是高压生产公司,不是则跳过 String pkOrg = pmoHeadVO.getPk_org(); String orgCode = MyHelper.transferField(OrgVO.getDefaultTableName(), OrgVO.CODE, OrgVO.PK_ORG, pkOrg); if (checkIfOrg(orgCode, configParams)) { continue; } + // 期初生产订单不推MES,其余生产订单类型推MES + String billType = pmoHeadVO.getVtrantypecode(); + if (checkBillType(billType, configParams)) { + continue; + } String cpmohid = pmoHeadVO.getCpmohid(); String vbillcode = pmoHeadVO.getVbillcode(); JSONObject singleObj = new JSONObject(); @@ -339,5 +344,19 @@ public class AfterApproveSyncHighpressureMesRule implements IRule { return map; } + private boolean checkBillType(String code, Map configParams) throws BusinessException { + String targetCode = configParams.get("vtrantypecode"); + if (targetCode == null || nc.vo.am.common.util.StringUtils.isEmpty(targetCode)) { + throw new BusinessException("未配置单据类型参数"); + } + String[] types = targetCode.split(","); + for (String type : types) { + if (!type.isEmpty() && type.equals(code)) { + return true; + } + } + return false; + } + } diff --git a/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterPickmRuleHighpressureRule.java b/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterPickmRuleHighpressureRule.java index bfb749f7..586f9147 100644 --- a/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterPickmRuleHighpressureRule.java +++ b/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterPickmRuleHighpressureRule.java @@ -121,6 +121,11 @@ public class AfterPickmRuleHighpressureRule implements IRule { if ("55A3-0002".equals(sourcebilltype.get("pk_billtypecode"))) { continue; } + // 期初类型的单据不推MES,其余类型推MES + String billType = pickmHeadVO.getVbusitype(); + if (checkBillType(billType, configParams)) { + continue; + } JSONObject singleObj = new JSONObject(); // 创建子项数组 JSONArray contentArray = new JSONArray(); @@ -281,5 +286,19 @@ public class AfterPickmRuleHighpressureRule implements IRule { return map; } + private boolean checkBillType(String code, Map configParams) throws BusinessException { + String targetCode = configParams.get("vbusitype"); + if (targetCode == null || nc.vo.am.common.util.StringUtils.isEmpty(targetCode)) { + throw new BusinessException("未配置单据类型参数"); + } + String[] types = targetCode.split(","); + for (String type : types) { + if (!type.isEmpty() && type.equals(code)) { + return true; + } + } + return false; + } + } \ No newline at end of file diff --git a/mmpac/src/public/nccloud/web/mmpac/pickm/service/SyncGyMesPickmUtil.java b/mmpac/src/public/nccloud/web/mmpac/pickm/service/SyncGyMesPickmUtil.java index 68d29084..492af9bd 100644 --- a/mmpac/src/public/nccloud/web/mmpac/pickm/service/SyncGyMesPickmUtil.java +++ b/mmpac/src/public/nccloud/web/mmpac/pickm/service/SyncGyMesPickmUtil.java @@ -79,6 +79,11 @@ public class SyncGyMesPickmUtil { if ("55A3-0002".equals(sourcebilltype.get("pk_billtypecode"))) { continue; } + // 期初类型的单据不推MES,其余类型推MES + String billType = pickmHeadVO.getVbusitype(); + if (checkBillType(billType, configParams)) { + continue; + } JSONObject singleObj = new JSONObject(); // 创建子项数组 JSONArray contentArray = new JSONArray(); @@ -236,4 +241,18 @@ public class SyncGyMesPickmUtil { return map; } + + private boolean checkBillType(String code, Map configParams) throws BusinessException { + String targetCode = configParams.get("vbusitype"); + if (targetCode == null || nc.vo.am.common.util.StringUtils.isEmpty(targetCode)) { + throw new BusinessException("未配置单据类型参数"); + } + String[] types = targetCode.split(","); + for (String type : types) { + if (!type.isEmpty() && type.equals(code)) { + return true; + } + } + return false; + } } diff --git a/so/src/private/nc/bs/so/m30/rule/approve/AfterSoSyncRuleGyMes.java b/so/src/private/nc/bs/so/m30/rule/approve/AfterSoSyncRuleGyMes.java index b0503c83..6877ced1 100644 --- a/so/src/private/nc/bs/so/m30/rule/approve/AfterSoSyncRuleGyMes.java +++ b/so/src/private/nc/bs/so/m30/rule/approve/AfterSoSyncRuleGyMes.java @@ -67,15 +67,20 @@ public class AfterSoSyncRuleGyMes implements IRule { BaseDAO baseDAO = new BaseDAO(); HYPubBO hybo = new HYPubBO(); for (SaleOrderVO vo : useVOs) { - // 判断物料的业务单元是否是箱变公司,不是则跳过 + // 判断物料的业务单元是否是高压生产公司,不是则跳过 String pkOrg = vo.getParentVO().getPk_org(); String orgCode = MyHelper.transferField(OrgVO.getDefaultTableName(), OrgVO.CODE, OrgVO.PK_ORG, pkOrg); if (checkIfOrg(orgCode, configParams)) { continue; } - SaleOrderHVO hvo = vo.getParentVO(); SaleOrderBVO[] itemVOS = vo.getChildrenVO(); + // 期初类型的订单不推MES,其余订单类型推MES + String billType = hvo.getVtrantypecode(); + if (checkBillType(billType, configParams)) { + continue; + } + // 客户 String customerSql = " select name from bd_customer where dr = 0 and pk_customer = '" + hvo.getCcustomerid() + "' "; String customerName = (String) baseDAO.executeQuery(customerSql, new ColumnProcessor()); @@ -90,7 +95,7 @@ public class AfterSoSyncRuleGyMes implements IRule { String saleDef = hvo.getVdef26()== null ? "" : hvo.getVdef26(); if (!saleDef.equals("Y")) { // 更新自定义项26为“Y” - String sql = "update so_saleorder set vdef26 = '" + "Y" + "' where vbillcode = '" + hvo.getVbillcode() + "'"; + String sql = "update so_saleorder set vdef26 = 'Y' where csaleorderid = '" + hvo.getCsaleorderid() + "'"; baseDAO.executeUpdate(sql); for (SaleOrderBVO item : itemVOS) { @@ -302,6 +307,20 @@ public class AfterSoSyncRuleGyMes implements IRule { return map; } + private boolean checkBillType(String code, Map configParams) throws BusinessException { + String targetCode = configParams.get("vtrantypecodeS"); + if (targetCode == null || nc.vo.am.common.util.StringUtils.isEmpty(targetCode)) { + throw new BusinessException("未配置单据类型参数"); + } + String[] types = targetCode.split(","); + for (String type : types) { + if (!type.isEmpty() && type.equals(code)) { + return true; + } + } + return false; + } + }