From 9e6af290b9520fafd2ecd4bc7b9b550b1f524a97 Mon Sep 17 00:00:00 2001 From: zengweihai Date: Wed, 20 Nov 2024 14:28:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E8=AF=84=E4=BC=B0?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E5=B9=B3=E5=9D=87=E5=88=86=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E5=8F=8A=E5=AF=B9=E5=BA=94=E5=AD=97=E6=AE=B5=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/SupEvalRecordReportListPlugin.java | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 main/java/shkd/repc/resm/report/data/SupEvalRecordReportListPlugin.java diff --git a/main/java/shkd/repc/resm/report/data/SupEvalRecordReportListPlugin.java b/main/java/shkd/repc/resm/report/data/SupEvalRecordReportListPlugin.java new file mode 100644 index 0000000..5be6e1e --- /dev/null +++ b/main/java/shkd/repc/resm/report/data/SupEvalRecordReportListPlugin.java @@ -0,0 +1,41 @@ +package shkd.repc.resm.report.data; + +import com.grapecity.documents.excel.S; +import kd.bos.algo.DataSet; +import kd.bos.algo.JoinDataSet; +import kd.bos.algo.JoinType; +import kd.bos.entity.report.FastFilter; +import kd.bos.entity.report.FilterInfo; +import kd.bos.entity.report.ReportQueryParam; +import kd.bos.orm.query.QFilter; +import kd.bos.servicehelper.QueryServiceHelper; +import kd.repc.resm.formplugin.report.SupEvalRecordReportList; +import kd.repc.resm.formplugin.report.eval.SupEvalRecReportNewList; + +import java.util.List; + +public class SupEvalRecordReportListPlugin extends SupEvalRecReportNewList { + @Override + public DataSet query(ReportQueryParam reportQueryParam, Object arg1) throws Throwable { + FilterInfo filterInfo = reportQueryParam.getFilter(); + List evalTaskEntryFilter = this.getEvalTaskEntryFilter(filterInfo); + FastFilter fastFilter = filterInfo.getFastFilter(); + if (fastFilter != null) { + evalTaskEntryFilter.addAll(fastFilter.getQFilters()); + } + + QFilter[] evalTaskEntryFilterS = (QFilter[])evalTaskEntryFilter.toArray(new QFilter[evalTaskEntryFilter.size()]); + String selectFieldInResm = "evaldetail.suppliertype.name as listsuppliergroup,evaldetail.supplier as listsupplier,org as listevalorg,evaldetail.project_category as listproject_category,evaldetail.contract.project.name as listproject,name as listevaltask,evaldetail.evaltype as listevaltype,evaldetail.contract as listcontract ,evalmodel as listevalmodel ,eval_year_num as listyear ,duringeval as listduringeval ,ordertime as listevaldate,evaldetail.actualscore as listevalscore,evaldetail.evalgradle as listevalgrade,evaldetail.commonopinion as description,evaldetail.id as evaldetailid,id as evaltaskid"; + DataSet finish = QueryServiceHelper.queryDataSet("resm_evaltask_new", "resm_evaltask_new", selectFieldInResm, evalTaskEntryFilterS, (String)null); +// + DataSet finish_avg = finish.groupBy(new String[]{"listsupplier"}).avg("listevalscore").finish(); + + DataSet select = finish_avg.select("listsupplier as listsupplier1", "listevalscore as qeug_avgscore"); + + DataSet evalTaskSetEntry = QueryServiceHelper.queryDataSet("resm_evaltask_new", "resm_evaltask_new", selectFieldInResm, evalTaskEntryFilterS, (String)null); + JoinDataSet join = evalTaskSetEntry.join(select, JoinType.LEFT); + DataSet result = join.on("listsupplier", "listsupplier1").select("listsuppliergroup", "listsupplier", "listevalorg", "listproject_category", "listproject", "listevaltask", "listevaltype", "listcontract", "listevalmodel", "listyear", "listduringeval", "listevaldate", "listevalscore", "qeug_avgscore", "listevalgrade", "description", "evaldetailid","evaltaskid").finish(); + + return result.orderBy(new String[]{"listsupplier desc"}); + } +}