Bläddra i källkod

refactor(cycle):优化考核周期相关插件代码结构

- 移除了 BatchEvalCycleFormPlugin 中未使用的导入类
- 简化了 PerfManagerFormPlugin 的依赖引用
- 调整 AnnualPerfDetailReportListDataPlugin 中字段拼接逻辑- 新增 PerfmanagerQueryListPlugin 插件以支持年度绩效明细报表展示
- 在 CycleGenerateOpPlugin 中增加调试打印信息
wyc 1 vecka sedan
förälder
incheckning
8a854ecd99

+ 34 - 0
code/opmc/nckd-jxccl-opmc/src/main/java/nckd/jxccl/opmc/pm/plugin/form/PerfmanagerQueryListPlugin.java

@@ -0,0 +1,34 @@
+package nckd.jxccl.opmc.pm.plugin.form;
+
+import kd.bos.form.ShowType;
+import kd.bos.form.events.AfterDoOperationEventArgs;
+import kd.bos.list.plugin.AbstractListPlugin;
+import kd.bos.report.ReportShowParameter;
+import kd.sdk.plugin.Plugin;
+
+/**
+* 人员考评列表
+* 实体标识:nckd_perfmanager_query
+* @author W.Y.C
+* @date 2025/11/14 9:38
+* @version 1.0
+*/
+public class PerfmanagerQueryListPlugin extends AbstractListPlugin implements Plugin {
+
+
+    @Override
+    public void afterDoOperation(AfterDoOperationEventArgs e) {
+        if(e.getOperationResult() != null && e.getOperationResult().isSuccess()){
+            String operateKey = e.getOperateKey();
+            if("annualperfdetail".equalsIgnoreCase(operateKey)){
+                // 打开单据列表
+                ReportShowParameter reportShowParameter = new ReportShowParameter();
+                reportShowParameter.setFormId("nckd_annualperfdetail");
+                reportShowParameter.getOpenStyle().setShowType(ShowType.MainNewTabPage); // 设置打开方式
+                reportShowParameter.setCaption("年度绩效结果明细");
+                this.getView().showForm(reportShowParameter);
+
+            }
+        }
+    }
+}

+ 0 - 3
code/opmc/nckd-jxccl-opmc/src/main/java/nckd/jxccl/opmc/pm/plugin/form/cycle/BatchEvalCycleFormPlugin.java

@@ -16,7 +16,6 @@ import kd.bos.form.events.AfterDoOperationEventArgs;
 import kd.bos.form.events.MessageBoxClosedEvent;
 import kd.bos.form.plugin.AbstractFormPlugin;
 import kd.bos.org.utils.DynamicObjectUtils;
-import kd.bos.servicehelper.operation.OperationServiceHelper;
 import kd.bos.servicehelper.operation.SaveServiceHelper;
 import kd.sdk.plugin.Plugin;
 import nckd.jxccl.base.common.constant.FormConstant;
@@ -36,12 +35,10 @@ import java.util.Collections;
 import java.util.Date;
 import java.util.EventObject;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
-import java.util.Set;
 import java.util.StringJoiner;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.stream.Collectors;

+ 0 - 14
code/opmc/nckd-jxccl-opmc/src/main/java/nckd/jxccl/opmc/pm/plugin/form/cycle/PerfManagerFormPlugin.java

@@ -1,36 +1,22 @@
 package nckd.jxccl.opmc.pm.plugin.form.cycle;
 
-import kd.bos.bill.AbstractBillPlugIn;
-import kd.bos.dataentity.entity.DynamicObject;
-import kd.bos.dataentity.entity.DynamicObjectCollection;
-import kd.bos.entity.constant.StatusEnum;
 import kd.bos.entity.datamodel.events.PropertyChangedArgs;
 import kd.bos.form.control.EntryGrid;
-import kd.bos.form.events.BeforeDoOperationEventArgs;
 import kd.bos.form.field.DateEdit;
 import kd.bos.form.field.FieldEdit;
-import kd.bos.form.operate.FormOperate;
 import kd.bos.form.plugin.AbstractFormPlugin;
 import kd.bos.logging.Log;
 import kd.bos.logging.LogFactory;
-import kd.bos.orm.query.QCP;
-import kd.bos.orm.query.QFilter;
-import kd.bos.servicehelper.QueryServiceHelper;
-import kd.bos.util.CollectionUtils;
 import kd.sdk.plugin.Plugin;
-import nckd.jxccl.base.common.constant.FormConstant;
 import nckd.jxccl.base.common.utils.ConvertUtil;
 import nckd.jxccl.base.common.utils.DateUtil;
-import nckd.jxccl.base.common.utils.StrFormatter;
 import nckd.jxccl.opmc.pm.common.PerfManagerFormConstant;
 
 import java.util.Date;
 import java.util.EventObject;
 import java.util.HashSet;
 import java.util.List;
-import java.util.Objects;
 import java.util.Set;
-import java.util.stream.Collectors;
 
 /**
 * 考核周期表单插件

+ 21 - 24
code/opmc/nckd-jxccl-opmc/src/main/java/nckd/jxccl/opmc/pm/plugin/form/result/AnnualPerfDetailReportListDataPlugin.java

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

+ 1 - 0
code/opmc/nckd-jxccl-opmc/src/main/java/nckd/jxccl/opmc/pm/plugin/operate/cycle/CycleGenerateOpPlugin.java

@@ -184,6 +184,7 @@ public class CycleGenerateOpPlugin extends AbstractOperationServicePlugIn implem
             DataSet perfManagerQueryDataSet = QueryEntityHelper.getInstance().getQueryDataSet(
                     perfManagerQueryEntityType, perfManagerQueryFieldBuilder.buildSelectLowerCase(),
                     new QFilter[]{perfManagerFilter}, perfManagerQueryFieldBuilder.buildOrder());
+            perfManagerQueryDataSet.print(true);
 
             // 收集所有人员ID
             collectPersonIds(personIds, perfManagerQueryDataSet.copy());