From 564aad435b56cc75f1327ebcc3be115b41cbb34c Mon Sep 17 00:00:00 2001 From: zengweihai Date: Tue, 26 Nov 2024 15:53:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E8=80=83=E5=AF=9F?= =?UTF-8?q?=E6=B1=87=E6=80=BB=E8=A1=A8=E5=8D=95=E8=A1=A8=E5=8D=95=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E6=A0=A1=E9=AA=8C=E6=95=B0=E6=8D=AE=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E4=B8=BA=E7=A9=BA(=E4=B8=B4=E6=97=B6=E7=89=88)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/SupInspectSumReportFormPlugin.java | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/main/java/shkd/repc/resm/report/form/SupInspectSumReportFormPlugin.java b/main/java/shkd/repc/resm/report/form/SupInspectSumReportFormPlugin.java index 9b1ef32..8551e82 100644 --- a/main/java/shkd/repc/resm/report/form/SupInspectSumReportFormPlugin.java +++ b/main/java/shkd/repc/resm/report/form/SupInspectSumReportFormPlugin.java @@ -1,12 +1,20 @@ package shkd.repc.resm.report.form; +import kd.bos.dataentity.entity.DynamicObject; +import kd.bos.dataentity.entity.DynamicObjectCollection; import kd.bos.dataentity.metadata.IDataEntityProperty; import kd.bos.entity.datamodel.events.ChangeData; import kd.bos.entity.datamodel.events.PropertyChangedArgs; +import kd.bos.entity.report.FilterInfo; +import kd.bos.entity.report.ReportQueryParam; import kd.bos.form.plugin.AbstractFormPlugin; +import kd.bos.orm.query.QCP; +import kd.bos.orm.query.QFilter; import kd.bos.report.plugin.AbstractReportFormPlugin; +import kd.bos.servicehelper.BusinessDataServiceHelper; import kd.sdk.plugin.Plugin; +import java.util.ArrayList; import java.util.EventObject; /** @@ -54,4 +62,54 @@ public class SupInspectSumReportFormPlugin extends AbstractReportFormPlugin impl } } + + + @Override + public boolean verifyQuery(ReportQueryParam queryParam) { + FilterInfo filterInfo = queryParam.getFilter(); + QFilter qFilter = new QFilter("billstatus", QCP.equals, "B");//提交评分状态为已提交 + DynamicObjectCollection orges = (DynamicObjectCollection)filterInfo.getValue("qeug_orgfilter"); + //todo:设置所属组织过滤条件 + if (orges != null && orges.size() > 0){ + ArrayList orgIdList = new ArrayList<>(); + for (DynamicObject org : orges) { + orgIdList.add(org.getLong("id")); + } + qFilter.and("org.id",QCP.in,orgIdList); + } + DynamicObjectCollection regSupplies = (DynamicObjectCollection)filterInfo.getValue("qeug_evalsupplierfilter");//潜在供应商集合 + DynamicObjectCollection offSupplies = (DynamicObjectCollection)filterInfo.getValue("qeug_evaloffsuppliefilter");//正式供应商集合 + DynamicObjectCollection supplierGroups = (DynamicObjectCollection)filterInfo.getValue("qeug_suppliergroupfilter");//供应商分类集合 + //todo:设置供应商过滤条件 + if (regSupplies != null || offSupplies != null){ + if (regSupplies != null && regSupplies.size() > 0){//潜在供应商 + ArrayList regSupplyIdList = new ArrayList<>(); + for (DynamicObject regSupply : regSupplies) { + regSupplyIdList.add(regSupply.getLong("id"));//填充潜在供应商主键 + } + qFilter.and("evalsupplier.id",QCP.in,regSupplyIdList); + } + if (offSupplies != null && offSupplies.size() > 0){//正式供应商 + ArrayList offSupplyIdList = new ArrayList<>(); + for (DynamicObject offSupply : offSupplies) { + offSupplyIdList.add(offSupply.getLong("id"));//填充正式供应商主键 + } + qFilter.and("evaloffsupplier.id",QCP.in,offSupplyIdList); + } + } + //todo:设置供应商分类过滤条件 + if (supplierGroups != null && supplierGroups.size() > 0){ + ArrayList supplierGroupIdList = new ArrayList<>();//供应商分类集合 + for (DynamicObject supplierGroup : supplierGroups) { + supplierGroupIdList.add(supplierGroup.getLong("id"));//填充供应商分类主键 + } + qFilter.and("multisuppliertype.fbasedataid.id",QCP.in,supplierGroupIdList); + } + DynamicObject[] resm_myexams = BusinessDataServiceHelper.load("resm_myexam", "id,name,org,examsuppliername,modifytime,evalscore,creator,entry_evalscore,entry_evalscore.qeug_scoredesc,entry_evalscore.scoredesc", qFilter.toArray());//加载数据源 + if(!(resm_myexams != null && resm_myexams.length > 0)) { + this.getView().showTipNotification("该条件下无符合条件的数据!"); + return false; + } + return super.verifyQuery(queryParam); + } } \ No newline at end of file