|
@@ -28,6 +28,7 @@ import nckd.jxccl.hr.psms.common.PerfRankMgmtConstant;
|
|
|
import nckd.jxccl.hr.psms.common.PositionStructureConstant;
|
|
import nckd.jxccl.hr.psms.common.PositionStructureConstant;
|
|
|
import nckd.jxccl.hr.psms.common.bo.PositionAppointmentBO;
|
|
import nckd.jxccl.hr.psms.common.bo.PositionAppointmentBO;
|
|
|
import nckd.jxccl.hr.psms.helper.PositionFileHelper;
|
|
import nckd.jxccl.hr.psms.helper.PositionFileHelper;
|
|
|
|
|
+import nckd.jxccl.hr.psms.helper.data.JobLevelRuleConfig;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
@@ -1049,7 +1050,40 @@ public class JobLevelCalculatorService {
|
|
|
//2、全员绩效排名位于后30%。
|
|
//2、全员绩效排名位于后30%。
|
|
|
jobLevelIndex--;
|
|
jobLevelIndex--;
|
|
|
}else{
|
|
}else{
|
|
|
- //技术或职能序列
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 使用动态配置规则替换硬编码规则
|
|
|
|
|
+ List<JobLevelRuleConfig> ruleConfigs = PositionFileHelper.getLevelConditionConf();
|
|
|
|
|
+
|
|
|
|
|
+ // 查找匹配的规则
|
|
|
|
|
+ JobLevelRuleConfig matchingRule = ruleConfigs.stream()
|
|
|
|
|
+ .filter(rule -> rule.isMatchJobSeq(jobSeqEnum.getCode()) &&
|
|
|
|
|
+ rule.isMatchJobLevel(currentJobLevelIndex))
|
|
|
|
|
+ .findFirst()
|
|
|
|
|
+ .orElse(null);
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ if (matchingRule != null) {
|
|
|
|
|
+ StrFormatter.format("职位序列【{}】职级【{}】应用的升保降级规则配置为【{}】,最大职级【{}】,最小职级【{}】,升级百分比阈值【{}】,降级百分比阈值",
|
|
|
|
|
+ matchingRule.getName(),matchingRule.getMaxJobLevelSeq(),matchingRule.getMinJobLevel(),matchingRule.getUpGradeThreshold(),matchingRule.getDownGradeThreshold());
|
|
|
|
|
+
|
|
|
|
|
+ int upGradeThreshold = matchingRule.getUpGradeThreshold() != null ?
|
|
|
|
|
+ matchingRule.getUpGradeThreshold() : 0;
|
|
|
|
|
+ int downGradeThreshold = matchingRule.getDownGradeThreshold() != null ?
|
|
|
|
|
+ matchingRule.getDownGradeThreshold() : 0;
|
|
|
|
|
+
|
|
|
|
|
+ // 使用配置的阈值进行判断
|
|
|
|
|
+ if (allowanceRank <= selMaxAllowanceRank(upGradeThreshold, countR)) {
|
|
|
|
|
+ jobLevelIndex++;
|
|
|
|
|
+ } else if (allowanceRank >= selMinAllowanceRank(downGradeThreshold, countR) &&
|
|
|
|
|
+ selMinAllowanceRank(downGradeThreshold, countR) > 0) {
|
|
|
|
|
+ jobLevelIndex--;
|
|
|
|
|
+ }
|
|
|
|
|
+ }else{
|
|
|
|
|
+ throw new ValidationException(StrFormatter.format("未匹配到符合职位序列【{}】职级【{}】对应的升保降级规则配置,请检查配置是否正确!",
|
|
|
|
|
+ jobSeqEnum.getName(), currentJobLevelIndex));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /* //技术或职能序列
|
|
|
if (JobSeqEnum.TECHNICALS.getCode().equals(jobSeqEnum.getCode()) || JobSeqEnum.FUNCTIONAL.getCode().equals(jobSeqEnum.getCode())) {
|
|
if (JobSeqEnum.TECHNICALS.getCode().equals(jobSeqEnum.getCode()) || JobSeqEnum.FUNCTIONAL.getCode().equals(jobSeqEnum.getCode())) {
|
|
|
|
|
|
|
|
if (currentJobLevelIndex > 9) {
|
|
if (currentJobLevelIndex > 9) {
|
|
@@ -1116,7 +1150,7 @@ public class JobLevelCalculatorService {
|
|
|
jobLevelIndex--;
|
|
jobLevelIndex--;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ }*/
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (currentJobLevelIndex > 1 && jobLevelIndex - currentJobLevelIndex > 1) {
|
|
if (currentJobLevelIndex > 1 && jobLevelIndex - currentJobLevelIndex > 1) {
|
|
@@ -1145,18 +1179,38 @@ public class JobLevelCalculatorService {
|
|
|
return jobLevelIndex;
|
|
return jobLevelIndex;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public static int selMaxAllowanceRank(int percent, int countallowancerank) {
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 计算R排名的最大允许排名(前百分之几对应的排名)
|
|
|
|
|
+ * 用于确定员工R排名是否在前百分之几的范围内,以判断是否符合升级条件
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param percent 百分比阈值(如60表示前60%)
|
|
|
|
|
+ * @param countAllowanceRank 参与R排名的总人数
|
|
|
|
|
+ * @return int 对应百分比的最大排名位置
|
|
|
|
|
+ * @author W.Y.C
|
|
|
|
|
+ * @date: 2025/09/22 19:47
|
|
|
|
|
+ */
|
|
|
|
|
+ public static int selMaxAllowanceRank(int percent, int countAllowanceRank) {
|
|
|
int maxAllowanceRank = 0;
|
|
int maxAllowanceRank = 0;
|
|
|
- double maxAllowancerRankDouble = Double.parseDouble(countallowancerank + "") / 100.0 * Double.parseDouble(percent + "");
|
|
|
|
|
|
|
+ double maxAllowancerRankDouble = Double.parseDouble(countAllowanceRank + "") / 100.0 * Double.parseDouble(percent + "");
|
|
|
maxAllowanceRank = (int) Math.round(maxAllowancerRankDouble);
|
|
maxAllowanceRank = (int) Math.round(maxAllowancerRankDouble);
|
|
|
return maxAllowanceRank;
|
|
return maxAllowanceRank;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- public static int selMinAllowanceRank(int percent, int countallowancerank) {
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 计算R排名的最小允许排名(后百分之几对应的排名)
|
|
|
|
|
+ * 用于确定员工R排名是否在后百分之几的范围内,以判断是否符合降级条件
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param percent 百分比阈值(如5表示后5%)
|
|
|
|
|
+ * @param countAllowanceRank 参与R排名的总人数
|
|
|
|
|
+ * @return int 对应百分比的最小排名位置
|
|
|
|
|
+ * @author W.Y.C
|
|
|
|
|
+ * @date: 2025/09/22 19:47
|
|
|
|
|
+ */
|
|
|
|
|
+ public static int selMinAllowanceRank(int percent, int countAllowanceRank) {
|
|
|
int minAllowanceRank = 0;
|
|
int minAllowanceRank = 0;
|
|
|
- double minAllowanceRankDouble = Double.parseDouble(countallowancerank + "") / 100.0 * Double.parseDouble(percent + "");
|
|
|
|
|
- minAllowanceRank = countallowancerank - ((int) Math.round(minAllowanceRankDouble));
|
|
|
|
|
|
|
+ double minAllowanceRankDouble = Double.parseDouble(countAllowanceRank + "") / 100.0 * Double.parseDouble(percent + "");
|
|
|
|
|
+ minAllowanceRank = countAllowanceRank - ((int) Math.round(minAllowanceRankDouble));
|
|
|
return minAllowanceRank;
|
|
return minAllowanceRank;
|
|
|
}
|
|
}
|
|
|
|
|
|