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