From 40ff22168230ddc2c5e2df6ab5f5df5c2b79eebc Mon Sep 17 00:00:00 2001 From: xuhaihui <2098865055@qq.com> Date: Tue, 29 Jul 2025 15:48:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=82=B9=E5=87=BB=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E9=87=87=E8=B4=AD=E7=94=B3=E8=AF=B7=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E5=90=8E=E5=BC=B9=E5=87=BA=E7=9A=84=E9=87=87=E8=B4=AD=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=E5=88=86=E5=BD=95=E4=B8=AD=E7=9A=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=9A=84=E6=9D=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/MaterialInbPurchaseApplyPlugin.java | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/MaterialInbPurchaseApplyPlugin.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/MaterialInbPurchaseApplyPlugin.java index ef4fc02..9892917 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/MaterialInbPurchaseApplyPlugin.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/MaterialInbPurchaseApplyPlugin.java @@ -23,6 +23,7 @@ import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.bos.servicehelper.QueryServiceHelper; import kd.sdk.plugin.Plugin; +import java.math.BigDecimal; import java.util.*; import java.util.stream.Collectors; @@ -48,15 +49,27 @@ public class MaterialInbPurchaseApplyPlugin extends AbstractBillPlugIn implement HashMap paramters = new HashMap<>(); DynamicObjectCollection entryEntityCollection = this.getModel().getDataEntity(true).getDynamicObjectCollection("entryentity");//入库单分录 List entryIds = new ArrayList<>(); - List entryIds2 = new ArrayList<>(); +// List entryIds2 = new ArrayList<>(); for (DynamicObject entryEntity : entryEntityCollection) { Long entryEntityId = entryEntity.getLong("listingid");//合同清单id entryIds.add(entryEntityId); - entryIds2.add(entryEntityId); +// entryIds2.add(entryEntityId); } long purchaseApplyId = purchaseApply.getLong("id");//采购申请单id - QFilter[] qFilte = new QFilter[]{new QFilter("zcgj_purchaseapply.id", QCP.equals, purchaseApplyId)}; + QFilter[] qFilter = new QFilter[]{new QFilter("id", QCP.equals, purchaseApplyId)}; + DynamicObject ecma_purchaseApply = BusinessDataServiceHelper.loadSingle("ecma_purchaseapply", + "purchaseentry,purchaseentry.purchaseqty,purchaseentry.zcgj_incount,purchaseentry.id", qFilter);//采购申请单 + DynamicObjectCollection purchaseEntryCollection = ecma_purchaseApply.getDynamicObjectCollection("purchaseentry");//采购明细单据体 + for (DynamicObject purchaseEntry : purchaseEntryCollection) { + BigDecimal purchaseQty = purchaseEntry.getBigDecimal("purchaseqty");//采购数量 + BigDecimal zcgj_inCount = purchaseEntry.getBigDecimal("zcgj_incount");//已入库数量 + if (purchaseQty.compareTo(zcgj_inCount) == 0) { + long purchaseEntryId = purchaseEntry.getLong("id"); + entryIds.add(purchaseEntryId); + } + } +/* QFilter[] qFilte = new QFilter[]{new QFilter("zcgj_purchaseapply.id", QCP.equals, purchaseApplyId)}; DynamicObject[] ecma_materialInBills = BusinessDataServiceHelper.load("ecma_materialinbill","entryentity,entryentity.listingid", qFilte);//入库单 for (DynamicObject materialInBill : ecma_materialInBills) { DynamicObjectCollection entryEntityCollection1 = materialInBill.getDynamicObjectCollection("entryentity");//入库单分录 @@ -69,7 +82,7 @@ public class MaterialInbPurchaseApplyPlugin extends AbstractBillPlugIn implement } entryIds.add(entryEntityId); } - } + }*/ paramters.put("purchaseApplyId", purchaseApplyId); paramters.put("entryIds", entryIds); formShowParameter.setCustomParams(paramters);