Commit d3afe4be by 张富康

fix(perfSalary): 修正试用期和正式期基本工资赋值错误

- 将试用期和正式期考勤后的基本工资赋值逻辑从set方法改为变量赋值
- 调整自动绩效评估规则中员工等级判定逻辑
- 修正异动月份的计算及绩效规则应用细节
- 更新部分数据查询参数,优化数据获取条件
- 调整转正日期判断,修正当月无转正的判定逻辑
1 parent 8bc6f6c1
......@@ -186,9 +186,9 @@ public class AttendanceSummaryService {
afterAttendanceTotalBasicSalary = trialBasicSalary;
}
} else {
updatePerfAppraisal.setAfterAttendanceProbationBasicSalary(BigDecimal.ZERO);
updatePerfAppraisal.setAfterAttendanceRegularBasicSalary(formalBasicSalary);
updatePerfAppraisal.setAfterAttendanceTotalBasicSalary(formalBasicSalary);
afterAttendanceProbationBasicSalary = BigDecimal.ZERO;
afterAttendanceRegularBasicSalary = formalBasicSalary;
afterAttendanceTotalBasicSalary = formalBasicSalary;
}
} else {
// 不满勤
......
......@@ -85,6 +85,7 @@ public class AutoPerfEvaluationService {
String staffBeisenBaseCondition2 = "DATE_FORMAT(entry_date, '%Y-%m') <= '{}'";
staffBeisenBaseCondition2 = StrUtil.format(staffBeisenBaseCondition2, lastMonth);
staffBeisenBaseExample.createCriteria().andEqualTo("deletedFlag", 'N')
// .andEqualTo("staffPhone", "15889804758")
.andCondition(staffBeisenBaseCondition1).andCondition(staffBeisenBaseCondition2);
List<StaffBeisenBaseInfo> staffBeiSenBaseInfos = staffBeisenBaseInfoMapper.selectByExample(staffBeisenBaseExample);
log.info("获取到 {} 条员工数据", staffBeiSenBaseInfos.size());
......@@ -98,6 +99,7 @@ public class AutoPerfEvaluationService {
attendanceSummaryCondition = StrUtil.format(attendanceSummaryCondition, lastMonth);
attendanceSummaryExample.createCriteria().andEqualTo("deletedFlag", 'N')
// .andCondition(attendanceSummaryCondition)
// .andEqualTo("mobilePhone", "15889804758")
.andEqualTo("attendanceMonth", lastMonth);
List<AttendanceSummary> attendanceSummaries = attendanceSummaryMapper.selectByExample(attendanceSummaryExample);
Map<String, AttendanceSummary> attendanceSummaryMap = new HashMap<>();
......@@ -119,12 +121,14 @@ public class AutoPerfEvaluationService {
dataBizQueryParamsDTO.setStartDate(DateUtil.format(lastMonthFirstYMD, DatePattern.NORM_DATE_PATTERN));
dataBizQueryParamsDTO.setEndDate(DateUtil.format(lastMonthLastYMD, DatePattern.NORM_DATE_PATTERN));
// 线上 default.brand.id=1,-2,2695,-4
String brandIds = OrePropertyConfigurer.getProperty("default.brand.id", String.class, "-1,-2,3454,-4");
String brandIds = OrePropertyConfigurer.getProperty("default.brand.id", String.class, "1,-2,2695,-4");
dataBizQueryParamsDTO.setBrandIds(brandIds);
dataBizQueryParamsDTO.setExts("staffIds");
dataBizQueryParamsDTO.setDateType(2);
String jsonBody = JSONUtil.toJsonStr(dataBizQueryParamsDTO);
DataResp<List<DataBusinessDTO>> listDataResp = getDataStatsService.getListDataResp(jsonBody);
// DataResp<List<DataBusinessDTO>> listDataResp = new DataResp<>();
// listDataResp.setContent(new ArrayList<>());
List<DataBusinessDTO> content = listDataResp.getContent();
// 给每个手机号设置 0 产值 map
Map<String, BigDecimal> phoneOutValueMap = staffBeiSenBaseInfos.stream().collect(
......@@ -143,7 +147,7 @@ public class AutoPerfEvaluationService {
}
log.info("phoneOutValueMap:{}", phoneOutValueMap);
content.clear();
boolean judgeAutoPerformRuleEnable = ObjectUtil.isEmpty(autoPerformRule) || (ObjectUtil.isNotEmpty(autoPerformRule) && ObjectUtil.equals(autoPerformRule.getStatus(), 1));
boolean judgeAutoPerformRuleEnable = ObjectUtil.isEmpty(autoPerformRule) || (ObjectUtil.isNotEmpty(autoPerformRule) && ObjectUtil.equals(autoPerformRule.getStatus(), 2));
List<PerformanceEvaluation> performanceEvaluations = new ArrayList<>();
for (StaffBeisenBaseInfo employee : staffBeiSenBaseInfos) {
log.info("开始处理员工 {} 的数据", employee.getStaffName());
......@@ -217,9 +221,9 @@ public class AutoPerfEvaluationService {
afterAttendanceTotalBasicSalary = trialBasicSalary;
}
} else {
performanceEvaluation.setAfterAttendanceProbationBasicSalary(BigDecimal.ZERO);
performanceEvaluation.setAfterAttendanceRegularBasicSalary(formalBasicSalary);
performanceEvaluation.setAfterAttendanceTotalBasicSalary(formalBasicSalary);
afterAttendanceProbationBasicSalary = BigDecimal.ZERO;
afterAttendanceRegularBasicSalary = formalBasicSalary;
afterAttendanceTotalBasicSalary = formalBasicSalary;
}
} else {
// 不满勤
......@@ -285,32 +289,32 @@ public class AutoPerfEvaluationService {
calculatorMonthOnboardTriggerRewardCoefficient = autoPerformRule.getMonthOnboardDefaultRewardCoefficient();
Integer monthOnboardAttendanceDays = autoPerformRule.getMonthOnboardAttendanceDays();
// 自动打绩效类型 1-当月入职新员工-规则内 2-当月入职新员工-规则外 3-非当月入职员工-规则内 4-非当月入职员工-规则外
autoGradeType = 1;
autoGradeType = 2;
// 判断出勤天数是否满足 monthOnboardAttendanceDays 标准 >=该天数
if (actualAttendanceDays.compareTo(new BigDecimal(monthOnboardAttendanceDays)) >= 0) {
// 判断产值是否满足产值阈值 < 该产值阈值
Integer monthOnboardOutputThreshold = autoPerformRule.getMonthOnboardOutputThreshold();
if (staffOutValue.compareTo(BigDecimal.valueOf(monthOnboardOutputThreshold)) < 0) {
// 触发规则
autoGradeType = 2;
autoGradeType = 1;
calculatorLevel = autoPerformRule.getMonthOnboardTriggerLevelCode();
calculatorMonthOnboardTriggerScore = autoPerformRule.getMonthOnboardTriggerScore();
calculatorMonthOnboardTriggerRewardCoefficient = autoPerformRule.getMonthOnboardTriggerRewardCoefficient();
}
}
} else {
autoGradeType = 3;
calculatorLevel = autoPerformRule.getNoMonthOnboardTriggerLevelCode();
calculatorMonthOnboardTriggerScore = autoPerformRule.getNoMonthOnboardTriggerScore();
calculatorMonthOnboardTriggerRewardCoefficient = autoPerformRule.getNoMonthOnboardTriggerRewardCoefficient();
autoGradeType = 4;
calculatorLevel = autoPerformRule.getNoMonthOnboardDefaultLevelCode();
calculatorMonthOnboardTriggerScore = autoPerformRule.getNoMonthOnboardDefaultScore();
calculatorMonthOnboardTriggerRewardCoefficient = autoPerformRule.getNoMonthOnboardDefaultRewardCoefficient();
Integer noMonthOnboardOutputThreshold = autoPerformRule.getNoMonthOnboardOutputThreshold();
// 判断产值是否满足产值阈值 < 该产值阈值
if (staffOutValue.compareTo(BigDecimal.valueOf(noMonthOnboardOutputThreshold)) < 0) {
// 触发规则
autoGradeType = 4;
autoGradeType = 3;
calculatorLevel = autoPerformRule.getNoMonthOnboardTriggerLevelCode();
calculatorMonthOnboardTriggerScore = autoPerformRule.getNoMonthOnboardDefaultScore();
calculatorMonthOnboardTriggerRewardCoefficient = autoPerformRule.getNoMonthOnboardDefaultRewardCoefficient();
calculatorMonthOnboardTriggerScore = autoPerformRule.getNoMonthOnboardTriggerScore();
calculatorMonthOnboardTriggerRewardCoefficient = autoPerformRule.getNoMonthOnboardTriggerRewardCoefficient();
}
}
performanceEvaluation.setAutoGradeCode(calculatorLevel);
......@@ -413,9 +417,9 @@ public class AutoPerfEvaluationService {
DateTime officialDate = DateUtil.parse(officialDateStr, DatePattern.NORM_DATE_PATTERN);
// 如果转正时间晚于当月最后一天,则当月无转正
if (officialDate.compareTo(monthLastYMD) > 0) {
return false;
} else {
return true;
} else {
return false;
}
} else {
return false;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!