Commit d3afe4be by 张富康

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

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