Merge branch 'bo_daily' into dev
This commit is contained in:
@@ -11,6 +11,7 @@ import lombok.Setter;
|
||||
@EqualsAndHashCode
|
||||
public class GetDailyRecordsStatus {
|
||||
private Long id;
|
||||
private Integer dayGroupNo;
|
||||
private String dayGroup;
|
||||
private RecordStatusType allStatusType;
|
||||
private String incomeStatus;
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.adapters.persistence;
|
||||
|
||||
import app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.ports.UpdateDailyNonePortOut;
|
||||
import app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.ports.application.domain.UpdateDailyNoneCmd;
|
||||
import app.module.core.config.application.enums.DailySort;
|
||||
import app.module.core.config.application.enums.DailyTargetStatus;
|
||||
import app.module.core.usecase.daily.record.ports.DailyRecordPortIn;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Slf4j
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class UpdateDailyNoneDao implements UpdateDailyNonePortOut {
|
||||
private final UpdateDailyNoneMapper mapper;
|
||||
private final DailyRecordPortIn dailyRecordPortIn;
|
||||
|
||||
@Override
|
||||
public void create(UpdateDailyNoneCmd command) {
|
||||
command.setDailyRecordSeq(mapper.getDailyRecordSeq(command));
|
||||
|
||||
if (command.getCurrentStep() != null) {
|
||||
if (DailyTargetStatus.TODAY_NONE.equals(command.getCurrentStatus())) {
|
||||
// 등록된 데이터 일괄 삭제
|
||||
if (DailySort.INCOME.equals(command.getCurrentStep())) {
|
||||
mapper.removeDailyIncome(command);
|
||||
} else if (DailySort.WORK.equals(command.getCurrentStep())) {
|
||||
mapper.removeDailyWork(command);
|
||||
} else if (DailySort.EXPENSE.equals(command.getCurrentStep())) {
|
||||
mapper.removeDailyExpense(command);
|
||||
} else if (DailySort.POWER.equals(command.getCurrentStep())) {
|
||||
mapper.removeDailyPower(command);
|
||||
} else if (DailySort.FORESTRY.equals(command.getCurrentStep())) {
|
||||
mapper.removeDailyForestry(command);
|
||||
} else if (DailySort.FARMING.equals(command.getCurrentStep())) {
|
||||
mapper.removeDailyFarming(command);
|
||||
}
|
||||
}
|
||||
|
||||
dailyRecordPortIn.updateByStatus(command.getSearchMonth(), command.getGroupNo(), command.getHouseholdSeq(), command.getCurrentStep().name(), command.getCurrentStatus().name());
|
||||
|
||||
} else {
|
||||
log.error("[CreateDailyNone] Current step is null. cmd:{}", command);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.adapters.persistence;
|
||||
|
||||
import app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.ports.application.domain.UpdateDailyNoneCmd;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface UpdateDailyNoneMapper {
|
||||
/**
|
||||
* 일계부 항목 일련번호 조회
|
||||
*
|
||||
* @param command 검색 조건
|
||||
* @return 일계부 항목 일련번호
|
||||
*/
|
||||
Long getDailyRecordSeq(UpdateDailyNoneCmd command);
|
||||
|
||||
/**
|
||||
* 특정일의 수입 전체 삭제
|
||||
* @param command 검색 조건
|
||||
*/
|
||||
void removeDailyIncome(UpdateDailyNoneCmd command);
|
||||
|
||||
/**
|
||||
* 특정일의 임업노동 투입 전체 삭제
|
||||
* @param command 검색 조건
|
||||
*/
|
||||
void removeDailyWork(UpdateDailyNoneCmd command);
|
||||
|
||||
/**
|
||||
* 특정일의 지출 전체 삭제
|
||||
* @param command 검색 조건
|
||||
*/
|
||||
void removeDailyExpense(UpdateDailyNoneCmd command);
|
||||
|
||||
/**
|
||||
* 동력 사용시간 전체 삭제
|
||||
* @param command 검색 조건
|
||||
*/
|
||||
void removeDailyPower(UpdateDailyNoneCmd command);
|
||||
|
||||
/**
|
||||
* 자가임업 생산물 중 자가소비량 전체 삭제
|
||||
* @param command 검색 조건
|
||||
*/
|
||||
void removeDailyForestry(UpdateDailyNoneCmd command);
|
||||
|
||||
/**
|
||||
* 자가농업 생산물 중 자가소비량 전체 삭제
|
||||
* @param command 검색 조건
|
||||
*/
|
||||
void removeDailyFarming(UpdateDailyNoneCmd command);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.adapters.web;
|
||||
|
||||
import app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.adapters.web.modal.UpdateDailyNoneReqVO;
|
||||
import app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.ports.UpdateDailyNonePortIn;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
class UpdateDailyNoneController {
|
||||
private final UpdateDailyNonePortIn updateDailyNonePortIn;
|
||||
|
||||
@PostMapping(path = "/api/household/daily/today-none")
|
||||
ResponseEntity<?> create(@RequestBody UpdateDailyNoneReqVO formVO) {
|
||||
log.debug("formVO: {}", formVO);
|
||||
|
||||
updateDailyNonePortIn.create(formVO);
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK).body(formVO);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.adapters.web.modal;
|
||||
|
||||
import app.module.core.config.application.enums.DailySort;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class UpdateDailyNoneReqVO {
|
||||
private String recordMonth;
|
||||
private Integer groupNo;
|
||||
private Long householdSeq;
|
||||
|
||||
/**
|
||||
* 현재 단계
|
||||
*/
|
||||
private DailySort currentStep;
|
||||
/**
|
||||
* 금일 데이터 없음 여부 (Y/N)
|
||||
*/
|
||||
private String todayNone;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.ports;
|
||||
|
||||
import app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.adapters.web.modal.UpdateDailyNoneReqVO;
|
||||
|
||||
public interface UpdateDailyNonePortIn {
|
||||
/**
|
||||
* 일계부 금일 데이터 없음 등록
|
||||
*
|
||||
* @param formVO 입력 데이터
|
||||
*/
|
||||
void create(UpdateDailyNoneReqVO formVO);
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.ports;
|
||||
|
||||
import app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.ports.application.domain.UpdateDailyNoneCmd;
|
||||
|
||||
public interface UpdateDailyNonePortOut {
|
||||
/**
|
||||
* 일계부 금일 데이터 없음 등록
|
||||
*
|
||||
* @param command 입력 데이터
|
||||
*/
|
||||
void create(UpdateDailyNoneCmd command);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.ports.application;
|
||||
|
||||
import app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.adapters.web.modal.UpdateDailyNoneReqVO;
|
||||
import app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.ports.UpdateDailyNonePortIn;
|
||||
import app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.ports.UpdateDailyNonePortOut;
|
||||
import app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.ports.application.domain.UpdateDailyNoneCmd;
|
||||
import app.module.core.config.application.enums.DailyTargetStatus;
|
||||
import app.module.core.config.application.util.AuditUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class UpdateDailyNoneService implements UpdateDailyNonePortIn {
|
||||
private final UpdateDailyNonePortOut portOut;
|
||||
|
||||
@Override
|
||||
public void create(UpdateDailyNoneReqVO formVO) {
|
||||
DailyTargetStatus currentStatus = "Y".equals(formVO.getTodayNone()) ? DailyTargetStatus.TODAY_NONE : DailyTargetStatus.TARGET;
|
||||
|
||||
UpdateDailyNoneCmd command = AuditUtil.update(
|
||||
new UpdateDailyNoneCmd(
|
||||
formVO.getRecordMonth(),
|
||||
formVO.getGroupNo(),
|
||||
formVO.getHouseholdSeq(),
|
||||
formVO.getCurrentStep(),
|
||||
currentStatus,
|
||||
null)
|
||||
);
|
||||
|
||||
portOut.create(command);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.ports.application.domain;
|
||||
|
||||
import app.module.core.config.adapters.persistence.component.AuditCommand;
|
||||
import app.module.core.config.application.enums.DailySort;
|
||||
import app.module.core.config.application.enums.DailyTargetStatus;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class UpdateDailyNoneCmd extends AuditCommand {
|
||||
private String searchMonth;
|
||||
private Integer groupNo;
|
||||
private Long householdSeq;
|
||||
|
||||
/**
|
||||
* 현재 단계
|
||||
*/
|
||||
private DailySort currentStep;
|
||||
/**
|
||||
* 현재 입력상태
|
||||
*/
|
||||
private DailyTargetStatus currentStatus;
|
||||
/**
|
||||
* 일계부 항목 일련번호
|
||||
*/
|
||||
private Long dailyRecordSeq;
|
||||
}
|
||||
@@ -34,6 +34,7 @@
|
||||
)
|
||||
SELECT
|
||||
dr.id AS id,
|
||||
ddg.group_no AS day_group_no,
|
||||
/* 해당 월의 말일을 기준으로 종료일을 제한하여 일자 그룹 표시 */
|
||||
ddg.start_day ||
|
||||
CASE
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="app.module.admin.usecase.household.tab.dailyRecord.updateDailyNone.adapters.persistence.UpdateDailyNoneMapper">
|
||||
|
||||
<select id="getDailyRecordSeq">
|
||||
select id
|
||||
from daily_record
|
||||
where is_deleted = false
|
||||
and record_month = #{searchMonth}
|
||||
and day_group_no = #{groupNo}
|
||||
and household_seq = #{householdSeq}
|
||||
</select>
|
||||
|
||||
<select id="removeDailyIncome">
|
||||
<if test="dailyRecordSeq != null and dailyRecordSeq != ''">
|
||||
update daily_income set
|
||||
<include refid="common.fields.DeleteBaseSet"/>
|
||||
where is_deleted = false
|
||||
and daily_record_seq = #{dailyRecordSeq}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="removeDailyWork">
|
||||
<if test="dailyRecordSeq != null and dailyRecordSeq != ''">
|
||||
update daily_work set
|
||||
<include refid="common.fields.DeleteBaseSet"/>
|
||||
where is_deleted = false
|
||||
and daily_record_seq = #{dailyRecordSeq}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="removeDailyExpense">
|
||||
<if test="dailyRecordSeq != null and dailyRecordSeq != ''">
|
||||
update daily_expense set
|
||||
<include refid="common.fields.DeleteBaseSet"/>
|
||||
where is_deleted = false
|
||||
and daily_record_seq = #{dailyRecordSeq}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="removeDailyPower">
|
||||
<if test="dailyRecordSeq != null and dailyRecordSeq != ''">
|
||||
update daily_power set
|
||||
<include refid="common.fields.DeleteBaseSet"/>
|
||||
where is_deleted = false
|
||||
and daily_record_seq = #{dailyRecordSeq}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="removeDailyForestry">
|
||||
<if test="dailyRecordSeq != null and dailyRecordSeq != ''">
|
||||
update daily_forestry set
|
||||
<include refid="common.fields.DeleteBaseSet"/>
|
||||
where is_deleted = false
|
||||
and daily_record_seq = #{dailyRecordSeq}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="removeDailyFarming">
|
||||
<if test="dailyRecordSeq != null and dailyRecordSeq != ''">
|
||||
update daily_farming set
|
||||
<include refid="common.fields.DeleteBaseSet"/>
|
||||
where is_deleted = false
|
||||
and daily_record_seq = #{dailyRecordSeq}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -4,6 +4,10 @@
|
||||
|
||||
<div class="layer-wrap" th:fragment="tabFragment">
|
||||
<div class="tab-content daily-record" data-tab-value="tab1" >
|
||||
<input type="hidden" name="dailyId">
|
||||
<input type="hidden" name="groupNo">
|
||||
<input type="hidden" name="dayGroupText">
|
||||
|
||||
<!-- 일계부 등록 현황 리스트 -->
|
||||
<div class="daily-record-content daily-record-list">
|
||||
<div class="content-inner">
|
||||
@@ -11,23 +15,23 @@
|
||||
<ul>
|
||||
<li>
|
||||
<p>작성완료</p>
|
||||
<span><strong id="doneCount">6</strong>건</span>
|
||||
<span><strong id="doneCount">0</strong>건</span>
|
||||
</li>
|
||||
<li>
|
||||
<p>미작성</p>
|
||||
<span><strong id="emptyCount">6</strong>건</span>
|
||||
<span><strong id="emptyCount">0</strong>건</span>
|
||||
</li>
|
||||
<li>
|
||||
<p>미완료</p>
|
||||
<span><strong id="incompleteCount">6</strong>건</span>
|
||||
<span><strong id="incompleteCount">0</strong>건</span>
|
||||
</li>
|
||||
<li>
|
||||
<p>대기</p>
|
||||
<span><strong id="waitingCount">6</strong>건</span>
|
||||
<span><strong id="waitingCount">0</strong>건</span>
|
||||
</li>
|
||||
<li>
|
||||
<p>완료율</p>
|
||||
<span><strong id="progressPercent">56.12</strong>%</span>
|
||||
<span><strong id="progressPercent">0</strong>%</span>
|
||||
</li>
|
||||
</ul>
|
||||
</article>
|
||||
@@ -53,8 +57,21 @@
|
||||
|
||||
<!-- 일계부 등록 현황 상세 -->
|
||||
<div class="daily-record-content daily-record-detail" style="display: none;">
|
||||
|
||||
<div class="content-inner">
|
||||
<!-- 현황 -->
|
||||
<section class="table-group">
|
||||
<div class="table-tit-group">
|
||||
<h3 class="_selectedGroupNo">현황</h3>
|
||||
<div class="component-btns bottom-btn-group" th:unless="${activeProfile != 'local'}">
|
||||
<div class="btns-row align-right">
|
||||
<button type="button" class="btn small" onclick="getDailyRecordsList()">
|
||||
<span class="btn-txt">등록 현황 목록</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 수입 -->
|
||||
<section class="table-group">
|
||||
<div class="table-tit-group">
|
||||
@@ -65,12 +82,19 @@
|
||||
<span class="btn-txt">영수증 다운로드 <i class="ico-download" aria-hidden="true"></i></span>
|
||||
</button>
|
||||
<button type="button" class="btn small">
|
||||
<span class="btn-txt">등록여부</span>
|
||||
<span class="btn-txt">
|
||||
<label class="radio-inner">
|
||||
<span class="radio-item">
|
||||
<span class="radio-txt">금일 데이터 없음</span>
|
||||
</span>
|
||||
<input type="checkbox" id="incomeStatus" data-step="INCOME" onclick="showDailyNoneConfirm(this)">
|
||||
</label>
|
||||
</span>
|
||||
</button>
|
||||
<button type="button" class="btn small btn-secondary">
|
||||
<button type="button" class="btn small btn-secondary" style="display: none;" data-step="INCOME" data-list-id="table-income" onclick="removeDaily(this)">
|
||||
<span class=" btn-txt">삭제</span>
|
||||
</button>
|
||||
<button type="button" class="btn small btn-primary">
|
||||
<button type="button" class="btn small btn-primary" style="display: none;" data-step="INCOME" data-modal-id="modal-income" onclick="saveDaily(this)">
|
||||
<span class="btn-txt">추가</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -104,12 +128,19 @@
|
||||
<div class="component-btns bottom-btn-group" th:unless="${activeProfile != 'local'}">
|
||||
<div class="btns-row align-right">
|
||||
<button type="button" class="btn small">
|
||||
<span class="btn-txt">등록여부</span>
|
||||
<span class="btn-txt">
|
||||
<label class="radio-inner">
|
||||
<span class="radio-item">
|
||||
<span class="radio-txt">금일 데이터 없음</span>
|
||||
</span>
|
||||
<input type="checkbox" id="workStatus" data-step="WORK" onclick="showDailyNoneConfirm(this)">
|
||||
</label>
|
||||
</span>
|
||||
</button>
|
||||
<button type="button" class="btn small btn-secondary">
|
||||
<button type="button" class="btn small btn-secondary" style="display: none;" data-step="WORK" data-list-id="table-work" onclick="removeDaily(this)">
|
||||
<span class=" btn-txt">삭제</span>
|
||||
</button>
|
||||
<button type="button" class="btn small btn-primary">
|
||||
<button type="button" class="btn small btn-primary" style="display: none;" data-step="WORK" data-modal-id="modal-work" onclick="saveDaily(this)">
|
||||
<span class="btn-txt">추가</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -159,12 +190,19 @@
|
||||
<span class="btn-txt">영수증 다운로드 <i class="ico-download" aria-hidden="true"></i></span>
|
||||
</button>
|
||||
<button type="button" class="btn small">
|
||||
<span class="btn-txt">등록여부</span>
|
||||
<span class="btn-txt">
|
||||
<label class="radio-inner">
|
||||
<span class="radio-item">
|
||||
<span class="radio-txt">금일 데이터 없음</span>
|
||||
</span>
|
||||
<input type="checkbox" id="expenseStatus" data-step="EXPENSE" onclick="showDailyNoneConfirm(this)">
|
||||
</label>
|
||||
</span>
|
||||
</button>
|
||||
<button type="button" class="btn small btn-secondary">
|
||||
<button type="button" class="btn small btn-secondary" style="display: none;" data-step="EXPENSE" data-list-id="table-expense" onclick="removeDaily(this)">
|
||||
<span class=" btn-txt">삭제</span>
|
||||
</button>
|
||||
<button type="button" class="btn small btn-primary">
|
||||
<button type="button" class="btn small btn-primary" style="display: none;" data-step="EXPENSE" data-modal-id="modal-expense" onclick="saveDaily(this)">
|
||||
<span class="btn-txt">추가</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -197,12 +235,19 @@
|
||||
<div class="component-btns bottom-btn-group" th:unless="${activeProfile != 'local'}">
|
||||
<div class="btns-row align-right">
|
||||
<button type="button" class="btn small">
|
||||
<span class="btn-txt">등록여부</span>
|
||||
<span class="btn-txt">
|
||||
<label class="radio-inner">
|
||||
<span class="radio-item">
|
||||
<span class="radio-txt">금일 데이터 없음</span>
|
||||
</span>
|
||||
<input type="checkbox" id="powerStatus" data-step="POWER" onclick="showDailyNoneConfirm(this)">
|
||||
</label>
|
||||
</span>
|
||||
</button>
|
||||
<button type="button" class="btn small btn-secondary">
|
||||
<button type="button" class="btn small btn-secondary" style="display: none;" data-step="POWER" data-list-id="table-power" onclick="removeDaily(this)">
|
||||
<span class=" btn-txt">삭제</span>
|
||||
</button>
|
||||
<button type="button" class="btn small btn-primary">
|
||||
<button type="button" class="btn small btn-primary" style="display: none;" data-step="POWER" data-modal-id="modal-power" onclick="saveDaily(this)">
|
||||
<span class="btn-txt">추가</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -231,12 +276,19 @@
|
||||
<div class="component-btns bottom-btn-group" th:unless="${activeProfile != 'local'}">
|
||||
<div class="btns-row align-right">
|
||||
<button type="button" class="btn small">
|
||||
<span class="btn-txt">등록여부</span>
|
||||
<span class="btn-txt">
|
||||
<label class="radio-inner">
|
||||
<span class="radio-item">
|
||||
<span class="radio-txt">금일 데이터 없음</span>
|
||||
</span>
|
||||
<input type="checkbox" id="forestryStatus" data-step="FORESTRY" onclick="showDailyNoneConfirm(this)">
|
||||
</label>
|
||||
</span>
|
||||
</button>
|
||||
<button type="button" class="btn small btn-secondary">
|
||||
<button type="button" class="btn small btn-secondary" style="display: none;" data-step="FORESTRY" data-list-id="table-forestry" onclick="removeDaily(this)">
|
||||
<span class=" btn-txt">삭제</span>
|
||||
</button>
|
||||
<button type="button" class="btn small btn-primary">
|
||||
<button type="button" class="btn small btn-primary" style="display: none;" data-step="FORESTRY" data-modal-id="modal-forestry" onclick="saveDaily(this)">
|
||||
<span class="btn-txt">추가</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -267,12 +319,19 @@
|
||||
<div class="component-btns bottom-btn-group" th:unless="${activeProfile != 'local'}">
|
||||
<div class="btns-row align-right">
|
||||
<button type="button" class="btn small">
|
||||
<span class="btn-txt">등록여부</span>
|
||||
<span class="btn-txt">
|
||||
<label class="radio-inner">
|
||||
<span class="radio-item">
|
||||
<span class="radio-txt">금일 데이터 없음</span>
|
||||
</span>
|
||||
<input type="checkbox" id="farmingStatus" data-step="FARMING" onclick="showDailyNoneConfirm(this)">
|
||||
</label>
|
||||
</span>
|
||||
</button>
|
||||
<button type="button" class="btn small btn-secondary">
|
||||
<button type="button" class="btn small btn-secondary" style="display: none;" data-step="FARMING" data-list-id="table-farming" onclick="removeDaily(this)">
|
||||
<span class=" btn-txt">삭제</span>
|
||||
</button>
|
||||
<button type="button" class="btn small btn-primary">
|
||||
<button type="button" class="btn small btn-primary" style="display: none;" data-step="FARMING" data-modal-id="modal-farming" onclick="saveDaily(this)">
|
||||
<span class="btn-txt">추가</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -300,10 +359,10 @@
|
||||
</div>
|
||||
|
||||
<script th:inline="javascript">
|
||||
const f = document.reqForm;
|
||||
|
||||
// 일계부 등록 현황 리스트 조회
|
||||
const getDailyRecords = () => {
|
||||
const f = document.reqForm;
|
||||
|
||||
ajaxUtil._ajaxMethod(
|
||||
'/api/household/dailyRecordsStatus',
|
||||
{
|
||||
@@ -331,7 +390,7 @@
|
||||
tmpl +=
|
||||
`
|
||||
<tr>
|
||||
<td class="underline"><a href="javascript:void(0);" onclick="getDailyRecordsView(${item.id});">${item.dayGroup}</a></td>
|
||||
<td class="underline"><a href="javascript:void(0);" onclick="getDailyRecordsView(${item.id}, ${item.dayGroupNo}, '${item.dayGroup}');">${item.dayGroup}</a></td>
|
||||
<td>
|
||||
<span class="tag ${statusInfoMap[item.allStatusType].className}">
|
||||
${statusInfoMap[item.allStatusType].label}
|
||||
@@ -357,15 +416,20 @@
|
||||
);
|
||||
}
|
||||
|
||||
// 임산물 등록 현황 상세
|
||||
const getDailyRecordsView = (id) => {
|
||||
// 일계부 등록 현황 상세
|
||||
const getDailyRecordsView = (id, groupNo, dayGroupText) => {
|
||||
if(id == null) {
|
||||
alert('등록 내역이 없습니다.');
|
||||
return;
|
||||
}
|
||||
|
||||
f.dailyId.value = id;
|
||||
f.groupNo.value = groupNo;
|
||||
f.dayGroupText.value = dayGroupText;
|
||||
|
||||
const listArea = $('.tab-content .daily-record-list');
|
||||
const detailArea = $('.tab-content .daily-record-detail');
|
||||
detailArea.find('._selectedGroupNo').text(dayGroupText + '일 현황');
|
||||
|
||||
listArea.hide();
|
||||
detailArea.show();
|
||||
@@ -375,6 +439,24 @@
|
||||
{ recordSeq: id },
|
||||
function(response) { // 성공
|
||||
console.log("일계부 등록 상세 데이터 : ", response);
|
||||
|
||||
// 금일 데이터 없음 체크
|
||||
$('#incomeStatus').attr('checked', response.status.incomeStatus === 'TODAY_NONE');
|
||||
$('#workStatus').attr('checked', response.status.workStatus === 'TODAY_NONE');
|
||||
$('#expenseStatus').attr('checked', response.status.expenseStatus === 'TODAY_NONE');
|
||||
$('#powerStatus').attr('checked', response.status.powerStatus === 'TODAY_NONE');
|
||||
$('#forestryStatus').attr('checked', response.status.forestryStatus === 'TODAY_NONE');
|
||||
if (response.status.farmingStatus === 'NONE') {
|
||||
$('#farmingStatus').attr('disabled', true);
|
||||
} else {
|
||||
$('#farmingStatus').attr('disabled', false);
|
||||
$('#farmingStatus').attr('checked', response.status.farmingStatus === 'TODAY_NONE');
|
||||
}
|
||||
|
||||
// 금일 데이터 없음에 따라 버튼 hide 처리
|
||||
showDailyNoneBtn();
|
||||
|
||||
// 상세 테이블 그리기
|
||||
gridIncomeTable(response.status.incomeStatus, response.incomes);
|
||||
gridWorkTable(response.status.workStatus, response.works);
|
||||
gridExpenseTable(response.status.expenseStatus, response.expenses);
|
||||
@@ -390,6 +472,17 @@
|
||||
);
|
||||
}
|
||||
|
||||
// 입력현황 목록
|
||||
const getDailyRecordsList = () => {
|
||||
getDailyRecords();
|
||||
|
||||
const listArea = $('.tab-content .daily-record-list');
|
||||
const detailArea = $('.tab-content .daily-record-detail');
|
||||
|
||||
listArea.show();
|
||||
detailArea.hide();
|
||||
}
|
||||
|
||||
// 수입 테이블 그리기
|
||||
const gridIncomeTable = (status, data) => {
|
||||
const tbody = $('#table-income tbody');
|
||||
@@ -637,6 +730,95 @@
|
||||
|
||||
tbody.append(tmpl);
|
||||
}
|
||||
|
||||
// 금일 데이터 없음에 따라 버튼 hide/show 처리
|
||||
const showDailyNoneBtn = () => {
|
||||
$('.daily-record-detail').find('.table-tit-group').each(function(index, item) {
|
||||
let checkedIndex = false;
|
||||
$(item).find('[type="button"]').each(function(indexBtn, itemBtn) {
|
||||
let $chkBox = $(itemBtn).find('input[type="checkbox"]');
|
||||
if (($chkBox.length !== 0 && $chkBox.is(':disabled'))) {
|
||||
checkedIndex = true;
|
||||
}
|
||||
|
||||
if (checkedIndex) {
|
||||
$(itemBtn).hide();
|
||||
} else {
|
||||
$(itemBtn).show();
|
||||
}
|
||||
|
||||
if ($chkBox.length !== 0) {
|
||||
checkedIndex = $chkBox.is(':checked') || $chkBox.is(':disabled');
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
// 데이터 초기화 Confirm
|
||||
const showDailyNoneConfirm = (el) => {
|
||||
const currentStep = $(el).data('step');
|
||||
const todayNone = $(el).is(':checked') ? 'Y' : 'N';
|
||||
if (currentStep === undefined) {
|
||||
alert('변경할 수 없는 상태입니다.');
|
||||
$(el).prop('checked', todayNone !== 'Y');
|
||||
return;
|
||||
}
|
||||
|
||||
const obj = $(f).serializeObject();
|
||||
obj.currentStep = currentStep;
|
||||
obj.todayNone = todayNone;
|
||||
|
||||
if (todayNone === 'Y') {
|
||||
etUI.dialog.confirm({
|
||||
title: '초기화 안내',
|
||||
message: '등록하신 모든 내용을 삭제하시겠어요?<br>삭제된 내용은 복구할 수 없습니다.',
|
||||
negativeCallback: function () {
|
||||
$(el).prop('checked', todayNone !== 'Y');
|
||||
},
|
||||
positiveCallback: function () {
|
||||
updateDailyNone(el, obj);
|
||||
},
|
||||
});
|
||||
|
||||
} else {
|
||||
updateDailyNone(el, obj);
|
||||
}
|
||||
}
|
||||
|
||||
// 금일 데이터 없음 수정 처리
|
||||
const updateDailyNone = (el, obj) => {
|
||||
ajaxUtil._ajaxAsyncNoWaiting(
|
||||
'/api/household/daily/today-none',
|
||||
obj,
|
||||
function () {
|
||||
if (obj.todayNone === 'Y') {
|
||||
alert('데이터 초기화가 완료되었습니다.');
|
||||
} else {
|
||||
alert('등록 상태가 변경되었습니다.');
|
||||
}
|
||||
|
||||
getDailyRecordsView(f.dailyId.value, f.groupNo.value, f.dayGroupText.value);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// 일계부 등록 처리
|
||||
const saveDaily = (el) => {
|
||||
const currentStep = $(el).data('step');
|
||||
const currentModalId = $(el).data('modalId');
|
||||
console.log('removeDaily', currentStep, currentModalId);
|
||||
|
||||
alert('TODO : 추가')
|
||||
}
|
||||
|
||||
// 일계부 삭제 처리
|
||||
const removeDaily = (el) => {
|
||||
const currentStep = $(el).data('step');
|
||||
const currentListId = $(el).data('listId');
|
||||
console.log('removeDaily', currentStep, currentListId);
|
||||
|
||||
alert('TODO : 삭제')
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</html>
|
||||
@@ -27,6 +27,8 @@ public class AuditCommand {
|
||||
public void update() {
|
||||
this.updatedAt = LocalDateTime.now();
|
||||
this.updatedBy = getCurrentUsername();
|
||||
this.deletedAt = LocalDateTime.now();
|
||||
this.deletedBy = getCurrentUsername();
|
||||
}
|
||||
|
||||
public void delete() {
|
||||
|
||||
@@ -77,6 +77,7 @@ public class DailyRecordDao implements DailyRecordPortOut {
|
||||
);
|
||||
|
||||
if ("ALL".equals(targetType)) {
|
||||
// 전체 입력상태 변경
|
||||
String allStatus = this.getUpdateAllStatus(recordMonth, dayGroupNo, householdSeq);
|
||||
if (allStatus != null) {
|
||||
command.setAllStatus(allStatus);
|
||||
@@ -88,7 +89,11 @@ public class DailyRecordDao implements DailyRecordPortOut {
|
||||
}
|
||||
|
||||
} else {
|
||||
// 항목 입력상태 변경
|
||||
dailyRecordMapper.updateDailyRecordStatus(command);
|
||||
|
||||
// 전체 입력상태 변경
|
||||
this.updateByAllStatus(command.getRecordMonth(), command.getDayGroupNo(), command.getHouseholdSeq());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,8 +8,10 @@ public interface DailyRecordPortIn {
|
||||
/**
|
||||
* 일계부 항목 조회
|
||||
*
|
||||
* @param reqVO 검색 조건
|
||||
* @return 항목 상세
|
||||
* @param recordMonth
|
||||
* @param dayGroupNo
|
||||
* @param householdSeq
|
||||
* @return 항목 상세
|
||||
*/
|
||||
DailyRecordDto detail(String recordMonth, Integer dayGroupNo, Long householdSeq);
|
||||
|
||||
|
||||
@@ -15,7 +15,16 @@ public class UpdateDailyRecordStatusCmd extends AuditCommand {
|
||||
private Integer dayGroupNo;
|
||||
private Long householdSeq;
|
||||
|
||||
/**
|
||||
* 전체 입력상태
|
||||
*/
|
||||
private String allStatus;
|
||||
/**
|
||||
* 변경 대상
|
||||
*/
|
||||
private String targetType;
|
||||
/**
|
||||
* 변경 대상 입력상태
|
||||
*/
|
||||
private String targetStatus;
|
||||
}
|
||||
|
||||
@@ -87,7 +87,6 @@
|
||||
, all_status = #{allStatus}
|
||||
</if>
|
||||
<if test="targetType != null and targetType != ''">
|
||||
/* TODO 개별 상태값 변경 */
|
||||
<choose>
|
||||
<when test="targetType eq 'INCOME'">
|
||||
, income_status = #{targetStatus}
|
||||
|
||||
@@ -77,7 +77,6 @@ public class DailyRecordController {
|
||||
|
||||
DailyRecordDto detail = dailyRecordPortIn.detail(reqVO.getSearchMonth(), reqVO.getGroupNo(), reqVO.getHouseholdSeq());
|
||||
|
||||
// TODO : true / false 를 업데이트하는 것은 대상 타켓이 되는 것이라 판단하여 그냥 강제 업데이트할 것인가? valid 체크
|
||||
dailyRecordPortIn.updateByStatus(detail.getRecordMonth(), detail.getGroupNo(), reqVO.getHouseholdSeq(), targetType, "Y".equals(targetStatus) ? DailyTargetStatus.TODAY_NONE.name() : DailyTargetStatus.TARGET.name());
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK).body(reqVO);
|
||||
|
||||
Reference in New Issue
Block a user