지난달 분기도 수정

This commit is contained in:
주수현
2025-07-23 19:21:54 +09:00
parent 8d6b3add8e
commit 1b5b61d6ef
8 changed files with 33 additions and 27 deletions

View File

@@ -50,7 +50,7 @@ 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_MONTH == 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_DATE); yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth() : yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DATE);
boolean editable = !LocalDate.now().isAfter(maxMonth); boolean editable = !LocalDate.now().isAfter(maxMonth);

View File

@@ -83,14 +83,16 @@ 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_MONTH == 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_DATE); yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth() : yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DATE);
LocalDate minMonth = DailyRecordConstants.MODIFY_LIMIT_MONTH == 31 ? LocalDate minMonth = DailyRecordConstants.MODIFY_LIMIT_DATE == 31 ?
yearMonth.minusMonths(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_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.isAfter(minMonth);
model.addAttribute("pastMonthlyInfo", pastMonthlyInfo); model.addAttribute("pastMonthlyInfo", pastMonthlyInfo);
model.addAttribute("currentMonthlyInfo", currentMonthlyInfo); model.addAttribute("currentMonthlyInfo", currentMonthlyInfo);

View File

@@ -82,15 +82,15 @@ 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_MONTH == 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_DATE); yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth() : yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DATE);
LocalDate minMonth = DailyRecordConstants.MODIFY_LIMIT_MONTH == 31 ? LocalDate minMonth = DailyRecordConstants.MODIFY_LIMIT_DATE == 31 ?
yearMonth.minusMonths(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_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.isAfter(minMonth);
model.addAttribute("pastMonthlyInfo", pastMonthlyInfo); model.addAttribute("pastMonthlyInfo", pastMonthlyInfo);
model.addAttribute("currentMonthlyInfo", currentMonthlyInfo); model.addAttribute("currentMonthlyInfo", currentMonthlyInfo);

View File

@@ -118,10 +118,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 = yearMonth.plusMonths(1).atDay(15);
LocalDate maxMonth = DailyRecordConstants.MODIFY_LIMIT_MONTH == 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_DATE); yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth() : yearMonth.plusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atDay(DailyRecordConstants.MODIFY_LIMIT_DATE);
LocalDate minMonth = DailyRecordConstants.MODIFY_LIMIT_MONTH == 31 ?
yearMonth.minusMonths(DailyRecordConstants.MODIFY_LIMIT_MONTH).atEndOfMonth() : 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);

View File

@@ -51,6 +51,7 @@
<when test="order.property eq 'updatedAt'">a.updated_at</when> <when test="order.property eq 'updatedAt'">a.updated_at</when>
<when test="order.property eq 'createdBy'">a.created_by</when> <when test="order.property eq 'createdBy'">a.created_by</when>
<when test="order.property eq 'createdAt'">a.created_at</when> <when test="order.property eq 'createdAt'">a.created_at</when>
<when test="order.property eq 'month'">a.month</when>
<otherwise>a.id</otherwise> <otherwise>a.id</otherwise>
</choose> </choose>
<choose> <choose>
@@ -58,6 +59,7 @@
<otherwise>ASC</otherwise> <otherwise>ASC</otherwise>
</choose> </choose>
</foreach> </foreach>
OFFSET #{pageable.offset} ROWS FETCH NEXT #{pageable.pageSize} ROWS ONLY OFFSET #{pageable.offset} ROWS FETCH NEXT #{pageable.pageSize} ROWS ONLY
</if> </if>
</select> </select>

View File

@@ -20,7 +20,6 @@
a.updated_by AS updatedBy a.updated_by AS updatedBy
FROM monthly_input_status a FROM monthly_input_status a
WHERE a.is_deleted = false WHERE a.is_deleted = false
AND a.forest_product_status != 'NONE'
AND a.household_seq = #{householdSeq} AND a.household_seq = #{householdSeq}
AND a.month = ( AND a.month = (
SELECT TO_CHAR(TO_DATE(month, 'YYYYMM') - INTERVAL '1 month', 'YYYYMM') SELECT TO_CHAR(TO_DATE(month, 'YYYYMM') - INTERVAL '1 month', 'YYYYMM')

View File

@@ -123,6 +123,7 @@
currentStatus: /*[[${currentMonthlyInfo.bankAutoTransferInputStatus}]]*/'', currentStatus: /*[[${currentMonthlyInfo.bankAutoTransferInputStatus}]]*/'',
pastStatus: /*[[${pastMonthlyInfo?.bankAutoTransferInputStatus}]]*/'', pastStatus: /*[[${pastMonthlyInfo?.bankAutoTransferInputStatus}]]*/'',
pastBankId: /*[[${pastMonthlyInfo?.id}]]*/'', pastBankId: /*[[${pastMonthlyInfo?.id}]]*/'',
pastMonth: /*[[${pastMonthlyInfo?.month}]]*/'',
editable: /*[[${editable}]]*/, editable: /*[[${editable}]]*/,
preEditable: /*[[${preEditable}]]*/, preEditable: /*[[${preEditable}]]*/,
}, },
@@ -207,29 +208,31 @@
if( ENV.data.pastBankList.length === 0) { if( ENV.data.pastBankList.length === 0) {
callPastInfoBtn.disabled = true; callPastInfoBtn.disabled = true;
if (ENV.data.preEditable && ENV.data.pastBankList.length === 0 && ENV.data.currentMonth >= "202508") { //if (ENV.data.preEditable && ENV.data.pastBankList.length === 0 && ENV.data.currentMonth >= "202508") {
if (ENV.data.preEditable && ENV.data.pastBankList.length === 0 ) {
const handlePageShow = function (event) { const handlePageShow = function (event) {
if ('sessionStorage' in window && window['sessionStorage'] !== null) { if ('sessionStorage' in window && window['sessionStorage'] !== null) {
// history.back으로 돌아온 경우 (navigation.type == 2) // history.back으로 돌아온 경우 (navigation.type == 2)
console.log("window.performance.navigation.type ",window.performance.navigation.type );
if (event.persisted || (window.performance && window.performance.navigation.type === 2)) { if (event.persisted || (window.performance && window.performance.navigation.type === 2)) {
sessionStorage.removeItem('pastInputAlertShown'); // 플래그 제거 sessionStorage.removeItem('pastInputAlertShown'); // 플래그 제거
return; // 알림창 표시하지 않음 return; // 알림창 표시하지 않음
} } else if (event.persisted || (window.performance && window.performance.navigation.type <= 1)) {
// 페이지가 처음 로드되었거나 새로고침된 경우 (navigation.type == 0 또는 1)
// 페이지가 처음 로드되었거나 새로고침된 경우 (navigation.type == 0 또는 1)
if (event.persisted || (window.performance && window.performance.navigation.type <= 1)) {
kri.isReturn = true; kri.isReturn = true;
const hasShownAlert = sessionStorage.getItem('pastInputAlertShown'); const hasShownAlert = sessionStorage.getItem('pastInputAlertShown');
if (!hasShownAlert && ENV.data.pastBankList.length === 0) { if (hasShownAlert !== ENV.data.currentMonth && hasShownAlert !== ENV.data.pastMonth && ENV.data.pastBankList.length === 0) {
etUI.dialog.alert({ etUI.dialog.alert({
title: '지난달 정보 등록하기', title: '지난달 정보 등록하기',
message: '지난달 정보를 아직 입력하지 않으셨네요.\n정확한 조사를 위해 지난달 정보를 입력해주세요.\n\n확인 버튼을 누르시면 지난달 은행자동이체 내역등록으로 이동합니다.', message: '지난달 정보를 아직 입력하지 않으셨네요.\n정확한 조사를 위해 지난달 정보를 입력해주세요.\n\n확인 버튼을 누르시면 지난달 은행자동이체 내역등록으로 이동합니다.',
type: 'alert', type: 'alert',
callback: function () { callback: function () {
sessionStorage.setItem('pastInputAlertShown', 'true'); sessionStorage.setItem('pastInputAlertShown', ENV.data.pastMonth);
location.href = ENV.httpUrl.preMonth + "/" + ENV.data.pastBankId; location.href = ENV.httpUrl.preMonth + "/" + ENV.data.pastBankId;
}, },
}); });
} else if(hasShownAlert === ENV.data.pastMonth) {
sessionStorage.removeItem('pastInputAlertShown');
} }
} }
} }

View File

@@ -122,6 +122,7 @@
currentStatus: /*[[${currentMonthlyInfo.bankAutoTransferOutputStatus}]]*/'', currentStatus: /*[[${currentMonthlyInfo.bankAutoTransferOutputStatus}]]*/'',
pastStatus: /*[[${pastMonthlyInfo?.bankAutoTransferOutputStatus}]]*/'', pastStatus: /*[[${pastMonthlyInfo?.bankAutoTransferOutputStatus}]]*/'',
pastBankId: /*[[${pastMonthlyInfo?.id}]]*/'', pastBankId: /*[[${pastMonthlyInfo?.id}]]*/'',
pastMonth: /*[[${pastMonthlyInfo?.month}]]*/'',
editable: /*[[${editable}]]*/, editable: /*[[${editable}]]*/,
preEditable: /*[[${preEditable}]]*/, preEditable: /*[[${preEditable}]]*/,
}, },
@@ -204,7 +205,8 @@
if (ENV.data.editable) { if (ENV.data.editable) {
if (ENV.data.preEditable && ENV.data.pastBankList.length === 0 && ENV.data.currentMonth >= "202508") { //if (ENV.data.preEditable && ENV.data.pastBankList.length === 0 && ENV.data.currentMonth >= "202508") {
if (ENV.data.preEditable && ENV.data.pastBankList.length === 0) {
callPastInfoBtn.disabled = true; callPastInfoBtn.disabled = true;
const handlePageShow = function(event) { const handlePageShow = function(event) {
@@ -213,23 +215,23 @@
if (event.persisted || (window.performance && window.performance.navigation.type === 2)) { if (event.persisted || (window.performance && window.performance.navigation.type === 2)) {
sessionStorage.removeItem('pastOutputAlertShown'); // 플래그 제거 sessionStorage.removeItem('pastOutputAlertShown'); // 플래그 제거
return; // 알림창 표시하지 않음 return; // 알림창 표시하지 않음
} }else if (event.persisted || (window.performance && window.performance.navigation.type <= 1)) {
// 페이지가 처음 로드되었거나 새로고침된 경우 (navigation.type == 0 또는 1)
// 페이지가 처음 로드되었거나 새로고침된 경우 (navigation.type == 0 또는 1)
if (event.persisted || (window.performance && window.performance.navigation.type <= 1)) {
kri.isReturn = true; kri.isReturn = true;
const hasShownAlert = sessionStorage.getItem('pastOutputAlertShown'); const hasShownAlert = sessionStorage.getItem('pastOutputAlertShown');
if (!hasShownAlert && ENV.data.pastBankList.length === 0) { if (hasShownAlert !== ENV.data.currentMonth && hasShownAlert !== ENV.data.pastMonth && ENV.data.pastBankList.length === 0) {
callPastInfoBtn.disabled = true; callPastInfoBtn.disabled = true;
etUI.dialog.alert({ etUI.dialog.alert({
title: '지난달 정보 등록하기', title: '지난달 정보 등록하기',
message: '지난달 정보를 아직 입력하지 않으셨네요.\n정확한 조사를 위해 지난달 정보를 입력해주세요.\n\n확인 버튼을 누르시면 지난달 은행자동이체 내역등록으로 이동합니다.', message: '지난달 정보를 아직 입력하지 않으셨네요.\n정확한 조사를 위해 지난달 정보를 입력해주세요.\n\n확인 버튼을 누르시면 지난달 은행자동이체 내역등록으로 이동합니다.',
type: 'alert', type: 'alert',
callback: function() { callback: function() {
sessionStorage.setItem('pastOutputAlertShown', 'true'); sessionStorage.setItem('pastOutputAlertShown', ENV.data.pastMonth);
location.href = ENV.httpUrl.preMonth + "/" + ENV.data.pastBankId; location.href = ENV.httpUrl.preMonth + "/" + ENV.data.pastBankId;
}, },
}); });
} else if (hasShownAlert === ENV.data.pastMonth) {
sessionStorage.removeItem('pastOutputAlertShown');
} }
} }
} }