Commit 699f7958 by 张富康

fix(service): 限制只能修改上月绩效数据

- 在提交绩效数据时,判断修改月份是否为上月
- 若修改月份不是上月,抛出异常禁止修改历史数据
- 统一在单个和批量提交接口中增加该校验逻辑
- 保持其他时间提交限制的校验不变
1 parent 92deb277
......@@ -113,6 +113,10 @@ public class PerformanceEvaluationService {
if (judgeTime) {
throw new RpcServiceException("亲,当前时间不能再提交数据");
}
// 判断修改的月份是否为上月
if (ObjectUtil.notEqual(perfAppraisalSubmitReqDTO.getEvaluationMonth(), DateUtil.format(DateUtil.lastMonth(), "yyyy-MM"))) {
throw new RpcServiceException("亲,不能修改历史的数据");
}
PerfRuleReqDTO perfRuleReqDTO = new PerfRuleReqDTO();
perfRuleReqDTO.setMobilePhone(perfAppraisalSubmitReqDTO.getMobilePhone());
perfRuleReqDTO.setQueryMonth(perfAppraisalSubmitReqDTO.getEvaluationMonth());
......@@ -217,6 +221,10 @@ public class PerformanceEvaluationService {
if (judgeTime) {
throw new RpcServiceException("亲,当前时间不能再提交数据");
}
// 判断修改的月份是否为上月
if (ObjectUtil.notEqual(perfAppraisalBatchSubmitReqDTO.getEvaluationMonth(), DateUtil.format(DateUtil.lastMonth(), "yyyy-MM"))) {
throw new RpcServiceException("亲,不能修改历史的数据");
}
// 获取该绩效月份的配置
PerformanceMonthly performanceMonthly = performanceMonthlyMapper.findByYearMonth(perfAppraisalBatchSubmitReqDTO.getEvaluationMonth());
// 通过uuid获取对应的系数
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!