feat(holiday): 增加加班多少天后作废的功能- 在 HolidayBalanceSettingSaveReqVO 和 HolidayBalanceSettingDO 中添加 afterFewDays 字段

- 在 HolidayUserRecordServiceImpl 中实现加班多少天后作废的逻辑
- 更新 validityPeriodCalculation 方法以支持新的作废类型
This commit is contained in:
aikai 2025-03-31 16:37:49 +08:00
parent 166cd8c27a
commit ed69f18ef7
3 changed files with 14 additions and 4 deletions

View File

@ -38,9 +38,12 @@ public class HolidayBalanceSettingSaveReqVO {
@Schema(description = "是否按实际工作时长发放 0否 1是(例如每年1月1日发放6天假期入职时间是6月1日的员工则按照半年发放3天假期当余额出现小数时按四舍五入取整)")
private Integer actualWorkFlag;
@Schema(description = "有效期类型 1自发放日起1个月 2自发放日起1周年 3按入职日期起12个月 4自然年1月1日-12月31日 5每年固定时间作废 6永久有效 7每月固定时间作废 8每季末作废")
@Schema(description = "有效期类型 1自发放日起1个月 2自发放日起1周年 3按入职日期起12个月 4自然年1月1日-12月31日 5每年固定时间作废 6永久有效 7每月固定时间作废 8每季末作废 9加班多少天后作废")
private Integer validityPeriod;
@Schema(description = "加班多少天后作废")
private Integer afterFewDays;
@Schema(description = "每年固定时间作废格式 MM-dd 例如 09-10 每年9月10号作废", example = "12794")
private String fixedEveryYearInvalid;

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.system.dal.dataobject.holiday.holidaybalancesetting;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
@ -61,9 +62,13 @@ public class HolidayBalanceSettingDO extends BaseDO {
*/
private Integer actualWorkFlag;
/**
* 有效期类型 1自发放日起1个月 2自发放日起1周年 3按入职日期起12个月 4自然年1月1日-12月31日 5每年固定时间作废 6永久有效 7每月固定时间作废 8每季末作废
* 有效期类型 1自发放日起1个月 2自发放日起1周年 3按入职日期起12个月 4自然年1月1日-12月31日 5每年固定时间作废 6永久有效 7每月固定时间作废 8每季末作废 9加班多少天后作废
*/
private Integer validityPeriod;
/**
* 加班多少天后作废
*/
private Integer afterFewDays;
/**
* 每年固定时间作废格式 MM-dd 例如 09-10 每年9月10号作废
*/

View File

@ -538,8 +538,7 @@ public class HolidayUserRecordServiceImpl implements HolidayUserRecordService {
}
@Override
public Map<Long, LocalDateTime> validityPeriodCalculation(LocalDateTime now, Long
userId, HolidayBalanceSettingDO holidayBalanceSettingDO) {
public Map<Long, LocalDateTime> validityPeriodCalculation(LocalDateTime now, Long userId, HolidayBalanceSettingDO holidayBalanceSettingDO) {
LocalDateTime localDateTime = null;
Map<Long, LocalDateTime> map = new HashMap<>();
switch (holidayBalanceSettingDO.getValidityPeriod()) {
@ -584,6 +583,9 @@ public class HolidayUserRecordServiceImpl implements HolidayUserRecordService {
case 8:
localDateTime = LocalDateTimeUtils.getQuarterEnd(now);
break;
case 9:
localDateTime = now.plusDays(holidayBalanceSettingDO.getAfterFewDays());
break;
default:
}
if (holidayBalanceSettingDO.getExtensionAllowedFlag() != null &&