[FO] 일계부 수입, 지출의 단위 직접입력 추가
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
package app.module.front.config.constants;
|
||||
|
||||
public class CommonConstants {
|
||||
private CommonConstants() {
|
||||
throw new IllegalAccessError("어플리케이션에서 공통으로 사용되는 상수 클래스로 생성자를 사용할 수 없습니다.");
|
||||
}
|
||||
|
||||
/**
|
||||
* 단위의 직접입력 코드
|
||||
*/
|
||||
public static final String UNIT_CODE_SELF = "code.record.unit.self";
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package app.module.front.usecase.daily.expense.ports.application;
|
||||
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
||||
import app.module.core.usecase.uicode.list.ports.application.domain.UICodeElement;
|
||||
import app.module.front.config.application.util.AuditUtil;
|
||||
import app.module.front.config.constants.CommonConstants;
|
||||
import app.module.front.usecase.daily.expense.adapters.persistence.model.DailyExpenseDto;
|
||||
import app.module.front.usecase.daily.expense.adapters.web.model.CreateDailyExpenseReqVO;
|
||||
import app.module.front.usecase.daily.expense.adapters.web.model.DailyExpenseUIReqVO;
|
||||
@@ -53,7 +54,11 @@ public class DailyExpenseService implements DailyExpensePortIn {
|
||||
List<UICodeElement> recordUnit = uiCodeListPortIn.connect("code.record.unit");
|
||||
|
||||
for (DailyExpenseDto dto : list) {
|
||||
dto.setUnitLabel(this.getCodeLabel(dto.getUnitCode(), recordUnit));
|
||||
if (CommonConstants.UNIT_CODE_SELF.equals(dto.getUnitCode())) {
|
||||
dto.setUnitLabel(dto.getUnitSelf());
|
||||
} else {
|
||||
dto.setUnitLabel(this.getCodeLabel(dto.getUnitCode(), recordUnit));
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
@@ -96,6 +101,7 @@ public class DailyExpenseService implements DailyExpensePortIn {
|
||||
formVO.getSourcePurpose(),
|
||||
formVO.getQuantity(),
|
||||
formVO.getUnitCode(),
|
||||
formVO.getUnitSelf(),
|
||||
formVO.getPrice(),
|
||||
formVO.getEstimatedValue()));
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package app.module.front.usecase.daily.income.ports.application;
|
||||
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
||||
import app.module.core.usecase.uicode.list.ports.application.domain.UICodeElement;
|
||||
import app.module.front.config.application.util.AuditUtil;
|
||||
import app.module.front.config.constants.CommonConstants;
|
||||
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto;
|
||||
import app.module.front.usecase.daily.income.adapters.web.model.CreateDailyIncomeReqVO;
|
||||
import app.module.front.usecase.daily.income.adapters.web.model.DailyIncomeUIReqVO;
|
||||
@@ -55,7 +56,12 @@ public class DailyIncomeService implements DailyIncomePortIn {
|
||||
|
||||
for (DailyIncomeDto dto : list) {
|
||||
dto.setCropLabel(this.getCodeLabel(dto.getCropCode(), recordCrop));
|
||||
dto.setUnitLabel(this.getCodeLabel(dto.getUnitCode(), recordUnit));
|
||||
|
||||
if (CommonConstants.UNIT_CODE_SELF.equals(dto.getUnitCode())) {
|
||||
dto.setUnitLabel(dto.getUnitSelf());
|
||||
} else {
|
||||
dto.setUnitLabel(this.getCodeLabel(dto.getUnitCode(), recordUnit));
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
@@ -99,6 +105,7 @@ public class DailyIncomeService implements DailyIncomePortIn {
|
||||
formVO.getSourcePurpose(),
|
||||
formVO.getQuantity(),
|
||||
formVO.getUnitCode(),
|
||||
formVO.getUnitSelf(),
|
||||
formVO.getPrice(),
|
||||
formVO.getEstimatedValue()));
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
resultType="app.module.front.usecase.daily.expense.adapters.persistence.model.DailyExpenseDto">
|
||||
select ds.id, ds.daily_record_seq, ds.input_type, ds.is_credit as credit
|
||||
, ds.category_self, ds.source_purpose
|
||||
, ds.quantity, ds.unit_code, ds.price, ds.estimated_value
|
||||
, ds.quantity, ds.unit_code, ds.unit_self, ds.price, ds.estimated_value
|
||||
from daily_expense ds
|
||||
<include refid="app.module.front.usecase.daily.record.adapters.persistence.DailyRecordMapper.InnerJoinByDailyRecord"/>
|
||||
where ds.is_deleted = false
|
||||
@@ -30,13 +30,13 @@
|
||||
<insert id="createDailyExpense" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into daily_expense (
|
||||
daily_record_seq, input_type, is_credit, income_mark_code, category_self, source_purpose
|
||||
, quantity, unit_code, price, estimated_value
|
||||
, quantity, unit_code, unit_self, price, estimated_value
|
||||
, is_deleted
|
||||
, <include refid="common.fields.CreateUpdateBaseColumns"/>
|
||||
) values (
|
||||
#{dailyRecordSeq}
|
||||
, #{inputType}, #{credit}, #{incomeMarkCode}, #{categorySelf}, #{sourcePurpose}
|
||||
, #{quantity}, #{unitCode}, #{price}, #{estimatedValue}
|
||||
, #{quantity}, #{unitCode}, #{unitSelf}, #{price}, #{estimatedValue}
|
||||
, false
|
||||
, <include refid="common.fields.CreateUpdateBaseValues"/>
|
||||
)
|
||||
@@ -50,6 +50,7 @@
|
||||
, source_purpose = #{sourcePurpose}
|
||||
, quantity = #{quantity}
|
||||
, unit_code = #{unitCode}
|
||||
, unit_self = #{unitSelf}
|
||||
, price = #{price}
|
||||
, estimated_value = #{estimatedValue}
|
||||
where is_deleted = false
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
resultType="app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto">
|
||||
select ds.id, ds.daily_record_seq, ds.input_type, ds.is_credit as credit
|
||||
, ds.crop_code, ds.category_self, ds.source_purpose
|
||||
, ds.quantity, ds.unit_code, ds.price, ds.estimated_value
|
||||
, ds.quantity, ds.unit_code, ds.unit_self, ds.price, ds.estimated_value
|
||||
from daily_income ds
|
||||
<include refid="app.module.front.usecase.daily.record.adapters.persistence.DailyRecordMapper.InnerJoinByDailyRecord"/>
|
||||
where ds.is_deleted = false
|
||||
@@ -30,13 +30,13 @@
|
||||
<insert id="createDailyIncome" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into daily_income (
|
||||
daily_record_seq, input_type, is_credit, expense_mark_code, crop_code, category_self, source_purpose
|
||||
, quantity, unit_code, price, estimated_value
|
||||
, quantity, unit_code, unit_self, price, estimated_value
|
||||
, is_deleted
|
||||
, <include refid="common.fields.CreateUpdateBaseColumns"/>
|
||||
) values (
|
||||
#{dailyRecordSeq}
|
||||
, #{inputType}, #{credit}, #{expenseMarkCode}, #{cropCode}, #{categorySelf}, #{sourcePurpose}
|
||||
, #{quantity}, #{unitCode}, #{price}, #{estimatedValue}
|
||||
, #{quantity}, #{unitCode}, #{unitSelf}, #{price}, #{estimatedValue}
|
||||
, false
|
||||
, <include refid="common.fields.CreateUpdateBaseValues"/>
|
||||
)
|
||||
@@ -51,6 +51,7 @@
|
||||
, source_purpose = #{sourcePurpose}
|
||||
, quantity = #{quantity}
|
||||
, unit_code = #{unitCode}
|
||||
, unit_self = #{unitSelf}
|
||||
, price = #{price}
|
||||
, estimated_value = #{estimatedValue}
|
||||
where is_deleted = false
|
||||
|
||||
@@ -8321,6 +8321,9 @@ button.swiper-pagination-bullet {
|
||||
}
|
||||
.form-group .input-flex-group .d-flex .component-input {
|
||||
margin-top: 0;
|
||||
-webkit-box-flex: 1;
|
||||
-webkit-flex: 1;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.form-desc {
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
</p>
|
||||
</div>
|
||||
<div id="unitCode" class="component-select bottom-sheet" data-props-default="단위를 선택해 주세요" data-props-type="bottomSheet">
|
||||
<input type="hidden1" name="unitCode" th:value="${detail.unitCode}">
|
||||
<input type="hidden" name="unitCode" th:value="${detail.unitCode}">
|
||||
<button type="button" class="select-box">
|
||||
<span class="select-txt"></span>
|
||||
</button>
|
||||
@@ -114,6 +114,11 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-input" data-option="직접 입력">
|
||||
<div class="input-field">
|
||||
<input type="text" name="unitSelf" th:value="${detail.unitSelf}" maxlength="30" placeholder="단위를 입력해 주세요">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -164,6 +164,11 @@
|
||||
selectItemCallback({selectValue, dataValue}){
|
||||
console.log('selectItemCallback', selectValue, dataValue)
|
||||
$('input[name="unitCode"]').val(dataValue)
|
||||
|
||||
// TODO : ui js 에서 show 적용유무 파악하기
|
||||
if (dataValue === 'code.record.unit.self') {
|
||||
$('#unitCode').parent().find('.component-input').addClass('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -144,6 +144,11 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="component-input" data-option="직접 입력">
|
||||
<div class="input-field">
|
||||
<input type="text" name="unitSelf" th:value="${detail.unitSelf}" maxlength="30" placeholder="단위를 입력해 주세요">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -177,6 +177,11 @@
|
||||
selectItemCallback({selectValue, dataValue}){
|
||||
console.log('selectItemCallback', selectValue, dataValue)
|
||||
$('input[name="unitCode"]').val(dataValue)
|
||||
|
||||
// TODO : ui js 에서 show 적용유무 파악하기
|
||||
if (dataValue === 'code.record.unit.self') {
|
||||
$('#unitCode').parent().find('.component-input').addClass('show');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -201,7 +206,11 @@
|
||||
|
||||
// data set
|
||||
selectboxInstance1.setValue($formWrap.find('input[name="cropCode"]').val());
|
||||
//selectboxInstance1.update();
|
||||
|
||||
selectboxInstance2.setValue($formWrap.find('input[name="unitCode"]').val());
|
||||
//selectboxInstance2.update();
|
||||
|
||||
if ($price.val() === '' && $estimatedValue.val() !== '') {
|
||||
modalControl._priceDisabled($price);
|
||||
} else if ($price.val() !== '' && $estimatedValue.val() === '') {
|
||||
|
||||
Reference in New Issue
Block a user