은행 자동 이체 내역 지난달 정보 가지고 오기 alert창 추가,,
This commit is contained in:
@@ -15,6 +15,7 @@ import app.module.front.usecase.info.monthly.getPrevMonthlyInputStatus.ports.app
|
||||
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 lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
@@ -28,6 +29,7 @@ import java.time.LocalDate;
|
||||
import java.time.YearMonth;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
@Slf4j
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
class GetBankInputUIController {
|
||||
@@ -38,7 +40,6 @@ class GetBankInputUIController {
|
||||
private final GetBanksPortIn getBanksPortIn;
|
||||
private final UICodeListPortIn uiCodeListPortIn;
|
||||
|
||||
|
||||
@GetMapping(path = "/info/bank/create/input/{id}")
|
||||
public String operate(Model model,
|
||||
@PathVariable Long id
|
||||
@@ -49,7 +50,6 @@ class GetBankInputUIController {
|
||||
|
||||
// 전달 입력 상태 취득 , 데이터가 없을 경우 null
|
||||
// 이전달 입력상태:NONE일 경우도 null
|
||||
|
||||
GetPrevMonthlyInputStatus pastMonthlyInfo =
|
||||
prevMonthlyInputStatusPortIn.operate(
|
||||
new GetPrevMonthlyInputStatusCmd(
|
||||
@@ -82,9 +82,10 @@ class GetBankInputUIController {
|
||||
YearMonth yearMonth = YearMonth.parse(currentMonthlyInfo.getMonth(), formatter);
|
||||
|
||||
LocalDate maxMonth = yearMonth.plusMonths(1).atDay(15);
|
||||
LocalDate minMonth = yearMonth.minusMonths(1).atDay(15);
|
||||
LocalDate today = LocalDate.now();
|
||||
boolean editable = !today.isAfter(maxMonth);
|
||||
|
||||
boolean preEditable = !today.isBefore(minMonth);
|
||||
|
||||
model.addAttribute("pastMonthlyInfo", pastMonthlyInfo);
|
||||
model.addAttribute("currentMonthlyInfo", currentMonthlyInfo);
|
||||
@@ -100,6 +101,7 @@ class GetBankInputUIController {
|
||||
|
||||
model.addAttribute("MonthStatus", MonthStatus.class);
|
||||
model.addAttribute("editable", editable);
|
||||
model.addAttribute("preEditable", preEditable);
|
||||
|
||||
|
||||
return "info/bank/input";
|
||||
|
||||
@@ -87,9 +87,10 @@ class GetBankOutputUIController {
|
||||
YearMonth yearMonth = YearMonth.parse(currentMonthlyInfo.getMonth(), formatter);
|
||||
|
||||
LocalDate maxMonth = yearMonth.plusMonths(1).atDay(15);
|
||||
LocalDate minMonth = yearMonth.minusMonths(1).atDay(15);
|
||||
LocalDate today = LocalDate.now();
|
||||
boolean editable = !today.isAfter(maxMonth);
|
||||
|
||||
boolean preEditable = !today.isBefore(minMonth);
|
||||
|
||||
model.addAttribute("pastMonthlyInfo", pastMonthlyInfo);
|
||||
model.addAttribute("currentMonthlyInfo", currentMonthlyInfo);
|
||||
@@ -105,7 +106,7 @@ class GetBankOutputUIController {
|
||||
|
||||
model.addAttribute("MonthStatus", MonthStatus.class);
|
||||
model.addAttribute("editable", editable);
|
||||
|
||||
model.addAttribute("preEditable", preEditable);
|
||||
|
||||
return "info/bank/output";
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<div class="inner">
|
||||
<hgroup class="tit-group">
|
||||
<h3>
|
||||
[[${currentMonthlyInfo.koreanMonth}]]의 <br>
|
||||
<strong>은행 자동이체(수입) 내역 <span id="totalItems">[[${bankList.totalElements}]]</span>건 등록</strong> 되었습니다.
|
||||
</h3>
|
||||
<p>수입 내역을 등록해 주세요.</p>
|
||||
@@ -105,6 +106,7 @@
|
||||
let ENV = {
|
||||
httpUrl: {
|
||||
root: /*[[#{uri.front.info.bank.path}]]*/ 'rootUrl',
|
||||
preMonth: /*[[|/info/bank/create/input|]]*/ 'preMonthUrl',
|
||||
save: /*[[|/api/front#{uri.front.info.bank.path}/create|]]*/ 'saveUrl'
|
||||
},
|
||||
module: {
|
||||
@@ -117,9 +119,12 @@
|
||||
bankList : /*[[${bankList.content}]]*/ [],
|
||||
pastBankList : /*[[${pastBankList.content}]]*/ [],
|
||||
id: /*[[${currentMonthlyInfo.id}]]*/'',
|
||||
currentMonth: /*[[${currentMonthlyInfo.month}]]*/'',
|
||||
currentStatus: /*[[${currentMonthlyInfo.bankAutoTransferInputStatus}]]*/'',
|
||||
pastStatus: /*[[${pastMonthlyInfo?.bankAutoTransferInputStatus}]]*/'',
|
||||
pastBankId: /*[[${pastMonthlyInfo?.id}]]*/'',
|
||||
editable: /*[[${editable}]]*/,
|
||||
preEditable: /*[[${preEditable}]]*/,
|
||||
},
|
||||
elementRefs: {
|
||||
// noDataCheckbox: document.getElementById("forestProductStatus"),
|
||||
@@ -198,11 +203,42 @@
|
||||
|
||||
const clearAllItems = document.getElementById('clearAllItems');
|
||||
|
||||
if (ENV.data.pastBankList.length == 0) {
|
||||
callPastInfoBtn.disabled = true;
|
||||
}
|
||||
|
||||
if (ENV.data.editable) {
|
||||
if(ENV.data.preEditable && ENV.data.pastBankList.length === 0 && ENV.data.currentMonth >= "202508"){
|
||||
callPastInfoBtn.disabled = true;
|
||||
debugger
|
||||
const handlePageShow = function(event) {
|
||||
if ('sessionStorage' in window && window['sessionStorage'] !== null) {
|
||||
// history.back으로 돌아온 경우 (navigation.type == 2)
|
||||
if (event.persisted || (window.performance && window.performance.navigation.type === 2)) {
|
||||
sessionStorage.removeItem('pastInputAlertShown'); // 플래그 제거
|
||||
return; // 알림창 표시하지 않음
|
||||
}
|
||||
|
||||
// 페이지가 처음 로드되었거나 새로고침된 경우 (navigation.type == 0 또는 1)
|
||||
if (event.persisted || (window.performance && window.performance.navigation.type <= 1)) {
|
||||
kri.isReturn = true;
|
||||
const hasShownAlert = sessionStorage.getItem('pastInputAlertShown');
|
||||
if (!hasShownAlert && ENV.data.pastBankList.length === 0) {
|
||||
callPastInfoBtn.disabled = true;
|
||||
etUI.dialog.alert({
|
||||
title: '지난달 정보 등록하기',
|
||||
message: '지난달 정보를 아직 입력하지 않으셨네요.\n정확한 조사를 위해 지난달 정보를 입력해주세요.\n\n확인 버튼을 누르시면 지난달 은행자동이체 내역등록으로 이동합니다.',
|
||||
type: 'alert',
|
||||
callback: function() {
|
||||
sessionStorage.setItem('pastInputAlertShown', 'true');
|
||||
location.href = ENV.httpUrl.preMonth + "/" + ENV.data.pastBankId;
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 초기 로드 시 실행
|
||||
handlePageShow({ persisted: false, performance: window.performance });
|
||||
|
||||
}
|
||||
if (ENV.data.currentStatus == "NONE") {
|
||||
if (ENV.data.pastStatus && ENV.data.pastStatus == "REGISTERED" && ENV.data.pastBankList.length > 0) {
|
||||
this.checkUsePastData();
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<div class="inner">
|
||||
<hgroup class="tit-group">
|
||||
<h3>
|
||||
[[${currentMonthlyInfo.koreanMonth}]]의 <br>
|
||||
<strong>은행 자동이체(지출) 내역 <span id="totalItems">[[${bankList.totalElements}]]</span>건 등록</strong> 되었습니다.
|
||||
</h3>
|
||||
<p>지출 내역을 등록해 주세요.</p>
|
||||
@@ -105,6 +106,7 @@
|
||||
let ENV = {
|
||||
httpUrl: {
|
||||
root: /*[[#{uri.front.info.bank.path}]]*/ 'rootUrl',
|
||||
preMonth: /*[[|/info/bank/create/output|]]*/ 'preMonthUrl',
|
||||
save: /*[[|/api/front#{uri.front.info.bank.path}/create|]]*/ 'saveUrl'
|
||||
},
|
||||
module: {
|
||||
@@ -119,7 +121,9 @@
|
||||
id: /*[[${currentMonthlyInfo.id}]]*/'',
|
||||
currentStatus: /*[[${currentMonthlyInfo.bankAutoTransferOutputStatus}]]*/'',
|
||||
pastStatus: /*[[${pastMonthlyInfo?.bankAutoTransferOutputStatus}]]*/'',
|
||||
pastBankId: /*[[${pastMonthlyInfo?.id}]]*/'',
|
||||
editable: /*[[${editable}]]*/,
|
||||
preEditable: /*[[${preEditable}]]*/,
|
||||
},
|
||||
elementRefs: {
|
||||
// noDataCheckbox: document.getElementById("forestProductStatus"),
|
||||
@@ -197,11 +201,44 @@
|
||||
|
||||
const clearAllItems = document.getElementById('clearAllItems');
|
||||
|
||||
if (ENV.data.pastBankList.length == 0) {
|
||||
callPastInfoBtn.disabled = true;
|
||||
}
|
||||
|
||||
if (ENV.data.editable) {
|
||||
|
||||
if (ENV.data.preEditable && ENV.data.pastBankList.length === 0 && ENV.data.currentMonth >= "202508") {
|
||||
callPastInfoBtn.disabled = true;
|
||||
|
||||
const handlePageShow = function(event) {
|
||||
if ('sessionStorage' in window && window['sessionStorage'] !== null) {
|
||||
// history.back으로 돌아온 경우 (navigation.type == 2)
|
||||
if (event.persisted || (window.performance && window.performance.navigation.type === 2)) {
|
||||
sessionStorage.removeItem('pastOutputAlertShown'); // 플래그 제거
|
||||
return; // 알림창 표시하지 않음
|
||||
}
|
||||
|
||||
// 페이지가 처음 로드되었거나 새로고침된 경우 (navigation.type == 0 또는 1)
|
||||
if (event.persisted || (window.performance && window.performance.navigation.type <= 1)) {
|
||||
kri.isReturn = true;
|
||||
const hasShownAlert = sessionStorage.getItem('pastOutputAlertShown');
|
||||
if (!hasShownAlert && ENV.data.pastBankList.length === 0) {
|
||||
callPastInfoBtn.disabled = true;
|
||||
etUI.dialog.alert({
|
||||
title: '지난달 정보 등록하기',
|
||||
message: '지난달 정보를 아직 입력하지 않으셨네요.\n정확한 조사를 위해 지난달 정보를 입력해주세요.\n\n확인 버튼을 누르시면 지난달 은행자동이체 내역등록으로 이동합니다.',
|
||||
type: 'alert',
|
||||
callback: function() {
|
||||
sessionStorage.setItem('pastOutputAlertShown', 'true');
|
||||
location.href = ENV.httpUrl.preMonth + "/" + ENV.data.pastBankId;
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// 초기 로드 시 실행
|
||||
handlePageShow({ persisted: false, performance: window.performance });
|
||||
}
|
||||
|
||||
if (ENV.data.currentStatus == "NONE") {
|
||||
if (ENV.data.pastStatus && ENV.data.pastStatus == "REGISTERED" && ENV.data.pastBankList.length > 0) {
|
||||
this.checkUsePastData();
|
||||
|
||||
Reference in New Issue
Block a user