Merge remote-tracking branch 'origin/dev' into bo_daily
This commit is contained in:
@@ -61,7 +61,8 @@ class CreateBankInputController {
|
||||
//TODO 트렌젝션 고려
|
||||
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()) {
|
||||
|
||||
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.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));
|
||||
} else {
|
||||
return ResponseEntity.ok(ApiResponse.failure(null));
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.util.List;
|
||||
public class CreateBankInputReqVO {
|
||||
|
||||
|
||||
private Boolean status;
|
||||
// private Boolean status;
|
||||
private Long id;
|
||||
private String transferType;
|
||||
private List<CreateBankInputProductReqVO> bankList;
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
AND a.forest_product_status != 'NONE'
|
||||
AND a.household_seq = #{householdSeq}
|
||||
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
|
||||
WHERE is_deleted = false AND id = #{id}
|
||||
);
|
||||
|
||||
@@ -172,7 +172,7 @@ kri.form.errorInit = function (formElement) {
|
||||
if (formElement.length > 0) {
|
||||
$(formElement).find('.component-input').removeClass('input-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 () {
|
||||
$(this).remove();
|
||||
});
|
||||
@@ -238,11 +238,12 @@ kri.form.error = function(errorList){
|
||||
}
|
||||
});
|
||||
|
||||
if(errorList && errorList.length > 0){
|
||||
const target = $('[name="' + errorList[0].field + '"]');
|
||||
if (target.length > 0) {
|
||||
target.focus();
|
||||
}
|
||||
// 포커스 이동
|
||||
if ($('.input-invalid').length != 0) {
|
||||
$('.input-invalid').eq(0).find('input').focus();
|
||||
}
|
||||
if ($('.select-invalid').length != 0) {
|
||||
$('.select-invalid').eq(0).find('button').focus();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,18 +31,18 @@
|
||||
<span class="btn-txt">추가 등록</span>
|
||||
</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>
|
||||
</button>
|
||||
|
||||
|
||||
<div class="component-input align-center" id="forestProductStatusDiv">
|
||||
<label class="checkbox-inner">
|
||||
<input type="checkbox" id="forestProductStatus" name="forestProductStatus"
|
||||
th:value="${MonthStatus.NOTHING}" onchange="formControl.handleNoDataToggle()">
|
||||
<span class="checkbox-item"><span class="checkbox-txt">이번달 등록내용 없음</span></span>
|
||||
</label>
|
||||
</div>
|
||||
<!-- <div class="component-input align-center" id="forestProductStatusDiv">-->
|
||||
<!-- <label class="checkbox-inner">-->
|
||||
<!-- <input type="checkbox" id="forestProductStatus" name="forestProductStatus"-->
|
||||
<!-- th:value="${MonthStatus.NOTHING}" onchange="formControl.handleNoDataToggle()">-->
|
||||
<!-- <span class="checkbox-item"><span class="checkbox-txt">이번달 등록내용 없음</span></span>-->
|
||||
<!-- </label>-->
|
||||
<!-- </div>-->
|
||||
|
||||
</section>
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
|
||||
|
||||
|
||||
</div>"/api/front/info/bank/create"
|
||||
</div>
|
||||
|
||||
<section layout:fragment="script">
|
||||
<script th:inline="javascript">
|
||||
@@ -122,7 +122,7 @@
|
||||
editable: /*[[${editable}]]*/,
|
||||
},
|
||||
elementRefs: {
|
||||
noDataCheckbox: document.getElementById("forestProductStatus"),
|
||||
// noDataCheckbox: document.getElementById("forestProductStatus"),
|
||||
select:{
|
||||
cropCodeSelect : null,
|
||||
transferCategoryCodeSelect : null,
|
||||
@@ -190,7 +190,7 @@
|
||||
const callPastInfoBtn = document.getElementById("callPastInfoBtn");
|
||||
|
||||
//데이터 없음 버튼
|
||||
const forestProductStatus = document.getElementById("forestProductStatus");
|
||||
// const forestProductStatus = document.getElementById("forestProductStatus");
|
||||
|
||||
//등록 완료 버튼
|
||||
const next = document.getElementById('complateBtn');
|
||||
@@ -206,15 +206,16 @@
|
||||
if (ENV.data.pastStatus && ENV.data.pastStatus == "REGISTERED" && ENV.data.pastBankList.length > 0) {
|
||||
this.checkUsePastData();
|
||||
}
|
||||
} else if (ENV.data.currentStatus == "NOTHING") {
|
||||
|
||||
|
||||
addItemBtn.disabled = true;
|
||||
icon.classList.toggle("ico-add", false);
|
||||
icon.classList.toggle("ico-add-disabled", true);
|
||||
callPastInfoBtn.disabled = true;
|
||||
forestProductStatus.checked = true;
|
||||
next.disabled = true;
|
||||
// }
|
||||
// else if (ENV.data.currentStatus == "NOTHING") {
|
||||
//
|
||||
//
|
||||
// addItemBtn.disabled = true;
|
||||
// icon.classList.toggle("ico-add", false);
|
||||
// icon.classList.toggle("ico-add-disabled", true);
|
||||
// callPastInfoBtn.disabled = true;
|
||||
// forestProductStatus.checked = true;
|
||||
// next.disabled = true;
|
||||
|
||||
} else if (ENV.data.currentStatus == "REGISTERED") {
|
||||
if (ENV.data.bankList.length > 0) {
|
||||
@@ -240,7 +241,7 @@
|
||||
icon.classList.toggle("ico-add", false);
|
||||
icon.classList.toggle("ico-add-disabled", true);
|
||||
callPastInfoBtn.disabled = true;
|
||||
forestProductStatus.disabled = true;
|
||||
// forestProductStatus.disabled = true;
|
||||
next.disabled = true;
|
||||
next.style.display = "none";
|
||||
clearAllItems.style.display = "none";
|
||||
@@ -322,30 +323,33 @@
|
||||
updateLayout() {
|
||||
|
||||
|
||||
const isChecked = ENV.elementRefs.noDataCheckbox.checked;
|
||||
|
||||
// const isChecked = ENV.elementRefs.noDataCheckbox.checked;
|
||||
const btn = document.getElementById("addItemBtn");
|
||||
const icon = btn.querySelector("i");
|
||||
|
||||
const status = document.getElementById('forestProductStatusDiv');
|
||||
// const status = document.getElementById('forestProductStatusDiv');
|
||||
const callPastInfoBtn = document.getElementById("callPastInfoBtn");
|
||||
|
||||
const next = document.getElementById('complateBtn');
|
||||
const header = document.getElementById('listHeader');
|
||||
const count = document.getElementById('listCount');
|
||||
const totalItems = document.getElementById('totalItems');
|
||||
const total = ENV.data.bankList.length;
|
||||
const isData = total > 0;
|
||||
|
||||
|
||||
header.style.display = total > 0 ? '' : 'none';
|
||||
status.style.display = total > 0 ? 'none' : '';
|
||||
callPastInfoBtn.style.display = total > 0 ? 'none' : '';
|
||||
header.style.display = isData ? '' : 'none';
|
||||
// status.style.display = total > 0 ? 'none' : '';
|
||||
callPastInfoBtn.style.display = isData? 'none' : '';
|
||||
count.textContent = total;
|
||||
totalItems.textContent = total;
|
||||
|
||||
|
||||
btn.disabled = isChecked;
|
||||
icon.classList.toggle("ico-add", !isChecked);
|
||||
icon.classList.toggle("ico-add-disabled", isChecked);
|
||||
if (isChecked) {
|
||||
next.disabled = !isChecked;
|
||||
btn.disabled = isData;
|
||||
icon.classList.toggle("ico-add", !isData);
|
||||
icon.classList.toggle("ico-add-disabled", isData);
|
||||
if (isData) {
|
||||
next.disabled = !isData;
|
||||
} else {
|
||||
next.disabled = total <= 0;
|
||||
}
|
||||
@@ -474,9 +478,6 @@
|
||||
ENV.data.bankList = [];
|
||||
document.getElementById('listBody').innerHTML = '';
|
||||
formControl.updateLayout();
|
||||
|
||||
// TODO(ks): 선택 삭제 시 전체 count 미반영 중. 일단 전체 초기화에서만 count 갱신.
|
||||
document.getElementById('totalItems').textContent = ENV.data.bankList.length;
|
||||
},
|
||||
});
|
||||
},
|
||||
@@ -487,7 +488,7 @@
|
||||
ajaxUtil._ajaxAsync(
|
||||
ENV.httpUrl.save,
|
||||
{
|
||||
status: ENV.elementRefs.noDataCheckbox.checked,
|
||||
// status: ENV.elementRefs.noDataCheckbox.checked,
|
||||
id: ENV.data.id,
|
||||
transferType:"code.bank.input",
|
||||
bankList: ENV.data.bankList
|
||||
@@ -532,10 +533,14 @@
|
||||
: `${getCategory(categoryCode)}`;
|
||||
|
||||
let tagCount = '';
|
||||
if(product.count && product.unitCode != "code.record.unit.self"){
|
||||
tagCount = `<li><p>수량</p><span>${format(product.count)}${getUnit(product.unitCode)}</span></li>`;
|
||||
if (product.count > 0) {
|
||||
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 {
|
||||
tagCount = `<li><p>수량</p><span>${format(product.count)}${product.unit}</span></li>`
|
||||
tagCount = '';
|
||||
}
|
||||
|
||||
const buttonGroupHtml = isEdit
|
||||
@@ -557,7 +562,9 @@
|
||||
${buttonGroupHtml}
|
||||
</div>
|
||||
<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 != ''
|
||||
? `<li><p>수입원</p><span>${product.sourcePurpose}</span></li>`
|
||||
: ''}
|
||||
|
||||
@@ -31,18 +31,18 @@
|
||||
<span class="btn-txt">추가 등록</span>
|
||||
</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>
|
||||
</button>
|
||||
|
||||
|
||||
<div class="component-input align-center" id="forestProductStatusDiv">
|
||||
<label class="checkbox-inner">
|
||||
<input type="checkbox" id="forestProductStatus" name="forestProductStatus"
|
||||
th:value="${MonthStatus.NOTHING}" onchange="formControl.handleNoDataToggle()">
|
||||
<span class="checkbox-item"><span class="checkbox-txt">이번달 등록내용 없음</span></span>
|
||||
</label>
|
||||
</div>
|
||||
<!-- <div class="component-input align-center" id="forestProductStatusDiv">-->
|
||||
<!-- <label class="checkbox-inner">-->
|
||||
<!-- <input type="checkbox" id="forestProductStatus" name="forestProductStatus"-->
|
||||
<!-- th:value="${MonthStatus.NOTHING}" onchange="formControl.handleNoDataToggle()">-->
|
||||
<!-- <span class="checkbox-item"><span class="checkbox-txt">이번달 등록내용 없음</span></span>-->
|
||||
<!-- </label>-->
|
||||
<!-- </div>-->
|
||||
|
||||
</section>
|
||||
|
||||
@@ -122,7 +122,7 @@
|
||||
editable: /*[[${editable}]]*/,
|
||||
},
|
||||
elementRefs: {
|
||||
noDataCheckbox: document.getElementById("forestProductStatus"),
|
||||
// noDataCheckbox: document.getElementById("forestProductStatus"),
|
||||
select:{
|
||||
transferCategoryCodeSelect : null,
|
||||
unitCodeSelect : null,
|
||||
@@ -189,7 +189,7 @@
|
||||
const callPastInfoBtn = document.getElementById("callPastInfoBtn");
|
||||
|
||||
//데이터 없음 버튼
|
||||
const forestProductStatus = document.getElementById("forestProductStatus");
|
||||
// const forestProductStatus = document.getElementById("forestProductStatus");
|
||||
|
||||
//등록 완료 버튼
|
||||
const next = document.getElementById('complateBtn');
|
||||
@@ -205,15 +205,15 @@
|
||||
if (ENV.data.pastStatus && ENV.data.pastStatus == "REGISTERED" && ENV.data.pastBankList.length > 0) {
|
||||
this.checkUsePastData();
|
||||
}
|
||||
} else if (ENV.data.currentStatus == "NOTHING") {
|
||||
|
||||
|
||||
addItemBtn.disabled = true;
|
||||
icon.classList.toggle("ico-add", false);
|
||||
icon.classList.toggle("ico-add-disabled", true);
|
||||
callPastInfoBtn.disabled = true;
|
||||
forestProductStatus.checked = true;
|
||||
next.disabled = true;
|
||||
// } else if (ENV.data.currentStatus == "NOTHING") {
|
||||
//
|
||||
//
|
||||
// addItemBtn.disabled = true;
|
||||
// icon.classList.toggle("ico-add", false);
|
||||
// icon.classList.toggle("ico-add-disabled", true);
|
||||
// callPastInfoBtn.disabled = true;
|
||||
// forestProductStatus.checked = true;
|
||||
// next.disabled = true;
|
||||
|
||||
} else if (ENV.data.currentStatus == "REGISTERED") {
|
||||
if (ENV.data.bankList.length > 0) {
|
||||
@@ -239,7 +239,7 @@
|
||||
icon.classList.toggle("ico-add", false);
|
||||
icon.classList.toggle("ico-add-disabled", true);
|
||||
callPastInfoBtn.disabled = true;
|
||||
forestProductStatus.disabled = true;
|
||||
// forestProductStatus.disabled = true;
|
||||
next.disabled = true;
|
||||
next.style.display = "none";
|
||||
clearAllItems.style.display = "none";
|
||||
@@ -313,30 +313,33 @@
|
||||
updateLayout() {
|
||||
|
||||
|
||||
const isChecked = ENV.elementRefs.noDataCheckbox.checked;
|
||||
// const isChecked = ENV.elementRefs.noDataCheckbox.checked;
|
||||
const btn = document.getElementById("addItemBtn");
|
||||
const icon = btn.querySelector("i");
|
||||
|
||||
const status = document.getElementById('forestProductStatusDiv');
|
||||
// const status = document.getElementById('forestProductStatusDiv');
|
||||
const callPastInfoBtn = document.getElementById("callPastInfoBtn");
|
||||
|
||||
const next = document.getElementById('complateBtn');
|
||||
const header = document.getElementById('listHeader');
|
||||
const count = document.getElementById('listCount');
|
||||
const totalItems = document.getElementById('totalItems');
|
||||
const total = ENV.data.bankList.length;
|
||||
const isData = total > 0;
|
||||
|
||||
|
||||
header.style.display = total > 0 ? '' : 'none';
|
||||
status.style.display = total > 0 ? 'none' : '';
|
||||
callPastInfoBtn.style.display = total > 0 ? 'none' : '';
|
||||
header.style.display = isData ? '' : 'none';
|
||||
// status.style.display = total > 0 ? 'none' : '';
|
||||
callPastInfoBtn.style.display = isData ? 'none' : '';
|
||||
count.textContent = total;
|
||||
totalItems.textContent = total;
|
||||
|
||||
|
||||
btn.disabled = isChecked;
|
||||
icon.classList.toggle("ico-add", !isChecked);
|
||||
icon.classList.toggle("ico-add-disabled", isChecked);
|
||||
if (isChecked) {
|
||||
next.disabled = !isChecked;
|
||||
btn.disabled = isData;
|
||||
icon.classList.toggle("ico-add", !isData);
|
||||
icon.classList.toggle("ico-add-disabled", isData);
|
||||
if (isData) {
|
||||
next.disabled = !isData;
|
||||
} else {
|
||||
next.disabled = total <= 0;
|
||||
}
|
||||
@@ -468,9 +471,6 @@
|
||||
ENV.data.bankList = [];
|
||||
document.getElementById('listBody').innerHTML = '';
|
||||
formControl.updateLayout();
|
||||
|
||||
// TODO(ks): 선택 삭제 시 전체 count 미반영 중. 일단 전체 초기화에서만 count 갱신.
|
||||
document.getElementById('totalItems').textContent = ENV.data.bankList.length;
|
||||
},
|
||||
});
|
||||
},
|
||||
@@ -481,7 +481,7 @@
|
||||
ajaxUtil._ajaxAsync(
|
||||
ENV.httpUrl.save,
|
||||
{
|
||||
status: ENV.elementRefs.noDataCheckbox.checked,
|
||||
// status: ENV.elementRefs.noDataCheckbox.checked,
|
||||
id: ENV.data.id,
|
||||
transferType:"code.bank.output",
|
||||
bankList: ENV.data.bankList
|
||||
@@ -525,10 +525,14 @@
|
||||
: `${getCategory(categoryCode)}`;
|
||||
|
||||
let tagCount = '';
|
||||
if(product.count && product.unitCode != "code.record.unit.self"){
|
||||
tagCount = `<li><p>수량</p><span>${format(product.count)}${getUnit(product.unitCode)}</span></li>`;
|
||||
if (product.count > 0) {
|
||||
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 {
|
||||
tagCount = `<li><p>수량</p><span>${format(product.count)}${product.unit}</span></li>`
|
||||
tagCount = '';
|
||||
}
|
||||
|
||||
const buttonGroupHtml = isEdit
|
||||
|
||||
Reference in New Issue
Block a user