diff --git a/core/src/main/resources/sql/data/02_uicode.sql b/core/src/main/resources/sql/data/02_uicode.sql index 6701ebaf..ce9184e4 100644 --- a/core/src/main/resources/sql/data/02_uicode.sql +++ b/core/src/main/resources/sql/data/02_uicode.sql @@ -118,17 +118,58 @@ VALUES -- 재배형태 ('code.record.crop', 'code.record', '재배형태', NULL, NULL, true, 0, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), -('code.record.crop.11', 'code.record.crop', '당년산/일반', '11', NULL, true, 0, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), -('code.record.crop.12', 'code.record.crop', '당년산/유기농', '12', NULL, true, 1, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), -('code.record.crop.13', 'code.record.crop', '당년산/무농약', '13', NULL, true, 2, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), -('code.record.crop.15', 'code.record.crop', '당년산/GAP 인증', '15', NULL, true, 3, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.crop.11', 'code.record.crop', '당년산/ 일반', '11', NULL, true, 0, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.crop.12', 'code.record.crop', '당년산 / 친환경 인증 / 유기농', '12', NULL, true, 1, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.crop.13', 'code.record.crop', '당년산 / 친환경 인증 / 무농약', '13', NULL, true, 2, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.crop.15', 'code.record.crop', '당년산 / GAP 인증', '15', NULL, true, 3, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.crop.21', 'code.record.crop', '전년산 / 일반', '21', NULL, true, 3, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.crop.22', 'code.record.crop', '전년산 / 친환경 인증 / 유기농', '22', NULL, true, 3, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.crop.23', 'code.record.crop', '전년산 / 친환경 인증 / 무농약', '23', NULL, true, 3, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.crop.24', 'code.record.crop', '전년산 / 친환경 인증 / 저농약', '24', NULL, true, 3, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.crop.25', 'code.record.crop', '전년산 / GAP 인증', '25', NULL, true, 3, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), --- 단위 Code -('code.record.unit', 'code.record', '단위 Code', NULL, NULL, true, 0, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), -('code.record.unit.gram', 'code.record.unit', 'g', 'g', NULL, true, 0, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), -('code.record.unit.kg', 'code.record.unit', 'kg', 'kg', NULL, true, 1, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +-- 면적 +('code.record.area', 'code.record', '면적', NULL, NULL, true, 1, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.area.11', 'code.record.area', '평', '평', NULL, true, 0, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.area.12', 'code.record.area', 'm2 (제곱미터)', 'm2', NULL, true, 1, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.area.13', 'code.record.area', 'ha (헥타르)', 'ha', NULL, true, 2, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.area.14', 'code.record.area', '정보', '정보', NULL, true, 3, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.area.self', 'code.record.area', '직접 입력', 'SELF', NULL, true, 99, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), + +-- 수확량(판매량) 단위 +('code.record.unit', 'code.record', '수확량(판매량) 단위', NULL, NULL, true, 2, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.unit.gram', 'code.record.unit', 'g (그램)', 'g', NULL, true, 0, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.unit.kg', 'code.record.unit', 'kg (킬로그램)', 'kg', NULL, true, 1, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.unit.13', 'code.record.unit', '근', '근', NULL, true, 2, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.unit.14', 'code.record.unit', '관', '관', NULL, true, 3, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.unit.15', 'code.record.unit', 'L (리터)', 'L', NULL, true, 4, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.unit.16', 'code.record.unit', '되', '되', NULL, true, 5, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.unit.17', 'code.record.unit', '말', '말', NULL, true, 6, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.unit.18', 'code.record.unit', '섬', '섬', NULL, true, 7, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.unit.self', 'code.record.unit', '직접 입력', 'SELF', NULL, true, 99, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), + +-- 자가농업 생산물 중 자가소비량 +('code.record.farming', 'code.record', '자가농업 생산물 중 자가소비량', NULL, NULL, true, 3, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.farming.11', 'code.record.farming', '쌀', '12111,81012', NULL, true, 0, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.farming.12', 'code.record.farming', '찹쌀', '12111,81012', NULL, true, 1, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.farming.13', 'code.record.farming', '보리', '12111,81012', NULL, true, 2, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.farming.14', 'code.record.farming', '콩', '12114,81012', NULL, true, 3, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.farming.15', 'code.record.farming', '팥', '12114,81012', NULL, true, 4, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.farming.16', 'code.record.farming', '고구마', '12114,81012', NULL, true, 5, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.farming.17', 'code.record.farming', '감자', '12114,81012', NULL, true, 6, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.farming.18', 'code.record.farming', '배추', '12115,81012', NULL, true, 7, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.farming.19', 'code.record.farming', '고추', '12115,81012', NULL, true, 8, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.farming.20', 'code.record.farming', '마늘', '12115,81012', NULL, true, 9, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.farming.21', 'code.record.farming', '양파', '12115,81012', NULL, true, 10, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.farming.22', 'code.record.farming', '파', '12115,81012', NULL, true, 11, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.farming.23', 'code.record.farming', '오이', '12115,81012', NULL, true, 12, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.farming.24', 'code.record.farming', '무', '12115,81012', NULL, true, 13, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.farming.25', 'code.record.farming', '김치', '12115,81012', NULL, true, 14, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.farming.26', 'code.record.farming', '닭', '12122,81012', NULL, true, 15, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.farming.27', 'code.record.farming', '달걀', '12123,81012', NULL, true, 16, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.farming.28', 'code.record.farming', '과일', '12117,81012', NULL, true, 17, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.farming.29', 'code.record.farming', '수수', '12113,81012', NULL, true, 18, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.farming.30', 'code.record.farming', '기장', '12113,81012', NULL, true, 19, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.farming.31', 'code.record.farming', '깨', '12116,81012', NULL, true, 20, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), +('code.record.farming.self', 'code.record.farming', '직접 입력', 'SELF', NULL, true, 99, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false); --- 수입 종류 -('code.record.income', 'code.record', '단위 Code', NULL, NULL, true, 0, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), -('code.record.income.01', 'code.record.income', '종류1', '01', NULL, true, 0, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false), -('code.record.income.02', 'code.record.income', '종류2', '02', NULL, true, 1, NOW(), 'khj', NOW(), 'khj', NULL, NULL, false); diff --git a/front/src/main/java/app/module/front/usecase/daily/expense/ports/application/DailyExpenseService.java b/front/src/main/java/app/module/front/usecase/daily/expense/ports/application/DailyExpenseService.java index 6c67275c..e0bee7b3 100644 --- a/front/src/main/java/app/module/front/usecase/daily/expense/ports/application/DailyExpenseService.java +++ b/front/src/main/java/app/module/front/usecase/daily/expense/ports/application/DailyExpenseService.java @@ -94,9 +94,10 @@ public class DailyExpenseService implements DailyExpensePortIn { new CreateDailyExpenseCmd( formVO.getId(), formVO.getDailyRecordSeq(), + (formVO.getCredit() ? "52210" : null), // [정책] 외상판매 Y 일 경우 수입부호 52210 적재 + null, formVO.getInputType(), formVO.getCredit(), - (formVO.getCredit() ? "52210" : null), // [정책] 외상판매 Y 일 경우 수입부호 52210 적재 formVO.getCategorySelf(), formVO.getSourcePurpose(), formVO.getQuantity(), diff --git a/front/src/main/java/app/module/front/usecase/daily/expense/ports/application/domain/CreateDailyExpenseCmd.java b/front/src/main/java/app/module/front/usecase/daily/expense/ports/application/domain/CreateDailyExpenseCmd.java index 16e5857d..2376b927 100644 --- a/front/src/main/java/app/module/front/usecase/daily/expense/ports/application/domain/CreateDailyExpenseCmd.java +++ b/front/src/main/java/app/module/front/usecase/daily/expense/ports/application/domain/CreateDailyExpenseCmd.java @@ -13,9 +13,10 @@ import lombok.ToString; public class CreateDailyExpenseCmd extends FrontAuditCommand { private Long id; private Long dailyRecordSeq; + private String incomeMark; + private String expenseMark; private String inputType; private Boolean credit; - private String incomeMarkCode; private String categorySelf; private String sourcePurpose; private Integer quantity; diff --git a/front/src/main/java/app/module/front/usecase/daily/income/ports/application/DailyIncomeService.java b/front/src/main/java/app/module/front/usecase/daily/income/ports/application/DailyIncomeService.java index ed28c76b..e72535ce 100644 --- a/front/src/main/java/app/module/front/usecase/daily/income/ports/application/DailyIncomeService.java +++ b/front/src/main/java/app/module/front/usecase/daily/income/ports/application/DailyIncomeService.java @@ -97,10 +97,11 @@ public class DailyIncomeService implements DailyIncomePortIn { new CreateDailyIncomeCmd( formVO.getId(), formVO.getDailyRecordSeq(), + null, + (formVO.getCredit() ? "91206" : null), // [정책] 외상판매 Y 일 경우 지출부호 91206 적재 formVO.getInputType(), formVO.getCredit(), formVO.getCropCode(), - (formVO.getCredit() ? "91206" : null), // [정책] 외상판매 Y 일 경우 지출부호 91206 적재 formVO.getCategorySelf(), formVO.getSourcePurpose(), formVO.getQuantity(), diff --git a/front/src/main/java/app/module/front/usecase/daily/income/ports/application/domain/CreateDailyIncomeCmd.java b/front/src/main/java/app/module/front/usecase/daily/income/ports/application/domain/CreateDailyIncomeCmd.java index 36c63819..06d1ceb9 100644 --- a/front/src/main/java/app/module/front/usecase/daily/income/ports/application/domain/CreateDailyIncomeCmd.java +++ b/front/src/main/java/app/module/front/usecase/daily/income/ports/application/domain/CreateDailyIncomeCmd.java @@ -13,10 +13,11 @@ import lombok.ToString; public class CreateDailyIncomeCmd extends FrontAuditCommand { private Long id; private Long dailyRecordSeq; + private String incomeMark; + private String expenseMark; private String inputType; private Boolean credit; private String cropCode; - private String expenseMarkCode; private String categorySelf; private String sourcePurpose; private Integer quantity; diff --git a/front/src/main/resources/mappers/daily/DailyExpenseMapper.xml b/front/src/main/resources/mappers/daily/DailyExpenseMapper.xml index cfa0ea57..b14cf298 100644 --- a/front/src/main/resources/mappers/daily/DailyExpenseMapper.xml +++ b/front/src/main/resources/mappers/daily/DailyExpenseMapper.xml @@ -29,13 +29,14 @@ insert into daily_expense ( - daily_record_seq, input_type, is_credit, income_mark_code, category_self, source_purpose + daily_record_seq, income_mark, expense_mark + , input_type, is_credit, category_self, source_purpose , quantity, unit_code, unit_self, price, estimated_value , is_deleted , ) values ( - #{dailyRecordSeq} - , #{inputType}, #{credit}, #{incomeMarkCode}, #{categorySelf}, #{sourcePurpose} + #{dailyRecordSeq}, #{incomeMark}, #{expenseMark} + , #{inputType}, #{credit}, #{categorySelf}, #{sourcePurpose} , #{quantity}, #{unitCode}, #{unitSelf}, #{price}, #{estimatedValue} , false , @@ -45,7 +46,8 @@ update daily_expense set , is_credit = #{credit} - , income_mark_code = #{incomeMarkCode} + , income_mark = #{incomeMark} + , expense_mark = #{expenseMark} , category_self = #{categorySelf} , source_purpose = #{sourcePurpose} , quantity = #{quantity} diff --git a/front/src/main/resources/mappers/daily/DailyIncomeMapper.xml b/front/src/main/resources/mappers/daily/DailyIncomeMapper.xml index 31af2f1a..d6e746b0 100644 --- a/front/src/main/resources/mappers/daily/DailyIncomeMapper.xml +++ b/front/src/main/resources/mappers/daily/DailyIncomeMapper.xml @@ -29,13 +29,14 @@ insert into daily_income ( - daily_record_seq, input_type, is_credit, expense_mark_code, crop_code, category_self, source_purpose + daily_record_seq, income_mark, expense_mark + , input_type, is_credit, crop_code, category_self, source_purpose , quantity, unit_code, unit_self, price, estimated_value , is_deleted , ) values ( - #{dailyRecordSeq} - , #{inputType}, #{credit}, #{expenseMarkCode}, #{cropCode}, #{categorySelf}, #{sourcePurpose} + #{dailyRecordSeq}, #{incomeMark}, #{expenseMark} + , #{inputType}, #{credit}, #{cropCode}, #{categorySelf}, #{sourcePurpose} , #{quantity}, #{unitCode}, #{unitSelf}, #{price}, #{estimatedValue} , false , @@ -45,7 +46,8 @@ update daily_income set , is_credit = #{credit} - , expense_mark_code = #{expenseMarkCode} + , income_mark = #{incomeMark} + , expense_mark = #{expenseMark} , crop_code = #{cropCode} , category_self = #{categorySelf} , source_purpose = #{sourcePurpose} diff --git a/front/src/main/resources/templates/common/components.html b/front/src/main/resources/templates/common/components.html index b27d66da..1aa00ef8 100644 --- a/front/src/main/resources/templates/common/components.html +++ b/front/src/main/resources/templates/common/components.html @@ -26,8 +26,8 @@ - - + + diff --git a/front/src/main/resources/templates/record/calendar.html b/front/src/main/resources/templates/record/calendar.html index c78dfa4e..f0dfa54e 100644 --- a/front/src/main/resources/templates/record/calendar.html +++ b/front/src/main/resources/templates/record/calendar.html @@ -410,10 +410,10 @@ } } - new DatepickerComponent(function(list, currentDate, viewDate){ - console.log('changeDateCallback', list, currentDate, viewDate); + new DatepickerComponent(function(rowdata, currentDate, viewDate){ + console.log('changeDateCallback', rowdata, currentDate, viewDate); - formControl.setDetail(list, currentDate, viewDate); + formControl.setDetail(this.currentMonth, rowdata, currentDate, viewDate); }, function(monthKey, currentDate){ console.log('changeMonthCallback', monthKey, currentDate); @@ -445,9 +445,14 @@ }; let formControl = { - setDetail(list, currentDate, viewDate) { - const todoList = list.filter(f => !(f.code === 'MONTHLY' || f.code === 'BANK')); - const etcList = list.filter(f => f.code === 'MONTHLY' || f.code === 'BANK'); + setDetail(searchMonth, rowdata, currentDate, viewDate) { + console.log(typeof rowdata, searchMonth, rowdata.no, rowdata.children) + let todoList = []; + let etcList = []; + if (typeof rowdata === 'object' && rowdata.children !== undefined) { + todoList = rowdata.children.filter(f => !(f.code === 'MONTHLY' || f.code === 'BANK')); + etcList = rowdata.children.filter(f => f.code === 'MONTHLY' || f.code === 'BANK'); + } console.log(todoList) console.log(etcList) @@ -455,23 +460,26 @@ let html = ''; if (todoList === undefined || todoList.length === 0) { html = tmpl.render({ + month: searchMonth, + no: rowdata.no, date: currentDate, etcList: etcList, }); } else { tmpl = $.templates('#dailyListTmpl'); html = tmpl.render({ + month: searchMonth, + no: rowdata.no, date: currentDate, list: todoList, etcList: etcList, }); } - console.log(html) $('#selectedDay').html(html); }, recordCreate(searchMonth, groupNo) { - location.href = ENV.httpUrl.create.replace('{searchMonth}', searchMonth).replace('{groupNo}', groupNo); + location.href = ENV.httpUrl.create.replace('{searchMonth}', searchMonth.replace('-', '')).replace('{groupNo}', groupNo); }, }; @@ -479,7 +487,7 @@ {{include tmpl="#titleTmpl" /}}
-
diff --git a/front/src/main/resources/templates/record/daily.html b/front/src/main/resources/templates/record/daily.html index 43b644d3..39cefb1a 100644 --- a/front/src/main/resources/templates/record/daily.html +++ b/front/src/main/resources/templates/record/daily.html @@ -40,7 +40,7 @@ -
+
-
+ -
-
+
*/-->
diff --git a/front/src/main/resources/templates/record/income/index.html b/front/src/main/resources/templates/record/income/index.html index df3d4e6a..de1251bd 100644 --- a/front/src/main/resources/templates/record/income/index.html +++ b/front/src/main/resources/templates/record/income/index.html @@ -179,9 +179,11 @@ $('input[name="unitCode"]').val(dataValue) // TODO : ui js 에서 show 적용유무 파악하기 + /* if (dataValue === 'code.record.unit.self') { $('#unitCode').parent().find('.component-input').addClass('show'); } + */ } });