[FO] 일계부 항목 수정 가능하도록 추가
This commit is contained in:
@@ -12,7 +12,7 @@ public interface DailyRecordMapper {
|
|||||||
DailyRecordDto getDailyRecord(DailyRecordUIReqVO reqVO);
|
DailyRecordDto getDailyRecord(DailyRecordUIReqVO reqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 등록 여부
|
* 일계부 항목 등록 여부
|
||||||
*
|
*
|
||||||
* @param reqVO
|
* @param reqVO
|
||||||
* @return
|
* @return
|
||||||
@@ -20,14 +20,21 @@ public interface DailyRecordMapper {
|
|||||||
Integer getDailyRecordExistCount(DailyRecordUIReqVO reqVO);
|
Integer getDailyRecordExistCount(DailyRecordUIReqVO reqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 등록(생성)
|
* 일계부 항목 등록(생성)
|
||||||
*
|
*
|
||||||
* @param command
|
* @param command
|
||||||
*/
|
*/
|
||||||
void createDailyRecord(CreateDailyRecordCmd command);
|
void createDailyRecord(CreateDailyRecordCmd command);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 상태 수정
|
* 일계부 항목 수정
|
||||||
|
*
|
||||||
|
* @param command
|
||||||
|
*/
|
||||||
|
void updateDailyRecord(CreateDailyRecordCmd command);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 항목의 상태 수정
|
||||||
*
|
*
|
||||||
* @param command
|
* @param command
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@@ -66,6 +66,9 @@ public class DailyRecordServiceImpl implements DailyRecordService {
|
|||||||
|
|
||||||
log.debug("[CreateDailyRecord] record={}", command);
|
log.debug("[CreateDailyRecord] record={}", command);
|
||||||
} else {
|
} else {
|
||||||
|
// TODO : NONE 으로 변경시 연관 테이블 데이터 삭제할 것인가?
|
||||||
|
dailyRecordMapper.updateDailyRecord(command);
|
||||||
|
|
||||||
log.warn("[DailyRecordCreate] existCount={}, recordMonth={}, dayGroupNo={}", existCount, reqVO.getRecordMonth(), reqVO.getDayGroupNo());
|
log.warn("[DailyRecordCreate] existCount={}, recordMonth={}, dayGroupNo={}", existCount, reqVO.getRecordMonth(), reqVO.getDayGroupNo());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,6 +40,21 @@
|
|||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateDailyRecord">
|
||||||
|
update daily_record set <include refid="common.fields.UpdateBaseSet"/>
|
||||||
|
, all_status = #{allStatus}
|
||||||
|
, income_status = #{incomeStatus}
|
||||||
|
, work_status = #{workStatus}
|
||||||
|
, expense_status = #{expenseStatus}
|
||||||
|
, power_status = #{powerStatus}
|
||||||
|
, forestry_status = #{forestryStatus}
|
||||||
|
, farming_status = #{farmingStatus}
|
||||||
|
where is_deleted = false
|
||||||
|
and record_month = #{recordMonth}
|
||||||
|
and day_group_no = #{dayGroupNo}
|
||||||
|
and household_seq = #{householdSeq}
|
||||||
|
</update>
|
||||||
|
|
||||||
<update id="updateDailyRecordStatus">
|
<update id="updateDailyRecordStatus">
|
||||||
update daily_record set <include refid="common.fields.UpdateBaseSet"/>
|
update daily_record set <include refid="common.fields.UpdateBaseSet"/>
|
||||||
<if test="allStatus != null and allStatus != ''">
|
<if test="allStatus != null and allStatus != ''">
|
||||||
|
|||||||
@@ -25,14 +25,18 @@ krip.daily.goToPrev = function(target, searchMonth, groupNo) {
|
|||||||
console.log(url);
|
console.log(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
krip.daily.goToPrev = function() {
|
||||||
|
// TODO : history.back 으로 해결 되는가?
|
||||||
|
history.back();
|
||||||
|
}
|
||||||
|
|
||||||
krip.daily.goToNext = function(target, searchMonth, groupNo) {
|
krip.daily.goToNext = function(target, searchMonth, groupNo) {
|
||||||
let url = krip.daily.httpUrl.target;
|
let url = krip.daily.httpUrl.target;
|
||||||
url = url.replace('{month}', searchMonth);
|
url = url.replace('{month}', searchMonth);
|
||||||
url = url.replace('{groupNo}', groupNo);
|
url = url.replace('{groupNo}', groupNo);
|
||||||
url = url.replace('{target}', target);
|
url = url.replace('{target}', target);
|
||||||
|
|
||||||
console.log(url);
|
location.href = url;
|
||||||
//location.href = url;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -32,7 +32,8 @@
|
|||||||
<div class="component-input">
|
<div class="component-input">
|
||||||
<label class="switch-inner type-txt">
|
<label class="switch-inner type-txt">
|
||||||
<span class="switch-label">수입</span>
|
<span class="switch-label">수입</span>
|
||||||
<input type="checkbox" name="incomeStatus" value="WAITING" data-target="income">
|
<input type="checkbox" name="incomeStatus" value="TARGET" data-target="income"
|
||||||
|
th:checked="${#strings.equals(dailyRecord.incomeStatus, 'TARGET') or #strings.equals(dailyRecord.incomeStatus, 'DONE')}">
|
||||||
<span class="switch-item">
|
<span class="switch-item">
|
||||||
<span class="switch-handle"></span>
|
<span class="switch-handle"></span>
|
||||||
</span>
|
</span>
|
||||||
@@ -41,7 +42,8 @@
|
|||||||
<div class="component-input">
|
<div class="component-input">
|
||||||
<label class="switch-inner type-txt">
|
<label class="switch-inner type-txt">
|
||||||
<span class="switch-label">임업노동 투입 내역</span>
|
<span class="switch-label">임업노동 투입 내역</span>
|
||||||
<input type="checkbox" name="workStatus" value="WAITING" data-target="work">
|
<input type="checkbox" name="workStatus" value="TARGET" data-target="work"
|
||||||
|
th:checked="${#strings.equals(dailyRecord.workStatus, 'TARGET') or #strings.equals(dailyRecord.workStatus, 'DONE')}">
|
||||||
<span class="switch-item">
|
<span class="switch-item">
|
||||||
<span class="switch-handle"></span>
|
<span class="switch-handle"></span>
|
||||||
</span>
|
</span>
|
||||||
@@ -50,7 +52,8 @@
|
|||||||
<div class="component-input">
|
<div class="component-input">
|
||||||
<label class="switch-inner type-txt">
|
<label class="switch-inner type-txt">
|
||||||
<span class="switch-label">지출</span>
|
<span class="switch-label">지출</span>
|
||||||
<input type="checkbox" name="expenseStatus" value="WAITING" data-target="expense">
|
<input type="checkbox" name="expenseStatus" value="TARGET" data-target="expense"
|
||||||
|
th:checked="${#strings.equals(dailyRecord.expenseStatus, 'TARGET') or #strings.equals(dailyRecord.expenseStatus, 'DONE')}">
|
||||||
<span class="switch-item">
|
<span class="switch-item">
|
||||||
<span class="switch-handle"></span>
|
<span class="switch-handle"></span>
|
||||||
</span>
|
</span>
|
||||||
@@ -59,7 +62,8 @@
|
|||||||
<div class="component-input">
|
<div class="component-input">
|
||||||
<label class="switch-inner type-txt">
|
<label class="switch-inner type-txt">
|
||||||
<span class="switch-label">동력 사용시간</span>
|
<span class="switch-label">동력 사용시간</span>
|
||||||
<input type="checkbox" name="powerStatus" value="WAITING" data-target="power">
|
<input type="checkbox" name="powerStatus" value="TARGET" data-target="power"
|
||||||
|
th:checked="${#strings.equals(dailyRecord.powerStatus, 'TARGET') or #strings.equals(dailyRecord.powerStatus, 'DONE')}">
|
||||||
<span class="switch-item">
|
<span class="switch-item">
|
||||||
<span class="switch-handle"></span>
|
<span class="switch-handle"></span>
|
||||||
</span>
|
</span>
|
||||||
@@ -68,17 +72,21 @@
|
|||||||
<div class="component-input">
|
<div class="component-input">
|
||||||
<label class="switch-inner type-txt">
|
<label class="switch-inner type-txt">
|
||||||
<span class="switch-label">자가임업 생산물 중 자가소비량</span>
|
<span class="switch-label">자가임업 생산물 중 자가소비량</span>
|
||||||
<input type="checkbox" name="forestryStatus" value="WAITING" data-target="forestry">
|
<input type="checkbox" name="forestryStatus" value="TARGET" data-target="forestry"
|
||||||
|
th:checked="${#strings.equals(dailyRecord.forestryStatus, 'TARGET') or #strings.equals(dailyRecord.forestryStatus, 'DONE')}">
|
||||||
<span class="switch-item">
|
<span class="switch-item">
|
||||||
<span class="switch-handle"></span>
|
<span class="switch-handle"></span>
|
||||||
</span>
|
</span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<!-- TODO : 자가농업 생산물 중 자가소비량은 7일차 등록일에만 노출 및 선택 -->
|
<!--/* [정책] 자가농업 생산물 중 자가소비량은 7일차 등록일에만 노출 및 선택, 21일 이후는 마지막 날 */-->
|
||||||
<div class="component-input">
|
<div class="component-input"
|
||||||
|
th:if="${reqVO.groupNo eq 4 or reqVO.groupNo eq 8 or reqVO.groupNo eq 12
|
||||||
|
or reqVO.groupNo eq 16 or reqVO.groupNo eq 17}">
|
||||||
<label class="switch-inner type-txt">
|
<label class="switch-inner type-txt">
|
||||||
<span class="switch-label">자가농업 생산물 중 자가소비량</span>
|
<span class="switch-label">자가농업 생산물 중 자가소비량</span>
|
||||||
<input type="checkbox" name="farmingStatus" value="WAITING" data-target="farming">
|
<input type="checkbox" name="farmingStatus" value="TARGET" data-target="farming"
|
||||||
|
th:checked="${#strings.equals(dailyRecord.farmingStatus, 'TARGET') or #strings.equals(dailyRecord.farmingStatus, 'DONE')}">
|
||||||
<span class="switch-item">
|
<span class="switch-item">
|
||||||
<span class="switch-handle"></span>
|
<span class="switch-handle"></span>
|
||||||
</span>
|
</span>
|
||||||
@@ -90,7 +98,7 @@
|
|||||||
</main>
|
</main>
|
||||||
|
|
||||||
<div class="component-btns fixed">
|
<div class="component-btns fixed">
|
||||||
<div class="btns-row" th:if="${!dailyRecord.updated}">
|
<div class="btns-row">
|
||||||
<button type="button" class="btn btn-l btn-primary" th:onclick="formControl.createValid([[${reqVO.searchMonth}]], [[${reqVO.groupNo}]])">
|
<button type="button" class="btn btn-l btn-primary" th:onclick="formControl.createValid([[${reqVO.searchMonth}]], [[${reqVO.groupNo}]])">
|
||||||
<span class="btn-txt">다음 단계로 이동</span>
|
<span class="btn-txt">다음 단계로 이동</span>
|
||||||
</button>
|
</button>
|
||||||
@@ -104,7 +112,7 @@
|
|||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
let ENV = {
|
let ENV = {
|
||||||
httpUrl: {
|
httpUrl: {
|
||||||
root: /*[[|/record/daily/${reqVO.searchMonth}/${reqVO.groupNo}|]]*/'rootUrl',
|
create: /*[[|/api/record/daily/${reqVO.searchMonth}/${reqVO.groupNo}|]]*/'createUrl',
|
||||||
},
|
},
|
||||||
month: [[${reqVO.searchMonth}]],
|
month: [[${reqVO.searchMonth}]],
|
||||||
groupNo: [[${reqVO.groupNo}]],
|
groupNo: [[${reqVO.groupNo}]],
|
||||||
@@ -156,9 +164,9 @@
|
|||||||
|
|
||||||
const obj = $(f).serializeObject();
|
const obj = $(f).serializeObject();
|
||||||
ajaxUtil._ajaxAsync(
|
ajaxUtil._ajaxAsync(
|
||||||
ENV.httpUrl.root,
|
ENV.httpUrl.create,
|
||||||
obj,
|
obj,
|
||||||
function (rstData, status) {
|
function () {
|
||||||
if (f.todayNone.value === 'Y') {
|
if (f.todayNone.value === 'Y') {
|
||||||
krip.daily.goToMain();
|
krip.daily.goToMain();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -106,7 +106,7 @@
|
|||||||
<!-- 하단 고정 버튼 -->
|
<!-- 하단 고정 버튼 -->
|
||||||
<div class="component-btns fixed">
|
<div class="component-btns fixed">
|
||||||
<div class="btns-row">
|
<div class="btns-row">
|
||||||
<button type="button" class="btn btn-l btn-secondary">
|
<button type="button" class="btn btn-l btn-secondary" onclick="krip.daily.goToPrev();">
|
||||||
<span class="btn-txt">이전 단계로 이동</span>
|
<span class="btn-txt">이전 단계로 이동</span>
|
||||||
</button>
|
</button>
|
||||||
<!-- 비활성화 스타일/ 버튼 속성 disable 추가-->
|
<!-- 비활성화 스타일/ 버튼 속성 disable 추가-->
|
||||||
@@ -222,24 +222,23 @@
|
|||||||
function(rstHtml, status) {
|
function(rstHtml, status) {
|
||||||
$('.modal01').find('.modal-content').html(rstHtml);
|
$('.modal01').find('.modal-content').html(rstHtml);
|
||||||
|
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
etUI.components.SelectBox().core.init(document.querySelector('#categoryCode'));
|
etUI.components.SelectBox().core.init(document.querySelector('#categoryCode'));
|
||||||
etUI.components.SelectBox().core.init(document.querySelector('#cropCode'));
|
etUI.components.SelectBox().core.init(document.querySelector('#cropCode'));
|
||||||
etUI.components.SelectBox().core.init(document.querySelector('#unitCode'));
|
etUI.components.SelectBox().core.init(document.querySelector('#unitCode'));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
const selectbox = etUI.components.SelectBox();
|
etUI.components.SelectBox().core.init(document.querySelector('#categoryCode'), {
|
||||||
etUI.components.SelectBox().core.init(document.querySelector('#selectCategory'), {
|
|
||||||
onChange: function() {
|
onChange: function() {
|
||||||
console.log('sssssssssss')
|
console.log('sssssssssss')
|
||||||
},
|
},
|
||||||
selectItemCallback: function() {
|
selectItemCallback: function() {
|
||||||
|
// TODO : console.log ?
|
||||||
console.log(1111)
|
console.log(1111)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
etUI.components.SelectBox().core.init(document.querySelector('#selectUnit'), {
|
etUI.components.SelectBox().core.init(document.querySelector('#unitCode'), {
|
||||||
onChange: function() {
|
onChange: function() {
|
||||||
console.log('sssssssssss')
|
console.log('sssssssssss')
|
||||||
},
|
},
|
||||||
@@ -247,20 +246,19 @@
|
|||||||
console.log(3333)
|
console.log(3333)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
|
|
||||||
document.querySelector('#selectUnit').addEventListener('select:onChange', (e) => {
|
/*document.querySelector('#selectUnit').addEventListener('select:onChange', (e) => {
|
||||||
console.log(e.detail);
|
console.log(e.detail);
|
||||||
console.log(e.detail.value);
|
console.log(e.detail.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
etUI.components.SelectBox();
|
|
||||||
const selectbox2 = document.querySelector('.component-select');
|
const selectbox2 = document.querySelector('.component-select');
|
||||||
selectbox2.addEventListener('select:onChange', (e) => {
|
selectbox2.addEventListener('select:onChange', (e) => {
|
||||||
console.log(e.detail);
|
console.log(e.detail);
|
||||||
console.log(e.detail.value);
|
console.log(e.detail.value);
|
||||||
});
|
});
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//document.queerySelector('#unitSelect')
|
//document.queerySelector('#unitSelect')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user