Ver Fonte

feat(hr): 新增行政组织常量并优化绩效管理逻辑

- 在基础常量类中新增行政组织常量 NCKD_ORG
- 从荣誉学生常量类中移除重复的行政组织常量定义
- 在绩效管理表单常量类中新增年度绩效归档记录实体标识
- 优化周期生成插件逻辑,增加对岗位工资制单位的查询和过滤
- 引入 QueryServiceHelper 和 Stream 工具类支持新功能实现
- 添加对岗位工资制单位为空时的边界条件处理
- 完善在职人员及新入职人员的权限范围查询逻辑
wyc há 6 dias atrás
pai
commit
ff3345658a

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

@@ -306,6 +306,8 @@ public class FormConstant {
     public static final String NCKD_SIXTHORG = "nckd_sixthorg";
     /** 工作性质 */
     public static final String NCKD_WORKNATURE = "nckd_worknature";
+    /** 行政组织 */
+    public static final String NCKD_ORG = "nckd_org";
 
 
 }

+ 0 - 2
code/hr/nckd-jxccl-hr/src/main/java/nckd/jxccl/hr/hstu/common/HonorStudentConstant.java

@@ -68,8 +68,6 @@ public class HonorStudentConstant extends FormConstant {
 
     /** 地区差异分-实体标识 */
     public static final String ORGDIFFERENCE_ENTITYID = "nckd_orgdifferencewh";
-    /** 行政组织 */
-    public static final String NCKD_ORG = "nckd_org";
     /** 地区差异分 */
     public static final String NCKD_DIFFERENCESCORE = "nckd_differencescore";
 

+ 5 - 0
code/opmc/nckd-jxccl-opmc/src/main/java/nckd/jxccl/opmc/pm/common/PerfManagerFormConstant.java

@@ -79,4 +79,9 @@ public class PerfManagerFormConstant extends FormConstant {
     /** 撤销归档 */
     public static final String UNARCHIVE_OP = "unarchive";
     /*-------------------------------------- 年度绩效归档记录 end --------------------------------------*/
+
+    /*-------------------------------------- 年度绩效归档记录 begin --------------------------------------*/
+    /** 年度绩效归档记录-实体标识 */
+    public static final String POSTWAGEUNITLIST_ENTITYID = "nckd_postwageunitlist";
+    /*-------------------------------------- 年度绩效归档记录 end --------------------------------------*/
 }

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

@@ -21,6 +21,7 @@ import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
 import kd.bos.entity.plugin.args.BeginOperationTransactionArgs;
 import kd.bos.orm.query.QCP;
 import kd.bos.orm.query.QFilter;
+import kd.bos.servicehelper.QueryServiceHelper;
 import kd.bos.servicehelper.basedata.BaseDataServiceHelper;
 import kd.bos.servicehelper.operation.OperationServiceHelper;
 import kd.hr.hbp.business.servicehelper.HRQueryEntityHelper;
@@ -51,6 +52,7 @@ import java.util.Set;
 import java.util.StringJoiner;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 /**
 * 周期生成
@@ -165,10 +167,18 @@ public class CycleGenerateOpPlugin extends AbstractOperationServicePlugIn implem
         LocalDateTime lastEnd = DateUtil.endOfYear(lastDate);
 
         Long currUserId = RequestContext.get().getCurrUserId();
+        Map<Long, PerfManagerSaveOpPlugin.PersonPerfInfo> personPerfInfoMap = new HashMap<>();
 
+        //查询岗位工资制单位
+        DynamicObjectCollection postWageUnitList = QueryServiceHelper.query(PerfManagerFormConstant.POSTWAGEUNITLIST_ENTITYID, QueryFieldBuilder.create().addIdNumberName(FormConstant.NCKD_ORG).buildSelect(), null);
+        List<Long> postWageUnitIds = postWageUnitList.stream().map(postWageUnit -> postWageUnit.getLong(String.join(".", FormConstant.NCKD_ORG, FormConstant.ID_KEY))).collect(Collectors.toList());
         // 在职并去年入职的人员
         QFilter newHireFilter = buildNewHireFilter(lastBegin, lastEnd);
-
+        if(!postWageUnitIds.isEmpty()){
+            newHireFilter.and(String.join(".", FormConstant.HRPI_EMPPOSORGREL, FormConstant.COMPANY_KEY), QCP.in, postWageUnitIds);
+        }else{
+            return personPerfInfoMap;
+        }
         // 只处理权限范围内的人员
         AuthorizedOrgResultWithSub userAdminOrgWithSub = HRPermissionServiceHelper.getUserAdminOrgsWithSub(
                 currUserId, "nckd_pm", PerfManagerFormConstant.PERFMANAGER_ENTITYID,
@@ -179,11 +189,12 @@ public class CycleGenerateOpPlugin extends AbstractOperationServicePlugIn implem
             newHireFilter.and(String.join(".", FormConstant.HRPI_EMPPOSORGREL, FormConstant.ADMINORG), QCP.in, orgIds);
         }
 
-        Map<Long, PerfManagerSaveOpPlugin.PersonPerfInfo> personPerfInfoMap = new HashMap<>();
+
         DynamicObjectCollection newHirePersonList = queryNewHirePersons(newHireFilter);
 
         // 构建考核周期查询条件
         QFilter perfManagerFilter = buildPerfManagerFilter(userAdminOrgWithSub);
+        perfManagerFilter.and(String.join(".", FormConstant.HRPI_EMPPOSORGREL, FormConstant.COMPANY_KEY), QCP.in, postWageUnitIds);
         QueryFieldBuilder perfManagerQueryFieldBuilder = buildPerfManagerQueryFieldBuilder();
         QueryEntityType perfManagerQueryEntityType = (QueryEntityType) EntityMetadataCache.getDataEntityTypeNoCache("nckd_perfmanager_query");