Merge branch 'susu' into dev

This commit is contained in:
주수현
2025-07-24 10:43:43 +09:00
8 changed files with 51 additions and 53 deletions

View File

@@ -91,11 +91,8 @@ public class DailyUtil {
* @return true=수정 가능, false=수정 불가 * @return true=수정 가능, false=수정 불가
*/ */
public boolean isModifiable(LocalDate startDate, LocalDate endDate) { public boolean isModifiable(LocalDate startDate, LocalDate endDate) {
//LocalDate limitStart = LocalDate.now().minusDays(DailyRecordConstants.MODIFY_LIMIT_DAY);
//return (limitStart.isBefore(startDate) || limitStart.isEqual(startDate) || limitStart.isEqual(endDate));
LocalDate today = LocalDate.now(); LocalDate today = LocalDate.now();
boolean isModifyPeriod = today.getDayOfMonth() <= DailyRecordConstants.MODIFY_LIMIT_DATE; boolean isModifyPeriod = today.getDayOfMonth() <= DailyRecordConstants.MODIFY_LIMIT_DAY;
LocalDate limitStart = isModifyPeriod? today.minusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).withDayOfMonth(1):today.minusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH-1).withDayOfMonth(1); LocalDate limitStart = isModifyPeriod? today.minusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).withDayOfMonth(1):today.minusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH-1).withDayOfMonth(1);
@@ -110,17 +107,27 @@ public class DailyUtil {
* @return true=등록 가능, false=등록 불가 * @return true=등록 가능, false=등록 불가
*/ */
public boolean isRegisterPossible(LocalDate startDate, LocalDate endDate) { public boolean isRegisterPossible(LocalDate startDate, LocalDate endDate) {
//LocalDate limitStart = LocalDate.now().minusDays(DailyRecordConstants.REGISTER_LIMIT_DAY);
//return (limitStart.isBefore(startDate) || limitStart.isEqual(startDate) || limitStart.isEqual(endDate));
LocalDate today = LocalDate.now(); LocalDate today = LocalDate.now();
boolean isModifyPeriod = today.getDayOfMonth() <= DailyRecordConstants.REGISTER_LIMIT_DATE; boolean isModifyPeriod = today.getDayOfMonth() <= DailyRecordConstants.REGISTER_LIMIT_DAY;
LocalDate limitStart = isModifyPeriod? today.minusMonths(DailyRecordConstants.REGISTER_LIMIT_MONTH).withDayOfMonth(1):today.minusMonths(DailyRecordConstants.REGISTER_LIMIT_MONTH-1).withDayOfMonth(1); LocalDate limitStart = isModifyPeriod? today.minusMonths(DailyRecordConstants.REGISTER_LIMIT_MONTH).withDayOfMonth(1):today.minusMonths(DailyRecordConstants.REGISTER_LIMIT_MONTH-1).withDayOfMonth(1);
return (limitStart.isBefore(startDate) || limitStart.isEqual(startDate) || limitStart.isEqual(endDate)); return (limitStart.isBefore(startDate) || limitStart.isEqual(startDate) || limitStart.isEqual(endDate));
} }
/**
* 오늘 날짜 기준으로 등록/수정 가능한 날짜 가져오기
*
*/
public LocalDate getLimitDate(){
LocalDate today = LocalDate.now();
boolean isModifyPeriod = today.getDayOfMonth() <= DailyRecordConstants.REGISTER_LIMIT_DAY;
return isModifyPeriod? today.minusMonths(DailyRecordConstants.REGISTER_LIMIT_MONTH).withDayOfMonth(1):today.minusMonths(DailyRecordConstants.REGISTER_LIMIT_MONTH-1).withDayOfMonth(1);
}
/** /**
* 문자형 타입의 숫자에 콤마 적용 * 문자형 타입의 숫자에 콤마 적용
* *

View File

@@ -35,41 +35,34 @@ public final class DailyRecordConstants {
*/ */
public static final String FORESTRY_EXPENSE_MARK = "81011"; public static final String FORESTRY_EXPENSE_MARK = "81011";
/**
* 일계부 등록 가능 일
* [정책] 15일전까지 데이터 등록 가능
*/
public static final int REGISTER_LIMIT_DAY = 60;
/** /**
* 일계부 등록 가능 월 * 일계부 등록 가능 월
* [정책] 월별 * [정책] 해당월 15일까지는 이전달 데이터 등록 가능
* 이전 달을 의미하는 상수
*/ */
public static final int REGISTER_LIMIT_MONTH = 1; public static final int REGISTER_LIMIT_MONTH = 1;
/** /**
* 일계부 등록 가능 일 * 일계부 등록 가능 일
* [정책] 15일전까지 데이터 등록 가능 * [정책] 해당월 15일까지는 이전달 데이터 등록 가능
* TODO : 15로 변경 * 날짜 기준 정책
* TODO 15로 변경
*/ */
public static final int REGISTER_LIMIT_DATE = 31; public static final int REGISTER_LIMIT_DAY = 31;
/** /**
* 일계부 수정 가능 일 * 일계부 수정 가능 월
* [정책] 15일전까지 데이터 수정 가능 * [정책] 해당월 15일까지는 이전달 데이터 수정 가능
*/ * 이전 달을 의미하는 상수
public static final int MODIFY_LIMIT_DAY = 60;
/**
* 일계부 수정 가능 일
* [정책] 15일전까지 데이터 수정 가능
* TODO : 15로 변경
*/
public static final int MODIFY_LIMIT_DATE = 31;
/**
* 일계부 수정 가능 일
* [정책] 월별
*/ */
public static final int MODIFY_LIMIT_MONTH = 1; public static final int MODIFY_LIMIT_MONTH = 1;
/**
* 일계부 수정 가능 일
* [정책] 해당월 15일까지는 이전달 데이터 수정 가능
* 날짜 기준 정책
* TODO : 15로 변경
*/
public static final int MODIFY_LIMIT_DAY = 31;
} }

View File

@@ -50,8 +50,8 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
monthlyStatus.isForestNone() ? "/info/monthly" : String.format("/info/monthly/month/%s", command.getSearchMonth()))); monthlyStatus.isForestNone() ? "/info/monthly" : String.format("/info/monthly/month/%s", command.getSearchMonth())));
YearMonth yearMonth = YearMonth.parse(command.getSearchMonth(), DateTimeFormatter.ofPattern("yyyyMM")); YearMonth yearMonth = YearMonth.parse(command.getSearchMonth(), DateTimeFormatter.ofPattern("yyyyMM"));
LocalDate maxMonth = DailyRecordConstants.MODIFY_LIMIT_DATE == 31 ? LocalDate maxMonth = DailyRecordConstants.MODIFY_LIMIT_DAY == 31 ?
yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth() : yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DATE); yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth() : yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DAY);
boolean editable = !LocalDate.now().isAfter(maxMonth); boolean editable = !LocalDate.now().isAfter(maxMonth);
monthlyList.add(new CalendarChildren( monthlyList.add(new CalendarChildren(
@@ -162,10 +162,8 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
@Override @Override
public int getDataNoneCountBySomeDayAfter(Long householdSeq) { public int getDataNoneCountBySomeDayAfter(Long householdSeq) {
// 검색 당일을 제외하여 -1 처리 LocalDate limitDate = dailyUtil.getLimitDate();
int limitDay = DailyRecordConstants.REGISTER_LIMIT_DAY - 1; return recordCalendarMapper.getDataNoneCountBySomeDayAfter(householdSeq, limitDate);
return recordCalendarMapper.getDataNoneCountBySomeDayAfter(householdSeq, limitDay);
} }
@Override @Override

View File

@@ -7,6 +7,7 @@ import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCa
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.time.LocalDate;
import java.util.List; import java.util.List;
@Mapper @Mapper
@@ -38,10 +39,10 @@ public interface RecordCalendarMapper {
* 등록가능 기간에 미등록된 데이터 개수 조회 * 등록가능 기간에 미등록된 데이터 개수 조회
* *
* @param householdSeq 임가회원 일련번호 * @param householdSeq 임가회원 일련번호
* @param limitDay 전일로부터 x일전 검색 일 * @param limitDate 입력 가능한 최소 날짜
* @return 미등록 건 수 * @return 미등록 건 수
*/ */
Integer getDataNoneCountBySomeDayAfter(@Param("householdSeq") Long householdSeq, @Param("limitDay") Integer limitDay); Integer getDataNoneCountBySomeDayAfter(@Param("householdSeq") Long householdSeq, @Param("limitDate") LocalDate limitDate);
/** /**
* 최신 등록일 데이터 조회 * 최신 등록일 데이터 조회

View File

@@ -83,10 +83,10 @@ class GetBankInputUIController {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMM"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMM");
YearMonth yearMonth = YearMonth.parse(currentMonthlyInfo.getMonth(), formatter); YearMonth yearMonth = YearMonth.parse(currentMonthlyInfo.getMonth(), formatter);
LocalDate maxMonth = DailyRecordConstants.MODIFY_LIMIT_DATE == 31 ? LocalDate maxMonth = DailyRecordConstants.MODIFY_LIMIT_DAY == 31 ?
yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth() : yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DATE); yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth() : yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DAY);
LocalDate minMonth = DailyRecordConstants.MODIFY_LIMIT_DATE == 31 ? LocalDate minMonth = DailyRecordConstants.MODIFY_LIMIT_DAY == 31 ?
yearMonth.minusMonths(1).plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth() : yearMonth.minusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DATE); yearMonth.minusMonths(1).plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth() : yearMonth.minusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DAY);
LocalDate today = LocalDate.now(); LocalDate today = LocalDate.now();

View File

@@ -82,10 +82,10 @@ class GetBankOutputUIController {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMM"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMM");
YearMonth yearMonth = YearMonth.parse(currentMonthlyInfo.getMonth(), formatter); YearMonth yearMonth = YearMonth.parse(currentMonthlyInfo.getMonth(), formatter);
LocalDate maxMonth = DailyRecordConstants.MODIFY_LIMIT_DATE == 31 ? LocalDate maxMonth = DailyRecordConstants.MODIFY_LIMIT_DAY == 31 ?
yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth() : yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DATE); yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth() : yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DAY);
LocalDate minMonth = DailyRecordConstants.MODIFY_LIMIT_DATE == 31 ? LocalDate minMonth = DailyRecordConstants.MODIFY_LIMIT_DAY == 31 ?
yearMonth.minusMonths(1).plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth() : yearMonth.minusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DATE); yearMonth.minusMonths(1).plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth() : yearMonth.minusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DAY);
LocalDate today = LocalDate.now(); LocalDate today = LocalDate.now();
boolean editable = !today.isAfter(maxMonth); boolean editable = !today.isAfter(maxMonth);

View File

@@ -117,9 +117,8 @@ class CreateMonthlyUIController {
//수정 가능 여부 판단 //수정 가능 여부 판단
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMM"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMM");
YearMonth yearMonth = YearMonth.parse(currentMonthlyInfo.getMonth(), formatter); YearMonth yearMonth = YearMonth.parse(currentMonthlyInfo.getMonth(), formatter);
//LocalDate maxMonth = yearMonth.plusMonths(1).atDay(15); LocalDate maxMonth = DailyRecordConstants.MODIFY_LIMIT_DAY == 31 ?
LocalDate maxMonth = DailyRecordConstants.MODIFY_LIMIT_DATE == 31 ? yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth() : yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DAY);
yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth() : yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DATE);
LocalDate today = LocalDate.now(); LocalDate today = LocalDate.now();
boolean editable = !today.isAfter(maxMonth); boolean editable = !today.isAfter(maxMonth);

View File

@@ -40,7 +40,7 @@
<select id="getDataNoneCountBySomeDayAfter"> <select id="getDataNoneCountBySomeDayAfter">
<![CDATA[ <![CDATA[
with register_period as ( with register_period as (
select generate_series((CURRENT_DATE - INTERVAL '${limitDay} days')::date , (CURRENT_DATE - INTERVAL '1 days')::date, '1 day'::interval)::date as record_date select generate_series(#{limitDate}::date , (CURRENT_DATE - INTERVAL '1 days')::date, '1 day'::interval)::date as record_date
) )
select count(rp.record_date) filter (where dr.id is null or dr.all_status = 'WAITING') select count(rp.record_date) filter (where dr.id is null or dr.all_status = 'WAITING')
from register_period rp from register_period rp