From 902802a93dcba1f713b73dddd31b45b1700476cd Mon Sep 17 00:00:00 2001 From: chenshaoxin <1981897232@qq.com> Date: Wed, 20 Nov 2024 18:14:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4=20?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BA=BA=EF=BC=9A=E9=99=88=E7=BB=8D=E9=91=AB?= =?UTF-8?q?=20=E6=97=B6=E9=97=B4=EF=BC=9A2024/11/19=20=2017=EF=BC=9A00=20?= =?UTF-8?q?=E5=86=85=E5=AE=B9=EF=BC=9A=E6=88=90=E6=9C=AC=E6=B5=8B=E7=AE=97?= =?UTF-8?q?=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../recos/formplugin/MeasureciFormPlugin.java | 15 ++--- .../formplugin/RecosMeasurecosFormPlugin.java | 56 +++++++++++++++---- 2 files changed, 49 insertions(+), 22 deletions(-) diff --git a/main/java/shkd/repc/recos/formplugin/MeasureciFormPlugin.java b/main/java/shkd/repc/recos/formplugin/MeasureciFormPlugin.java index c653702..1b800f4 100644 --- a/main/java/shkd/repc/recos/formplugin/MeasureciFormPlugin.java +++ b/main/java/shkd/repc/recos/formplugin/MeasureciFormPlugin.java @@ -16,6 +16,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; public class MeasureciFormPlugin extends AbstractFormPlugin { @Override @@ -28,17 +29,11 @@ public class MeasureciFormPlugin extends AbstractFormPlugin { Object measurecostid = this.getModel().getValue("measurecostid");//成本测算ID DynamicObject measurecost = BusinessDataServiceHelper.loadSingle(measurecostid,"recos_measurecost"); DynamicObject project = measurecost.getDynamicObject("project"); - String number = project.getString("number");//项目编码 - QFilter filter = new QFilter("qeug_cpmc.id", QCP.equals, producttypeid). - and(new QFilter("qeug_xmnumber", QCP.equals, number)); - DynamicObject queryone = QueryServiceHelper.queryOne("qeug_gcl", "id", filter.toArray()); - if (queryone==null){ - this.getView().showSuccessNotification("请维护项目面积数据"); - return; - } + DynamicObject repmd_projectbill = BusinessDataServiceHelper.loadSingle(project.getPkValue(),"repmd_projectbill");//获取项目 + DynamicObjectCollection productentry = repmd_projectbill.getDynamicObjectCollection("productentry");//获取对应产品 + List children = productentry .stream().filter(e -> e.getDynamicObject("productentry_producttype").getString("id").equals(producttypeid.toString())).collect(Collectors.toList()); + DynamicObjectCollection qeug_entryentity = children.get(0).getDynamicObjectCollection("qeug_subentryentity");//子单据体 Map result = new HashMap<>(); - DynamicObject gcl = BusinessDataServiceHelper.loadSingle(queryone.get("id"),"qeug_gcl"); - DynamicObjectCollection qeug_entryentity = gcl.getDynamicObjectCollection("qeug_entryentity");//面积 for (int i = 0; i