Merge remote-tracking branch 'origin/dev' into bo_daily

This commit is contained in:
김현주
2025-06-27 18:10:18 +09:00
6 changed files with 109 additions and 95 deletions

View File

@@ -61,7 +61,8 @@ class CreateBankInputController {
//TODO 트렌젝션 고려 //TODO 트렌젝션 고려
removeBanksPortIn.operate(new RemoveBanksCmd(currentMonthlyInfo.getId(), AuthUtil.getUserSeq(), reqVO.getTransferType())); removeBanksPortIn.operate(new RemoveBanksCmd(currentMonthlyInfo.getId(), AuthUtil.getUserSeq(), reqVO.getTransferType()));
if (!reqVO.getStatus() && reqVO.getBankList() != null && !reqVO.getBankList().isEmpty()) { // 등록없음 처리가 아님. // if (!reqVO.getStatus() && reqVO.getBankList() != null && !reqVO.getBankList().isEmpty()) { // 등록없음 처리가 아님.
if (reqVO.getBankList() != null && !reqVO.getBankList().isEmpty()) { // 등록없음 처리가 아님.
for (CreateBankInputProductReqVO item : reqVO.getBankList()) { for (CreateBankInputProductReqVO item : reqVO.getBankList()) {
UICodeView code = uiCodeViewPortIn.connect(item.getTransferCategoryCode()).orElse(null); UICodeView code = uiCodeViewPortIn.connect(item.getTransferCategoryCode()).orElse(null);
@@ -99,16 +100,17 @@ class CreateBankInputController {
reqVO.getTransferType().equals("code.bank.input") ? MonthStatus.REGISTERED : currentMonthlyInfo.getBankAutoTransferInputStatus(), reqVO.getTransferType().equals("code.bank.input") ? MonthStatus.REGISTERED : currentMonthlyInfo.getBankAutoTransferInputStatus(),
reqVO.getTransferType().equals("code.bank.output") ? MonthStatus.REGISTERED : currentMonthlyInfo.getBankAutoTransferOutputStatus() reqVO.getTransferType().equals("code.bank.output") ? MonthStatus.REGISTERED : currentMonthlyInfo.getBankAutoTransferOutputStatus()
)); ));
} else {
updateMonthlyInputStatusPortIn.operate(new UpdateMonthlyInputStatusCmd(
currentMonthlyInfo.getId(),
AuthUtil.getUserSeq(),
currentMonthlyInfo.getMonth(),
currentMonthlyInfo.getBankAutoTransferInputStatus(),
reqVO.getTransferType().equals("code.bank.input") ? MonthStatus.NOTHING : currentMonthlyInfo.getBankAutoTransferInputStatus(),
reqVO.getTransferType().equals("code.bank.output") ? MonthStatus.NOTHING : currentMonthlyInfo.getBankAutoTransferOutputStatus()
));
} }
// else {
// updateMonthlyInputStatusPortIn.operate(new UpdateMonthlyInputStatusCmd(
// currentMonthlyInfo.getId(),
// AuthUtil.getUserSeq(),
// currentMonthlyInfo.getMonth(),
// currentMonthlyInfo.getBankAutoTransferInputStatus(),
// reqVO.getTransferType().equals("code.bank.input") ? MonthStatus.NOTHING : currentMonthlyInfo.getBankAutoTransferInputStatus(),
// reqVO.getTransferType().equals("code.bank.output") ? MonthStatus.NOTHING : currentMonthlyInfo.getBankAutoTransferOutputStatus()
// ));
// }
return ResponseEntity.ok(ApiResponse.success(null)); return ResponseEntity.ok(ApiResponse.success(null));
} else { } else {
return ResponseEntity.ok(ApiResponse.failure(null)); return ResponseEntity.ok(ApiResponse.failure(null));

View File

@@ -13,7 +13,7 @@ import java.util.List;
public class CreateBankInputReqVO { public class CreateBankInputReqVO {
private Boolean status; // private Boolean status;
private Long id; private Long id;
private String transferType; private String transferType;
private List<CreateBankInputProductReqVO> bankList; private List<CreateBankInputProductReqVO> bankList;

View File

@@ -23,7 +23,7 @@
AND a.forest_product_status != 'NONE' 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, 'YYYY-MM') - INTERVAL '1 month', 'YYYY-MM') SELECT TO_CHAR(TO_DATE(month, 'YYYYMM') - INTERVAL '1 month', 'YYYYMM')
FROM monthly_input_status FROM monthly_input_status
WHERE is_deleted = false AND id = #{id} WHERE is_deleted = false AND id = #{id}
); );

View File

@@ -172,7 +172,7 @@ kri.form.errorInit = function (formElement) {
if (formElement.length > 0) { if (formElement.length > 0) {
$(formElement).find('.component-input').removeClass('input-invalid'); $(formElement).find('.component-input').removeClass('input-invalid');
$(formElement).find('.input-flex-group').removeClass('invalid'); $(formElement).find('.input-flex-group').removeClass('invalid');
$(formElement).find('.select-group').removeClass('select-invalid'); $(formElement).find('.select-group').removeClass('input-invalid');
$(formElement).find('.input-info').each(function () { $(formElement).find('.input-info').each(function () {
$(this).remove(); $(this).remove();
}); });
@@ -238,11 +238,12 @@ kri.form.error = function(errorList){
} }
}); });
if(errorList && errorList.length > 0){ // 포커스 이동
const target = $('[name="' + errorList[0].field + '"]'); if ($('.input-invalid').length != 0) {
if (target.length > 0) { $('.input-invalid').eq(0).find('input').focus();
target.focus();
} }
if ($('.select-invalid').length != 0) {
$('.select-invalid').eq(0).find('button').focus();
} }
} }

View File

@@ -31,18 +31,18 @@
<span class="btn-txt">추가 등록</span> <span class="btn-txt">추가 등록</span>
</button> </button>
<button type="button" class="btn btn-m btn-link btn-full" id="callPastInfoBtn"> <button type="button" class="btn btn-m btn-link btn-full" id="callPastInfoBtn" onclick="formControl.checkUsePastData()">
<span class="btn-txt">이전 정보 불러오기</span> <span class="btn-txt">이전 정보 불러오기</span>
</button> </button>
<div class="component-input align-center" id="forestProductStatusDiv"> <!-- <div class="component-input align-center" id="forestProductStatusDiv">-->
<label class="checkbox-inner"> <!-- <label class="checkbox-inner">-->
<input type="checkbox" id="forestProductStatus" name="forestProductStatus" <!-- <input type="checkbox" id="forestProductStatus" name="forestProductStatus"-->
th:value="${MonthStatus.NOTHING}" onchange="formControl.handleNoDataToggle()"> <!-- th:value="${MonthStatus.NOTHING}" onchange="formControl.handleNoDataToggle()">-->
<span class="checkbox-item"><span class="checkbox-txt">이번달 등록내용 없음</span></span> <!-- <span class="checkbox-item"><span class="checkbox-txt">이번달 등록내용 없음</span></span>-->
</label> <!-- </label>-->
</div> <!-- </div>-->
</section> </section>
@@ -97,7 +97,7 @@
</div>"/api/front/info/bank/create" </div>
<section layout:fragment="script"> <section layout:fragment="script">
<script th:inline="javascript"> <script th:inline="javascript">
@@ -122,7 +122,7 @@
editable: /*[[${editable}]]*/, editable: /*[[${editable}]]*/,
}, },
elementRefs: { elementRefs: {
noDataCheckbox: document.getElementById("forestProductStatus"), // noDataCheckbox: document.getElementById("forestProductStatus"),
select:{ select:{
cropCodeSelect : null, cropCodeSelect : null,
transferCategoryCodeSelect : null, transferCategoryCodeSelect : null,
@@ -190,7 +190,7 @@
const callPastInfoBtn = document.getElementById("callPastInfoBtn"); const callPastInfoBtn = document.getElementById("callPastInfoBtn");
//데이터 없음 버튼 //데이터 없음 버튼
const forestProductStatus = document.getElementById("forestProductStatus"); // const forestProductStatus = document.getElementById("forestProductStatus");
//등록 완료 버튼 //등록 완료 버튼
const next = document.getElementById('complateBtn'); const next = document.getElementById('complateBtn');
@@ -206,15 +206,16 @@
if (ENV.data.pastStatus && ENV.data.pastStatus == "REGISTERED" && ENV.data.pastBankList.length > 0) { if (ENV.data.pastStatus && ENV.data.pastStatus == "REGISTERED" && ENV.data.pastBankList.length > 0) {
this.checkUsePastData(); this.checkUsePastData();
} }
} else if (ENV.data.currentStatus == "NOTHING") { // }
// else if (ENV.data.currentStatus == "NOTHING") {
//
addItemBtn.disabled = true; //
icon.classList.toggle("ico-add", false); // addItemBtn.disabled = true;
icon.classList.toggle("ico-add-disabled", true); // icon.classList.toggle("ico-add", false);
callPastInfoBtn.disabled = true; // icon.classList.toggle("ico-add-disabled", true);
forestProductStatus.checked = true; // callPastInfoBtn.disabled = true;
next.disabled = true; // forestProductStatus.checked = true;
// next.disabled = true;
} else if (ENV.data.currentStatus == "REGISTERED") { } else if (ENV.data.currentStatus == "REGISTERED") {
if (ENV.data.bankList.length > 0) { if (ENV.data.bankList.length > 0) {
@@ -240,7 +241,7 @@
icon.classList.toggle("ico-add", false); icon.classList.toggle("ico-add", false);
icon.classList.toggle("ico-add-disabled", true); icon.classList.toggle("ico-add-disabled", true);
callPastInfoBtn.disabled = true; callPastInfoBtn.disabled = true;
forestProductStatus.disabled = true; // forestProductStatus.disabled = true;
next.disabled = true; next.disabled = true;
next.style.display = "none"; next.style.display = "none";
clearAllItems.style.display = "none"; clearAllItems.style.display = "none";
@@ -322,30 +323,33 @@
updateLayout() { updateLayout() {
const isChecked = ENV.elementRefs.noDataCheckbox.checked;
// const isChecked = ENV.elementRefs.noDataCheckbox.checked;
const btn = document.getElementById("addItemBtn"); const btn = document.getElementById("addItemBtn");
const icon = btn.querySelector("i"); const icon = btn.querySelector("i");
const status = document.getElementById('forestProductStatusDiv'); // const status = document.getElementById('forestProductStatusDiv');
const callPastInfoBtn = document.getElementById("callPastInfoBtn"); const callPastInfoBtn = document.getElementById("callPastInfoBtn");
const next = document.getElementById('complateBtn'); const next = document.getElementById('complateBtn');
const header = document.getElementById('listHeader'); const header = document.getElementById('listHeader');
const count = document.getElementById('listCount'); const count = document.getElementById('listCount');
const totalItems = document.getElementById('totalItems');
const total = ENV.data.bankList.length; const total = ENV.data.bankList.length;
const isData = total > 0;
header.style.display = isData ? '' : 'none';
header.style.display = total > 0 ? '' : 'none'; // status.style.display = total > 0 ? 'none' : '';
status.style.display = total > 0 ? 'none' : ''; callPastInfoBtn.style.display = isData? 'none' : '';
callPastInfoBtn.style.display = total > 0 ? 'none' : '';
count.textContent = total; count.textContent = total;
totalItems.textContent = total;
btn.disabled = isChecked; btn.disabled = isData;
icon.classList.toggle("ico-add", !isChecked); icon.classList.toggle("ico-add", !isData);
icon.classList.toggle("ico-add-disabled", isChecked); icon.classList.toggle("ico-add-disabled", isData);
if (isChecked) { if (isData) {
next.disabled = !isChecked; next.disabled = !isData;
} else { } else {
next.disabled = total <= 0; next.disabled = total <= 0;
} }
@@ -474,9 +478,6 @@
ENV.data.bankList = []; ENV.data.bankList = [];
document.getElementById('listBody').innerHTML = ''; document.getElementById('listBody').innerHTML = '';
formControl.updateLayout(); formControl.updateLayout();
// TODO(ks): 선택 삭제 시 전체 count 미반영 중. 일단 전체 초기화에서만 count 갱신.
document.getElementById('totalItems').textContent = ENV.data.bankList.length;
}, },
}); });
}, },
@@ -487,7 +488,7 @@
ajaxUtil._ajaxAsync( ajaxUtil._ajaxAsync(
ENV.httpUrl.save, ENV.httpUrl.save,
{ {
status: ENV.elementRefs.noDataCheckbox.checked, // status: ENV.elementRefs.noDataCheckbox.checked,
id: ENV.data.id, id: ENV.data.id,
transferType:"code.bank.input", transferType:"code.bank.input",
bankList: ENV.data.bankList bankList: ENV.data.bankList
@@ -532,10 +533,14 @@
: `${getCategory(categoryCode)}`; : `${getCategory(categoryCode)}`;
let tagCount = ''; let tagCount = '';
if(product.count && product.unitCode != "code.record.unit.self"){ if (product.count > 0) {
tagCount = `<li><p>수량</p><span>${format(product.count)}${getUnit(product.unitCode)}</span></li>`; const unitText = product.unitCode !== 'code.record.unit.self'
? getUnit(product.unitCode)
: product.unit;
tagCount = `<li><p>수량</p><span>${format(product.count)}${unitText}</span></li>`;
} else { } else {
tagCount = `<li><p>수량</p><span>${format(product.count)}${product.unit}</span></li>` tagCount = '';
} }
const buttonGroupHtml = isEdit const buttonGroupHtml = isEdit
@@ -557,7 +562,9 @@
${buttonGroupHtml} ${buttonGroupHtml}
</div> </div>
<ul class="detail-list"> <ul class="detail-list">
<li><p>재배형태</p><span>${getCrop(product.cropCode)}</span></li> ${product.cropCode != null && product.cropCode != ''
? `<li><p>재배형태</p><span>${getCrop(product.cropCode)}</span></li>`
: ''}
${product.sourcePurpose != null && product.sourcePurpose != '' ${product.sourcePurpose != null && product.sourcePurpose != ''
? `<li><p>수입원</p><span>${product.sourcePurpose}</span></li>` ? `<li><p>수입원</p><span>${product.sourcePurpose}</span></li>`
: ''} : ''}

View File

@@ -31,18 +31,18 @@
<span class="btn-txt">추가 등록</span> <span class="btn-txt">추가 등록</span>
</button> </button>
<button type="button" class="btn btn-m btn-link btn-full" id="callPastInfoBtn"> <button type="button" class="btn btn-m btn-link btn-full" id="callPastInfoBtn" onclick="formControl.checkUsePastData()">
<span class="btn-txt">이전 정보 불러오기</span> <span class="btn-txt">이전 정보 불러오기</span>
</button> </button>
<div class="component-input align-center" id="forestProductStatusDiv"> <!-- <div class="component-input align-center" id="forestProductStatusDiv">-->
<label class="checkbox-inner"> <!-- <label class="checkbox-inner">-->
<input type="checkbox" id="forestProductStatus" name="forestProductStatus" <!-- <input type="checkbox" id="forestProductStatus" name="forestProductStatus"-->
th:value="${MonthStatus.NOTHING}" onchange="formControl.handleNoDataToggle()"> <!-- th:value="${MonthStatus.NOTHING}" onchange="formControl.handleNoDataToggle()">-->
<span class="checkbox-item"><span class="checkbox-txt">이번달 등록내용 없음</span></span> <!-- <span class="checkbox-item"><span class="checkbox-txt">이번달 등록내용 없음</span></span>-->
</label> <!-- </label>-->
</div> <!-- </div>-->
</section> </section>
@@ -122,7 +122,7 @@
editable: /*[[${editable}]]*/, editable: /*[[${editable}]]*/,
}, },
elementRefs: { elementRefs: {
noDataCheckbox: document.getElementById("forestProductStatus"), // noDataCheckbox: document.getElementById("forestProductStatus"),
select:{ select:{
transferCategoryCodeSelect : null, transferCategoryCodeSelect : null,
unitCodeSelect : null, unitCodeSelect : null,
@@ -189,7 +189,7 @@
const callPastInfoBtn = document.getElementById("callPastInfoBtn"); const callPastInfoBtn = document.getElementById("callPastInfoBtn");
//데이터 없음 버튼 //데이터 없음 버튼
const forestProductStatus = document.getElementById("forestProductStatus"); // const forestProductStatus = document.getElementById("forestProductStatus");
//등록 완료 버튼 //등록 완료 버튼
const next = document.getElementById('complateBtn'); const next = document.getElementById('complateBtn');
@@ -205,15 +205,15 @@
if (ENV.data.pastStatus && ENV.data.pastStatus == "REGISTERED" && ENV.data.pastBankList.length > 0) { if (ENV.data.pastStatus && ENV.data.pastStatus == "REGISTERED" && ENV.data.pastBankList.length > 0) {
this.checkUsePastData(); this.checkUsePastData();
} }
} else if (ENV.data.currentStatus == "NOTHING") { // } else if (ENV.data.currentStatus == "NOTHING") {
//
//
addItemBtn.disabled = true; // addItemBtn.disabled = true;
icon.classList.toggle("ico-add", false); // icon.classList.toggle("ico-add", false);
icon.classList.toggle("ico-add-disabled", true); // icon.classList.toggle("ico-add-disabled", true);
callPastInfoBtn.disabled = true; // callPastInfoBtn.disabled = true;
forestProductStatus.checked = true; // forestProductStatus.checked = true;
next.disabled = true; // next.disabled = true;
} else if (ENV.data.currentStatus == "REGISTERED") { } else if (ENV.data.currentStatus == "REGISTERED") {
if (ENV.data.bankList.length > 0) { if (ENV.data.bankList.length > 0) {
@@ -239,7 +239,7 @@
icon.classList.toggle("ico-add", false); icon.classList.toggle("ico-add", false);
icon.classList.toggle("ico-add-disabled", true); icon.classList.toggle("ico-add-disabled", true);
callPastInfoBtn.disabled = true; callPastInfoBtn.disabled = true;
forestProductStatus.disabled = true; // forestProductStatus.disabled = true;
next.disabled = true; next.disabled = true;
next.style.display = "none"; next.style.display = "none";
clearAllItems.style.display = "none"; clearAllItems.style.display = "none";
@@ -313,30 +313,33 @@
updateLayout() { updateLayout() {
const isChecked = ENV.elementRefs.noDataCheckbox.checked; // const isChecked = ENV.elementRefs.noDataCheckbox.checked;
const btn = document.getElementById("addItemBtn"); const btn = document.getElementById("addItemBtn");
const icon = btn.querySelector("i"); const icon = btn.querySelector("i");
const status = document.getElementById('forestProductStatusDiv'); // const status = document.getElementById('forestProductStatusDiv');
const callPastInfoBtn = document.getElementById("callPastInfoBtn"); const callPastInfoBtn = document.getElementById("callPastInfoBtn");
const next = document.getElementById('complateBtn'); const next = document.getElementById('complateBtn');
const header = document.getElementById('listHeader'); const header = document.getElementById('listHeader');
const count = document.getElementById('listCount'); const count = document.getElementById('listCount');
const totalItems = document.getElementById('totalItems');
const total = ENV.data.bankList.length; const total = ENV.data.bankList.length;
const isData = total > 0;
header.style.display = total > 0 ? '' : 'none'; header.style.display = isData ? '' : 'none';
status.style.display = total > 0 ? 'none' : ''; // status.style.display = total > 0 ? 'none' : '';
callPastInfoBtn.style.display = total > 0 ? 'none' : ''; callPastInfoBtn.style.display = isData ? 'none' : '';
count.textContent = total; count.textContent = total;
totalItems.textContent = total;
btn.disabled = isChecked; btn.disabled = isData;
icon.classList.toggle("ico-add", !isChecked); icon.classList.toggle("ico-add", !isData);
icon.classList.toggle("ico-add-disabled", isChecked); icon.classList.toggle("ico-add-disabled", isData);
if (isChecked) { if (isData) {
next.disabled = !isChecked; next.disabled = !isData;
} else { } else {
next.disabled = total <= 0; next.disabled = total <= 0;
} }
@@ -468,9 +471,6 @@
ENV.data.bankList = []; ENV.data.bankList = [];
document.getElementById('listBody').innerHTML = ''; document.getElementById('listBody').innerHTML = '';
formControl.updateLayout(); formControl.updateLayout();
// TODO(ks): 선택 삭제 시 전체 count 미반영 중. 일단 전체 초기화에서만 count 갱신.
document.getElementById('totalItems').textContent = ENV.data.bankList.length;
}, },
}); });
}, },
@@ -481,7 +481,7 @@
ajaxUtil._ajaxAsync( ajaxUtil._ajaxAsync(
ENV.httpUrl.save, ENV.httpUrl.save,
{ {
status: ENV.elementRefs.noDataCheckbox.checked, // status: ENV.elementRefs.noDataCheckbox.checked,
id: ENV.data.id, id: ENV.data.id,
transferType:"code.bank.output", transferType:"code.bank.output",
bankList: ENV.data.bankList bankList: ENV.data.bankList
@@ -525,10 +525,14 @@
: `${getCategory(categoryCode)}`; : `${getCategory(categoryCode)}`;
let tagCount = ''; let tagCount = '';
if(product.count && product.unitCode != "code.record.unit.self"){ if (product.count > 0) {
tagCount = `<li><p>수량</p><span>${format(product.count)}${getUnit(product.unitCode)}</span></li>`; const unitText = product.unitCode !== 'code.record.unit.self'
? getUnit(product.unitCode)
: product.unit;
tagCount = `<li><p>수량</p><span>${format(product.count)}${unitText}</span></li>`;
} else { } else {
tagCount = `<li><p>수량</p><span>${format(product.count)}${product.unit}</span></li>` tagCount = '';
} }
const buttonGroupHtml = isEdit const buttonGroupHtml = isEdit