Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

Tyx 1 неделя назад
Родитель
Сommit
88e44ed6cc

+ 42 - 0
code/base/nckd-jxccl-base-common/src/main/java/nckd/jxccl/base/common/algo/DistinctConcatFunction.java

@@ -0,0 +1,42 @@
+package nckd.jxccl.base.common.algo;
+
+import kd.bos.algo.CustomAggFunction;
+import kd.bos.algo.DataType;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+* 去重并按逗号拼接
+* @author W.Y.C
+* @date 2025/12/30 12:41
+* @version 1.0
+*/
+public class DistinctConcatFunction extends CustomAggFunction<Set<String>> {
+    
+    public DistinctConcatFunction() {
+        // “distinct_concat”是函数名,DataType.StringType 指定返回类型为字符串
+        super("distinct_concat", DataType.StringType);
+    }
+
+    public Set<String> newAggValue() {
+        return new HashSet<>();
+    }
+
+    public Set<String> addValue(Set<String> aggValue, Object value) {
+
+        aggValue = aggValue == null ?  new HashSet<>() : aggValue;
+        aggValue.add(String.valueOf(value));
+        return aggValue;
+    }
+
+    public Set<String> combineAggValue(Set<String> aggValue, Set<String> aggValue2) {
+        aggValue.addAll(aggValue2);
+        return aggValue;
+    }
+
+    public Object getResult(Set<String> aggValue) {
+        return aggValue == null ? "" : String.join(",", aggValue);
+    }
+}

+ 4 - 0
code/base/nckd-jxccl-base-common/src/main/java/nckd/jxccl/base/common/constant/FormConstant.java

@@ -31,6 +31,8 @@ public class FormConstant {
     public static final String HBSS_OCPQUALLEVEL = "hbss_ocpquallevel";
     /**职称信息-实体标识*/
     public static final String HRPI_PERPROTITLE = "hrpi_perprotitle";
+    /**员工技能信息-实体标识*/
+    public static final String NCKD_HRPI_EMPSKILL = "nckd_hrpi_empskill";
     /**职业资格-实体标识*/
     public static final String HRPI_PEROCPQUAL = "hrpi_perocpqual";
     /**职位序列-实体标识*/
@@ -413,6 +415,8 @@ public class FormConstant {
     public static final String NCKD_ORG = "nckd_org";
     /** 人员 */
     public static final String NCKD_EMPLOYEE = "nckd_employee";
+    /** 技能名称 */
+    public static final String NCKD_QUALINAME = "nckd_qualiname";
 
     /** 描述*/
     public static final String NCKD_DESCRIPTION = "nckd_description";

+ 5 - 4
code/opmc/nckd-jxccl-opmc/src/main/java/nckd/jxccl/opmc/pm/plugin/form/print/BatchModDocstampPopupFormPlugin.java

@@ -50,7 +50,7 @@ public class BatchModDocstampPopupFormPlugin extends AbstractFormPlugin implemen
                 Date fileIssueTime = this.getModel().getDataEntity(true).getDate(PerfManagerFormConstant.NCKD_FILEISSUETIME);
                 Date stampTime = this.getModel().getDataEntity(true).getDate(PerfManagerFormConstant.NCKD_STAMPTIME);
                 DynamicObjectCollection query = QueryServiceHelper.query(PerfManagerFormConstant.DOCSTAMP_ENTITYID,
-                        FormConstant.ID_KEY + "," + String.join(",", FormConstant.NCKD_PERSON, FormConstant.ID_KEY),
+                        FormConstant.ID_KEY,
                         new QFilter[]{new QFilter(String.join(".", FormConstant.NCKD_PERSON, FormConstant.ID_KEY), QCP.in, list)});
                 List<Long> ids = query.stream().map(dynamicObject -> dynamicObject.getLong(FormConstant.ID_KEY)).collect(Collectors.toList());
                 MainEntityType docStampEntityType = EntityMetadataCache.getDataEntityType(PerfManagerFormConstant.DOCSTAMP_ENTITYID);
@@ -59,10 +59,10 @@ public class BatchModDocstampPopupFormPlugin extends AbstractFormPlugin implemen
                 List<DynamicObject> save = new java.util.ArrayList<>();
                 java.util.Set<Long> foundPersonIds = new java.util.HashSet<>();
                 for (DynamicObject dynamicObject : load) {
-                    Long personId = dynamicObject.getLong(String.join(",", FormConstant.NCKD_PERSON, FormConstant.ID_KEY));
+                    Long personId = dynamicObject.getLong(String.join(".", FormConstant.NCKD_PERSON, FormConstant.ID_KEY));
                     foundPersonIds.add(personId);
                     dynamicObject.set(PerfManagerFormConstant.NCKD_STAMPTIME, stampTime);
-                    dynamicObject.set(PerfManagerFormConstant.NCKD_FILEISSUETIME, stampTime);
+                    dynamicObject.set(PerfManagerFormConstant.NCKD_FILEISSUETIME, fileIssueTime);
                     save.add(dynamicObject);
                 }
 
@@ -79,7 +79,7 @@ public class BatchModDocstampPopupFormPlugin extends AbstractFormPlugin implemen
                     DynamicObject employee = EntityHelper.newEntity(FormConstant.HRPI_EMPLOYEE,missingPersonId);
                     dynamicObject.set(FormConstant.NCKD_PERSON,employee);
                     dynamicObject.set(PerfManagerFormConstant.NCKD_STAMPTIME, stampTime);
-                    dynamicObject.set(PerfManagerFormConstant.NCKD_FILEISSUETIME, stampTime);
+                    dynamicObject.set(PerfManagerFormConstant.NCKD_FILEISSUETIME, fileIssueTime);
                     save.add(dynamicObject);
 
                 }
@@ -98,6 +98,7 @@ public class BatchModDocstampPopupFormPlugin extends AbstractFormPlugin implemen
                     }
                     throw new ValidationException("保存失败" + errorMsg.toString());
                 }else{
+                    this.getView().returnDataToParent("true");
                     this.getView().close();
                 }
 

+ 1 - 0
code/opmc/nckd-jxccl-opmc/src/main/java/nckd/jxccl/opmc/pm/plugin/form/print/PerfBatchPrintListPlugin.java

@@ -87,6 +87,7 @@ public class PerfBatchPrintListPlugin extends AbstractReportFormPlugin implement
             if(returnData != null){
                 /*Map<String, Date> returnDate = ConvertUtil.toMap(returnData);
                 this.getPageCache().put("fileIssueTime", JSON.toJSONString(returnDate));*/
+                this.getView().showSuccessNotification( "文件印发及盖章时间修改成功");
                 this.getView().invokeOperation(FormConstant.REFRESH_OP);
             }
         }

+ 27 - 7
code/opmc/nckd-jxccl-opmc/src/main/java/nckd/jxccl/opmc/pm/plugin/form/print/PrintPerfDetailReportListDataPlugin.java

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