휴가관리 수정

This commit is contained in:
dyhj625 2025-02-28 13:05:26 +09:00
parent 6d46c07b29
commit 55c911a121
2 changed files with 20 additions and 12 deletions

View File

@ -222,27 +222,35 @@ public class localvacaService {
/**
* 연차 계산 로직
*/
private int procCalculateTotalVacation(LocalDate hireDate) {
LocalDate today = LocalDate.now();
public int procCalculateTotalVacation(LocalDate hireDate) {
LocalDate today = LocalDate.now(); //LocalDate.of(2027, 6, 15);
int yearsWorked = hireDate.until(today).getYears();
// 🔹 1년 미만: 연간 12개 지급
if (yearsWorked < 1) {
return 12;
}
// 🔹 1년 이상 기본 15개
// 🔹 입사 1년 후부터 기본 15개 지급
int totalVacation = 15;
LocalDate nextIncreaseDate = hireDate.plusYears(2).withMonth(1).withDayOfMonth(1);
LocalDate firstIncreaseDate = hireDate.plusYears(1).withMonth(1).withDayOfMonth(1);
// 🔹 2년마다 1개 추가
while (nextIncreaseDate.isBefore(today) || nextIncreaseDate.isEqual(today)) {
// 🔹 매년 1월 1일마다 15개씩 증가
while (firstIncreaseDate.isBefore(today) || firstIncreaseDate.isEqual(today)) {
totalVacation += 15;
firstIncreaseDate = firstIncreaseDate.plusYears(1);
}
// 🔹 입사월 기준으로 2년마다 1개 추가 증가
LocalDate additionalIncreaseDate = hireDate.plusYears(2).withMonth(hireDate.getMonthValue()).withDayOfMonth(1);
while (additionalIncreaseDate.isBefore(today) || additionalIncreaseDate.isEqual(today)) {
totalVacation += 1;
nextIncreaseDate = nextIncreaseDate.plusYears(2);
additionalIncreaseDate = additionalIncreaseDate.plusYears(2);
}
return totalVacation;
}
public List<MapDto> selectSentVacationCount(MapDto map) {
return localvacaMapper.selectSentVacationCount(map);

View File

@ -82,10 +82,10 @@ server:
secure: true
same-site: NONE
partitioned: true
ssl:
key-store: classpath:localhost.p12
key-store-password: pmgk1234
key-store-type: PKCS12
# ssl:
# key-store: classpath:localhost.p12
# key-store-password: pmgk1234
# key-store-type: PKCS12
logging:
level: