Procházet zdrojové kódy

feat(hr): 更新离职申请和岗位分配功能

- 在FormConstant中新增定额明细实体标识常量
- 修改离职申请表单插件中的考勤档案获取方式,从返回BOID改为返回序列化字符串
- 添加SerializationUtils依赖用于JSON序列化操作
- 在岗位人力资源常量类中新增岗级、管理层级细项和法人岗位层级字段定义
- 在岗位分配表单插件中增加对新字段的数据复制逻辑
- 修改考勤服务接口方法签名,将返回值从Long改为String类型
- 更新查询定额方法中的应用标识参数引用方式
jtd před 6 dny
rodič
revize
2814289236

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

@@ -178,6 +178,8 @@ public class FormConstant {
     public static final String HLCM_CONTRACTAPPLY_ENTITY = "hlcm_contractapply";
     /** 合同解除实体标识 */
     public static final String HLCM_CONTRACTAPPLYCANCEL_ENTITY = "hlcm_contractapplycancel";
+    /** 定额明细实体标识 */
+    public static final String WTP_QTLINEDETAIL_ENTITY = "wtp_qtlinedetail";
 
     //====================================== 标品op ======================================
     /** 确认框确认按钮 */

+ 7 - 3
code/hr/nckd-jxccl-hr/src/main/java/nckd/jxccl/hr/htm/plugin/form/quitapply/QuitApplyFormPlugin.java

@@ -2,6 +2,7 @@ package nckd.jxccl.hr.htm.plugin.form.quitapply;
 
 import kd.bos.common.enums.EnableEnum;
 import kd.bos.dataentity.entity.DynamicObject;
+import kd.bos.dataentity.serialization.SerializationUtils;
 import kd.bos.entity.datamodel.events.PropertyChangedArgs;
 import kd.bos.form.plugin.AbstractFormPlugin;
 import kd.bos.orm.query.QCP;
@@ -13,7 +14,9 @@ import nckd.jxccl.hr.htm.common.quitapply.QuitApplyConstant;
 import java.time.ZoneId;
 import java.util.Collections;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 /**
  * 离职申请单表单插件
@@ -77,13 +80,14 @@ public class QuitApplyFormPlugin extends AbstractFormPlugin {
      */
     private void setUnUsedAnnualLeave(Long employeeId, Date contractEndDate) {
         // 获取人员考勤档案
-        Long attFileBoId = DispatchServiceHelper.invokeService("nckd.jxccl.wtc.wtp.servicehelper", QuitApplyConstant.WTP_APP, "IWTPCustomerService", "getAttFileBoId", new Object[]{contractEndDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), employeeId});
-        if (attFileBoId == 0L) {
+        String attFileSerializedString = DispatchServiceHelper.invokeService("nckd.jxccl.wtc.wtp.servicehelper", QuitApplyConstant.WTP_APP, "IWTPCustomerService", "getAttFile", new Object[]{contractEndDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(), employeeId});
+        if (attFileSerializedString == null) {
             getView().showTipNotification("未获取到应休未休剩余年假,请检查离职人员是否存在离职时间内有效的考勤档案");
             return;
         }
+        Map<String, Object> attFile = SerializationUtils.fromJsonString(attFileSerializedString, HashMap.class);
 
-        List<DynamicObject> quotaList = DispatchServiceHelper.invokeService("nckd.jxccl.wtc.wtp.servicehelper", QuitApplyConstant.WTP_APP, "IWTPCustomerService", "queryQuota", new Object[]{attFileBoId, Collections.singletonList(1666695290893207552L), 0, contractEndDate, contractEndDate});
+        List<DynamicObject> quotaList = DispatchServiceHelper.invokeService("nckd.jxccl.wtc.wtp.servicehelper", QuitApplyConstant.WTP_APP, "IWTPCustomerService", "queryQuota", new Object[]{attFile.get("boId"), Collections.singletonList(1666695290893207552L), 0, contractEndDate, contractEndDate});
         if (quotaList != null && !quotaList.isEmpty()) {
             DynamicObject quotaDy = quotaList.get(0);
             getModel().setValue(QuitApplyConstant.NCKD_UNUSEDANNUALLEAVE_KEY, quotaDy.getBigDecimal(QuitApplyConstant.USABLEVALUE_KEY));

+ 6 - 0
code/hrmp/nckd-jxccl-hrmp/src/main/java/nckd/jxccl/hrmp/hbpm/common/hr/PositionHRConstant.java

@@ -29,5 +29,11 @@ public class PositionHRConstant extends FormConstant {
     public static final String PARENT_KEY = "parent";
     /** 上级岗位 */
     public static final String NCKD_PARENT_KEY = "nckd_parent";
+    /** 岗级 */
+    public static final String NCKD_POSTGRADE_KEY = "nckd_postgrade";
+    /** 管理层级细项 */
+    public static final String NCKD_MGTLVLDTL_KEY = "nckd_mgtlvldtl";
+    /** 法人岗位层级 */
+    public static final String NCKD_LEGPOSTLV_KEY = "nckd_legpostlv";
 
 }

+ 8 - 2
code/hrmp/nckd-jxccl-hrmp/src/main/java/nckd/jxccl/hrmp/hbpm/plugin/form/hr/PositionAssignFormPlugin.java

@@ -142,10 +142,16 @@ public class PositionAssignFormPlugin extends AbstractFormPlugin {
             // 重置ID
             newDyo.set(PositionHRConstant.ID_KEY, null);
             newDyo.set(PositionHRConstant.BOID_KEY, null);
-            // 设置行政组织
+            // 设置 行政组织
             newDyo.set(PositionHRConstant.ADMINORG, entryEntityDy.get(PositionHRConstant.NCKD_ADMINORG));
-            // 设置上级岗位
+            // 设置 上级岗位
             newDyo.set(PositionHRConstant.PARENT_KEY, entryEntityDy.get(PositionHRConstant.NCKD_PARENT_KEY));
+            // 设置 岗级
+            newDyo.set(PositionHRConstant.NCKD_POSTGRADE_KEY, entryEntityDy.get(PositionHRConstant.NCKD_POSTGRADE_KEY));
+            // 设置 管理层级细项
+            newDyo.set(PositionHRConstant.NCKD_MGTLVLDTL_KEY, entryEntityDy.get(PositionHRConstant.NCKD_MGTLVLDTL_KEY));
+            // 设置 法人岗位层级
+            newDyo.set(PositionHRConstant.NCKD_LEGPOSTLV_KEY, entryEntityDy.get(PositionHRConstant.NCKD_LEGPOSTLV_KEY));
             // 设置编码
             orgId = newDyo.getString(String.join(".", PositionHRConstant.ORG_KEY, PositionHRConstant.ID_KEY));
             String positionNumber = CodeRuleServiceHelper.getNumber(PositionHRConstant.HBPM_POSITIONHR, newDyo, orgId);

+ 10 - 4
code/wtc/nckd-jxccl-wtc/src/main/java/nckd/jxccl/wtc/wtp/mservice/WTPCustomerService.java

@@ -1,10 +1,12 @@
 package nckd.jxccl.wtc.wtp.mservice;
 
 import kd.bos.dataentity.entity.DynamicObject;
+import kd.bos.dataentity.serialization.DataEntitySerializerOption;
+import kd.bos.dataentity.serialization.SerializationUtils;
 import kd.hr.hbp.business.servicehelper.HRMServiceHelper;
-import kd.hr.hbp.common.util.HRObjectUtils;
 import kd.sdk.wtc.wtp.business.attfile.AttFileVersion;
 import kd.sdk.wtc.wtp.business.helper.WTPServiceHelper;
+import nckd.jxccl.base.common.constant.FormConstant;
 import nckd.jxccl.wtc.wtp.mservice.api.IWTPCustomerService;
 
 import java.time.LocalDate;
@@ -19,14 +21,18 @@ import java.util.List;
 public class WTPCustomerService implements IWTPCustomerService {
 
     @Override
-    public Long getAttFileBoId(LocalDate localDate, long employeeId) {
+    public String getAttFile(LocalDate localDate, long employeeId) {
         AttFileVersion attFile = WTPServiceHelper.getAttFile(localDate, employeeId);
-        return HRObjectUtils.isEmpty(attFile) ? 0L : attFile.getBoId();
+        return attFile == null ? null : SerializationUtils.toJsonString(WTPServiceHelper.getAttFile(localDate, employeeId));
     }
 
     @Override
     public List<DynamicObject> queryQuota(long attFileBoId, List<Long> qtTypeIdList, int rangQueryType, Date startDate, Date endDate) {
-        return HRMServiceHelper.invokeBizService("wtc", "wtp", "IQTService", "queryQuota", new Object[]{attFileBoId, qtTypeIdList, rangQueryType, startDate, endDate});
+        List<DynamicObject> quotaDyList = HRMServiceHelper.invokeBizService(FormConstant.WTC_CLOUD, FormConstant.WTP_APP, "IQTService", "queryQuota", new Object[]{attFileBoId, qtTypeIdList, rangQueryType, startDate, endDate});
+        DataEntitySerializerOption dataEntitySerializerOption = new DataEntitySerializerOption();
+        //dataEntitySerializerOption.setIncludeComplexProperty(true);// 包含基础资料已有的所有属性
+        //return quotaDyList == null || quotaDyList.isEmpty() ? new String[0] : quotaDyList.stream().map(DataEntitySerializer::serializerToString).toArray(String[]::new);
+        return quotaDyList;
     }
 
 }

+ 2 - 2
code/wtc/nckd-jxccl-wtc/src/main/java/nckd/jxccl/wtc/wtp/mservice/api/IWTPCustomerService.java

@@ -13,13 +13,13 @@ import java.util.List;
  */
 public interface IWTPCustomerService {
     /**
-     * 获取人员考勤档案BOID
+     * 获取人员考勤档案
      * @from: kd.sdk.wtc.wtp.business.helper.WTPServiceHelper.getAttFile
      * @param localDate
      * @param employeeId
      * @return
      */
-    Long getAttFileBoId(LocalDate localDate, long employeeId);
+    String getAttFile(LocalDate localDate, long employeeId);
 
     /**
      * 查询定额明细