From 742a08be8edf7f62a3072777d0dfac7bce96fb34 Mon Sep 17 00:00:00 2001 From: lihao Date: Thu, 20 Nov 2025 18:28:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=B1=E5=8F=98=E8=AF=B7=E8=B4=AD=E5=8D=95?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=B6=E6=9B=B4=E6=96=B0=E4=B8=8B=E6=B8=B8?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95=E5=88=B0=E8=B4=A7=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/pu/m20/action/PraybillRAction.java | 55 +++++++++++++++++-- 1 file changed, 50 insertions(+), 5 deletions(-) diff --git a/pu/src/private/nc/impl/pu/m20/action/PraybillRAction.java b/pu/src/private/nc/impl/pu/m20/action/PraybillRAction.java index 1ba54826..bd1cc028 100644 --- a/pu/src/private/nc/impl/pu/m20/action/PraybillRAction.java +++ b/pu/src/private/nc/impl/pu/m20/action/PraybillRAction.java @@ -6,21 +6,29 @@ package nc.impl.pu.m20.action; import java.util.Arrays; +import java.util.List; +import java.util.Map; + +import nc.bs.dao.BaseDAO; import nc.bs.pu.m20.maintain.PraybillInsertReviseBP; import nc.bs.pu.m20.maintain.PraybillUpdateReviseBP; import nc.bs.pu.m20.maintain.rule.delete.ReviseDeleteBeforeEventRule; import nc.bs.pu.m20.plugin.PraybillPluginPoint; +import nc.bs.uapbd.util.MyHelper; import nc.impl.pubapp.pattern.data.bill.BillDelete; import nc.impl.pubapp.pattern.data.bill.BillQuery; import nc.impl.pubapp.pattern.data.bill.BillUpdate; import nc.impl.pubapp.pattern.data.bill.tool.BillConcurrentTool; import nc.impl.pubapp.pattern.data.bill.tool.BillTransferTool; import nc.impl.pubapp.pattern.rule.processer.AroundProcesser; +import nc.jdbc.framework.processor.MapListProcessor; +import nc.vo.org.OrgVO; import nc.vo.pu.m20.entity.PraybillHeaderVO; import nc.vo.pu.m20.entity.PraybillItemVO; import nc.vo.pu.m20.entity.PraybillVO; import nc.vo.pu.m20.enumeration.EnumRevise; import nc.vo.pu.pub.enumeration.POEnumBillStatus; +import nc.vo.pub.BusinessException; import nc.vo.pub.lang.UFBoolean; import nc.vo.pub.lang.UFDate; import nc.vo.pubapp.AppContext; @@ -30,11 +38,12 @@ import nccloud.commons.lang.ArrayUtils; public class PraybillRAction { public PraybillRAction() { } - - public PraybillVO[] revise(PraybillVO[] orderVos) { + private Map configParams; + public PraybillVO[] revise(PraybillVO[] orderVos) throws BusinessException { if (ArrayUtils.isEmpty(orderVos)) { return null; } else { + BaseDAO dao = new BaseDAO(); BillTransferTool tool = new BillTransferTool(orderVos); PraybillVO[] voOrginal = (PraybillVO[])tool.getOriginBills(); PraybillVO[] voRevised; @@ -45,14 +54,50 @@ public class PraybillRAction { this.insertNewVO(orderVos); voRevised = this.saveNewVO(orderVos, voOrginal); this.saveOriginVos(voOrginal); - } else { + } else { voRevised = this.updateVO(orderVos, voOrginal); } - + /** + * 2025-11-12 + * 箱变请购单修改时更新下游采购订单到货时间 + */ + for (PraybillVO vo : voRevised) { + configParams = MyHelper.getConfigParams("xb-config", null); + if (configParams.isEmpty()) { + throw new BusinessException("箱变的QMS接口缺少配置"); + } + String pkOrg = vo.getHVO().getPk_org(); + String orgCode = MyHelper.transferField(OrgVO.getDefaultTableName(), OrgVO.CODE, OrgVO.PK_ORG, pkOrg); + if (checkIfOrg(orgCode, configParams)) { + continue; + } + for (PraybillItemVO itemVO: vo.getBVO()){ + String ordersql = "select pk_order_b from po_order_b where csourcebid ='" + itemVO.getPk_srcpraybillb() + "' and dr = 0"; + List> orders = (List>) dao.executeQuery(ordersql, new MapListProcessor()); + for (Map order : orders) { + // 更新采购订单 + String updateOrderSql = "update po_order_b set dplanarrvdate='" + itemVO.getDreqdate().toStdString()+" 00:00:00"+ "' where pk_order_b='" + + order.get("pk_order_b") + "'"; + dao.executeUpdate(updateOrderSql); + } + } + } return voRevised; } } - + private boolean checkIfOrg(String code, Map configParams) throws BusinessException { + String targetCode = configParams.get("xbOrg"); + 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(code)) { + return false; + } + } + return true; + } public PraybillVO[] reviseDelete(PraybillVO[] orderVos) { if (ArrayUtils.isEmpty(orderVos)) { return null;