From 79c6682b5d9ae483eb39eee19d3db5152f84be36 Mon Sep 17 00:00:00 2001 From: mzr Date: Wed, 19 Nov 2025 14:00:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=90=E6=96=99=E5=87=BA=E5=BA=93=E7=AD=BE?= =?UTF-8?q?=E5=AD=97=E5=90=8E=E4=BF=AE=E6=94=B9=E9=AB=98=E5=8E=8Bims-?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bs/ic/m4d/sign/rule/UpdateGyimsRule.java | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/ic/src/private/nc/bs/ic/m4d/sign/rule/UpdateGyimsRule.java b/ic/src/private/nc/bs/ic/m4d/sign/rule/UpdateGyimsRule.java index f88cd5a5..8ec42699 100644 --- a/ic/src/private/nc/bs/ic/m4d/sign/rule/UpdateGyimsRule.java +++ b/ic/src/private/nc/bs/ic/m4d/sign/rule/UpdateGyimsRule.java @@ -1,14 +1,14 @@ package nc.bs.ic.m4d.sign.rule; import nc.bs.dao.BaseDAO; -import nc.bs.uapbd.util.ImsDaoUtil; +import nc.bs.logging.Log; import nc.bs.uapbd.util.MyHelper; -import nc.vo.fi.pub.SqlUtils; -import nc.vo.ic.m4d.entity.MaterialOutVO; - import nc.impl.pubapp.pattern.rule.IRule; +import nc.vo.ic.m4d.entity.MaterialOutHeadVO; +import nc.vo.ic.m4d.entity.MaterialOutVO; import nc.vo.org.OrgVO; import nc.vo.pub.BusinessException; +import nc.vo.pubapp.pattern.exception.ExceptionUtils; import java.util.HashSet; import java.util.Map; @@ -21,6 +21,8 @@ import java.util.stream.Collectors; * 本月(2025-11-30) */ public class UpdateGyimsRule implements IRule { + private static final String LOG_INFO_NAME = "gyimslog"; + private static final Log logger = Log.getInstance(LOG_INFO_NAME); // IMS数据源 public BaseDAO imsDao; private Map configParams; @@ -49,14 +51,14 @@ public class UpdateGyimsRule implements IRule { throw new BusinessException("高压的gyims接口缺少配置"); } for (MaterialOutVO materialOutVO : materialOutVOS) { - + MaterialOutHeadVO head = materialOutVO.getHead(); // 判断物料的业务单元是否是高压公司,不是则跳过 - String pkOrg = materialOutVO.getHead().getPk_org(); + String pkOrg = head.getPk_org(); String orgCode = MyHelper.transferField(OrgVO.getDefaultTableName(), OrgVO.CODE, OrgVO.PK_ORG, pkOrg); if (checkIfOrg(orgCode, configParams)) { continue; } - imsIdSet.add(materialOutVO.getHead().getVbillcode()); + imsIdSet.add(head.getVbillcode()); } if (!imsIdSet.isEmpty()) { // 修改状态为 完成:优化SQL条件拼接,避免语法错误和SQL注入风险 @@ -69,13 +71,15 @@ public class UpdateGyimsRule implements IRule { String updateSql = "update BIPOutMainTab set status = '2' where vbillcode in (" + ids + ")"; // 3. 执行更新(注意:这里不需要再传递参数,SQL已拼接完成) - int rows = ImsDaoUtil.executeUpdate(updateSql,ids); + int rows = getImsDao().executeUpdate(updateSql); } } catch (BusinessException e) { - throw new RuntimeException(e); + logger.error("UpdateGyimsRule-exp:" + e.getMessage(), e); + ExceptionUtils.wrappException(e); } } + private boolean checkIfOrg(String code, Map configParams) throws BusinessException { String targetCode = configParams.get("imsOrg"); if (targetCode == null || nc.vo.am.common.util.StringUtils.isEmpty(targetCode)) {