|
|
@@ -1,6 +1,7 @@
|
|
|
package nckd.jxccl.opmc.pm.plugin.form.print;
|
|
|
|
|
|
import kd.bos.algo.DataSet;
|
|
|
+import kd.bos.algo.DataType;
|
|
|
import kd.bos.algo.GroupbyDataSet;
|
|
|
import kd.bos.algo.JoinType;
|
|
|
import kd.bos.algo.Row;
|
|
|
@@ -21,9 +22,11 @@ import kd.bos.mvc.list.ListDataProvider;
|
|
|
import kd.bos.orm.query.QCP;
|
|
|
import kd.bos.orm.query.QFilter;
|
|
|
import kd.bos.servicehelper.QueryServiceHelper;
|
|
|
+import kd.fi.frm.mservice.algo.DistinctConcatAggFunction;
|
|
|
import kd.hr.hbp.business.servicehelper.HRQueryEntityHelper;
|
|
|
import kd.hr.hbp.common.cache.HRPageCache;
|
|
|
import kd.sdk.plugin.Plugin;
|
|
|
+import nckd.jxccl.base.common.algo.DistinctConcatFunction;
|
|
|
import nckd.jxccl.base.common.algo.GroupMaxStrFunction;
|
|
|
import nckd.jxccl.base.common.constant.FormConstant;
|
|
|
import nckd.jxccl.base.common.utils.DateUtil;
|
|
|
@@ -73,6 +76,7 @@ public class PrintPerfDetailReportListDataPlugin extends AbstractReportListDataP
|
|
|
/*QFilter qFilter = new QFilter(PerfManagerFormConstant.NCKD_BEGINYEAR, QCP.less_equals, endDate)
|
|
|
.and(new QFilter(PerfManagerFormConstant.NCKD_ENDYEAR, QCP.large_equals, beginDate));*/
|
|
|
QFilter qFilter = QFilter.of("1=1");
|
|
|
+ qFilter.and(String.join(".", FormConstant.HRPI_EMPPOSORGREL, FormConstant.POS_STATUS,FormConstant.POST_STATE_CLS, FormConstant.NUMBER_KEY),QCP.equals,"1010_S");
|
|
|
|
|
|
// 处理快速过滤条件
|
|
|
processFastFilter(reportQueryParam, qFilter);
|
|
|
@@ -81,7 +85,7 @@ public class PrintPerfDetailReportListDataPlugin extends AbstractReportListDataP
|
|
|
processFilter(reportQueryParam, qFilter);
|
|
|
|
|
|
// 执行基础查询
|
|
|
- QueryEntityType queryEntityType = (QueryEntityType) EntityMetadataCache.getDataEntityType("annualperfdetailquery");
|
|
|
+ QueryEntityType queryEntityType = (QueryEntityType) EntityMetadataCache.getDataEntityType("printperfquery");
|
|
|
DataSet dataSet = HRQueryEntityHelper.getInstance().getQueryDataSet(queryEntityType,queryFieldBuilder.buildSelect(), new QFilter[]{qFilter}, null);
|
|
|
DataSet dataSetCopy = dataSet.copy();
|
|
|
Set<Long> personIds = new HashSet();
|
|
|
@@ -116,14 +120,17 @@ public class PrintPerfDetailReportListDataPlugin extends AbstractReportListDataP
|
|
|
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(".", FormConstant.HRPI_EMPENTREL, FormConstant.LABOR_REL_STATUS, FormConstant.ID_KEY),
|
|
|
String.join(".", FormConstant.NCKD_PERSON, FormConstant.NCKD_JOINWORKTIME),
|
|
|
String.join(".", FormConstant.NCKD_PERSON, FormConstant.BIRTHDAY),
|
|
|
String.join(".", FormConstant.NCKD_PERSON, FormConstant.GENDER,FormConstant.NAME_KEY),
|
|
|
String.join(".", FormConstant.HRPI_PEREDUEXP, FormConstant.EDUCATION_KEY,FormConstant.NAME_KEY),
|
|
|
// String.join(".", FormConstant.NCKD_EMPPOSORGREL, FormConstant.POSITION_KEY, FormConstant.ID_KEY),
|
|
|
String.join(".", "last_perfmanager", PerfManagerFormConstant.NCKD_BEGINYEAR),
|
|
|
- String.join(".", "last_perfmanager", PerfManagerFormConstant.NCKD_ENDYEAR)
|
|
|
+ String.join(".", "last_perfmanager", PerfManagerFormConstant.NCKD_ENDYEAR),
|
|
|
+ String.join(".", PerfManagerFormConstant.DOCSTAMP_ENTITYID, PerfManagerFormConstant.NCKD_STAMPTIME),
|
|
|
+ String.join(".", PerfManagerFormConstant.DOCSTAMP_ENTITYID, PerfManagerFormConstant.NCKD_FILEISSUETIME),
|
|
|
+ String.join(".", PerfManagerFormConstant.HRPI_EMPPOSORGREL, PerfManagerFormConstant.POSITION_KEY, FormConstant.ID_KEY),
|
|
|
});
|
|
|
int tempIndex1 = 1;
|
|
|
for (int year = fiveYearsAgo; year <= currentYear; year++) {
|
|
|
@@ -131,13 +138,22 @@ public class PrintPerfDetailReportListDataPlugin extends AbstractReportListDataP
|
|
|
.max("temp_"+tempIndex1, tempIndex1+"_result");
|
|
|
tempIndex1++;
|
|
|
}
|
|
|
- IAppCache nckdPm = AppCache.get("nckd_pm");
|
|
|
+ //职称/技能使用逗号分拼接
|
|
|
+ groupbyDataSet.agg(new DistinctConcatFunction(),"hrpi_perprotitle.professional.name","perprotitlenames");
|
|
|
+ groupbyDataSet.agg(new DistinctConcatFunction(),"nckd_hrpi_empskill.nckd_qualiname","qualinames");
|
|
|
|
|
|
DataSet annualPerfDetailQueryDataSet = groupbyDataSet.finish();
|
|
|
+ String[] mainTableFieldNames = annualPerfDetailQueryDataSet.getRowMeta().getFieldNames();
|
|
|
+ // 创建新数组,长度比原数组多1
|
|
|
+ String[] newMainTableFieldNames = new String[mainTableFieldNames.length + 1];
|
|
|
+ System.arraycopy(mainTableFieldNames, 0, newMainTableFieldNames, 0, mainTableFieldNames.length);
|
|
|
+ // 在最后添加新字段
|
|
|
+ newMainTableFieldNames[mainTableFieldNames.length] = "REPLACE(REPLACE(REPLACE(concat(perprotitlenames,';',qualinames),'null,',''),'null;',''),'null','') as perprotitlOrQuali";
|
|
|
+ mainTableFieldNames = newMainTableFieldNames;
|
|
|
+ annualPerfDetailQueryDataSet.select(mainTableFieldNames);
|
|
|
|
|
|
// 获取近5年的岗位信息
|
|
|
DataSet positionDateSet = getPositions(fiveYearsAgo, currentYear,personIds);
|
|
|
- String[] mainTableFieldNames = annualPerfDetailQueryDataSet.getRowMeta().getFieldNames();
|
|
|
String[] pivotFieldNames = positionDateSet.getRowMeta().getFieldNames();
|
|
|
annualPerfDetailQueryDataSet = annualPerfDetailQueryDataSet.join(positionDateSet, JoinType.LEFT)
|
|
|
.on(String.join(".", FormConstant.NCKD_PERSON, FormConstant.ID_KEY), String.join(".", FormConstant.EMPLOYEE_KEY, FormConstant.ID_KEY))
|
|
|
@@ -322,17 +338,21 @@ public class PrintPerfDetailReportListDataPlugin extends AbstractReportListDataP
|
|
|
.add(String.join(".", FormConstant.NCKD_PERSON, FormConstant.BIRTHDAY))
|
|
|
.add(String.join(".", FormConstant.NCKD_PERSON, FormConstant.GENDER,FormConstant.NAME_KEY))
|
|
|
.add(String.join(".", FormConstant.HRPI_PEREDUEXP, FormConstant.EDUCATION_KEY,FormConstant.NAME_KEY))
|
|
|
- .addIdNumberName(FormConstant.HRPI_EMPPOSORGREL,FormConstant.POS_STATUS)
|
|
|
+ .addIdNumberName(FormConstant.HRPI_EMPENTREL,FormConstant.LABOR_REL_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)
|
|
|
+ .addIdNumberName( PerfManagerFormConstant.HRPI_EMPPOSORGREL, PerfManagerFormConstant.POSITION_KEY)
|
|
|
// .addIdNumberName(FormConstant.HRPI_EMPPOSORGREL,FormConstant.POSITION_KEY)
|
|
|
.addGroup(new String[]{"last_perfmanager"},
|
|
|
PerfManagerFormConstant.NCKD_BEGINYEAR,
|
|
|
- PerfManagerFormConstant.NCKD_ENDYEAR);
|
|
|
+ PerfManagerFormConstant.NCKD_ENDYEAR)
|
|
|
+ .addGroup(new String[]{PerfManagerFormConstant.DOCSTAMP_ENTITYID},PerfManagerFormConstant.NCKD_STAMPTIME,PerfManagerFormConstant.NCKD_FILEISSUETIME)
|
|
|
+ .add(String.join(".", FormConstant.HRPI_PERPROTITLE, FormConstant.PROFESSIONAL_KEY,FormConstant.NAME_KEY))
|
|
|
+ .add(String.join(".", FormConstant.NCKD_HRPI_EMPSKILL, FormConstant.NCKD_QUALINAME));
|
|
|
|
|
|
}
|
|
|
|