From 55c911a1219b538f4fee50b0d6f424c489d78a7d Mon Sep 17 00:00:00 2001 From: dyhj625 Date: Fri, 28 Feb 2025 13:05:26 +0900 Subject: [PATCH] =?UTF-8?q?=ED=9C=B4=EA=B0=80=EA=B4=80=EB=A6=AC=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../localhost/service/localvacaService.java | 24 ++++++++++++------- src/main/resources/application.yml | 8 +++---- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/main/java/io/company/localhost/service/localvacaService.java b/src/main/java/io/company/localhost/service/localvacaService.java index 5b6dd27..dc847d6 100644 --- a/src/main/java/io/company/localhost/service/localvacaService.java +++ b/src/main/java/io/company/localhost/service/localvacaService.java @@ -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 selectSentVacationCount(MapDto map) { return localvacaMapper.selectSentVacationCount(map); diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 7060bfc..065e8f1 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -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: