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"}); + } +}