날짜 기준 15일 -> 월기준 15일로 변경 했는데 잘될지는 모르겟음 (TODO 15일로 변경 되어야됨)
임산물 / 은행자동이체도 바꾸엇지만 잘될지는 모르겠음,,,,ㅠ
This commit is contained in:
@@ -91,7 +91,13 @@ 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.MODIFIY_LIMIT_DAY);
|
//LocalDate limitStart = LocalDate.now().minusDays(DailyRecordConstants.MODIFY_LIMIT_DAY);
|
||||||
|
//return (limitStart.isBefore(startDate) || limitStart.isEqual(startDate) || limitStart.isEqual(endDate));
|
||||||
|
|
||||||
|
LocalDate today = LocalDate.now();
|
||||||
|
boolean isModifyPeriod = today.getDayOfMonth() <= DailyRecordConstants.MODIFY_LIMIT_DATE;
|
||||||
|
|
||||||
|
LocalDate limitStart = isModifyPeriod? today.minusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).withDayOfMonth(1):today.minusMonths(DailyRecordConstants.MODIFY_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));
|
||||||
}
|
}
|
||||||
@@ -104,7 +110,13 @@ 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);
|
//LocalDate limitStart = LocalDate.now().minusDays(DailyRecordConstants.REGISTER_LIMIT_DAY);
|
||||||
|
//return (limitStart.isBefore(startDate) || limitStart.isEqual(startDate) || limitStart.isEqual(endDate));
|
||||||
|
|
||||||
|
LocalDate today = LocalDate.now();
|
||||||
|
boolean isModifyPeriod = today.getDayOfMonth() <= DailyRecordConstants.REGISTER_LIMIT_DATE;
|
||||||
|
|
||||||
|
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));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,11 +39,37 @@ public final class DailyRecordConstants {
|
|||||||
* 일계부 등록 가능 일
|
* 일계부 등록 가능 일
|
||||||
* [정책] 15일전까지 데이터 등록 가능
|
* [정책] 15일전까지 데이터 등록 가능
|
||||||
*/
|
*/
|
||||||
public static final int REGISTER_LIMIT_DAY = 15;
|
public static final int REGISTER_LIMIT_DAY = 60;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 등록 가능 월
|
||||||
|
* [정책] 월별
|
||||||
|
*/
|
||||||
|
public static final int REGISTER_LIMIT_MONTH = 1;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 등록 가능 일
|
||||||
|
* [정책] 15일전까지 데이터 등록 가능
|
||||||
|
* TODO : 15로 변경
|
||||||
|
*/
|
||||||
|
public static final int REGISTER_LIMIT_DATE = 31;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 수정 가능 일
|
* 일계부 수정 가능 일
|
||||||
* [정책] 15일전까지 데이터 수정 가능
|
* [정책] 15일전까지 데이터 수정 가능
|
||||||
*/
|
*/
|
||||||
public static final int MODIFIY_LIMIT_DAY = 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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
|
import java.time.YearMonth;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@@ -48,12 +49,16 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
|
|||||||
monthlyStatus.isForestNone() ? 0 : 1,
|
monthlyStatus.isForestNone() ? 0 : 1,
|
||||||
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"));
|
||||||
|
LocalDate maxMonth = yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DATE);
|
||||||
|
boolean editable = !LocalDate.now().isAfter(maxMonth);
|
||||||
|
|
||||||
monthlyList.add(new CalendarChildren(
|
monthlyList.add(new CalendarChildren(
|
||||||
"BANK",
|
"BANK",
|
||||||
"은행 자동이체 내역 등록",
|
"은행 자동이체 내역 등록",
|
||||||
null,
|
null,
|
||||||
monthlyStatus.isBankNone() ? 0 : 1,
|
monthlyStatus.isBankNone() ? 0 : 1,
|
||||||
(LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMM")).equals(command.getSearchMonth())) ? "/info/bank" : null));
|
editable ? String.format("/info/bank/%s", command.getSearchMonth()) : null));
|
||||||
|
|
||||||
List<RecordCalendar> refineList = new ArrayList<>();
|
List<RecordCalendar> refineList = new ArrayList<>();
|
||||||
for (DailyRecordCalendarDto calendar : calendarList) {
|
for (DailyRecordCalendarDto calendar : calendarList) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package app.module.front.usecase.info.bankUI.getBankInputUI.adapters.web;
|
package app.module.front.usecase.info.bankUI.getBankInputUI.adapters.web;
|
||||||
|
|
||||||
import app.module.core.config.application.enums.MonthStatus;
|
import app.module.core.config.application.enums.MonthStatus;
|
||||||
|
import app.module.core.config.constants.DailyRecordConstants;
|
||||||
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
||||||
import app.module.front.config.application.util.AuthUtil;
|
import app.module.front.config.application.util.AuthUtil;
|
||||||
import app.module.front.usecase.info.bank.getBanks.ports.GetBanksPortIn;
|
import app.module.front.usecase.info.bank.getBanks.ports.GetBanksPortIn;
|
||||||
@@ -82,8 +83,8 @@ 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 = yearMonth.plusMonths(1).atDay(15);
|
LocalDate maxMonth = yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DATE);
|
||||||
LocalDate minMonth = yearMonth.minusMonths(1).atDay(15);
|
LocalDate minMonth = yearMonth.minusMonths(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);
|
||||||
boolean preEditable = !today.isBefore(minMonth);
|
boolean preEditable = !today.isBefore(minMonth);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package app.module.front.usecase.info.bankUI.getBankOutputUI.adapters.web;
|
package app.module.front.usecase.info.bankUI.getBankOutputUI.adapters.web;
|
||||||
|
|
||||||
import app.module.core.config.application.enums.MonthStatus;
|
import app.module.core.config.application.enums.MonthStatus;
|
||||||
|
import app.module.core.config.constants.DailyRecordConstants;
|
||||||
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
||||||
import app.module.front.config.application.util.AuthUtil;
|
import app.module.front.config.application.util.AuthUtil;
|
||||||
import app.module.front.usecase.info.bank.getBanks.ports.GetBanksPortIn;
|
import app.module.front.usecase.info.bank.getBanks.ports.GetBanksPortIn;
|
||||||
@@ -81,10 +82,11 @@ 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 = yearMonth.plusMonths(1).atDay(15);
|
LocalDate maxMonth = yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DATE);
|
||||||
LocalDate minMonth = yearMonth.minusMonths(1).atDay(15);
|
LocalDate minMonth = yearMonth.minusMonths(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);
|
||||||
|
|
||||||
boolean preEditable = !today.isBefore(minMonth);
|
boolean preEditable = !today.isBefore(minMonth);
|
||||||
|
|
||||||
model.addAttribute("pastMonthlyInfo", pastMonthlyInfo);
|
model.addAttribute("pastMonthlyInfo", pastMonthlyInfo);
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package app.module.front.usecase.info.monthlyUI.createMonthlyUI.adapters.web;
|
package app.module.front.usecase.info.monthlyUI.createMonthlyUI.adapters.web;
|
||||||
|
|
||||||
import app.module.core.config.application.enums.MonthStatus;
|
import app.module.core.config.application.enums.MonthStatus;
|
||||||
|
import app.module.core.config.constants.DailyRecordConstants;
|
||||||
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
||||||
import app.module.front.config.application.util.AuthUtil;
|
import app.module.front.config.application.util.AuthUtil;
|
||||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.GetMonthlyInputStatusPortIn;
|
import app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.GetMonthlyInputStatusPortIn;
|
||||||
@@ -16,6 +17,7 @@ import app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.por
|
|||||||
import app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProducts;
|
import app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProducts;
|
||||||
import app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProductsCmd;
|
import app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProductsCmd;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.Page;
|
||||||
import org.springframework.data.domain.PageRequest;
|
import org.springframework.data.domain.PageRequest;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
@@ -31,6 +33,7 @@ import java.time.YearMonth;
|
|||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
@Controller
|
@Controller
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
class CreateMonthlyUIController {
|
class CreateMonthlyUIController {
|
||||||
@@ -114,10 +117,12 @@ 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 = yearMonth.plusMonths(1).atDay(15);
|
||||||
|
LocalDate maxMonth = yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DATE);
|
||||||
|
log.info("####################maxMonth={}",maxMonth);
|
||||||
LocalDate today = LocalDate.now();
|
LocalDate today = LocalDate.now();
|
||||||
boolean editable = !today.isAfter(maxMonth);
|
boolean editable = !today.isAfter(maxMonth);
|
||||||
|
log.info("####################editable={}",editable);
|
||||||
|
|
||||||
model.addAttribute("pastMonthlyInfo", pastMonthlyInfo);
|
model.addAttribute("pastMonthlyInfo", pastMonthlyInfo);
|
||||||
model.addAttribute("currentMonthlyInfo", currentMonthlyInfo);
|
model.addAttribute("currentMonthlyInfo", currentMonthlyInfo);
|
||||||
|
|||||||
@@ -819,8 +819,7 @@
|
|||||||
|
|
||||||
// 오늘 날짜가 해당 달의 마지막 날인지 확인
|
// 오늘 날짜가 해당 달의 마지막 날인지 확인
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
//const lastDayOfMonth = new Date(today.getFullYear(), today.getMonth() + 1, 0); // 해당 달의 마지막 날
|
const lastDayOfMonth = new Date(today.getFullYear(), today.getMonth() + 1, 0); // 해당 달의 마지막 날
|
||||||
const lastDayOfMonth = new Date(today.getFullYear(), today.getMonth(), 22); // TODO 삭제 테스트를 위해 22일로 수정
|
|
||||||
// 마지막 alert 날짜 확인
|
// 마지막 alert 날짜 확인
|
||||||
const lastAlertDate = sessionStorage.getItem('lastAlertDate');
|
const lastAlertDate = sessionStorage.getItem('lastAlertDate');
|
||||||
const todayDateString = today.toDateString();
|
const todayDateString = today.toDateString();
|
||||||
|
|||||||
Reference in New Issue
Block a user