[FO] 일계부 등록 현황 ING, 수정이외 기간 button disabled 처리

This commit is contained in:
김현주
2025-06-23 17:44:50 +09:00
parent bc409aa0ab
commit c7c7469cda
16 changed files with 123 additions and 97 deletions

View File

@@ -2,13 +2,15 @@ package app.module.front.usecase.daily.calendar.adapters.persistence;
import app.module.core.config.application.enums.MonthStatus; import app.module.core.config.application.enums.MonthStatus;
import app.module.front.usecase.daily.calendar.adapters.persistence.model.DailyRecordCalendarDto; import app.module.front.usecase.daily.calendar.adapters.persistence.model.DailyRecordCalendarDto;
import app.module.front.usecase.daily.calendar.adapters.persistence.model.DailyRecordStatusDto; import app.module.front.usecase.daily.record.adapters.persistence.DailyRecordMapper;
import app.module.front.usecase.daily.record.adapters.persistence.model.DailyRecordStatusDto;
import app.module.front.usecase.daily.calendar.adapters.persistence.model.MonthlyStatusDto; import app.module.front.usecase.daily.calendar.adapters.persistence.model.MonthlyStatusDto;
import app.module.front.usecase.daily.calendar.ports.RecordCalendarPortOut; import app.module.front.usecase.daily.calendar.ports.RecordCalendarPortOut;
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendar; import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendar;
import app.module.front.usecase.daily.calendar.ports.application.domain.CalendarChildren; import app.module.front.usecase.daily.calendar.ports.application.domain.CalendarChildren;
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendarCmd; import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendarCmd;
import app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus; import app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus;
import app.module.front.usecase.daily.record.ports.application.domain.GetDailyRecordCmd;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@@ -23,6 +25,7 @@ import java.util.Objects;
@RequiredArgsConstructor @RequiredArgsConstructor
public class RecordCalendarDao implements RecordCalendarPortOut { public class RecordCalendarDao implements RecordCalendarPortOut {
private final RecordCalendarMapper recordCalendarMapper; private final RecordCalendarMapper recordCalendarMapper;
private final DailyRecordMapper dailyRecordMapper;
@Override @Override
public List<RecordCalendar> operate(RecordCalendarCmd command) { public List<RecordCalendar> operate(RecordCalendarCmd command) {
@@ -176,7 +179,7 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
* @return * @return
*/ */
private List<DailyRecordStatusDto> getDailyRecordStatus(RecordCalendarCmd command) { private List<DailyRecordStatusDto> getDailyRecordStatus(RecordCalendarCmd command) {
List<DailyRecordStatusDto> statusList = recordCalendarMapper.getDailyRecordStatus(command); List<DailyRecordStatusDto> statusList = dailyRecordMapper.getDailyRecordStatus(new GetDailyRecordCmd(command.getSearchMonth(), null, command.getHouseholdSeq()));
if (statusList == null || statusList.isEmpty()) { if (statusList == null || statusList.isEmpty()) {
return Collections.emptyList(); return Collections.emptyList();
} }

View File

@@ -1,7 +1,7 @@
package app.module.front.usecase.daily.calendar.adapters.persistence; package app.module.front.usecase.daily.calendar.adapters.persistence;
import app.module.front.usecase.daily.calendar.adapters.persistence.model.DailyRecordCalendarDto; import app.module.front.usecase.daily.calendar.adapters.persistence.model.DailyRecordCalendarDto;
import app.module.front.usecase.daily.calendar.adapters.persistence.model.DailyRecordStatusDto; import app.module.front.usecase.daily.record.adapters.persistence.model.DailyRecordStatusDto;
import app.module.front.usecase.daily.calendar.adapters.persistence.model.MonthlyStatusDto; import app.module.front.usecase.daily.calendar.adapters.persistence.model.MonthlyStatusDto;
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendarCmd; import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendarCmd;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@@ -18,14 +18,6 @@ public interface RecordCalendarMapper {
*/ */
List<DailyRecordCalendarDto> getCalendarByDailyRecord(RecordCalendarCmd command); List<DailyRecordCalendarDto> getCalendarByDailyRecord(RecordCalendarCmd command);
/**
* 특정일의 일계부 등록 상태 조회
*
* @param command 검색 조건
* @return 일계부 등록 현황 목록
*/
List<DailyRecordStatusDto> getDailyRecordStatus(RecordCalendarCmd command);
/** /**
* 특정월의 월별 작성 상태 조회 * 특정월의 월별 작성 상태 조회
* *

View File

@@ -1,7 +1,5 @@
package app.module.front.usecase.daily.calendar.ports; package app.module.front.usecase.daily.calendar.ports;
import app.module.front.usecase.daily.calendar.adapters.persistence.model.DailyRecordStatusDto;
import app.module.front.usecase.daily.calendar.adapters.web.model.RecordCalendarUIReqVO;
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendar; import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendar;
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendarCmd; import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendarCmd;

View File

@@ -1,7 +1,5 @@
package app.module.front.usecase.daily.calendar.ports; package app.module.front.usecase.daily.calendar.ports;
import app.module.front.usecase.daily.calendar.adapters.persistence.model.DailyRecordCalendarDto;
import app.module.front.usecase.daily.calendar.adapters.persistence.model.DailyRecordStatusDto;
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendar; import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendar;
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendarCmd; import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendarCmd;

View File

@@ -1,6 +1,5 @@
package app.module.front.usecase.daily.calendar.ports.application; package app.module.front.usecase.daily.calendar.ports.application;
import app.module.front.usecase.daily.calendar.adapters.persistence.model.DailyRecordStatusDto;
import app.module.front.usecase.daily.calendar.adapters.web.model.RecordCalendarUIReqVO; import app.module.front.usecase.daily.calendar.adapters.web.model.RecordCalendarUIReqVO;
import app.module.front.usecase.daily.calendar.ports.RecordCalendarPortIn; import app.module.front.usecase.daily.calendar.ports.RecordCalendarPortIn;
import app.module.front.usecase.daily.calendar.ports.RecordCalendarPortOut; import app.module.front.usecase.daily.calendar.ports.RecordCalendarPortOut;
@@ -9,12 +8,7 @@ import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCa
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Locale;
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor

View File

@@ -2,7 +2,9 @@ package app.module.front.usecase.daily.record.adapters.persistence;
import app.module.front.config.application.util.AuditUtil; import app.module.front.config.application.util.AuditUtil;
import app.module.front.usecase.daily.record.adapters.persistence.model.DailyRecordDto; import app.module.front.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
import app.module.front.usecase.daily.record.adapters.persistence.model.DailyRecordStatusDto;
import app.module.front.usecase.daily.record.adapters.web.model.CreateDailyRecordReqVO; import app.module.front.usecase.daily.record.adapters.web.model.CreateDailyRecordReqVO;
import app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus;
import app.module.front.usecase.daily.record.ports.DailyRecordPortOut; import app.module.front.usecase.daily.record.ports.DailyRecordPortOut;
import app.module.front.usecase.daily.record.ports.application.domain.CreateDailyRecordCmd; import app.module.front.usecase.daily.record.ports.application.domain.CreateDailyRecordCmd;
import app.module.front.usecase.daily.record.ports.application.domain.GetDailyRecordCmd; import app.module.front.usecase.daily.record.ports.application.domain.GetDailyRecordCmd;
@@ -13,7 +15,9 @@ import org.springframework.stereotype.Repository;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.Locale; import java.util.Locale;
@Slf4j @Slf4j
@@ -55,11 +59,12 @@ public class DailyRecordDao implements DailyRecordPortOut {
log.debug("[CreateDailyRecord] record={}", command); log.debug("[CreateDailyRecord] record={}", command);
} else { } else {
// TODO : NONE 으로 변경시 연관 테이블 데이터 삭제할 것인가?
dailyRecordMapper.updateDailyRecord(command); dailyRecordMapper.updateDailyRecord(command);
log.warn("[DailyRecordCreate] existCount={}, recordMonth={}, dayGroupNo={}", existCount, findCmd.getSearchMonth(), findCmd.getGroupNo()); log.warn("[DailyRecordCreate] existCount={}, recordMonth={}, dayGroupNo={}", existCount, findCmd.getSearchMonth(), findCmd.getGroupNo());
} }
this.updateByAllStatus(findCmd);
} }
@Override @Override
@@ -76,6 +81,22 @@ public class DailyRecordDao implements DailyRecordPortOut {
dailyRecordMapper.updateDailyRecordStatus(command); dailyRecordMapper.updateDailyRecordStatus(command);
// TODO : target 업데이트 후 데이터 등록이 완료된 건은 allStatus 값 변경해주기 this.updateByAllStatus(new GetDailyRecordCmd(recordMonth, dayGroupNo, command.getHouseholdSeq()));
}
/**
* TODO : target 업데이트 후 데이터 등록이 완료된 건은 allStatus 값 변경해주기
* @param findCmd
*/
private void updateByAllStatus(GetDailyRecordCmd findCmd) {
List<DailyRecordStatusDto> statusList = dailyRecordMapper.getDailyRecordStatus(findCmd);
if (statusList != null && !statusList.isEmpty()) {
DailyRecordStatusDto statusDetail = statusList.get(0);
if (DailyTargetStatus.TARGET.equals(statusDetail.getIncomeStatus()) && statusDetail.getIncomeCount() != 0) {
}
}
} }
} }

View File

@@ -1,11 +1,15 @@
package app.module.front.usecase.daily.record.adapters.persistence; package app.module.front.usecase.daily.record.adapters.persistence;
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendarCmd;
import app.module.front.usecase.daily.record.adapters.persistence.model.DailyRecordDto; import app.module.front.usecase.daily.record.adapters.persistence.model.DailyRecordDto;
import app.module.front.usecase.daily.record.adapters.persistence.model.DailyRecordStatusDto;
import app.module.front.usecase.daily.record.ports.application.domain.CreateDailyRecordCmd; import app.module.front.usecase.daily.record.ports.application.domain.CreateDailyRecordCmd;
import app.module.front.usecase.daily.record.ports.application.domain.GetDailyRecordCmd; import app.module.front.usecase.daily.record.ports.application.domain.GetDailyRecordCmd;
import app.module.front.usecase.daily.record.ports.application.domain.UpdateDailyRecordStatusCmd; import app.module.front.usecase.daily.record.ports.application.domain.UpdateDailyRecordStatusCmd;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper @Mapper
public interface DailyRecordMapper { public interface DailyRecordMapper {
/** /**
@@ -16,6 +20,14 @@ public interface DailyRecordMapper {
*/ */
DailyRecordDto getDailyRecord(GetDailyRecordCmd command); DailyRecordDto getDailyRecord(GetDailyRecordCmd command);
/**
* 특정일의 일계부 등록 상태 조회
*
* @param command 검색 조건
* @return 일계부 등록 현황 목록
*/
List<DailyRecordStatusDto> getDailyRecordStatus(GetDailyRecordCmd command);
/** /**
* 일계부 항목 등록 여부 * 일계부 항목 등록 여부
* *

View File

@@ -1,4 +1,4 @@
package app.module.front.usecase.daily.calendar.adapters.persistence.model; package app.module.front.usecase.daily.record.adapters.persistence.model;
import app.module.front.usecase.daily.record.adapters.web.model.DailyStatus; import app.module.front.usecase.daily.record.adapters.web.model.DailyStatus;
import app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus; import app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus;

View File

@@ -16,6 +16,29 @@
and ddg.group_no = #{groupNo} and ddg.group_no = #{groupNo}
</select> </select>
<select id="getDailyRecordStatus"
resultType="app.module.front.usecase.daily.record.adapters.persistence.model.DailyRecordStatusDto">
select dr.id as daily_id
, dr.day_group_no, dr.start_date, dr.end_date
, dr.all_status
, dr.income_status
, dr.work_status
, dr.expense_status
, dr.power_status
, dr.forestry_status
, dr.farming_status
, (select count(*) from daily_income di where di.daily_record_seq = dr.id and di.is_deleted = false) as income_count
, (select count(*) from daily_work dw where dw.daily_record_seq = dr.id and dw.is_deleted = false) as work_count
, (select count(*) from daily_expense de where de.daily_record_seq = dr.id and de.is_deleted = false) as expense_count
, (select count(*) from daily_power dp where dp.daily_record_seq = dr.id and dp.is_deleted = false) as power_count
, (select count(*) from daily_forestry df1 where df1.daily_record_seq = dr.id and df1.is_deleted = false) as forestry_count
, (select count(*) from daily_farming df2 where df2.daily_record_seq = dr.id and df2.is_deleted = false) as farming_count
from daily_record dr
where dr.is_deleted = false
and dr.household_seq = #{householdSeq}
and dr.record_month = #{searchMonth}
</select>
<select id="getDailyRecordExistCount" resultType="int"> <select id="getDailyRecordExistCount" resultType="int">
select count(1) as exist select count(1) as exist
from daily_record dr from daily_record dr

View File

@@ -16,29 +16,6 @@
ddg.group_no asc ddg.group_no asc
</select> </select>
<select id="getDailyRecordStatus"
resultType="app.module.front.usecase.daily.calendar.adapters.persistence.model.DailyRecordStatusDto">
select dr.id as daily_id
, dr.day_group_no, dr.start_date, dr.end_date
, dr.all_status
, dr.income_status
, dr.work_status
, dr.expense_status
, dr.power_status
, dr.forestry_status
, dr.farming_status
, (select count(*) from daily_income di where di.daily_record_seq = dr.id and di.is_deleted = false) as income_count
, (select count(*) from daily_work dw where dw.daily_record_seq = dr.id and dw.is_deleted = false) as work_count
, (select count(*) from daily_expense de where de.daily_record_seq = dr.id and de.is_deleted = false) as expense_count
, (select count(*) from daily_power dp where dp.daily_record_seq = dr.id and dp.is_deleted = false) as power_count
, (select count(*) from daily_forestry df1 where df1.daily_record_seq = dr.id and df1.is_deleted = false) as forestry_count
, (select count(*) from daily_farming df2 where df2.daily_record_seq = dr.id and df2.is_deleted = false) as farming_count
from daily_record dr
where dr.is_deleted = false
and dr.household_seq = #{householdSeq}
and dr.record_month = #{searchMonth}
</select>
<select id="getMonthlyStatus"> <select id="getMonthlyStatus">
select mis.forest_product_status as forest_product, mis.bank_auto_transfer_input_status as bank_input, mis.bank_auto_transfer_output_status as bank_output select mis.forest_product_status as forest_product, mis.bank_auto_transfer_input_status as bank_input, mis.bank_auto_transfer_output_status as bank_output
from monthly_input_status mis from monthly_input_status mis
@@ -115,7 +92,7 @@
</select> </select>
<select id="getLatestDate" <select id="getLatestDate"
resultType="app.module.front.usecase.daily.calendar.adapters.persistence.model.DailyRecordStatusDto"> resultType="app.module.front.usecase.daily.record.adapters.persistence.model.DailyRecordStatusDto">
select dr.id as daily_id select dr.id as daily_id
, dr.day_group_no, dr.start_date, dr.end_date , dr.day_group_no, dr.start_date, dr.end_date
from daily_record dr from daily_record dr

View File

@@ -3,7 +3,9 @@
xmlns:th="http://www.thymeleaf.org" lang="ko"> xmlns:th="http://www.thymeleaf.org" lang="ko">
<div layout:fragment="content" th:classappend="acco-wrap"> <div layout:fragment="content" th:classappend="acco-wrap">
<main id="content" role="main"> <main id="content" role="main"
th:with="btnDisabled=${not dailyRecord.modifiable || #strings.equals(dailyRecord.expenseStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}
, btnIcoClass=${btnDisabled ? 'ico-add-disabled' : 'ico-add'}">
<div class="inner"> <div class="inner">
<hgroup class="tit-group"> <hgroup class="tit-group">
<h3> <h3>
@@ -23,11 +25,8 @@
<!--/* 신규 등록 : dailyRecord.modifiable=false 수정 기간 아님 */--> <!--/* 신규 등록 : dailyRecord.modifiable=false 수정 기간 아님 */-->
<th:block th:if="${#lists.isEmpty(expenseList)}"> <th:block th:if="${#lists.isEmpty(expenseList)}">
<button type="button" class="btn btn-m btn-secondary btn-full button-modal01" data-testid="button-modal01" <button type="button" class="btn btn-m btn-secondary btn-full button-modal01" data-testid="button-modal01"
th:disabled="${not dailyRecord.modifiable th:disabled="${btnDisabled}">
|| #strings.equals(dailyRecord.expenseStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}"> <i class="ico-small" aria-hidden="true" th:classappend="${btnIcoClass}"></i>
<i class=" ico-small" aria-hidden="true"
th:classappend="${not dailyRecord.modifiable
|| #strings.equals(dailyRecord.expenseStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE) ? 'ico-add-disabled' : 'ico-add'}"></i>
<span class="btn-txt">추가 등록</span> <span class="btn-txt">추가 등록</span>
</button> </button>
<div class="component-input align-center"> <div class="component-input align-center">
@@ -47,7 +46,8 @@
<section class="regist-item-area"> <section class="regist-item-area">
<p class="total"> <p class="total">
<span>총 <strong>[[${#lists.size(expenseList)}]]</strong>건</span> <span>총 <strong>[[${#lists.size(expenseList)}]]</strong>건</span>
<button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()"> <button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()"
th:if="${not btnDisabled}">
<i class="ico-reset ico-small" aria-hidden="true"></i> <i class="ico-reset ico-small" aria-hidden="true"></i>
<span>초기화</span> <span>초기화</span>
</button> </button>
@@ -57,7 +57,8 @@
th:each="item, itemStatus : ${expenseList}"> th:each="item, itemStatus : ${expenseList}">
<div class="item-tit-group"> <div class="item-tit-group">
<p class="item-name">[[${item.expenseKind}]]</p> <p class="item-name">[[${item.expenseKind}]]</p>
<div class="btn-group"> <div class="btn-group"
th:if="${not btnDisabled}">
<button type="button" class="delete" th:onclick="krip.daily.removeConfirm([[${item.id}]])"><span class="hide-txt">삭제</span></button> <button type="button" class="delete" th:onclick="krip.daily.removeConfirm([[${item.id}]])"><span class="hide-txt">삭제</span></button>
<button type="button" class="edit" th:onclick="krip.daily.createModal([[${item.id}]])"><span class="hide-txt">수정</span></button> <button type="button" class="edit" th:onclick="krip.daily.createModal([[${item.id}]])"><span class="hide-txt">수정</span></button>
</div> </div>

View File

@@ -3,7 +3,9 @@
xmlns:th="http://www.thymeleaf.org" lang="ko"> xmlns:th="http://www.thymeleaf.org" lang="ko">
<div layout:fragment="content" th:classappend="acco-wrap"> <div layout:fragment="content" th:classappend="acco-wrap">
<main id="content" role="main"> <main id="content" role="main"
th:with="btnDisabled=${not dailyRecord.modifiable || #strings.equals(dailyRecord.farmingStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}
, btnIcoClass=${btnDisabled ? 'ico-add-disabled' : 'ico-add'}">
<div class="inner"> <div class="inner">
<hgroup class="tit-group"> <hgroup class="tit-group">
<h3> <h3>
@@ -23,11 +25,8 @@
<!--/* 신규 등록 : dailyRecord.modifiable=false 수정 기간 아님 */--> <!--/* 신규 등록 : dailyRecord.modifiable=false 수정 기간 아님 */-->
<th:block th:if="${#lists.isEmpty(farmingList)}"> <th:block th:if="${#lists.isEmpty(farmingList)}">
<button type="button" class="btn btn-m btn-secondary btn-full button-modal01" data-testid="button-modal01" <button type="button" class="btn btn-m btn-secondary btn-full button-modal01" data-testid="button-modal01"
th:disabled="${not dailyRecord.modifiable th:disabled="${btnDisabled}">
|| #strings.equals(dailyRecord.farmingStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}"> <i class="ico-small" aria-hidden="true" th:classappend="${btnIcoClass}"></i>
<i class="ico-small" aria-hidden="true"
th:classappend="${not dailyRecord.modifiable
|| #strings.equals(dailyRecord.farmingStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE) ? 'ico-add-disabled' : 'ico-add'}"></i>
<span class="btn-txt">추가 등록</span> <span class="btn-txt">추가 등록</span>
</button> </button>
<div class="component-input align-center"> <div class="component-input align-center">
@@ -53,7 +52,8 @@
<section class="regist-item-area"> <section class="regist-item-area">
<p class="total"> <p class="total">
<span>총 <strong>[[${#lists.size(farmingList)}]]</strong>건</span> <span>총 <strong>[[${#lists.size(farmingList)}]]</strong>건</span>
<button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()"> <button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()"
th:if="${not btnDisabled}">
<i class="ico-reset ico-small" aria-hidden="true"></i> <i class="ico-reset ico-small" aria-hidden="true"></i>
<span>초기화</span> <span>초기화</span>
</button> </button>
@@ -63,7 +63,8 @@
th:each="item, itemStatus : ${farmingList}"> th:each="item, itemStatus : ${farmingList}">
<div class="item-tit-group"> <div class="item-tit-group">
<p class="item-name">[[${item.productLabel}]]</p> <p class="item-name">[[${item.productLabel}]]</p>
<div class="btn-group"> <div class="btn-group"
th:if="${not btnDisabled}">
<button type="button" class="delete" th:onclick="krip.daily.removeConfirm([[${item.id}]])"><span class="hide-txt">삭제</span></button> <button type="button" class="delete" th:onclick="krip.daily.removeConfirm([[${item.id}]])"><span class="hide-txt">삭제</span></button>
<button type="button" class="edit" th:onclick="krip.daily.createModal([[${item.id}]])"><span class="hide-txt">수정</span></button> <button type="button" class="edit" th:onclick="krip.daily.createModal([[${item.id}]])"><span class="hide-txt">수정</span></button>
</div> </div>

View File

@@ -3,7 +3,9 @@
xmlns:th="http://www.thymeleaf.org" lang="ko"> xmlns:th="http://www.thymeleaf.org" lang="ko">
<div layout:fragment="content" th:classappend="acco-wrap"> <div layout:fragment="content" th:classappend="acco-wrap">
<main id="content" role="main"> <main id="content" role="main"
th:with="btnDisabled=${not dailyRecord.modifiable || #strings.equals(dailyRecord.forestryStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}
, btnIcoClass=${btnDisabled ? 'ico-add-disabled' : 'ico-add'}">
<div class="inner"> <div class="inner">
<hgroup class="tit-group"> <hgroup class="tit-group">
<h3> <h3>
@@ -23,11 +25,8 @@
<!--/* 신규 등록 : dailyRecord.modifiable=false 수정 기간 아님 */--> <!--/* 신규 등록 : dailyRecord.modifiable=false 수정 기간 아님 */-->
<th:block th:if="${#lists.isEmpty(forestryList)}"> <th:block th:if="${#lists.isEmpty(forestryList)}">
<button type="button" class="btn btn-m btn-secondary btn-full button-modal01" data-testid="button-modal01" <button type="button" class="btn btn-m btn-secondary btn-full button-modal01" data-testid="button-modal01"
th:disabled="${not dailyRecord.modifiable th:disabled="${btnDisabled}">
|| #strings.equals(dailyRecord.forestryStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}"> <i class="ico-small" aria-hidden="true" th:classappend="${btnIcoClass}"></i>
<i class="ico-small" aria-hidden="true"
th:classappend="${not dailyRecord.modifiable
|| #strings.equals(dailyRecord.forestryStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE) ? 'ico-add-disabled' : 'ico-add'}"></i>
<span class="btn-txt">추가 등록</span> <span class="btn-txt">추가 등록</span>
</button> </button>
<div class="component-input align-center"> <div class="component-input align-center">
@@ -53,7 +52,8 @@
<section class="regist-item-area"> <section class="regist-item-area">
<p class="total"> <p class="total">
<span>총 <strong>[[${#lists.size(forestryList)}]]</strong>건</span> <span>총 <strong>[[${#lists.size(forestryList)}]]</strong>건</span>
<button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()"> <button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()"
th:if="${not btnDisabled}">
<i class="ico-reset ico-small" aria-hidden="true"></i> <i class="ico-reset ico-small" aria-hidden="true"></i>
<span>초기화</span> <span>초기화</span>
</button> </button>
@@ -63,7 +63,8 @@
th:each="item, itemStatus : ${forestryList}"> th:each="item, itemStatus : ${forestryList}">
<div class="item-tit-group"> <div class="item-tit-group">
<p class="item-name">[[${item.productName}]]</p> <p class="item-name">[[${item.productName}]]</p>
<div class="btn-group"> <div class="btn-group"
th:if="${not btnDisabled}">
<button type="button" class="delete" th:onclick="krip.daily.removeConfirm([[${item.id}]])"><span class="hide-txt">삭제</span></button> <button type="button" class="delete" th:onclick="krip.daily.removeConfirm([[${item.id}]])"><span class="hide-txt">삭제</span></button>
<button type="button" class="edit" th:onclick="krip.daily.createModal([[${item.id}]])"><span class="hide-txt">수정</span></button> <button type="button" class="edit" th:onclick="krip.daily.createModal([[${item.id}]])"><span class="hide-txt">수정</span></button>
</div> </div>

View File

@@ -3,7 +3,9 @@
xmlns:th="http://www.thymeleaf.org" lang="ko"> xmlns:th="http://www.thymeleaf.org" lang="ko">
<div layout:fragment="content" th:classappend="acco-wrap"> <div layout:fragment="content" th:classappend="acco-wrap">
<main id="content" role="main"> <main id="content" role="main"
th:with="btnDisabled=${not dailyRecord.modifiable || #strings.equals(dailyRecord.incomeStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}
, btnIcoClass=${btnDisabled ? 'ico-add-disabled' : 'ico-add'}">
<div class="inner"> <div class="inner">
<hgroup class="tit-group"> <hgroup class="tit-group">
<h3> <h3>
@@ -24,11 +26,8 @@
<!--/* 신규 등록 : dailyRecord.modifiable=false 수정 기간 아님 */--> <!--/* 신규 등록 : dailyRecord.modifiable=false 수정 기간 아님 */-->
<th:block th:if="${#lists.isEmpty(incomeList)}"> <th:block th:if="${#lists.isEmpty(incomeList)}">
<button type="button" class="btn btn-m btn-secondary btn-full button-modal01" data-testid="button-modal01" <button type="button" class="btn btn-m btn-secondary btn-full button-modal01" data-testid="button-modal01"
th:disabled="${not dailyRecord.modifiable th:disabled="${btnDisabled}">
|| #strings.equals(dailyRecord.incomeStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}"> <i class="ico-small" aria-hidden="true" th:classappend="${btnIcoClass}"></i>
<i class=" ico-small" aria-hidden="true"
th:classappend="${not dailyRecord.modifiable
|| #strings.equals(dailyRecord.incomeStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE) ? 'ico-add-disabled' : 'ico-add'}"></i>
<span class="btn-txt">추가 등록</span> <span class="btn-txt">추가 등록</span>
</button> </button>
<div class="component-input align-center"> <div class="component-input align-center">
@@ -48,7 +47,8 @@
<section class="regist-item-area"> <section class="regist-item-area">
<p class="total"> <p class="total">
<span>총 <strong>[[${#lists.size(incomeList)}]]</strong>건</span> <span>총 <strong>[[${#lists.size(incomeList)}]]</strong>건</span>
<button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()"> <button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()"
th:if="${not btnDisabled}">
<i class="ico-reset ico-small" aria-hidden="true"></i> <i class="ico-reset ico-small" aria-hidden="true"></i>
<span>초기화</span> <span>초기화</span>
</button> </button>
@@ -58,7 +58,8 @@
th:each="item, itemStatus : ${incomeList}"> th:each="item, itemStatus : ${incomeList}">
<div class="item-tit-group"> <div class="item-tit-group">
<p class="item-name">[[${item.incomeKind}]]</p> <p class="item-name">[[${item.incomeKind}]]</p>
<div class="btn-group"> <div class="btn-group"
th:if="${not btnDisabled}">
<button type="button" class="delete" th:onclick="krip.daily.removeConfirm([[${item.id}]])"><span class="hide-txt">삭제</span></button> <button type="button" class="delete" th:onclick="krip.daily.removeConfirm([[${item.id}]])"><span class="hide-txt">삭제</span></button>
<button type="button" class="edit" th:onclick="krip.daily.createModal([[${item.id}]])"><span class="hide-txt">수정</span></button> <button type="button" class="edit" th:onclick="krip.daily.createModal([[${item.id}]])"><span class="hide-txt">수정</span></button>
</div> </div>
@@ -91,7 +92,9 @@
</ul> </ul>
</div> </div>
</div> </div>
<button type="button" class="btn btn-m btn-secondary btn-full button-modal01" data-testid="button-modal01">
<button type="button" class="btn btn-m btn-secondary btn-full button-modal01" data-testid="button-modal01"
th:if="${not btnDisabled}">
<i class="ico-add ico-small" aria-hidden="true"></i> <i class="ico-add ico-small" aria-hidden="true"></i>
<span class="btn-txt">추가 등록</span> <span class="btn-txt">추가 등록</span>
</button> </button>

View File

@@ -3,7 +3,9 @@
xmlns:th="http://www.thymeleaf.org" lang="ko"> xmlns:th="http://www.thymeleaf.org" lang="ko">
<div layout:fragment="content" th:classappend="acco-wrap"> <div layout:fragment="content" th:classappend="acco-wrap">
<main id="content" role="main"> <main id="content" role="main"
th:with="btnDisabled=${not dailyRecord.modifiable || #strings.equals(dailyRecord.powerStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}
, btnIcoClass=${btnDisabled ? 'ico-add-disabled' : 'ico-add'}">
<div class="inner"> <div class="inner">
<hgroup class="tit-group"> <hgroup class="tit-group">
<h3> <h3>
@@ -23,11 +25,8 @@
<!--/* 신규 등록 : dailyRecord.modifiable=false 수정 기간 아님 */--> <!--/* 신규 등록 : dailyRecord.modifiable=false 수정 기간 아님 */-->
<th:block th:if="${#lists.isEmpty(powerList)}"> <th:block th:if="${#lists.isEmpty(powerList)}">
<button type="button" class="btn btn-m btn-secondary btn-full button-modal01" data-testid="button-modal01" <button type="button" class="btn btn-m btn-secondary btn-full button-modal01" data-testid="button-modal01"
th:disabled="${not dailyRecord.modifiable th:disabled="${btnDisabled}">
|| #strings.equals(dailyRecord.powerStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}"> <i class="ico-small" aria-hidden="true" th:classappend="${btnIcoClass}"></i>
<i class="ico-small" aria-hidden="true"
th:classappend="${not dailyRecord.modifiable
|| #strings.equals(dailyRecord.powerStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE) ? 'ico-add-disabled' : 'ico-add'}"></i>
<span class="btn-txt">추가 등록</span> <span class="btn-txt">추가 등록</span>
</button> </button>
<div class="component-input align-center"> <div class="component-input align-center">
@@ -47,7 +46,8 @@
<section class="regist-item-area"> <section class="regist-item-area">
<p class="total"> <p class="total">
<span>총 <strong>[[${#lists.size(powerList)}]]</strong>건</span> <span>총 <strong>[[${#lists.size(powerList)}]]</strong>건</span>
<button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()"> <button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()"
th:if="${not btnDisabled}">
<i class="ico-reset ico-small" aria-hidden="true"></i> <i class="ico-reset ico-small" aria-hidden="true"></i>
<span>초기화</span> <span>초기화</span>
</button> </button>
@@ -57,7 +57,8 @@
th:each="item, itemStatus : ${powerList}"> th:each="item, itemStatus : ${powerList}">
<div class="item-tit-group"> <div class="item-tit-group">
<p class="item-name">[[${item.equipmentName}]]</p> <p class="item-name">[[${item.equipmentName}]]</p>
<div class="btn-group"> <div class="btn-group"
th:if="${not btnDisabled}">
<button type="button" class="delete" th:onclick="krip.daily.removeConfirm([[${item.id}]])"><span class="hide-txt">삭제</span></button> <button type="button" class="delete" th:onclick="krip.daily.removeConfirm([[${item.id}]])"><span class="hide-txt">삭제</span></button>
<button type="button" class="edit" th:onclick="krip.daily.createModal([[${item.id}]])"><span class="hide-txt">수정</span></button> <button type="button" class="edit" th:onclick="krip.daily.createModal([[${item.id}]])"><span class="hide-txt">수정</span></button>
</div> </div>

View File

@@ -3,7 +3,9 @@
xmlns:th="http://www.thymeleaf.org" lang="ko"> xmlns:th="http://www.thymeleaf.org" lang="ko">
<div layout:fragment="content" th:classappend="acco-wrap"> <div layout:fragment="content" th:classappend="acco-wrap">
<main id="content" role="main"> <main id="content" role="main"
th:with="btnDisabled=${not dailyRecord.modifiable || #strings.equals(dailyRecord.workStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}
, btnIcoClass=${btnDisabled ? 'ico-add-disabled' : 'ico-add'}">
<div class="inner"> <div class="inner">
<hgroup class="tit-group"> <hgroup class="tit-group">
<h3> <h3>
@@ -23,11 +25,8 @@
<!--/* 신규 등록 : dailyRecord.modifiable=false 수정 기간 아님 */--> <!--/* 신규 등록 : dailyRecord.modifiable=false 수정 기간 아님 */-->
<th:block th:if="${#lists.isEmpty(workList)}"> <th:block th:if="${#lists.isEmpty(workList)}">
<button type="button" class="btn btn-m btn-secondary btn-full button-modal01" data-testid="button-modal01" <button type="button" class="btn btn-m btn-secondary btn-full button-modal01" data-testid="button-modal01"
th:disabled="${not dailyRecord.modifiable th:disabled="${btnDisabled}">
|| #strings.equals(dailyRecord.workStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}"> <i class="ico-small" aria-hidden="true" th:classappend="${btnIcoClass}"></i>
<i class="ico-small" aria-hidden="true"
th:classappend="${not dailyRecord.modifiable
|| #strings.equals(dailyRecord.workStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE) ? 'ico-add-disabled' : 'ico-add'}"></i>
<span class="btn-txt">추가 등록</span> <span class="btn-txt">추가 등록</span>
</button> </button>
<div class="component-input align-center"> <div class="component-input align-center">
@@ -55,7 +54,8 @@
<section class="regist-item-area"> <section class="regist-item-area">
<p class="total"> <p class="total">
<span>총 <strong>[[${#lists.size(workList)}]]</strong>건</span> <span>총 <strong>[[${#lists.size(workList)}]]</strong>건</span>
<button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()"> <button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()"
th:if="${not btnDisabled}">
<i class="ico-reset ico-small" aria-hidden="true"></i> <i class="ico-reset ico-small" aria-hidden="true"></i>
<span>초기화</span> <span>초기화</span>
</button> </button>
@@ -65,7 +65,8 @@
th:each="item, itemStatus : ${workList}"> th:each="item, itemStatus : ${workList}">
<div class="item-tit-group"> <div class="item-tit-group">
<p class="item-name">[[${item.itemName}]]</p> <p class="item-name">[[${item.itemName}]]</p>
<div class="btn-group"> <div class="btn-group"
th:if="${not btnDisabled}">
<button type="button" class="delete" th:onclick="krip.daily.removeConfirm([[${item.id}]])"><span class="hide-txt">삭제</span></button> <button type="button" class="delete" th:onclick="krip.daily.removeConfirm([[${item.id}]])"><span class="hide-txt">삭제</span></button>
<button type="button" class="edit" th:onclick="krip.daily.createModal([[${item.id}]])"><span class="hide-txt">수정</span></button> <button type="button" class="edit" th:onclick="krip.daily.createModal([[${item.id}]])"><span class="hide-txt">수정</span></button>
</div> </div>