Bladeren bron

feat(hr): 新增职级表单插件并优化薪酬调整任务逻辑

- 新增 JobLevelHrFormPlugin 插件处理职级相关字段变更
- 更新 FormConstant 中 NCKD_ISPARTICIPATE 字段注释说明
- 重构 PsmsAdjustSalaryTask 任务类,增强日志记录和参数校验
- 移除无效的薪酬标准匹配逻辑,简化定调薪流程
- 优化推送调薪申请单的数据组装和异常处理机制
- 修改 PushAdjustOpPlugin 插件,支持从调薪文件获取组织机构信息
- 注释掉绩效管理周期开始年与结束年间隔三年的校验逻辑
wyc 1 dag geleden
bovenliggende
commit
995c352864

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

@@ -433,7 +433,7 @@ public class FormConstant {
     public static final String AFFACTION_KEY = "affaction";
     /** 别名 */
     public static final String NCKD_ALIAS = "nckd_alias";
-    /** 别名 */
+    /** 是否参与 */
     public static final String NCKD_ISPARTICIPATE = "nckd_isparticipate";
 
 

+ 46 - 0
code/hr/nckd-jxccl-hr/src/main/java/nckd/jxccl/hr/psms/plugin/form/JobLevelHrFormPlugin.java

@@ -0,0 +1,46 @@
+package nckd.jxccl.hr.psms.plugin.form;
+
+import kd.bos.dataentity.entity.DynamicObject;
+import kd.bos.entity.datamodel.events.ChangeData;
+import kd.bos.entity.datamodel.events.PropertyChangedArgs;
+import kd.bos.form.plugin.AbstractFormPlugin;
+import kd.sdk.plugin.Plugin;
+import nckd.jxccl.base.common.constant.FormConstant;
+import nckd.jxccl.base.common.utils.ConvertUtil;
+import nckd.jxccl.hr.hstu.common.HonorStudentConstant;
+import nckd.jxccl.hr.psms.common.PositionStructureConstant;
+
+import java.util.Objects;
+
+/**
+* 职级
+* 实体标识:hbjm_joblevelhr
+* @author W.Y.C
+* @date 2025/12/22 18:47
+* @version 1.0
+*/
+public class JobLevelHrFormPlugin extends AbstractFormPlugin implements Plugin {
+
+    @Override
+    public void propertyChanged(PropertyChangedArgs e) {
+        String fieldKey = e.getProperty().getName();
+        ChangeData[] changeSet = e.getChangeSet();
+
+        if ("nckd_joblevelscm".equalsIgnoreCase(fieldKey)) {
+            if (changeSet != null && changeSet.length > 0) {
+                Object oldValue = changeSet[0].getOldValue();
+                Object newValue = changeSet[0].getNewValue();
+                if (!Objects.equals(oldValue, newValue)) {
+                    if(newValue != null) {
+                        Object[] mulSelectOrgIds = new Object[1];
+                        mulSelectOrgIds[0] = ConvertUtil.toDynamicObjectOrNull(newValue).getLong(FormConstant.ID_KEY);
+                        this.getModel().setValue("joblevelscm", mulSelectOrgIds);
+                    }else{
+                        this.getModel().setValue("joblevelscm", null);
+                    }
+
+                }
+            }
+        }
+    }
+}

+ 64 - 73
code/hr/nckd-jxccl-hr/src/main/java/nckd/jxccl/hr/psms/task/PsmsAdjustSalaryTask.java

@@ -22,9 +22,6 @@ import kd.bos.servicehelper.QueryServiceHelper;
 import kd.bos.servicehelper.operation.SaveServiceHelper;
 import kd.sdk.plugin.Plugin;
 import kd.sdk.swc.hcdm.business.helper.HCDMApplyBillServiceHelper;
-import kd.sdk.swc.hcdm.business.helper.HCDMSalaryStdServiceHelper;
-import kd.sdk.swc.hcdm.common.dto.stdtab.match.StdTableDataMatchParam;
-import kd.sdk.swc.hcdm.common.dto.stdtab.match.StdTableDataMatchResult;
 import nckd.jxccl.base.common.constant.FormConstant;
 import nckd.jxccl.base.common.enums.psms.AdjustTypeEnum;
 import nckd.jxccl.base.common.enums.psms.TypeStateEnum;
@@ -33,7 +30,6 @@ import nckd.jxccl.base.common.utils.ConvertUtil;
 import nckd.jxccl.base.common.utils.DateUtil;
 import nckd.jxccl.base.common.utils.QueryFieldBuilder;
 import nckd.jxccl.base.common.utils.StrFormatter;
-import nckd.jxccl.base.entity.helper.EntityHelper;
 import nckd.jxccl.base.swc.helper.AdjFileServiceHelper;
 import nckd.jxccl.hr.psms.common.PositionStructureConstant;
 
@@ -65,12 +61,18 @@ public class PsmsAdjustSalaryTask extends AbstractTask implements Plugin {
 
     @Override
     public void execute(RequestContext requestContext, Map<String, Object> map) throws KDException {
+        logger.info("开始执行职位体系推送薪酬任务, 参数: {}", JSON.toJSONString(map));
+        
         //1:为本月数据,2:为上月数据
         Integer type = ConvertUtil.toInt(map.get("type"));
         Date beginDateParam = ConvertUtil.toDate(map.get("beginDateParam"));
         Date endDateParam = ConvertUtil.toDate(map.get("endDateParam"));
+        
+        logger.info("解析参数完成: type={}, beginDateParam={}, endDateParam={}", type, beginDateParam, endDateParam);
+        
         // 校验日期:要么都为空,要么都不为空
         if ((beginDateParam == null && endDateParam != null) || (beginDateParam != null && endDateParam == null)) {
+            logger.error("日期参数错误-开始日期和结束日期必须同时为空或同时不为空, beginDateParam={}, endDateParam={}", beginDateParam, endDateParam);
             throw new ValidationException("日期参数错误-开始日期和结束日期必须同时为空或同时不为空");
         }
 
@@ -81,17 +83,21 @@ public class PsmsAdjustSalaryTask extends AbstractTask implements Plugin {
         if(beginDateParam != null && endDateParam != null){
             beginDate = DateUtil.beginOfDay(beginDateParam);
             endDate = DateUtil.endOfDay(endDateParam);
+            logger.info("使用自定义日期范围: beginDate={}, endDate={}", beginDate, endDate);
         }else{
             LocalDateTime now = DateUtil.now();
             if(type == 2){
                 now = DateUtil.minusMonths(now, 1);
+                logger.info("处理上月数据");
             }else if(type == 1){
-                //本月
+                logger.info("处理本月数据");
             }else{
+                logger.error("参数错误-type,只能为1或2, 当前type={}", type);
                 throw new ValidationException("参数错误-type,只能为1或2");
             }
             beginDate = DateUtil.toDate(DateUtil.beginOfMonth(now));
             endDate = DateUtil.toDate(DateUtil.endOfMonth(now));
+            logger.info("计算日期范围: beginDate={}, endDate={}", beginDate, endDate);
         }
         filter.and(FormConstant.CREATE_TIME_KEY,QCP.large_equals,beginDate);
         filter.and(FormConstant.CREATE_TIME_KEY,QCP.less_equals,new Date());
@@ -106,11 +112,17 @@ public class PsmsAdjustSalaryTask extends AbstractTask implements Plugin {
                 .addIdNumberName(PositionStructureConstant.NCKD_LASTPERSONPOSFILE,PositionStructureConstant.NCKD_JOBLEVELHR)
                 .orderDesc(FormConstant.CREATE_TIME_KEY);
         DynamicObjectCollection personPosFileColl = QueryServiceHelper.query(PositionStructureConstant.PERSONPOSFILE_ENTITYID, queryFieldBuilder.buildSelect(), new QFilter[]{filter});
+        
+        logger.info("查询到 {} 条职位档案记录", personPosFileColl.size());
+        
         // 按人员分组,Map<Long,List<DynamicObject>>
         Map<Long, List<DynamicObject>> personPosFileMap = personPosFileColl.stream()
                 .collect(Collectors.groupingBy(
                         obj -> obj.getLong(String.join(".", PositionStructureConstant.NCKD_PERSON, FormConstant.ID_KEY))
                 ));
+        
+        logger.info("按人员分组完成,共 {} 个员工", personPosFileMap.size());
+        
         //需要推送调薪的员工档案id
         List<Long> needAdjustSalaryId = new ArrayList<>();
         List<Long> needPersonId = new ArrayList<>();
@@ -154,62 +166,19 @@ public class PsmsAdjustSalaryTask extends AbstractTask implements Plugin {
                 }
             }
         }
+        
+        logger.info("筛选出需要推送调薪的记录 {} 条", needAdjustSalaryId.size());
 
         if(!needAdjustSalaryId.isEmpty()){
+            logger.info("开始获取人员最新岗位工资标准定薪记录");
             //获取人员最新岗位工资标准定薪记录
             List<AdjFileServiceHelper.SalaryAdjustmentResult> salaryAdjustmentResultList = AdjFileServiceHelper.getLastDecAdjRecords(needPersonId, FormConstant.STANDARDITEM_ID_KEY);
-            Map<Long,AdjFileServiceHelper.SalaryAdjustmentResult> salaryAdjustmentResultMap = new HashMap<>(salaryAdjustmentResultList.size());
+            Map<Long, List<AdjFileServiceHelper.SalaryAdjustmentResult>> salaryAdjustmentResultMap = salaryAdjustmentResultList.stream()
+                    .collect(Collectors.groupingBy(result -> result.employee.getLong(FormConstant.ID_KEY)));
+            
+            logger.info("获取到 {} 条定薪记录", salaryAdjustmentResultList.size());
+            
             if (!salaryAdjustmentResultList.isEmpty()) {
-                //薪酬标准ID
-                List<Long> salaryStIds = salaryAdjustmentResultList.stream().map(result -> result.salaryStDv.getLong(FormConstant.ID_KEY)).collect(Collectors.toList());
-                QFilter salaryStandardFilter = new QFilter(FormConstant.ID_KEY, QCP.in, salaryStIds)
-                        .and(String.join(".", "rankentry", "rank", FormConstant.NUMBER_KEY), QCP.equals, "01");
-                //获取标准表中01档的薪档
-                QueryFieldBuilder salaryStandFieldBuilder = QueryFieldBuilder.create()
-                        .add(FormConstant.ID_KEY)
-                        .addIdNumberNameWithExtras(new String[]{"rankentry", "rank"},FormConstant.INDEX_KEY);
-                DynamicObjectCollection salaryStandardColl = QueryServiceHelper.query("hcdm_salarystandard", salaryStandFieldBuilder.buildSelect(), new QFilter[]{salaryStandardFilter});
-                Map<Long, DynamicObject> salaryStandardMap = salaryStandardColl.stream()
-                        .collect(Collectors.toMap(
-                                obj -> obj.getLong(FormConstant.ID_KEY),
-                                obj -> obj
-                        ));
-
-                if (!salaryStandardMap.isEmpty()) {
-                    List<StdTableDataMatchParam> matchParams = new ArrayList<>();
-                    for (AdjFileServiceHelper.SalaryAdjustmentResult result : salaryAdjustmentResultList) {
-                        StdTableDataMatchParam stdTableDataMatchParam = new StdTableDataMatchParam();
-                        stdTableDataMatchParam.setStdTableId(result.salaryStDv.getLong(FormConstant.ID_KEY));
-                        stdTableDataMatchParam.setStdItemId(FormConstant.STANDARDITEM_ID_KEY);
-                        stdTableDataMatchParam.setGradeId(result.salaryGrade.getLong(FormConstant.ID_KEY));
-                        DynamicObject dynamicObject = salaryStandardMap.get(result.salaryStDv.getLong(FormConstant.ID_KEY));
-                        if(dynamicObject != null) {
-                            long rankId = dynamicObject.getLong(String.join(".", "rankentry", "rank", FormConstant.ID_KEY));
-                            stdTableDataMatchParam.setRankId(rankId);
-                            result.salaryRank = EntityHelper.newEntity(FormConstant.HSBS_SALARYRANK, rankId);
-                            matchParams.add(stdTableDataMatchParam);
-                        }
-                    }
-                    if(!matchParams.isEmpty()) {
-                        //获取薪酬项目、薪等、薪档对应金额(入参params的数组下标和出参的数组下标一一对应)
-                        List<StdTableDataMatchResult> stdTableDataMatchResults = HCDMSalaryStdServiceHelper.matchStdTableData(matchParams);
-                        for (int i = 0; i < salaryAdjustmentResultList.size(); i++) {
-                            AdjFileServiceHelper.SalaryAdjustmentResult result = salaryAdjustmentResultList.get(i);
-                            if (i < stdTableDataMatchResults.size() && stdTableDataMatchResults.get(i) != null) {
-                                //当前薪等01档的金额
-                                result.amount = stdTableDataMatchResults.get(i).getAmount();
-                                salaryAdjustmentResultMap.put(result.employee.getLong(FormConstant.ID_KEY), result);
-                            }
-                        }
-                    }
-                } else {
-                    logger.warn("未获取薪酬标准表中01档的薪档数据,薪酬标准ID:{}",salaryStIds);
-                }
-            } else {
-                logger.warn("未获取到人员岗位工资标准定薪记录,人员ID:{}",needPersonId);
-            }
-
-            if(!salaryAdjustmentResultMap.isEmpty()){
                 Map<Long, DynamicObject> jobLevelMap = new HashMap<>(jobLevelIds.size());
                 if(!jobLevelIds.isEmpty()) {
                     MainEntityType jobLevelEntityType = EntityMetadataCache.getDataEntityType(FormConstant.HBJM_JOBLEVELHR);
@@ -220,11 +189,16 @@ public class PsmsAdjustSalaryTask extends AbstractTask implements Plugin {
                                     obj -> obj.getLong(FormConstant.ID_KEY),
                                     obj -> obj
                             ));
+                    
+                    logger.info("加载 {} 条职级信息", load.length);
                 }
 
                 List<DynamicObject> updatePersonPosFile = new ArrayList<>();
                 MainEntityType personPosFileEntityType = EntityMetadataCache.getDataEntityType(PositionStructureConstant.PERSONPOSFILE_ENTITYID);
                 DynamicObject[] personPosFileArray = BusinessDataServiceHelper.load(needAdjustSalaryId.toArray(), personPosFileEntityType);
+                
+                logger.info("加载 {} 条职位档案记录用于更新", personPosFileArray.length);
+                
                 for (DynamicObject personPosFile : personPosFileArray) {
                     long jobLevelId = personPosFile.getLong(String.join(".", PositionStructureConstant.NCKD_JOBLEVELHR, FormConstant.ID_KEY));
                     long lastJobLevelId = personPosFile.getLong(String.join(".",PositionStructureConstant.NCKD_LASTPERSONPOSFILE, PositionStructureConstant.NCKD_JOBLEVELHR, FormConstant.ID_KEY));
@@ -234,21 +208,20 @@ public class PsmsAdjustSalaryTask extends AbstractTask implements Plugin {
                     if(jobLevel != null) {
                         DynamicObject person = personPosFile.getDynamicObject(FormConstant.NCKD_PERSON);
                         Date date = personPosFile.getDate(PositionStructureConstant.NCKD_BEGINDATE);
-                        AdjFileServiceHelper.SalaryAdjustmentResult salaryAdjustmentResult = salaryAdjustmentResultMap.get(person.getLong(FormConstant.ID_KEY));
-                        if (salaryAdjustmentResult != null && salaryAdjustmentResult.amount.compareTo(BigDecimal.ZERO) > 0) {
+                        List<AdjFileServiceHelper.SalaryAdjustmentResult> salaryAdjustmentResults = salaryAdjustmentResultMap.get(person.getLong(FormConstant.ID_KEY));
+                        if (salaryAdjustmentResults != null) {
+                            AdjFileServiceHelper.SalaryAdjustmentResult salaryAdjustmentResult = salaryAdjustmentResults.get(0);
                             BigDecimal coefficient = jobLevel.getBigDecimal(PositionStructureConstant.NCKD_COEFFICIENT);
-                            BigDecimal finalAmount = BigDecimal.ZERO;
-                            if(coefficient.compareTo(BigDecimal.ZERO) > 0) {
-                                //职位津贴=职位系数 X 所在岗级岗位工资一档金额
-                                finalAmount = coefficient.multiply(salaryAdjustmentResult.amount);
-                            }
-
-
+                            
+                            logger.info("处理员工 {}, 职位档案ID: {}, 职级系数: {}", 
+                                person.getString(FormConstant.NAME_KEY), 
+                                personPosFile.getLong(FormConstant.ID_KEY), 
+                                coefficient);
+                            
                             //触发定调薪
                             Map<String, Object> applyBill = new HashMap<>();
                             applyBill.put("billname", StrFormatter.format("【{}】的职位体系调整(职位津贴)",person.getString(FormConstant.NAME_KEY)));
                             Long orgId = RequestContext.get().getOrgId();
-
                             String uniquecode = UUID.randomUUID().toString().replace("-", "");
                             applyBill.put("_uniquecode", uniquecode);
                             if(salaryAdjustmentResult.hcdmOrg != null){
@@ -256,7 +229,6 @@ public class PsmsAdjustSalaryTask extends AbstractTask implements Plugin {
                             }else{
                                 applyBill.put("org", orgId);
                             }
-
                             //定调薪明细字段显示方案   调薪明细字段
                             applyBill.put("billtype", 2215975998602655744L);
                             //国家
@@ -293,7 +265,7 @@ public class PsmsAdjustSalaryTask extends AbstractTask implements Plugin {
                                     lastJobLevel == null ? "无" : lastJobLevel.getString(FormConstant.JOBLEVELSEQ)+"级",
                                     jobLevel.getString(FormConstant.NAME_KEY),
                                     jobLevel.getString(FormConstant.JOBLEVELSEQ),
-                                     coefficient
+                                    coefficient
                             );
                             applyBill.put("description", description);
                             List<Map<String, Object>> applyBillEntryData = new ArrayList<>();
@@ -304,11 +276,11 @@ public class PsmsAdjustSalaryTask extends AbstractTask implements Plugin {
                             applyBillEntry.put("employee", employeeId);
                             applyBillEntry.put("standarditem", 2321901533681170432L);    //定调薪项目   职位系数
                             applyBillEntry.put("frequency", 1095454108284088320L);       //频度  月
-                            applyBillEntry.put("amount", finalAmount);
+                            applyBillEntry.put("amount", coefficient);
                             applyBillEntry.put("position", positionId);
                             applyBillEntry.put("joblevel", jobLevel.getLong(FormConstant.ID_KEY));
-                            applyBillEntry.put("salarygrade", salaryAdjustmentResult.salaryGrade.getLong(FormConstant.ID_KEY));
-                            applyBillEntry.put("salaryrank", salaryAdjustmentResult.salaryRank.getLong(FormConstant.ID_KEY));
+                            /*applyBillEntry.put("salarygrade", salaryAdjustmentResult.salaryGrade.getLong(FormConstant.ID_KEY));
+                            applyBillEntry.put("salaryrank", salaryAdjustmentResult.salaryRank.getLong(FormConstant.ID_KEY));*/
                             applyBillEntry.put("reason", description);
                             applyBillEntryData.add(applyBillEntry);
                             applyBill.put("applybillent", applyBillEntryData);
@@ -317,24 +289,33 @@ public class PsmsAdjustSalaryTask extends AbstractTask implements Plugin {
                             Map<String, Object> papams = new HashMap<>();
                             papams.put("data", applyBillData);
                             papams.put("isUseMatchAmount", Boolean.TRUE);
+                            
+                            logger.info("准备推送员工 {} 的定调薪申请单", person.getString(FormConstant.NAME_KEY));
                             Map<String, Object> result = HCDMApplyBillServiceHelper.saveDraftApplyBill(papams);
                             if (!ConvertUtil.toBoolean(result.get("success")) || result.get("data") == null || ConvertUtil.toList(result.get("data")).isEmpty()) {
+                                logger.error("【{}】推送定调薪失败,原因:{}", person.getString(FormConstant.NAME_KEY), JSON.toJSONString(result));
                                 throw new ValidationException("【"+person.getString(FormConstant.NAME_KEY)+"】推送定调薪失败,原因:" + JSON.toJSONString(result));
                             }else{
                                 personPosFile.set(PositionStructureConstant.NCKD_ISSALADJPUSH, Boolean.TRUE);
                                 personPosFile.set(PositionStructureConstant.NCKD_SALADJPUSHTIME, new Date());
                                 personPosFile.set(PositionStructureConstant.NCKD_SALADJID, ConvertUtil.toMap(ConvertUtil.toList(result.get("data")).get(0)).get("id"));
-                                personPosFile.set(PositionStructureConstant.NCKD_SALADJNUMBER, null);
+                                
+                                logger.info("成功推送员工 {} 的定调薪申请单,申请单ID: {}", 
+                                    person.getString(FormConstant.NAME_KEY), 
+                                    ConvertUtil.toMap(ConvertUtil.toList(result.get("data")).get(0)).get("id"));
 
                                 updatePersonPosFile.add(personPosFile);
                             }
                         } else {
-                            logger.warn("未获取到员工【{}】最新岗位工资标准定薪记录01档的薪等金额,人员ID:", person.getString(FormConstant.NAME_KEY));
+                            logger.warn("未获取到员工【{}】最新岗位工资标准定薪记录01档的薪等金额,人员ID:{}", person.getString(FormConstant.NAME_KEY), person.getLong(FormConstant.ID_KEY));
                         }
+                    } else {
+                        logger.warn("员工 {} 的职级信息为空,跳过处理", personPosFile.getDynamicObject(FormConstant.NCKD_PERSON).getString(FormConstant.NAME_KEY));
                     }
                 }
 
                 if(!updatePersonPosFile.isEmpty()){
+                    logger.info("开始保存 {} 条职位档案更新记录", updatePersonPosFile.size());
                     OperationResult operationResult = SaveServiceHelper.saveOperate(PositionStructureConstant.PERSONPOSFILE_ENTITYID, updatePersonPosFile.toArray(new DynamicObject[0]), OperateOption.create());
                     if (!operationResult.isSuccess()) {
                         StringJoiner errorMsg = new StringJoiner("\n");
@@ -344,12 +325,22 @@ public class PsmsAdjustSalaryTask extends AbstractTask implements Plugin {
                         if (!ObjectUtils.isEmpty(operationResult.getMessage())) {
                             errorMsg.add(operationResult.getMessage());
                         }
+                        logger.error("保存职位档案失败,原因:{}", errorMsg.toString());
                         throw new ValidationException("保存职位档案失败,原因:" + errorMsg.toString());
+                    } else {
+                        logger.info("成功保存 {} 条职位档案记录", updatePersonPosFile.size());
                     }
+                } else {
+                    logger.info("没有需要保存的职位档案更新记录");
                 }
+
+            } else {
+                logger.warn("未获取到人员岗位工资标准定薪记录,人员ID:{}",needPersonId);
             }
         }else{
             logger.warn("没有需要推送的调薪数据");
         }
+        
+        logger.info("职位体系推送薪酬任务执行完成");
     }
 }

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

@@ -239,7 +239,7 @@ public class PerfManagerSaveOpPlugin extends AbstractOperationServicePlugIn impl
                     LocalDateTime endYear = ConvertUtil.toLocalDateTime(data.getDate(PerfManagerFormConstant.NCKD_ENDYEAR));
 
                     // 判断beginYear和endYear是不是间隔3年,例如:开始2025年,结束必须为2027年
-                    if (beginYear != null && endYear != null) {
+                   /* if (beginYear != null && endYear != null) {
                         int beginYearValue = beginYear.getYear();
                         int endYearValue = endYear.getYear();
                         if (endYearValue - beginYearValue != 2) {
@@ -247,7 +247,7 @@ public class PerfManagerSaveOpPlugin extends AbstractOperationServicePlugIn impl
                                     StrFormatter.format("周期开始年份【{}】与结束年份【{}】必须间隔3年,请检查!",
                                             beginYearValue, endYearValue));
                         }
-                    }
+                    }*/
 
                     //校验是否存在相同周期开始年的记录 begin
                     List<DynamicObject> personRecords = groupedQueryResults.getOrDefault(personId, Collections.emptyList());

+ 53 - 48
code/opmc/nckd-jxccl-opmc/src/main/java/nckd/jxccl/opmc/pm/plugin/operate/salary/PushAdjustOpPlugin.java

@@ -106,58 +106,63 @@ public class PushAdjustOpPlugin extends AbstractOperationServicePlugIn implement
                 DynamicObject person = pushAdjust.getDynamicObject(SalAdjTrackerConstant.NCKD_PERFMANAGER).getDynamicObject(FormConstant.NCKD_PERSON);
                 applyBill.put("billname", StrFormatter.format("【{}】的岗位工资动态调整(人员考评)",person.getString(FormConstant.NAME_KEY)));
 
-                Long orgId = RequestContext.get().getOrgId();
+                DynamicObject adjFileInfo = pushAdjust.getDynamicObject(SalAdjTrackerConstant.NCKD_ADJFILEINFO);
+                if(adjFileInfo != null) {
+                    Long orgId = adjFileInfo.getLong(String.join(".", FormConstant.ORG_KEY, FormConstant.ID_KEY)) > 0 ? adjFileInfo.getLong(String.join(".", FormConstant.ORG_KEY, FormConstant.ID_KEY)) : RequestContext.get().getOrgId();
 
-                String uniquecode = UUID.randomUUID().toString().replace("-", "");
-                applyBill.put("_uniquecode", uniquecode);
-                applyBill.put("org", orgId);
-                //定调薪明细字段显示方案   调薪明细字段
-                applyBill.put("billtype", 2215975998602655744L);
-                //国家
-                applyBill.put("billcountry", 1000001L);
-                //定调薪类型
-                applyBill.put("salaryadjrsn", 2352337648716103680L);
-                //默认币种
-                applyBill.put("billcurrency", 1L);
-                //定调薪方案
-                applyBill.put("salaryadjscm", 2322515162646457344L);
-                //汇率日期
-                applyBill.put("exchangeratedate", new Date());
-                //汇率表
-                applyBill.put("exctable", 2321965096026258432L);
-                //默认生效日期
-                applyBill.put("effectivedate", new Date());
-                //草稿状态
-                applyBill.put("isdraft", "1");
-                //审核状态
-                applyBill.put("auditstatus", "A");
-                //申请单数据来源   //1:手工新增  2:接口写入
-                applyBill.put("datasource", "2");
-                applyBill.put("description", pushAdjust.getString(SalAdjTrackerConstant.NCKD_WAGEEXPLAIN));
-                List<Map<String, Object>> applyBillEntryData = new ArrayList<>();
-                Map<String, Object> applyBillEntry = new HashMap<>();
-                Long employeeId = pushAdjust.getDynamicObject(SalAdjTrackerConstant.NCKD_PERFMANAGER).getDynamicObject(FormConstant.NCKD_PERSON).getLong(FormConstant.ID_KEY);
-                Long positionId = pushAdjust.getDynamicObject(SalAdjTrackerConstant.NCKD_POSITION).getLong(FormConstant.ID_KEY);
-                applyBillEntry.put("adjfile", pushAdjust.getDynamicObject(SalAdjTrackerConstant.NCKD_ADJFILEINFO).getLong(FormConstant.ID_KEY));
-                applyBillEntry.put("employee", employeeId);
-                applyBillEntry.put("standarditem", 2321899710350111744L);    //定调薪项目   岗位工资标准
-                applyBillEntry.put("frequency", 1095454108284088320L);       //频度  月
-                applyBillEntry.put("amount", pushAdjust.getBigDecimal(SalAdjTrackerConstant.NCKD_MONEY));
+                    String uniquecode = UUID.randomUUID().toString().replace("-", "");
+                    applyBill.put("_uniquecode", uniquecode);
+                    applyBill.put("org", orgId);
+                    //定调薪明细字段显示方案   调薪明细字段
+                    applyBill.put("billtype", 2215975998602655744L);
+                    //国家
+                    applyBill.put("billcountry", 1000001L);
+                    //定调薪类型
+                    applyBill.put("salaryadjrsn", 2352337648716103680L);
+                    //默认币种
+                    applyBill.put("billcurrency", 1L);
+                    //定调薪方案
+                    applyBill.put("salaryadjscm", 2322515162646457344L);
+                    //汇率日期
+                    applyBill.put("exchangeratedate", new Date());
+                    //汇率表
+                    applyBill.put("exctable", 2321965096026258432L);
+                    //默认生效日期
+                    applyBill.put("effectivedate", new Date());
+                    //草稿状态
+                    applyBill.put("isdraft", "1");
+                    //审核状态
+                    applyBill.put("auditstatus", "A");
+                    //申请单数据来源   //1:手工新增  2:接口写入
+                    applyBill.put("datasource", "2");
+                    applyBill.put("description", pushAdjust.getString(SalAdjTrackerConstant.NCKD_WAGEEXPLAIN));
+                    List<Map<String, Object>> applyBillEntryData = new ArrayList<>();
+                    Map<String, Object> applyBillEntry = new HashMap<>();
+                    Long employeeId = pushAdjust.getDynamicObject(SalAdjTrackerConstant.NCKD_PERFMANAGER).getDynamicObject(FormConstant.NCKD_PERSON).getLong(FormConstant.ID_KEY);
+                    Long positionId = pushAdjust.getDynamicObject(SalAdjTrackerConstant.NCKD_POSITION).getLong(FormConstant.ID_KEY);
+                    applyBillEntry.put("adjfile", adjFileInfo.getLong(FormConstant.ID_KEY));
+                    applyBillEntry.put("employee", employeeId);
+                    applyBillEntry.put("standarditem", 2321899710350111744L);    //定调薪项目   岗位工资标准
+                    applyBillEntry.put("frequency", 1095454108284088320L);       //频度  月
+                    applyBillEntry.put("amount", pushAdjust.getBigDecimal(SalAdjTrackerConstant.NCKD_MONEY));
 //            applyBillEntry.put("nckd_postgrade", salaryfile.getLong("position.nckd_postgrade.id"));  //岗级
-                applyBillEntry.put("position", positionId);
+                    applyBillEntry.put("position", positionId);
 
-                applyBillEntry.put("salarygrade", pushAdjust.getLong(String.join(".",SalAdjTrackerConstant.NCKD_SALARYGRADE,FormConstant.ID_KEY)));
-                applyBillEntry.put("salaryrank", pushAdjust.getLong(String.join(".",SalAdjTrackerConstant.NCKD_SALARYRANK,FormConstant.ID_KEY)));
-                applyBillEntry.put("reason", pushAdjust.getString(SalAdjTrackerConstant.NCKD_WAGEEXPLAIN));
-                applyBillEntryData.add(applyBillEntry);
-                applyBill.put("applybillent", applyBillEntryData);
-                applyBillData.add(applyBill);
+                    applyBillEntry.put("salarygrade", pushAdjust.getLong(String.join(".", SalAdjTrackerConstant.NCKD_SALARYGRADE, FormConstant.ID_KEY)));
+                    applyBillEntry.put("salaryrank", pushAdjust.getLong(String.join(".", SalAdjTrackerConstant.NCKD_SALARYRANK, FormConstant.ID_KEY)));
+                    applyBillEntry.put("reason", pushAdjust.getString(SalAdjTrackerConstant.NCKD_WAGEEXPLAIN));
+                    applyBillEntryData.add(applyBillEntry);
+                    applyBill.put("applybillent", applyBillEntryData);
+                    applyBillData.add(applyBill);
+                }
             }
-            papams.put("data", applyBillData);
-            papams.put("isUseMatchAmount", Boolean.TRUE);
-            Map<String, Object> result = HCDMApplyBillServiceHelper.saveDraftApplyBill(papams);
-            if (!ConvertUtil.toBoolean(result.get("success")) || result.get("data") == null || ConvertUtil.toList(result.get("data")).isEmpty()) {
-                throw new ValidationException("推送定调薪失败,原因:" + JSON.toJSONString(result));
+            if(!applyBillData.isEmpty()) {
+                papams.put("data", applyBillData);
+                papams.put("isUseMatchAmount", Boolean.TRUE);
+                Map<String, Object> result = HCDMApplyBillServiceHelper.saveDraftApplyBill(papams);
+                if (!ConvertUtil.toBoolean(result.get("success")) || result.get("data") == null || ConvertUtil.toList(result.get("data")).isEmpty()) {
+                    throw new ValidationException("推送定调薪失败,原因:" + JSON.toJSONString(result));
+                }
             }
         }
     }