내정보 끝.

This commit is contained in:
주우성
2025-06-18 14:40:11 +09:00
parent 5e59e1ba9c
commit 5d5f357504
9 changed files with 268 additions and 93 deletions

View File

@@ -29,7 +29,7 @@ public class GetBanks {
private Integer count;
private String unitCode;
private String unite;
private String unit;
private Integer price;
private String month;

View File

@@ -69,8 +69,8 @@ class CreateBankInputController {
String incomdeCode = null;
String expenseCode = null;
if(reqVO.getTransferType().equals("code.bank.input")){
incomdeCode = !code.getId().equals(reqVO.getTransferType()+".99") && code.getCodeType().equals("INPUT") ? code.getCodeValue() : null;
expenseCode = !code.getId().equals(reqVO.getTransferType()+".99") && code.getCodeType().equals("OUTPUT") ?code.getCodeValue() : null;
incomdeCode = !code.getId().equals(reqVO.getTransferType()+".self") && code.getCodeType().equals("INPUT") ? code.getCodeValue() : null;
expenseCode = !code.getId().equals(reqVO.getTransferType()+".self") && code.getCodeType().equals("OUTPUT") ?code.getCodeValue() : null;
}
createBankPortIn.operate(new CreateBankCmd(
AuthUtil.getUserSeq(),

View File

@@ -142,6 +142,13 @@ kri.form.error = function(errorList){
}
});
if(errorList && errorList.length > 0){
const target = $('[name="' + errorList[0].field + '"]');
if (target.length > 0) {
target.focus();
}
}
}

View File

@@ -285,10 +285,19 @@
ENV.elementRefs.select.unitCodeSelect.core.init($select3,{
selectItemCallback({selectValue, dataValue}){
document.querySelector('#unitCode').value=dataValue;
if(dataValue === "code.record.unit.self") {
document.querySelector('#unit').value="";
document.querySelector('#unitDiv').style.display ='block';
} else {
document.querySelector('#unit').value="";
document.querySelector('#unitDiv').style.display ='none';
}
}
});
ENV.module.modalPopup.open();
document.querySelector('.modal-content').scrollTop = 0;
},
function(code, rstData) {
kri.logger.error('Do nothing. code: '+ code, rstData);
@@ -351,24 +360,37 @@
const errors = [];
if (!form.transferCategoryCode.value) errors.push({field: 'transferCategoryCode', message: '수입종류를 선택해주세요.'});
if (form.transferCategoryCode.value && document.getElementById(form.transferCategoryCode.value+"_value")
if(document.getElementById(form.transferCategoryCode.value+"_value")){
if (form.transferCategoryCode.value && document.getElementById(form.transferCategoryCode.value+"_value")
&& !document.getElementById(form.transferCategoryCode.value+"_value").value){
errors.push({field: form.transferCategoryCode.value+"_value", message: '수입대상을 입력해주세요.'});
}
}
if (!form.sourcePurpose.value) errors.push({field: 'sourcePurpose', message: '수입원을 입력해주세요.'});
if (form.count.value && !form.unitCode.value) errors.push({
field: 'unitCode',
message: '단위를 선택해주세요.'
});
if(form.count.value){
if(!form.unitCode.value){
errors.push({
field: 'unitCode',
message: '단위를 선택해주세요.'
});
} else if (form.unitCode.value && form.unitCode.value =="code.record.unit.self" && !form.unit.value){
errors.push({
field: 'unit',
message: '단위를 입력해주세요.'
});
}
}
if (!form.price.value) errors.push({field: 'price', message: '금액을 입력해주세요.'});
console.log(errors) //////////////////////////
kri.form.error(errors);
if (errors.length > 0) {
return;
}
form.transferCategory.value = document.getElementById(form.transferCategoryCode.value+"_value").value;//입력값
if(document.getElementById(form.transferCategoryCode.value+"_value")){
form.transferCategory.value = document.getElementById(form.transferCategoryCode.value+"_value").value;//입력값
}
const formData = new FormData(form);
const product = {};
formData.forEach((value, key) => product[key] = value);
@@ -411,15 +433,20 @@
const field = form.elements.namedItem(key);
if (field) {
field.value = val;
if(key == 'transferCategoryCode'){
if(key == 'transferCategoryCode' && val == "code.bank.input.self"){
document.getElementById(val+"_value").value = product["transferCategory"];
}
if(key == 'unitCode' && val == "code.record.unit.self"){
document.getElementById("unitDiv").style.display = "";
}
}
});
ENV.elementRefs.select.cropCodeSelect.setValue(product.cropCode);
ENV.elementRefs.select.transferCategoryCodeSelect.setValue(product.transferCategoryCode);
ENV.elementRefs.select.unitCodeSelect.setValue(product.unitCode);
document.getElementById("unit").value = product.unit;
},100)
},
@@ -481,13 +508,16 @@
const categoryCode = product.transferCategoryCode;
const categoryCodeInputValue = product.transferCategory;
const categoryValue = product[`${categoryCode}_value`] ? product[`${categoryCode}_value`] : categoryCodeInputValue;
const tagTitle = categoryCode === 'code.bank.input.99'
? categoryValue
: `${getCategory(categoryCode)}<span>(${categoryValue})</span>`;
const tagTitle = categoryCode === 'code.bank.input.self'
? categoryCodeInputValue
: `${getCategory(categoryCode)}`;
const tagCount = product.count
? `<li><p>수량</p><span>${format(product.count)}${getUnit(product.unitCode)}</span></li>`
: '';
let tagCount = '';
if(product.count && product.unitCode != "code.record.unit.self"){
tagCount = `<li><p>수량</p><span>${format(product.count)}${getUnit(product.unitCode)}</span></li>`;
} else {
tagCount = `<li><p>수량</p><span>${format(product.count)}${product.unit}</span></li>`
}
const buttonGroupHtml = isEdit
? `

View File

@@ -85,14 +85,12 @@
<!-- 수당 인풋 -->
<!-- transferCategory+Text-->
<th:block th:each="item : ${transferCategoryList}">
<div class="component-input " th:data-option="${item.codeText}">
<div class="input-field">
<input type="text" th:id="${item.id}+'_value'" th:name="${item.id}+'_value'" value="" placeholder="수입 대상을 입력해 주세요." maxlength="30">
</div>
<ul class="input-info">
<li style="display:none">수입 대상을 입력해 주세요.</li>
<li class="txt-blue" th:if="${item.msgCode}" th:text="${item.msgCode}"></li>
<ul class="guide-info" th:if="${item.msgCode}">
<li class="txt-blue" th:text="${item.msgCode}"></li>
</ul>
</div>
</th:block>
@@ -160,6 +158,13 @@
</div>
</div>
</div>
<div class="component-input " id="unitDiv" style="display: none">
<div class="input-field">
<input type="text" name="unit" id="unit" value="" placeholder="단위를 입력해 주세요." maxlength="10">
</div>
</div>
</section>
<hr>

View File

@@ -277,10 +277,18 @@
ENV.elementRefs.select.unitCodeSelect.core.init($select3,{
selectItemCallback({selectValue, dataValue}){
document.querySelector('#unitCode').value=dataValue;
if(dataValue === "code.record.unit.self") {
document.querySelector('#unit').value="";
document.querySelector('#unitDiv').style.display ='block';
} else {
document.querySelector('#unit').value="";
document.querySelector('#unitDiv').style.display ='none';
}
}
});
ENV.module.modalPopup.open();
document.querySelector('.modal-content').scrollTop = 0;
},
function(code, rstData) {
kri.logger.error('Do nothing. code: '+ code, rstData);
@@ -351,11 +359,23 @@
}
if (!form.sourcePurpose.value) errors.push({field: 'sourcePurpose', message: '용도 입력해주세요.'});
if(form.count.value){
if(!form.unitCode.value){
errors.push({
field: 'unitCode',
message: '단위를 선택해주세요.'
});
} else if (form.unitCode.value && form.unitCode.value =="code.record.unit.self" && !form.unit.value){
if (form.count.value && !form.unitCode.value) errors.push({
field: 'unitCode',
message: '단위를 선택해주세요.'
});
errors.push({
field: 'unit',
message: '단위를 입력해주세요.'
});
}
}
if (!form.price.value) errors.push({field: 'price', message: '금액을 입력해주세요.'});
console.log(errors) //////////////////////////
kri.form.error(errors);
@@ -407,15 +427,19 @@
const field = form.elements.namedItem(key);
if (field) {
field.value = val;
if(key == 'transferCategoryCode' && val == "code.bank.input.99"){
if(key == 'transferCategoryCode' && val == "code.bank.input.self"){
document.getElementById(val+"_value").value = product["transferCategory"];
}
if(key == 'unitCode' && val == "code.record.unit.self"){
document.getElementById("unitDiv").style.display = "";
}
}
});
ENV.elementRefs.select.transferCategoryCodeSelect.setValue(product.transferCategoryCode);
ENV.elementRefs.select.unitCodeSelect.setValue(product.unitCode);
document.getElementById("unit").value = product.unit;
},100)
},
@@ -476,13 +500,16 @@
const categoryCode = product.transferCategoryCode;
const categoryCodeInputValue = product.transferCategory;
const categoryValue = product[`${categoryCode}_value`] ? product[`${categoryCode}_value`] : categoryCodeInputValue;
const tagTitle = categoryCode === 'code.bank.output.99'
const tagTitle = categoryCode === 'code.bank.output.self'
? categoryCodeInputValue
: `${getCategory(categoryCode)}`;
const tagCount = product.count
? `<li><p>수량</p><span>${format(product.count)}${getUnit(product.unitCode)}</span></li>`
: '';
let tagCount = '';
if(product.count && product.unitCode != "code.record.unit.self"){
tagCount = `<li><p>수량</p><span>${format(product.count)}${getUnit(product.unitCode)}</span></li>`;
} else {
tagCount = `<li><p>수량</p><span>${format(product.count)}${product.unit}</span></li>`
}
const buttonGroupHtml = isEdit
? `

View File

@@ -48,14 +48,14 @@
</div>
<th:block th:each="item : ${transferCategoryList}">
<div class="component-input " th:if="${item.id == 'code.bank.output.99'}" th:data-option="${item.codeText}">
<div class="component-input " th:data-option="${item.codeText}">
<div class="input-field">
<input type="text" th:id="${item.id}+'_value'" th:name="${item.id}+'_value'" value="" placeholder="수입 대상을 입력해 주세요." maxlength="30">
</div>
<ul class="input-info">
<li style="display:none">수입 대상을 입력해 주세요.</li>
<li class="txt-blue" th:if="${item.msgCode}" th:text="${item.msgCode}"></li>
<ul class="guide-info" th:if="${item.msgCode}">
<li class="txt-blue" th:text="${item.msgCode}"></li>
</ul>
</div>
</th:block>
</div>
@@ -121,6 +121,15 @@
</div>
</div>
</div>
<div class="component-input " id="unitDiv" style="display: none">
<div class="input-field">
<input type="text" name="unit" id="unit" value="" placeholder="단위를 입력해 주세요." maxlength="10">
</div>
</div>
</section>
<hr>

View File

@@ -40,37 +40,19 @@
</div>
</div>
<!-- 지목 -->
<div class="select-group">
<div class="select-label">
<p class="label-txt">
<div class="component-input">
<div class="input-label">
<label for="landType" class="label-txt">
지목
</p>
</label>
</div>
<div id="landTypeSelect" class="component-select bottom-sheet"
data-props-default="지목을 선택해 주세요" data-props-type="bottomSheet">
<input type="hidden" id="landType" name="landType" data-type="select">
<button type="button" class="select-box">
<span class="select-txt"></span>
</button>
<div class="select-options">
<div class="select-header">
<p>지목</p>
<button type="button" class="select-close">
<span class="hide-txt">닫기</span>
</button>
</div>
<div class="select-scroll">
<ul class="">
<th:block th:each="item : ${purposeList}">
<li class="option" th:data-value="${item.id}"
th:text="${item.codeText}">option1
</li>
</th:block>
</ul>
</div>
</div>
<div class="input-field">
<input type="text" id="landType" placeholder="지목을 입력해 주세요" name="landType"
maxlength="10">
</div>
</div>
<!-- 가능 면적 -->
<div class="component-input">
<div class="input-label">
@@ -170,6 +152,12 @@
</div>
</div>
</div>
<div class="component-input " id="mainYieldUnitDiv" style="display: none" data-option="직접 입력">
<div class="input-field">
<input type="text" name="mainYieldUnit" id="mainYieldUnit" value="" placeholder="단위를 입력해 주세요." maxlength="10">
</div>
</div>
</div>
</section>
@@ -222,6 +210,12 @@
</div>
</div>
</div>
<div class="component-input " id="mainSaleUnitDiv" style="display: none" data-option="직접 입력">
<div class="input-field">
<input type="text" name="mainSaleUnit" id="mainSaleUnit" value="" placeholder="단위를 입력해 주세요." maxlength="10">
</div>
</div>
</div>
</section>
@@ -274,6 +268,12 @@
</div>
</div>
</div>
<div class="component-input " id="subYieldUnitDiv" style="display: none" data-option="직접 입력">
<div class="input-field">
<input type="text" name="subYieldUnit" id="subYieldUnit" value="" placeholder="단위를 입력해 주세요." maxlength="10">
</div>
</div>
</div>
</section>
@@ -326,6 +326,12 @@
</div>
</div>
</div>
<div class="component-input " id="subSaleUnitDiv" style="display: none" data-option="직접 입력">
<div class="input-field">
<input type="text" name="subSaleUnit" id="subSaleUnit" value="" placeholder="단위를 입력해 주세요." maxlength="10">
</div>
</div>
</div>
</section>
<div class="component-btns">

View File

@@ -123,7 +123,6 @@
elementRefs: {
noDataCheckbox: document.getElementById("forestProductStatus"),
select:{
landTypeSelect : null,
mainYieldUnitCodeSelect : null,
mainSaleUnitCodeSelect : null,
subYieldUnitCodeSelect : null,
@@ -308,7 +307,7 @@
$('.addPopup').find('.modal-content-inner').html(rstHtml);
const selectConfigs = [
{ id: 'landTypeSelect', targetId: 'landType', key: 'landTypeSelect' },
{ id: 'mainYieldUnitCodeSelect', targetId: 'mainYieldUnitCode', key: 'mainYieldUnitCodeSelect' },
{ id: 'mainSaleUnitCodeSelect', targetId: 'mainSaleUnitCode', key: 'mainSaleUnitCodeSelect' },
{ id: 'subYieldUnitCodeSelect', targetId: 'subYieldUnitCode', key: 'subYieldUnitCodeSelect' },
@@ -321,11 +320,27 @@
selectBox.core.init($select, {
selectItemCallback({ selectValue, dataValue }) {
document.querySelector(`#${targetId}`).value = dataValue;
const withoutCode = targetId.replace(/Code$/, '');
console.log(withoutCode);
if(dataValue == "code.record.unit.self") {
console.log(dataValue + "close")
document.querySelector('#'+withoutCode).value="";
document.querySelector('#'+withoutCode+'Div').style.display ='block';
} else {
console.log(dataValue + "close")
document.querySelector('#'+withoutCode).value="";
document.querySelector('#'+withoutCode+'Div').style.display ='none';
}
}
});
ENV.elementRefs.select[key] = selectBox;
});
ENV.module.modalPopup.open();
document.querySelector('.modal-content').scrollTop = 0;
},
function(code, rstData) {
kri.logger.error('Do nothing. code: '+ code, rstData);
@@ -351,7 +366,7 @@
//등록 아이템 저장
saveFormData() {
const form = document.getElementById('forestForm');
const selects = ['landType', 'mainYieldUnitCode', 'mainSaleUnitCode', 'subYieldUnitCode', 'subSaleUnitCode'];
const selects = ['mainYieldUnitCode', 'mainSaleUnitCode', 'subYieldUnitCode', 'subSaleUnitCode'];
selects.forEach(id => {
const sel = document.getElementById(id + 'Select');
if (sel && sel.value) form[id].value = sel.value;
@@ -359,22 +374,70 @@
const errors = [];
if (!form.cropName.value) errors.push({field: 'cropName', message: '재배 작물명을 입력해주세요.'});
if (form.mainYield.value && !form.mainYieldUnitCode.value) errors.push({
field: 'mainYieldUnitCode',
message: '단위를 선택해주세요.'
});
if (form.mainSaleAmount.value && !form.mainSaleUnitCode.value) errors.push({
field: 'mainSaleUnitCode',
message: '단위를 선택해주세요.'
});
if (form.subYield.value && !form.subYieldUnitCode.value) errors.push({
field: 'subYieldUnitCode',
message: '단위를 선택해주세요.'
});
if (form.subSaleAmount.value && !form.subSaleUnitCode.value) errors.push({
field: 'subSaleUnitCode',
message: '단위를 선택해주세요.'
});
if(form.mainYield.value){
if(!form.mainYieldUnitCode.value){
errors.push({
field: 'mainYieldUnitCode',
message: '단위를 선택해주세요.'
});
} else if (form.mainYieldUnitCode.value && form.mainYieldUnitCode.value =="code.record.unit.self" && !form.mainYieldUnit.value){
errors.push({
field: 'mainYieldUnit',
message: '단위를 입력해주세요.'
});
}
}
if(form.mainSaleAmount.value){
if(!form.mainSaleUnitCode.value){
errors.push({
field: 'mainSaleUnitCode',
message: '단위를 선택해주세요.'
});
} else if (form.mainSaleUnitCode.value && form.mainSaleUnitCode.value =="code.record.unit.self" && !form.mainSaleUnit.value){
errors.push({
field: 'mainSaleUnit',
message: '단위를 입력해주세요.'
});
}
}
if(form.subYield.value){
if(!form.subYieldUnitCode.value){
errors.push({
field: 'subYieldUnitCode',
message: '단위를 선택해주세요.'
});
} else if (form.subYieldUnitCode.value && form.subYieldUnitCode.value =="code.record.unit.self" && !form.subYieldUnit.value){
errors.push({
field: 'subYieldUnit',
message: '단위를 입력해주세요.'
});
}
}
if(form.subSaleAmount.value){
if(!form.subSaleUnitCode.value){
errors.push({
field: 'subSaleUnitCode',
message: '단위를 선택해주세요.'
});
} else if (form.subSaleUnitCode.value && form.subSaleUnitCode.value =="code.record.unit.self" && !form.subSaleUnit.value){
errors.push({
field: 'subSaleUnit',
message: '단위를 입력해주세요.'
});
}
}
kri.form.error(errors);
if (errors.length > 0) return;
@@ -405,14 +468,32 @@
const form = document.getElementById('forestForm');
Object.entries(product).forEach(([key, val]) => {
const field = form.elements.namedItem(key);
if (field) field.value = val;
if (field) {
field.value = val;
if(key == 'mainYieldUnitCode' && val == "code.record.unit.self"){
document.getElementById("mainYieldUnitDiv").style.display = "block";
}
if(key == 'mainSaleUnitCode' && val == "code.record.unit.self"){
document.getElementById("mainSaleUnitDiv").style.display = "block";
}
if(key == 'subYieldUnitCode' && val == "code.record.unit.self"){
document.getElementById("subYieldUnitDiv").style.display = "block";
}
if(key == 'subSaleUnitCode' && val == "code.record.unit.self"){
document.getElementById("subSaleUnitDiv").style.display = "block";
}
}
});
ENV.elementRefs.select.landTypeSelect.setValue(product.landType);
ENV.elementRefs.select.mainYieldUnitCodeSelect.setValue(product.mainYieldUnitCode);
ENV.elementRefs.select.mainSaleUnitCodeSelect.setValue(product.mainSaleUnitCode);
ENV.elementRefs.select.subYieldUnitCodeSelect.setValue(product.subYieldUnitCode);
ENV.elementRefs.select.subSaleUnitCodeSelect.setValue(product.subSaleUnitCode);
document.getElementById("mainYieldUnit").value = product.mainYieldUnit;
document.getElementById("mainSaleUnit").value = product.mainSaleUnit;
document.getElementById("subYieldUnit").value = product.subYieldUnit;
document.getElementById("subSaleUnit").value = product.subSaleUnit;
},100);
@@ -439,9 +520,13 @@
return found ? found.codeText : '-';
},
// 단위 코드
getUnitLabel(code) {
const found = ENV.data.unitList.find(i => i.id === code);
return found ? found.codeText : '-';
getUnitLabel(code,inputValue) {
if(code == "code.record.unit.self"){
return inputValue;
} else {
const found = ENV.data.unitList.find(i => i.id === code);
return found ? found.codeText : '-';
}
},
@@ -485,6 +570,12 @@
const getUnit = formControl.getUnitLabel;
const getPurpose = formControl.getPurposeLabel;
// const mainYieldUnit = !product.mainYieldUnitCode ? ''
// const mainSaleUnit
// const subYieldUnit
// const subSaleUnit
const tag1 = product.landArea ? `<span>${format(product.landArea)}평</span>` : '';
let tag2 = '';
@@ -492,25 +583,25 @@
else if (product.town) tag2 = `<li><span>${product.town}</span></li>`;
else if (product.streetNum) tag2 = `<li><span>${product.streetNum}</span></li>`;
const tag3 = product.landType ? `<li><p>지목</p><span>${getPurpose(product.landType)}</span></li>` : '';
const tag3 = product.landType ? `<li><p>지목</p><span>${product.landType}</span></li>` : '';
const tag4 = product.availableArea ? `<li><p>가능면적</p><span>${format(product.availableArea)}평</span></li>` : '';
let tag5 = '';
if (product.mainYield && product.mainSaleAmount) {
tag5 = `<li><p>주생산물 수확량 / 판매량</p><span>${format(product.mainYield)}${getUnit(product.mainYieldUnitCode)} / ${format(product.mainSaleAmount)}${getUnit(product.mainSaleUnitCode)}</span></li>`;
tag5 = `<li><p>주생산물 수확량 / 판매량</p><span>${format(product.mainYield)}${getUnit(product.mainYieldUnitCode,product.mainYieldUnit)} / ${format(product.mainSaleAmount)}${getUnit(product.mainSaleUnitCode,product.mainSaleUnit)}</span></li>`;
} else if (product.mainYield) {
tag5 = `<li><p>주생산물 수확량</p><span>${format(product.mainYield)}${getUnit(product.mainYieldUnitCode)}</span></li>`;
tag5 = `<li><p>주생산물 수확량</p><span>${format(product.mainYield)}${getUnit(product.mainYieldUnitCode,product.mainYieldUnit)}</span></li>`;
} else if (product.mainSaleAmount) {
tag5 = `<li><p>주생산물 판매량</p><span>${format(product.mainSaleAmount)}${getUnit(product.mainSaleUnitCode)}</span></li>`;
tag5 = `<li><p>주생산물 판매량</p><span>${format(product.mainSaleAmount)}${getUnit(product.mainSaleUnitCode,product.mainSaleUnit)}</span></li>`;
}
let tag6 = '';
if (product.subYield && product.subSaleAmount) {
tag6 = `<li><p>부생산물 수확량 / 판매량</p><span>${format(product.subYield)}${getUnit(product.subYieldUnitCode)} / ${format(product.subSaleAmount)}${getUnit(product.subSaleUnitCode)}</span></li>`;
tag6 = `<li><p>부생산물 수확량 / 판매량</p><span>${format(product.subYield)}${getUnit(product.subYieldUnitCode,product.subYieldUnit)} / ${format(product.subSaleAmount)}${getUnit(product.subSaleUnitCode,product.subSaleUnit)}</span></li>`;
} else if (product.subYield) {
tag6 = `<li><p>부생산물 수확량</p><span>${format(product.subYield)}${getUnit(product.subYieldUnitCode)}</span></li>`;
tag6 = `<li><p>부생산물 수확량</p><span>${format(product.subYield)}${getUnit(product.subYieldUnitCode,product.subYieldUnit)}</span></li>`;
} else if (product.subSaleAmount) {
tag6 = `<li><p>부생산물 판매량</p><span>${format(product.subSaleAmount)}${getUnit(product.subSaleUnitCode)}</span></li>`;
tag6 = `<li><p>부생산물 판매량</p><span>${format(product.subSaleAmount)}${getUnit(product.subSaleUnitCode,product.subSaleUnit)}</span></li>`;
}
let buttonGroupHtml = '';