|
|
@@ -9,13 +9,10 @@ import kd.bos.entity.report.AbstractReportListDataPlugin;
|
|
|
import kd.bos.entity.report.ReportColumn;
|
|
|
import kd.bos.entity.report.ReportQueryParam;
|
|
|
import kd.bos.ext.hr.service.query.QueryEntityHelper;
|
|
|
-import kd.bos.metadata.entity.QueryEntity;
|
|
|
import kd.bos.orm.query.QCP;
|
|
|
import kd.bos.orm.query.QFilter;
|
|
|
-import kd.bos.servicehelper.QueryServiceHelper;
|
|
|
import kd.sdk.plugin.Plugin;
|
|
|
import nckd.jxccl.base.common.constant.FormConstant;
|
|
|
-import nckd.jxccl.base.common.constant.SystemQueryConstant;
|
|
|
import nckd.jxccl.base.common.utils.DateUtil;
|
|
|
import nckd.jxccl.base.common.utils.QueryFieldBuilder;
|
|
|
import nckd.jxccl.opmc.pm.common.PerfManagerFormConstant;
|
|
|
@@ -46,8 +43,8 @@ public class AnnualPerfDetailReportListDataPlugin extends AbstractReportListData
|
|
|
int currentYear = LocalDate.now().getYear() - 1; // 不包含今年
|
|
|
Date endDate = DateUtil.toDate(LocalDate.of(currentYear, 1, 1));
|
|
|
//查询最近5年的数据
|
|
|
- QFilter qFilter = new QFilter(String.join(".", PerfManagerFormConstant.NCKD_PERFMANAGERENTRY, PerfManagerFormConstant.NCKD_APPRAISALYEAR), QCP.large_equals, beginDate);
|
|
|
- qFilter.and(String.join(".", PerfManagerFormConstant.NCKD_PERFMANAGERENTRY, PerfManagerFormConstant.NCKD_APPRAISALYEAR), QCP.less_equals, endDate);
|
|
|
+ QFilter qFilter = new QFilter(String.join(".", PerfManagerFormConstant.PERFMANAGERENTRY, PerfManagerFormConstant.NCKD_APPRAISALYEAR), QCP.large_equals, beginDate);
|
|
|
+ qFilter.and(String.join(".", PerfManagerFormConstant.PERFMANAGERENTRY, PerfManagerFormConstant.NCKD_APPRAISALYEAR), QCP.less_equals, endDate);
|
|
|
|
|
|
// 执行基础查询
|
|
|
QueryEntityType queryEntityType = (QueryEntityType) EntityMetadataCache.getDataEntityType("annualperfdetailquery");
|
|
|
@@ -56,7 +53,7 @@ public class AnnualPerfDetailReportListDataPlugin extends AbstractReportListData
|
|
|
dataSet.print( true);
|
|
|
|
|
|
//过滤调实际结束实际之外的年份分录
|
|
|
- DataSet withYearFields = dataSet.filter("year("+String.join(".", PerfManagerFormConstant.NCKD_PERFMANAGERENTRY, PerfManagerFormConstant.NCKD_APPRAISALYEAR) +") " +
|
|
|
+ DataSet withYearFields = dataSet.filter("year("+String.join(".", PerfManagerFormConstant.PERFMANAGERENTRY, PerfManagerFormConstant.NCKD_APPRAISALYEAR) +") " +
|
|
|
"<= year(CASE WHEN nckd_actendyear is not null THEN nckd_actendyear ELSE "+PerfManagerFormConstant.NCKD_ENDYEAR+" end)");
|
|
|
withYearFields.print(true);
|
|
|
|
|
|
@@ -64,7 +61,7 @@ public class AnnualPerfDetailReportListDataPlugin extends AbstractReportListData
|
|
|
int tempIndex = 1;
|
|
|
for (int year = fiveYearsAgo; year <= currentYear; year++) {
|
|
|
withYearFields = withYearFields.addField(
|
|
|
- "CASE WHEN year(" + String.join(".", PerfManagerFormConstant.NCKD_PERFMANAGERENTRY, PerfManagerFormConstant.NCKD_APPRAISALYEAR) + ") = " + year + " THEN " + String.join(".", PerfManagerFormConstant.NCKD_PERFMANAGERENTRY, PerfManagerFormConstant.NCKD_APPRAISALRESULT)+ " ELSE null END",
|
|
|
+ "CASE WHEN year(" + String.join(".", PerfManagerFormConstant.PERFMANAGERENTRY, PerfManagerFormConstant.NCKD_APPRAISALYEAR) + ") = " + year + " THEN " + String.join(".", PerfManagerFormConstant.PERFMANAGERENTRY, PerfManagerFormConstant.NCKD_APPRAISALRESULT,FormConstant.ID_KEY)+ " ELSE null END",
|
|
|
"temp_" + tempIndex
|
|
|
);
|
|
|
tempIndex++;
|
|
|
@@ -75,13 +72,13 @@ public class AnnualPerfDetailReportListDataPlugin extends AbstractReportListData
|
|
|
DataSet result = withYearFields.groupBy(new String[]{
|
|
|
String.join(".", FormConstant.NCKD_EMPPOSORGREL,FormConstant.EMPLOYEE_KEY, FormConstant.EMP_NUMBER_KEY),
|
|
|
String.join(".", FormConstant.NCKD_EMPPOSORGREL,FormConstant.EMPLOYEE_KEY, FormConstant.NAME_KEY),
|
|
|
- String.join(".", FormConstant.HRPI_EMPPOSORGREL, FormConstant.ADMINORG, FormConstant.NCKD_FIRSTORG),
|
|
|
- String.join(".", FormConstant.HRPI_EMPPOSORGREL, FormConstant.ADMINORG, FormConstant.NCKD_SECONDORG),
|
|
|
- String.join(".", FormConstant.HRPI_EMPPOSORGREL, FormConstant.ADMINORG, FormConstant.NCKD_THIRDORG),
|
|
|
- String.join(".", FormConstant.HRPI_EMPPOSORGREL, FormConstant.ADMINORG, FormConstant.NCKD_FOURTHORG),
|
|
|
- String.join(".", FormConstant.HRPI_EMPPOSORGREL, FormConstant.ADMINORG, FormConstant.NCKD_FIFTHORG),
|
|
|
- String.join(".", FormConstant.HRPI_EMPPOSORGREL, FormConstant.ADMINORG, FormConstant.NCKD_SIXTHORG),
|
|
|
- String.join(".", FormConstant.HRPI_EMPPOSORGREL, FormConstant.POS_STATUS),
|
|
|
+ String.join(".", FormConstant.HRPI_EMPPOSORGREL, FormConstant.ADMINORG, FormConstant.NCKD_FIRSTORG,FormConstant.ID_KEY),
|
|
|
+ String.join(".", FormConstant.HRPI_EMPPOSORGREL, FormConstant.ADMINORG, FormConstant.NCKD_SECONDORG,FormConstant.ID_KEY),
|
|
|
+ String.join(".", FormConstant.HRPI_EMPPOSORGREL, FormConstant.ADMINORG, FormConstant.NCKD_THIRDORG,FormConstant.ID_KEY),
|
|
|
+ String.join(".", FormConstant.HRPI_EMPPOSORGREL, FormConstant.ADMINORG, FormConstant.NCKD_FOURTHORG,FormConstant.ID_KEY),
|
|
|
+ String.join(".", FormConstant.HRPI_EMPPOSORGREL, FormConstant.ADMINORG, FormConstant.NCKD_FIFTHORG,FormConstant.ID_KEY),
|
|
|
+ String.join(".", FormConstant.HRPI_EMPPOSORGREL, FormConstant.ADMINORG, FormConstant.NCKD_SIXTHORG,FormConstant.ID_KEY),
|
|
|
+ String.join(".", FormConstant.HRPI_EMPPOSORGREL, FormConstant.POS_STATUS,FormConstant.ID_KEY),
|
|
|
String.join(".", "last_perfmanager", PerfManagerFormConstant.NCKD_BEGINYEAR),
|
|
|
String.join(".", "last_perfmanager", PerfManagerFormConstant.NCKD_ENDYEAR)
|
|
|
})
|
|
|
@@ -129,17 +126,17 @@ public class AnnualPerfDetailReportListDataPlugin extends AbstractReportListData
|
|
|
.add(PerfManagerFormConstant.NCKD_BEGINYEAR)
|
|
|
.add(PerfManagerFormConstant.NCKD_ENDYEAR)
|
|
|
.add(PerfManagerFormConstant.NCKD_ACTENDYEAR)
|
|
|
- .addGroup(new String[]{PerfManagerFormConstant.NCKD_PERFMANAGERENTRY},PerfManagerFormConstant.NCKD_APPRAISALRESULT)
|
|
|
- .addGroup(new String[]{PerfManagerFormConstant.NCKD_PERFMANAGERENTRY}, PerfManagerFormConstant.NCKD_APPRAISALYEAR)
|
|
|
+ .addGroup(new String[]{PerfManagerFormConstant.PERFMANAGERENTRY},PerfManagerFormConstant.NCKD_APPRAISALRESULT)
|
|
|
+ .addIdNumberName(PerfManagerFormConstant.PERFMANAGERENTRY,PerfManagerFormConstant.NCKD_APPRAISALRESULT)
|
|
|
+ .addGroup(new String[]{PerfManagerFormConstant.PERFMANAGERENTRY},PerfManagerFormConstant.NCKD_APPRAISALYEAR)
|
|
|
.addGroup(new String[]{FormConstant.NCKD_EMPPOSORGREL,FormConstant.EMPLOYEE_KEY}, FormConstant.EMP_NUMBER_KEY, FormConstant.NAME_KEY)
|
|
|
- .addGroup(new String[]{FormConstant.HRPI_EMPPOSORGREL},FormConstant.POS_STATUS)
|
|
|
- .addGroup(new String[]{FormConstant.HRPI_EMPPOSORGREL, FormConstant.ADMINORG},
|
|
|
- FormConstant.NCKD_FIRSTORG,
|
|
|
- FormConstant.NCKD_SECONDORG,
|
|
|
- FormConstant.NCKD_THIRDORG,
|
|
|
- FormConstant.NCKD_FOURTHORG,
|
|
|
- FormConstant.NCKD_FIFTHORG,
|
|
|
- FormConstant.NCKD_SIXTHORG)
|
|
|
+ .addIdNumberName(FormConstant.HRPI_EMPPOSORGREL,FormConstant.POS_STATUS)
|
|
|
+ .addIdNumberName(FormConstant.HRPI_EMPPOSORGREL,FormConstant.ADMINORG,FormConstant.NCKD_FIRSTORG)
|
|
|
+ .addIdNumberName(FormConstant.HRPI_EMPPOSORGREL,FormConstant.ADMINORG,FormConstant.NCKD_SECONDORG)
|
|
|
+ .addIdNumberName(FormConstant.HRPI_EMPPOSORGREL,FormConstant.ADMINORG,FormConstant.NCKD_THIRDORG)
|
|
|
+ .addIdNumberName(FormConstant.HRPI_EMPPOSORGREL,FormConstant.ADMINORG,FormConstant.NCKD_FOURTHORG)
|
|
|
+ .addIdNumberName(FormConstant.HRPI_EMPPOSORGREL,FormConstant.ADMINORG,FormConstant.NCKD_FIFTHORG)
|
|
|
+ .addIdNumberName(FormConstant.HRPI_EMPPOSORGREL,FormConstant.ADMINORG,FormConstant.NCKD_SIXTHORG)
|
|
|
.addGroup(new String[]{"last_perfmanager"},
|
|
|
PerfManagerFormConstant.NCKD_BEGINYEAR,
|
|
|
PerfManagerFormConstant.NCKD_ENDYEAR);
|