From d2ff8dfb85b1f143183f3690a0061cbe0f26519d Mon Sep 17 00:00:00 2001 From: lihao Date: Fri, 17 Oct 2025 11:06:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=20=E7=94=9F=E4=BA=A7?= =?UTF-8?q?=E8=AE=A2=E5=8D=95-=E5=A4=87=E6=96=99=E8=AE=A1=E5=88=92-?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E8=AE=A2=E5=8D=95-=E8=AF=B7=E8=B4=AD?= =?UTF-8?q?=E5=8D=95-=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95-=E5=88=B0?= =?UTF-8?q?=E8=B4=A7=E5=8D=95-=E9=87=87=E8=B4=AD=E5=85=A5=E5=BA=93=20?= =?UTF-8?q?=E4=BE=9D=E6=AC=A1=E6=9B=B4=E6=96=B0=E4=B8=8B=E6=B8=B8=E5=8D=95?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AfterPickmRecalUpdateBuyingreqRule.java | 29 ++++++++++++++----- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterPickmRecalUpdateBuyingreqRule.java b/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterPickmRecalUpdateBuyingreqRule.java index 99a2bd8b..ca85399b 100644 --- a/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterPickmRecalUpdateBuyingreqRule.java +++ b/mmpac/src/private/nc/bs/mmpac/pmo/pac0002/bp/rule/AfterPickmRecalUpdateBuyingreqRule.java @@ -30,18 +30,31 @@ public class AfterPickmRecalUpdateBuyingreqRule implements IRule { // 查询备料计划 String pickmsql = "select cpickm_bid,nplanoutnum from mm_pickm_b where cpickmid in ( select cpickmid from mm_pickm where csourcebillrowid='" + pmoid + "' and dr=0) and dr = 0"; List> hmateral = (List>) dao.executeQuery(pickmsql, new MapListProcessor()); - + // 根据 生产订单-备料计划-计划订单-请购单-采购订单-到货单-采购入库 依次更新下游单据 for (Map map : hmateral) { - String buyingreqsql = "select pk_praybill_b,nnum from po_praybill_b where csourcebid ='" + map.get("cpickm_bid") + "' and dr = 0"; - List> buyingreq = (List>) dao.executeQuery(buyingreqsql, new MapListProcessor()); - for (Map map2 : buyingreq) { - if (new UFDouble((BigDecimal) map2.get("nnum")).compareTo(new UFDouble((BigDecimal)map.get("nplanoutnum"))) >0) { - String sql = "update po_praybill_b set vbdef15='" +map.get("nplanoutnum") + "' where pk_praybill_b='" - +map2.get("pk_praybill_b") + "'"; - dao.executeUpdate(sql); + // 查询计划订单 + String plosql = "select cpoid from mm_plo where vsrcbid ='" + map.get("cpickm_bid") + "' and dr = 0"; + List> ploList = (List>) dao.executeQuery(plosql, new MapListProcessor()); + for (Map plo : ploList) { + // 查询请购单 + String buyingreqsql = "select pk_praybill_b,nnum from po_praybill_b where csourcebid ='" + plo.get("cpoid") + "' and dr = 0"; + List> buyingreq = (List>) dao.executeQuery(buyingreqsql, new MapListProcessor()); + for (Map map2 : buyingreq) { + if (new UFDouble((BigDecimal) map2.get("nnum")).compareTo(new UFDouble((BigDecimal)map.get("nplanoutnum"))) >0) { + // 更新请购单 + String sql = "update po_praybill_b set vbdef15='" +map.get("nplanoutnum") + "' where pk_praybill_b='" + +map2.get("pk_praybill_b") + "'"; + dao.executeUpdate(sql); + + + } } } + + + + } } catch (DAOException e) { throw new RuntimeException(e);