Commit 1fb8665a by 张富康

Merge remote-tracking branch 'origin/v5.6.0' into v5.6.0

2 parents cb86d5d8 2095ab1d
...@@ -38,6 +38,8 @@ import org.springframework.transaction.annotation.Propagation; ...@@ -38,6 +38,8 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.time.YearMonth;
import java.time.temporal.ChronoUnit;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -105,23 +107,43 @@ public class EffectiveReferralReviewService { ...@@ -105,23 +107,43 @@ public class EffectiveReferralReviewService {
//2、查询T1时间配置 //2、查询T1时间配置
PerformanceTimeCycleDTO performanceTimeCycleDTO = performanceTimeCycleService.selectByCode(PerformanceTimeCycleCodeEnum.T1.getCode()); PerformanceTimeCycleDTO performanceTimeCycleDTO = performanceTimeCycleService.selectByCode(PerformanceTimeCycleCodeEnum.T1.getCode());
//3、填充复核状态,待复核状态下的数据,如果当前时间大于T1时间配置内的结束时间,置为已失效 //3、当前时间年月是否比核查时间晚并超过1个月, 则不可编辑
long monthDiff = getMonthDiff(list.get(0).getReviewMonth());
//4、填充复核状态,待复核状态下的数据,如果当前时间大于T1时间配置内的结束时间,置为已失效
for (EffectiveReferralReviewCommonDTO item : list) { for (EffectiveReferralReviewCommonDTO item : list) {
if (Objects.nonNull(performanceTimeCycleDTO) if ((Objects.nonNull(performanceTimeCycleDTO)
&& performanceTimeCycleDTO.getStartDate() != null && performanceTimeCycleDTO.getStartDate() != null
&& performanceTimeCycleDTO.getEndDate() != null && performanceTimeCycleDTO.getEndDate() != null
&& item.getIsReviewed().equals(0)) { && item.getIsReviewed().equals(0)
if (new Date().after(performanceTimeCycleDTO.getEndDate())) { && new Date().after(performanceTimeCycleDTO.getEndDate()))
item.setIsReviewed(2); || (item.getIsReviewed().equals(0) && monthDiff > 1)) {
} item.setIsReviewed(2);
} }
} }
//4、返回结果 //5、返回结果
pagination = RpcPagination.copyPage(page); pagination = RpcPagination.copyPage(page);
return pagination; return pagination;
} }
/**
* 获取月份差 当前时间年月 - 核查年月
* @param reviewMonth
* @return
*/
private long getMonthDiff(String reviewMonth) {
YearMonth targetMonth = YearMonth.parse(reviewMonth);
YearMonth currentMonth = YearMonth.now();
//计算月份差(当前 - 目标)
// 转换为LocalDate进行比较
return ChronoUnit.MONTHS.between(
targetMonth.atDay(1), // 转换为LocalDate进行比较
currentMonth.atDay(1)
);
}
/** /**
* 查询有效引荐数详情 * 查询有效引荐数详情
* *
...@@ -138,13 +160,16 @@ public class EffectiveReferralReviewService { ...@@ -138,13 +160,16 @@ public class EffectiveReferralReviewService {
EffectiveReferralReviewCommonDTO reviewCommonDTO = referralReviewCommonDTOS.get(0); EffectiveReferralReviewCommonDTO reviewCommonDTO = referralReviewCommonDTOS.get(0);
//2、查询T1时间配置 //2、查询T1时间配置
PerformanceTimeCycleDTO performanceTimeCycleDTO = performanceTimeCycleService.selectByCode(PerformanceTimeCycleCodeEnum.T1.getCode()); PerformanceTimeCycleDTO performanceTimeCycleDTO = performanceTimeCycleService.selectByCode(PerformanceTimeCycleCodeEnum.T1.getCode());
if (Objects.nonNull(performanceTimeCycleDTO)
//3、当前时间年月是否比核查时间晚并超过1个月, 则不可编辑
long monthDiff = getMonthDiff(reviewCommonDTO.getReviewMonth());
if ((Objects.nonNull(performanceTimeCycleDTO)
&& performanceTimeCycleDTO.getStartDate() != null && performanceTimeCycleDTO.getStartDate() != null
&& performanceTimeCycleDTO.getEndDate() != null && performanceTimeCycleDTO.getEndDate() != null
&& reviewCommonDTO.getIsReviewed().equals(0)) { && reviewCommonDTO.getIsReviewed().equals(0)
if (new Date().after(performanceTimeCycleDTO.getEndDate())) { && new Date().after(performanceTimeCycleDTO.getEndDate()))
reviewCommonDTO.setIsReviewed(2); || (reviewCommonDTO.getIsReviewed().equals(0) && monthDiff > 1)) {
} reviewCommonDTO.setIsReviewed(2);
} }
return reviewCommonDTO; return reviewCommonDTO;
} }
......
...@@ -706,6 +706,7 @@ public class StaffMonthSalarySlipService { ...@@ -706,6 +706,7 @@ public class StaffMonthSalarySlipService {
StaffMonthSalarySlipSendDTO resp = new StaffMonthSalarySlipSendDTO(); StaffMonthSalarySlipSendDTO resp = new StaffMonthSalarySlipSendDTO();
resp.setStaffName(monthSalary.getStaffName()); resp.setStaffName(monthSalary.getStaffName());
resp.setStaffPhone(monthSalary.getStaffPhone()); resp.setStaffPhone(monthSalary.getStaffPhone());
resp.setEntryDate(monthSalary.getEntryDate());
resp.setBusinessTypes(monthSalary.getBusinessTypes()); resp.setBusinessTypes(monthSalary.getBusinessTypes());
resp.setSalaryMonth(monthSalary.getSalaryMonth()); resp.setSalaryMonth(monthSalary.getSalaryMonth());
resp.setFinalDataFlag(monthSalary.getFinalDataFlag()); resp.setFinalDataFlag(monthSalary.getFinalDataFlag());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!