浏览代码

fix(hr): 修正年度调整逻辑中的空指针异常

- 修正了 AnnualAdjustmentService 中对 zgjbId 的判断条件,避免因值为 0 时引发逻辑错误
- 在 ContributionHelper 的 getValidScore 方法中增加 currentScore 非空校验,防止空指针异常
- 当 validScore 或 currentScore 为空时,返回零分以确保评分计算的稳定性
wyc 18 小时之前
父节点
当前提交
d5db630e51

+ 2 - 2
code/hr/nckd-jxccl-hr/src/main/java/nckd/jxccl/hr/psms/business/AnnualAdjustmentService.java

@@ -662,7 +662,7 @@ public class AnnualAdjustmentService {
             newjobgradeindex = maxJobGradeIndex;
         }
 
-        if((ac.data.getZgjbId() == null || ac.data.getZyjndjId() == 0) && (ac.data.getZyjndjId() == null || ac.data.getZyjndjId() == 0)) {
+        if((ac.data.getZgjbId() == null || ac.data.getZgjbId() == 0) && (ac.data.getZyjndjId() == null || ac.data.getZyjndjId() == 0)) {
             //如果没有聘任则取最低职级
             jobLevel = JobLevelCalculatorService.getLowestJobLevel(ac.convertJobSeq);
             if(jobLevel != null) {
@@ -679,7 +679,7 @@ public class AnnualAdjustmentService {
         }
 
 
-        if((ac.data.getZgjbId() == null || ac.data.getZyjndjId() == 0) && (ac.data.getZyjndjId() == null || ac.data.getZyjndjId() == 0)) {
+        if((ac.data.getZgjbId() == null || ac.data.getZgjbId() == 0) && (ac.data.getZyjndjId() == null || ac.data.getZyjndjId() == 0)) {
             //无聘任
             ac.adjustType = "7";
         }else if (newjobgradeindex == ac.data.getLastJobGradeIndex()) {

+ 3 - 1
code/hr/nckd-jxccl-hr/src/main/java/nckd/jxccl/hr/psms/helper/ContributionHelper.java

@@ -621,9 +621,11 @@ public class ContributionHelper {
         public BigDecimal getValidScore() {
             //为空时说明不限制分数
             BigDecimal trulyValidScore = this.currentScore;
-            if(this.validScore != null){
+            if(this.validScore != null && this.currentScore != null){
                 //如果可使用分数超过录入分数则使用录入分数(oriScore),否则使用可使用分数
                 trulyValidScore = this.validScore.min(this.currentScore);
+            }else{
+                return BigDecimal.ZERO;
             }
             return trulyValidScore;
         }