|
|
@@ -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;
|
|
|
@@ -38,6 +41,7 @@ import nckd.jxccl.hr.sdm.common.SanDingPlanEntryStatus;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
+import java.util.Collections;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.HashSet;
|
|
|
@@ -108,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)
|
|
|
@@ -327,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));
|
|
|
// 设置 实际占编人数
|
|
|
@@ -410,9 +418,7 @@ public class SendTaskOpPlugin extends AbstractOperationServicePlugIn {
|
|
|
messageInfo.setTag("三定管理");
|
|
|
long managerBoId = entryDyo.getDynamicObject(SanDingConstant.NCKD_MANAGER_KEY).getLong(SanDingConstant.BOID_KEY);
|
|
|
// 设置 消息接收人
|
|
|
-// List<Long> userIds = getUserIds(Collections.singletonList(managerBoId));
|
|
|
- List<Long> userIds = new ArrayList<Long>();
|
|
|
- userIds.add(2306610598445593600L);
|
|
|
+ List<Long> userIds = getUserIds(Collections.singletonList(managerBoId));
|
|
|
messageInfo.setUserIds(userIds);
|
|
|
// 设置 消息Web端url
|
|
|
messageInfo.setContentUrl(UrlService.getDomainContextUrl() + "/index.html?formId="+SanDingConstant.NCKD_SANDINGTASK_ENTITY+"&pkId=" + SANDING_TASK_MAP.get(entryDyo.getLong(SanDingConstant.ID_KEY)));
|