供应商评估报表平均分计算及对应字段调整

This commit is contained in:
zengweihai 2024-11-20 14:28:15 +08:00
parent f97dea2d99
commit 9e6af290b9
1 changed files with 41 additions and 0 deletions

View File

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