Эх сурвалжийг харах

feat(hr): 增加岗位数据过滤条件并优化实体设置

- 在查询岗位数据时增加生效状态、启用状态及非标准岗位过滤条件
- 使用EntityHelper创建新的行政组织和岗位实体对象
- 引入HisModelDataStatusEnum和EnableEnum枚举类支持数据状态判断
- 更新岗位相关字段的实体构建方式以提高数据准确性
jtd 1 өдөр өмнө
parent
commit
8b5de6174c

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

@@ -312,6 +312,8 @@ public class FormConstant {
     public static final String SOURCEDATA = "sourcedata";
     /**数据来源*/
     public static final String INITDATASOURCE = "initdatasource";
+    /** 是否标准岗位 */
+    public static final String ISSTANDARDPOS_KEY = "isstandardpos";
 
     /** 工具栏标识(二开)*/
     public static final String NCKD_TOOLBARAP = "nckd_toolbarap";

+ 10 - 3
code/hr/nckd-jxccl-hr/src/main/java/nckd/jxccl/hr/sdm/plugin/operate/SendTaskOpPlugin.java

@@ -25,12 +25,15 @@ import kd.bos.servicehelper.operation.SaveServiceHelper;
 import kd.bos.servicehelper.user.UserServiceHelper;
 import kd.bos.url.UrlService;
 import kd.bos.workflow.engine.msg.info.MessageInfo;
+import kd.drp.mdr.common.enums.Enable;
 import kd.hr.hbp.business.servicehelper.HRBaseServiceHelper;
 import kd.hr.hbp.business.servicehelper.HRQueryEntityHelper;
+import kd.hr.hbp.common.constants.history.HisModelDataStatusEnum;
 import kd.hr.hbp.common.util.HRDateTimeUtils;
 import kd.hr.hbp.common.util.HRObjectUtils;
 import kd.sdk.hr.hrpi.business.helper.HRPIEmployeeServiceHelper;
 import nckd.jxccl.base.common.utils.QueryFieldBuilder;
+import nckd.jxccl.base.entity.helper.EntityHelper;
 import nckd.jxccl.base.org.helper.OrgHelper;
 import nckd.jxccl.base.orm.helper.QFilterCommonHelper;
 import nckd.jxccl.hr.sdm.common.SanDingConstant;
@@ -109,7 +112,11 @@ public class SendTaskOpPlugin extends AbstractOperationServicePlugIn {
         // 获取 所有单位BOID
         Set<Long> companyBoIds = entryDyoColl.stream().map(entryDyo -> entryDyo.getLong(companyBoIdKey)).collect(Collectors.toSet());
         // 获取 所有岗位数据
-        QFilter qFilter = new QFilter(String.join(".", SanDingConstant.ADMINORG, SanDingConstant.BELONGCOMPANY_KEY, SanDingConstant.BOID_KEY),  QCP.in, companyBoIds).and(QFilterCommonHelper.getCurrentVersionFilter());
+        QFilter qFilter = new QFilter(String.join(".", SanDingConstant.ADMINORG, SanDingConstant.BELONGCOMPANY_KEY, SanDingConstant.BOID_KEY),  QCP.in, companyBoIds)
+                .and(QFilterCommonHelper.getCurrentVersionFilter())
+                .and(SanDingConstant.DATA_STATUS, QCP.equals, HisModelDataStatusEnum.EFFECTING.getStatus())
+                .and(SanDingConstant.ENABLE, QCP.equals, EnableEnum.YES.getCode())
+                .and(SanDingConstant.ISSTANDARDPOS_KEY, QCP.equals, EnableEnum.NO.getCode());
         // 查询 BOID、行政组织、行政组织.所属公司
         String queryFields = QueryFieldBuilder.create()
                 .add(SanDingConstant.BOID_KEY)
@@ -328,9 +335,9 @@ public class SendTaskOpPlugin extends AbstractOperationServicePlugIn {
                 // 岗位BOID
                 Long positionBoId = positionOrgMap.get("positionBoId");
                 // 设置 组织
-                sanDingTaskEntryDyo.set(SanDingConstant.NCKD_ADMINORG, positionOrgMap.get("adminOrgSourceVid"));
+                sanDingTaskEntryDyo.set(SanDingConstant.NCKD_ADMINORG, EntityHelper.newEntity(SanDingConstant.ADMINORGHR_ENTITYID, positionOrgMap.get("adminOrgSourceVid")));
                 // 设置 岗位
-                sanDingTaskEntryDyo.set(SanDingConstant.NCKD_POSITION_KEY, positionOrgMap.get("positionSourceVid"));
+                sanDingTaskEntryDyo.set(SanDingConstant.NCKD_POSITION_KEY, EntityHelper.newEntity(SanDingConstant.HBPM_POSITIONHR, positionOrgMap.get("positionSourceVid")));
                 // 设置 定员数
                 sanDingTaskEntryDyo.set(SanDingConstant.NCKD_AUTHORIZEDSTRENGTH_KEY, lastSanDingTaskMap.getOrDefault(entryDyo.getLong(companyBoIdKey)+"@"+positionBoId, 0));
                 // 设置 实际占编人数