휴가관리 수정

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

View File

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