Merge branch 'daily' into dev
This commit is contained in:
@@ -0,0 +1,102 @@
|
||||
package app.module.front.config.application.util;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.Locale;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DailyUtil {
|
||||
|
||||
/**
|
||||
* int -> localdate
|
||||
* @param month 월(yyyyMM)
|
||||
* @param day 일(d)
|
||||
* @return LocalDate
|
||||
*/
|
||||
public LocalDate getDayToLocalDate(String month, int day) {
|
||||
SimpleDateFormat beforeSdf = new SimpleDateFormat("yyyyMMdd", Locale.KOREAN);
|
||||
SimpleDateFormat afterSdf = new SimpleDateFormat("yyyy-MM-dd", Locale.KOREAN);
|
||||
|
||||
try {
|
||||
Date formatDate = beforeSdf.parse(month + String.format("%02d", day));
|
||||
|
||||
return LocalDate.parse(afterSdf.format(formatDate));
|
||||
} catch (Exception e) {
|
||||
log.warn("[DailyUtil][getDayToLocalDate] month={}, day={}", month, day, e);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 마지막 일 여부
|
||||
*
|
||||
* @param searchDate 종료일(yyyy-MM-dd)
|
||||
* @return true=마지막 일, false=마지막 일 아님
|
||||
*/
|
||||
public boolean isLastDay(LocalDate searchDate) {
|
||||
if (searchDate != null) {
|
||||
LocalDate lastDate = searchDate.withDayOfMonth(searchDate.lengthOfMonth());
|
||||
|
||||
return searchDate == lastDate;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 검색 일의 마지막 일 조회
|
||||
* @param searchDate 검색
|
||||
* @return 마지막 일
|
||||
*/
|
||||
public int getLastDay(LocalDate searchDate) {
|
||||
return searchDate.withDayOfMonth(searchDate.lengthOfMonth()).getDayOfMonth();
|
||||
}
|
||||
|
||||
/**
|
||||
* 자가농업 항목 오픈 여부
|
||||
* [정책] 자가농업 생산물 중 자가소비량은 7일차 등록일에만 노출 및 선택, 21일 이후는 마지막 날
|
||||
*
|
||||
* @param groupNo
|
||||
* @param searchDate 종료일
|
||||
* @return true=대상, false=대상 아님
|
||||
*/
|
||||
public boolean isFarmingOpen(int groupNo, LocalDate searchDate) {
|
||||
return groupNo == 4 || groupNo == 8 || groupNo == 12 || isLastDay(searchDate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 데이터 수정 가능 여부
|
||||
* [정책] 15일전까지 데이터 수정 가능(등록도 불가)
|
||||
* @param startDate
|
||||
* @param endDate
|
||||
* @return true=수정 가능, false=수정 불가
|
||||
*/
|
||||
public boolean isModifiable(LocalDate startDate, LocalDate endDate) {
|
||||
// TODO : 15일로 변경, 테스트를 위해 30일로 진행중
|
||||
LocalDate limitStart = LocalDate.now().minusDays(30);
|
||||
log.debug("isModifiable @@limitStart: {}, startDate: {}, endDate: {}", limitStart, startDate, endDate);
|
||||
|
||||
return (limitStart.isBefore(startDate) || limitStart.isEqual(startDate) || limitStart.isEqual(endDate));
|
||||
}
|
||||
|
||||
/**
|
||||
* 데이터 등록 가능 여부
|
||||
* @param startDate
|
||||
* @param endDate
|
||||
* @return
|
||||
*/
|
||||
public boolean isRegisterPossible(LocalDate startDate, LocalDate endDate) {
|
||||
// TODO : 15일로 변경, 테스트를 위해 60일로 진행중
|
||||
LocalDate limitStart = LocalDate.now().minusDays(60);
|
||||
log.debug("isRegisterPossible @@limitStart: {}, startDate: {}, endDate: {}", limitStart, startDate, endDate);
|
||||
|
||||
return (limitStart.isBefore(startDate) || limitStart.isEqual(startDate));
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package app.module.front.usecase.daily.calendar.adapters.persistence;
|
||||
|
||||
import app.module.core.config.application.enums.MonthStatus;
|
||||
import app.module.front.config.application.util.DailyUtil;
|
||||
import app.module.front.usecase.daily.calendar.adapters.persistence.model.DailyRecordCalendarDto;
|
||||
import app.module.front.usecase.daily.record.adapters.persistence.DailyRecordMapper;
|
||||
import app.module.front.usecase.daily.record.adapters.persistence.model.DailyRecordStatusDto;
|
||||
@@ -9,8 +10,10 @@ 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.CalendarChildren;
|
||||
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendarCmd;
|
||||
import app.module.front.usecase.daily.record.adapters.web.model.DailySort;
|
||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus;
|
||||
import app.module.front.usecase.daily.record.ports.application.domain.GetDailyRecordCmd;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@@ -26,6 +29,7 @@ import java.util.Objects;
|
||||
public class RecordCalendarDao implements RecordCalendarPortOut {
|
||||
private final RecordCalendarMapper recordCalendarMapper;
|
||||
private final DailyRecordMapper dailyRecordMapper;
|
||||
private final DailyUtil dailyUtil;
|
||||
|
||||
@Override
|
||||
public List<RecordCalendar> operate(RecordCalendarCmd command) {
|
||||
@@ -39,12 +43,14 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
|
||||
monthlyList.add(new CalendarChildren(
|
||||
"MONTHLY",
|
||||
"임산물 현황 등록",
|
||||
null, // TODO
|
||||
monthlyStatus.isForestNone() ? 0 : 1,
|
||||
monthlyStatus.isForestNone() ? "/info/monthly" : String.format("/info/monthly/month/%s", command.getSearchMonth())));
|
||||
|
||||
monthlyList.add(new CalendarChildren(
|
||||
"BANK",
|
||||
"은행 자동이체 내역 등록",
|
||||
null, // TODO
|
||||
monthlyStatus.isBankNone() ? 0 : 1,
|
||||
(LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMM")).equals(command.getSearchMonth())) ? "/info/bank" : null));
|
||||
|
||||
@@ -54,6 +60,11 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
|
||||
refine.setNo(calendar.getGroupNo());
|
||||
refine.setStart(calendar.getStartDay());
|
||||
refine.setEnd(calendar.getEndDay());
|
||||
refine.setStartDate(dailyUtil.getDayToLocalDate(command.getSearchMonth(), calendar.getStartDay()));
|
||||
refine.setEndDate(dailyUtil.getDayToLocalDate(command.getSearchMonth(), calendar.getEndDay()));
|
||||
|
||||
refine.setRegistrable(dailyUtil.isRegisterPossible(refine.getStartDate(), refine.getEndDate()));
|
||||
refine.setModifiable(dailyUtil.isModifiable(refine.getStartDate(), refine.getEndDate()));
|
||||
|
||||
DailyRecordStatusDto findStatus = statusList.stream()
|
||||
.filter(f -> Objects.equals(calendar.getDailyId(), f.getDailyId()))
|
||||
@@ -61,53 +72,62 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
|
||||
|
||||
List<CalendarChildren> childList = new ArrayList<>();
|
||||
if (findStatus == null) {
|
||||
refine.setChildren(new ArrayList<>());
|
||||
if (!dailyUtil.isRegisterPossible(refine.getStartDate(), refine.getEndDate())) {
|
||||
childList.addAll(this.getNoneChildList(dailyUtil.isFarmingOpen(refine.getNo(), refine.getEndDate())));
|
||||
}
|
||||
|
||||
} else {
|
||||
if (DailyTargetStatus.TARGET.equals(findStatus.getIncomeStatus())
|
||||
|| DailyTargetStatus.TODAY_NONE.equals(findStatus.getIncomeStatus())) {
|
||||
childList.add(new CalendarChildren(
|
||||
"INCOME",
|
||||
"수입",
|
||||
DailySort.INCOME.name(),
|
||||
DailySort.INCOME.getDesc(),
|
||||
findStatus.getIncomeStatus(),
|
||||
findStatus.getIncomeCount(),
|
||||
String.format(pathFormat, "income", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
||||
}
|
||||
if (DailyTargetStatus.TARGET.equals(findStatus.getWorkStatus())
|
||||
|| DailyTargetStatus.TODAY_NONE.equals(findStatus.getWorkStatus())) {
|
||||
childList.add(new CalendarChildren(
|
||||
"WORK",
|
||||
"임업노동 투입 내역",
|
||||
DailySort.WORK.name(),
|
||||
DailySort.WORK.getDesc(),
|
||||
findStatus.getWorkStatus(),
|
||||
findStatus.getWorkCount(),
|
||||
String.format(pathFormat, "work", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
||||
}
|
||||
if (DailyTargetStatus.TARGET.equals(findStatus.getExpenseStatus())
|
||||
|| DailyTargetStatus.TODAY_NONE.equals(findStatus.getExpenseStatus())) {
|
||||
childList.add(new CalendarChildren(
|
||||
"EXPENSE",
|
||||
"지출",
|
||||
DailySort.EXPENSE.name(),
|
||||
DailySort.EXPENSE.getDesc(),
|
||||
findStatus.getExpenseStatus(),
|
||||
findStatus.getExpenseCount(),
|
||||
String.format(pathFormat, "expense", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
||||
}
|
||||
if (DailyTargetStatus.TARGET.equals(findStatus.getPowerStatus())
|
||||
|| DailyTargetStatus.TODAY_NONE.equals(findStatus.getPowerStatus())) {
|
||||
childList.add(new CalendarChildren(
|
||||
"POWER",
|
||||
"동력 사용시간",
|
||||
DailySort.POWER.name(),
|
||||
DailySort.POWER.getDesc(),
|
||||
findStatus.getPowerStatus(),
|
||||
findStatus.getPowerCount(),
|
||||
String.format(pathFormat, "power", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
||||
}
|
||||
if (DailyTargetStatus.TARGET.equals(findStatus.getForestryStatus())
|
||||
|| DailyTargetStatus.TODAY_NONE.equals(findStatus.getForestryStatus())) {
|
||||
childList.add(new CalendarChildren(
|
||||
"FORESTRY",
|
||||
"자가임업 생산물 중 자가소비량",
|
||||
DailySort.FORESTRY.name(),
|
||||
DailySort.FORESTRY.getDesc(),
|
||||
findStatus.getForestryStatus(),
|
||||
findStatus.getForestryCount(),
|
||||
String.format(pathFormat, "forestry", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
||||
}
|
||||
if (DailyTargetStatus.TARGET.equals(findStatus.getFarmingStatus())
|
||||
|| DailyTargetStatus.TODAY_NONE.equals(findStatus.getFarmingStatus())) {
|
||||
childList.add(new CalendarChildren(
|
||||
"FARMING",
|
||||
"자가농업 생산물 중 자가소비량",
|
||||
DailySort.FARMING.name(),
|
||||
DailySort.FARMING.getDesc(),
|
||||
findStatus.getFarmingStatus(),
|
||||
findStatus.getFarmingCount(),
|
||||
String.format(pathFormat, "farming", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
||||
}
|
||||
@@ -121,6 +141,23 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
|
||||
return refineList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 미작성 목록 조회
|
||||
*
|
||||
* @param farmingOpen
|
||||
* @return 미작성 목록
|
||||
*/
|
||||
private List<CalendarChildren> getNoneChildList(boolean farmingOpen) {
|
||||
List<CalendarChildren> childList = new ArrayList<>();
|
||||
for (DailySort type : DailySort.values()) {
|
||||
if (!DailySort.FARMING.equals(type) || (DailySort.FARMING.equals(type) && farmingOpen)) {
|
||||
childList.add(new CalendarChildren(type.name(),type.getDesc()));
|
||||
}
|
||||
}
|
||||
|
||||
return childList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getDataNoneCountBySomeDayAfter(RecordCalendarCmd command) {
|
||||
int dataNoneCount = recordCalendarMapper.getDataNoneCountBySomeDayAfter(command);
|
||||
@@ -158,14 +195,17 @@ public class RecordCalendarDao implements RecordCalendarPortOut {
|
||||
List<DailyRecordCalendarDto> calendarList = recordCalendarMapper.getCalendarByDailyRecord(command);
|
||||
|
||||
List<DailyRecordCalendarDto> refineList = new ArrayList<>();
|
||||
for (DailyRecordCalendarDto record : calendarList) {
|
||||
record.setStartDate(command.getSearchMonth() + String.format("%02d", record.getStartDay()));
|
||||
for (DailyRecordCalendarDto calendar : calendarList) {
|
||||
LocalDate startDate = dailyUtil.getDayToLocalDate(command.getSearchMonth(), calendar.getStartDay());
|
||||
LocalDate endDate = dailyUtil.getDayToLocalDate(command.getSearchMonth(), calendar.getEndDay());
|
||||
int lastDay = dailyUtil.getLastDay(startDate);
|
||||
calendar.setStartDate(startDate.toString());
|
||||
|
||||
if ((command.getLastDay() == 28 || command.getLastDay() == 30) && record.getStartDay() == command.getLastDay()) {
|
||||
record.setEndDay(command.getLastDay());
|
||||
refineList.add(record);
|
||||
} else if (record.getStartDay() <= command.getLastDay() && record.getEndDay() <= command.getLastDay()) {
|
||||
refineList.add(record);
|
||||
if ((lastDay == 28 || lastDay == 30) && calendar.getStartDay() == lastDay) {
|
||||
calendar.setEndDay(lastDay);
|
||||
refineList.add(calendar);
|
||||
} else if (calendar.getStartDay() <= lastDay && calendar.getEndDay() <= lastDay) {
|
||||
refineList.add(calendar);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,8 +29,7 @@ public class RecordCalendarController {
|
||||
|
||||
List<RecordCalendar> calendarList = recordCalendarPortIn.operate(new RecordCalendarCmd(
|
||||
reqVO.getSearchMonth(),
|
||||
reqVO.getHouseholdSeq(),
|
||||
reqVO.getSearchDate().withDayOfMonth(reqVO.getSearchDate().lengthOfMonth()).getDayOfMonth()
|
||||
reqVO.getHouseholdSeq()
|
||||
));
|
||||
|
||||
return ResponseEntity.status(HttpStatus.OK).body(calendarList);
|
||||
|
||||
@@ -3,6 +3,7 @@ package app.module.front.usecase.daily.calendar.ports.application;
|
||||
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.RecordCalendarPortOut;
|
||||
import app.module.front.usecase.daily.calendar.ports.application.domain.CalendarChildren;
|
||||
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendar;
|
||||
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendarCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -17,20 +18,22 @@ public class RecordCalendarService implements RecordCalendarPortIn {
|
||||
|
||||
@Override
|
||||
public List<RecordCalendar> operate(RecordCalendarCmd command) {
|
||||
return portOut.operate(command);
|
||||
List<RecordCalendar> list = portOut.operate(command);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getDataNoneCountBySomeDayAfter() {
|
||||
RecordCalendarUIReqVO reqVO = new RecordCalendarUIReqVO();
|
||||
|
||||
return portOut.getDataNoneCountBySomeDayAfter(new RecordCalendarCmd(reqVO.getSearchMonth(), reqVO.getHouseholdSeq(), 0));
|
||||
return portOut.getDataNoneCountBySomeDayAfter(new RecordCalendarCmd(reqVO.getSearchMonth(), reqVO.getHouseholdSeq()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLatestDate() {
|
||||
RecordCalendarUIReqVO reqVO = new RecordCalendarUIReqVO();
|
||||
|
||||
return portOut.getLatestDate(new RecordCalendarCmd(reqVO.getSearchMonth(), reqVO.getHouseholdSeq(), 0));
|
||||
return portOut.getLatestDate(new RecordCalendarCmd(reqVO.getSearchMonth(), reqVO.getHouseholdSeq()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,45 @@
|
||||
package app.module.front.usecase.daily.calendar.ports.application.domain;
|
||||
|
||||
import app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class CalendarChildren {
|
||||
public CalendarChildren() {
|
||||
}
|
||||
|
||||
public CalendarChildren(String code, String codeLabel) {
|
||||
this.code = code;
|
||||
this.codeLabel = codeLabel;
|
||||
}
|
||||
|
||||
public CalendarChildren(String code, String codeLabel, DailyTargetStatus status, Integer total, String path) {
|
||||
this.code = code;
|
||||
this.codeLabel = codeLabel;
|
||||
this.status = status;
|
||||
this.total = total;
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
/**
|
||||
* 항목 코드
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 항목명
|
||||
*/
|
||||
private String codeLabel;
|
||||
private Integer total;
|
||||
/**
|
||||
* 상태
|
||||
*/
|
||||
private DailyTargetStatus status;
|
||||
/**
|
||||
* 등록 건수
|
||||
*/
|
||||
private int total;
|
||||
/**
|
||||
* 수정 페이지 경로
|
||||
*/
|
||||
private String path;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
package app.module.front.usecase.daily.calendar.ports.application.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@@ -14,6 +16,13 @@ public class RecordCalendar {
|
||||
private Integer no;
|
||||
private Integer start;
|
||||
private Integer end;
|
||||
//TODO : JsonIgnore
|
||||
// @JsonIgnore
|
||||
private LocalDate startDate;
|
||||
@JsonIgnore
|
||||
private LocalDate endDate;
|
||||
private boolean isRegistrable;
|
||||
private boolean isModifiable;
|
||||
private List<CalendarChildren> children;
|
||||
private List<CalendarChildren> monthly;
|
||||
}
|
||||
|
||||
@@ -14,8 +14,4 @@ public class RecordCalendarCmd {
|
||||
* 임가 일련번호
|
||||
*/
|
||||
private Long householdSeq;
|
||||
/**
|
||||
* 특정월의 마지막 일
|
||||
*/
|
||||
private int lastDay;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.thymeleaf.util.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@@ -37,12 +38,14 @@ public class DailyExpenseUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
* @param searchType 수정여부
|
||||
* @param targetList 다음 단계
|
||||
*/
|
||||
@GetMapping(path = "/{searchMonth}/{groupNo}")
|
||||
public String index(Model model, @PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||
, @RequestParam(name = "type", required = false) String searchType) {
|
||||
, @RequestParam(name = "type", required = false) String searchType
|
||||
, @RequestParam(name = "target", required = false) String targetList) {
|
||||
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo);
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo, targetList);
|
||||
|
||||
DailyExpenseUIReqVO reqVO = new DailyExpenseUIReqVO(searchMonth, groupNo);
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
@@ -52,7 +55,8 @@ public class DailyExpenseUIController {
|
||||
model.addAttribute("reqVO", reqVO);
|
||||
model.addAttribute("dailyRecord", dailyRecord);
|
||||
model.addAttribute("expenseList", expenseList);
|
||||
model.addAttribute("moveStep", !"update".equals(searchType));
|
||||
model.addAttribute("targetList", targetList);
|
||||
model.addAttribute("moveStep", "step".equals(searchType));
|
||||
|
||||
return "record/expense/index";
|
||||
}
|
||||
@@ -100,7 +104,7 @@ public class DailyExpenseUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo, String targetList) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
@@ -109,6 +113,20 @@ public class DailyExpenseUIController {
|
||||
throw new NoRecordDataException();
|
||||
}
|
||||
|
||||
if (!org.apache.commons.lang3.StringUtils.isBlank(targetList)) {
|
||||
List<DailySort> list = new ArrayList<>();
|
||||
for (DailySort type : DailySort.values()) {
|
||||
for (String target : targetList.split(",")) {
|
||||
if (type.name().equalsIgnoreCase(target)) {
|
||||
list.add(type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dailyRecord.setStepList(list);
|
||||
}
|
||||
|
||||
dailyRecord.setCurrentStep(DailySort.EXPENSE);
|
||||
|
||||
return dailyRecord;
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.thymeleaf.util.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@@ -37,12 +38,14 @@ public class DailyFarmingUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
* @param searchType 수정여부
|
||||
* @param targetList 다음 단계
|
||||
*/
|
||||
@GetMapping(path = "/{searchMonth}/{groupNo}")
|
||||
public String index(Model model, @PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||
, @RequestParam(name = "type", required = false) String searchType) {
|
||||
, @RequestParam(name = "type", required = false) String searchType
|
||||
, @RequestParam(name = "target", required = false) String targetList) {
|
||||
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo);
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo, targetList);
|
||||
|
||||
DailyFarmingUIReqVO reqVO = new DailyFarmingUIReqVO(searchMonth, groupNo);
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
@@ -52,7 +55,8 @@ public class DailyFarmingUIController {
|
||||
model.addAttribute("reqVO", reqVO);
|
||||
model.addAttribute("dailyRecord", dailyRecord);
|
||||
model.addAttribute("farmingList", farmingList);
|
||||
model.addAttribute("moveStep", !"update".equals(searchType));
|
||||
model.addAttribute("targetList", targetList);
|
||||
model.addAttribute("moveStep", "step".equals(searchType));
|
||||
|
||||
return "record/farming/index";
|
||||
}
|
||||
@@ -100,7 +104,7 @@ public class DailyFarmingUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo, String targetList) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
@@ -109,6 +113,20 @@ public class DailyFarmingUIController {
|
||||
throw new NoRecordDataException();
|
||||
}
|
||||
|
||||
if (!org.apache.commons.lang3.StringUtils.isBlank(targetList)) {
|
||||
List<DailySort> list = new ArrayList<>();
|
||||
for (DailySort type : DailySort.values()) {
|
||||
for (String target : targetList.split(",")) {
|
||||
if (type.name().equalsIgnoreCase(target)) {
|
||||
list.add(type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dailyRecord.setStepList(list);
|
||||
}
|
||||
|
||||
dailyRecord.setCurrentStep(DailySort.FARMING);
|
||||
|
||||
return dailyRecord;
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.thymeleaf.util.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@@ -37,12 +38,14 @@ public class DailyForestryUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
* @param searchType 수정여부
|
||||
* @param targetList 다음 단계
|
||||
*/
|
||||
@GetMapping(path = "/{searchMonth}/{groupNo}")
|
||||
public String index(Model model, @PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||
, @RequestParam(name = "type", required = false) String searchType) {
|
||||
, @RequestParam(name = "type", required = false) String searchType
|
||||
, @RequestParam(name = "target", required = false) String targetList) {
|
||||
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo);
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo, targetList);
|
||||
|
||||
DailyForestryUIReqVO reqVO = new DailyForestryUIReqVO(searchMonth, groupNo);
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
@@ -52,7 +55,8 @@ public class DailyForestryUIController {
|
||||
model.addAttribute("reqVO", reqVO);
|
||||
model.addAttribute("dailyRecord", dailyRecord);
|
||||
model.addAttribute("forestryList", forestryList);
|
||||
model.addAttribute("moveStep", !"update".equals(searchType));
|
||||
model.addAttribute("targetList", targetList);
|
||||
model.addAttribute("moveStep", "step".equals(searchType));
|
||||
|
||||
return "record/forestry/index";
|
||||
}
|
||||
@@ -100,7 +104,7 @@ public class DailyForestryUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo, String targetList) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
@@ -109,6 +113,20 @@ public class DailyForestryUIController {
|
||||
throw new NoRecordDataException();
|
||||
}
|
||||
|
||||
if (!org.apache.commons.lang3.StringUtils.isBlank(targetList)) {
|
||||
List<DailySort> list = new ArrayList<>();
|
||||
for (DailySort type : DailySort.values()) {
|
||||
for (String target : targetList.split(",")) {
|
||||
if (type.name().equalsIgnoreCase(target)) {
|
||||
list.add(type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dailyRecord.setStepList(list);
|
||||
}
|
||||
|
||||
dailyRecord.setCurrentStep(DailySort.FORESTRY);
|
||||
|
||||
return dailyRecord;
|
||||
|
||||
@@ -11,14 +11,15 @@ import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
||||
import app.module.front.usecase.daily.record.ports.DailyRecordPortIn;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.thymeleaf.util.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@@ -37,12 +38,14 @@ public class DailyIncomeUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
* @param searchType 수정여부
|
||||
* @param targetList 다음 단계
|
||||
*/
|
||||
@GetMapping(path = "/{searchMonth}/{groupNo}")
|
||||
public String index(Model model, @PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||
, @RequestParam(name = "type", required = false) String searchType) {
|
||||
, @RequestParam(name = "type", required = false) String searchType
|
||||
, @RequestParam(name = "target", required = false) String targetList) {
|
||||
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo);
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo, targetList);
|
||||
|
||||
DailyIncomeUIReqVO reqVO = new DailyIncomeUIReqVO(searchMonth, groupNo);
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
@@ -52,7 +55,8 @@ public class DailyIncomeUIController {
|
||||
model.addAttribute("reqVO", reqVO);
|
||||
model.addAttribute("dailyRecord", dailyRecord);
|
||||
model.addAttribute("incomeList", incomeList);
|
||||
model.addAttribute("moveStep", !"update".equals(searchType));
|
||||
model.addAttribute("targetList", targetList);
|
||||
model.addAttribute("moveStep", "step".equals(searchType));
|
||||
|
||||
return "record/income/index";
|
||||
}
|
||||
@@ -70,7 +74,8 @@ public class DailyIncomeUIController {
|
||||
, @PathVariable("id") String id) {
|
||||
|
||||
DailyIncomeUIReqVO reqVO = new DailyIncomeUIReqVO(searchMonth, groupNo);
|
||||
if (StringUtils.isEmpty(id)) {
|
||||
|
||||
if (StringUtils.isBlank(id)) {
|
||||
reqVO.setId(0L);
|
||||
} else {
|
||||
reqVO.setId(Long.parseLong(id));
|
||||
@@ -100,7 +105,7 @@ public class DailyIncomeUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo, String targetList) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
@@ -109,6 +114,20 @@ public class DailyIncomeUIController {
|
||||
throw new NoRecordDataException();
|
||||
}
|
||||
|
||||
if (!StringUtils.isBlank(targetList)) {
|
||||
List<DailySort> list = new ArrayList<>();
|
||||
for (DailySort type : DailySort.values()) {
|
||||
for (String target : targetList.split(",")) {
|
||||
if (type.name().equalsIgnoreCase(target)) {
|
||||
list.add(type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dailyRecord.setStepList(list);
|
||||
}
|
||||
|
||||
dailyRecord.setCurrentStep(DailySort.INCOME);
|
||||
|
||||
return dailyRecord;
|
||||
|
||||
@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.thymeleaf.util.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@@ -35,12 +36,14 @@ public class DailyPowerUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
* @param searchType 수정여부
|
||||
* @param targetList 다음 단계
|
||||
*/
|
||||
@GetMapping(path = "/{searchMonth}/{groupNo}")
|
||||
public String index(Model model, @PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||
, @RequestParam(name = "type", required = false) String searchType) {
|
||||
, @RequestParam(name = "type", required = false) String searchType
|
||||
, @RequestParam(name = "target", required = false) String targetList) {
|
||||
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo);
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo, targetList);
|
||||
|
||||
DailyPowerUIReqVO reqVO = new DailyPowerUIReqVO(searchMonth, groupNo);
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
@@ -50,7 +53,8 @@ public class DailyPowerUIController {
|
||||
model.addAttribute("reqVO", reqVO);
|
||||
model.addAttribute("dailyRecord", dailyRecord);
|
||||
model.addAttribute("powerList", powerList);
|
||||
model.addAttribute("moveStep", !"update".equals(searchType));
|
||||
model.addAttribute("targetList", targetList);
|
||||
model.addAttribute("moveStep", "step".equals(searchType));
|
||||
|
||||
return "record/power/index";
|
||||
}
|
||||
@@ -95,7 +99,7 @@ public class DailyPowerUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo, String targetList) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
@@ -104,6 +108,20 @@ public class DailyPowerUIController {
|
||||
throw new NoRecordDataException();
|
||||
}
|
||||
|
||||
if (!org.apache.commons.lang3.StringUtils.isBlank(targetList)) {
|
||||
List<DailySort> list = new ArrayList<>();
|
||||
for (DailySort type : DailySort.values()) {
|
||||
for (String target : targetList.split(",")) {
|
||||
if (type.name().equalsIgnoreCase(target)) {
|
||||
list.add(type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dailyRecord.setStepList(list);
|
||||
}
|
||||
|
||||
dailyRecord.setCurrentStep(DailySort.POWER);
|
||||
|
||||
return dailyRecord;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package app.module.front.usecase.daily.record.adapters.persistence;
|
||||
|
||||
import app.module.front.config.application.util.AuditUtil;
|
||||
import app.module.front.config.application.util.DailyUtil;
|
||||
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.DailyStatus;
|
||||
@@ -24,29 +25,29 @@ import java.util.Locale;
|
||||
@RequiredArgsConstructor
|
||||
public class DailyRecordDao implements DailyRecordPortOut {
|
||||
private final DailyRecordMapper dailyRecordMapper;
|
||||
private final DailyUtil dailyUtil;
|
||||
|
||||
@Override
|
||||
public DailyRecordDto detail(GetDailyRecordCmd command) {
|
||||
DailyRecordDto detail = dailyRecordMapper.getDailyRecord(command);
|
||||
if (detail != null && detail.getStartDate() == null) {
|
||||
try {
|
||||
SimpleDateFormat beforeSdf = new SimpleDateFormat("yyyyMMdd", Locale.KOREAN);
|
||||
SimpleDateFormat afterSdf = new SimpleDateFormat("yyyy-MM-dd", Locale.KOREAN);
|
||||
|
||||
Date formatDate = beforeSdf.parse(command.getSearchMonth() + String.format("%02d", detail.getStartDay()));
|
||||
detail.setStartDate(LocalDate.parse(afterSdf.format(formatDate)));
|
||||
|
||||
formatDate = beforeSdf.parse(command.getSearchMonth() + String.format("%02d", detail.getEndDay()));
|
||||
detail.setEndDate(LocalDate.parse(afterSdf.format(formatDate)));
|
||||
|
||||
if (detail != null) {
|
||||
if (detail.getStartDate() == null) {
|
||||
detail.setStartDate(dailyUtil.getDayToLocalDate(command.getSearchMonth(), detail.getStartDay()));
|
||||
detail.setEndDate(dailyUtil.getDayToLocalDate(command.getSearchMonth(), detail.getEndDay()));
|
||||
if (detail.getStartDate().getMonth() != detail.getEndDate().getMonth()) {
|
||||
// 종료일의 달이 변경되면 시작일=종료일 처리
|
||||
detail.setEndDate(detail.getStartDate());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("[DateParse] target={}", detail.getStartDay(), e);
|
||||
}
|
||||
|
||||
detail.setLastDay(dailyUtil.isLastDay(detail.getEndDate()));
|
||||
detail.setFarmingOpen(dailyUtil.isFarmingOpen(detail.getGroupNo(), detail.getEndDate()));
|
||||
detail.setRegistrable(dailyUtil.isRegisterPossible(detail.getStartDate(), detail.getEndDate()));
|
||||
detail.setModifiable(dailyUtil.isModifiable(detail.getStartDate(), detail.getEndDate()));
|
||||
}
|
||||
|
||||
log.debug("detail: {}", detail);
|
||||
|
||||
return detail;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,50 +37,26 @@ public class DailyRecordDto {
|
||||
*/
|
||||
private boolean farmingOpen;
|
||||
/**
|
||||
* 특정일의 데이터 등록 대상 항목
|
||||
* 데이터 등록 가능 여부
|
||||
*/
|
||||
private List<DailySort> targetList;
|
||||
private boolean registrable;
|
||||
/**
|
||||
* 데이터 수정 가능 여부
|
||||
*/
|
||||
private boolean modifiable;
|
||||
|
||||
/**
|
||||
* 현재 단계
|
||||
*/
|
||||
private DailySort currentStep;
|
||||
|
||||
/**
|
||||
* 마지막 일 여부
|
||||
* @return true=마지막 일, false=마지막 일 아님
|
||||
* 특정일의 데이터 등록 대상 항목
|
||||
*/
|
||||
public boolean isLastDay() {
|
||||
if (endDate != null) {
|
||||
LocalDate lastDate = endDate.withDayOfMonth(endDate.lengthOfMonth());
|
||||
|
||||
return endDate == lastDate;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private List<DailySort> targetList;
|
||||
/**
|
||||
* 자가농업 항목 오픈 여부
|
||||
* [정책] 자가농업 생산물 중 자가소비량은 7일차 등록일에만 노출 및 선택, 21일 이후는 마지막 날
|
||||
* @return true=대상, false=대상 아님
|
||||
* 다음 단계로 이동될 단계 대상 항목
|
||||
*/
|
||||
public boolean isFarmingOpen() {
|
||||
return groupNo == 4 || groupNo == 8 || groupNo == 12 || isLastDay();
|
||||
}
|
||||
|
||||
/**
|
||||
* 데이터 수정 가능 여부
|
||||
* [정책] 15일전까지 데이터 수정 가능(등록도 불가)
|
||||
* @return true=수정 가능, false=수정 불가
|
||||
*/
|
||||
public boolean isModifiable() {
|
||||
// TODO : 15일로 변경, 테스트를 위해 30일로 진행중
|
||||
LocalDate limitStart = LocalDate.now().minusDays(30);
|
||||
log.debug("@@limitStart: {}", limitStart);
|
||||
|
||||
return (limitStart.isBefore(startDate) || limitStart.isEqual(startDate) || limitStart.isEqual(endDate));
|
||||
}
|
||||
|
||||
private List<DailySort> stepList;
|
||||
/**
|
||||
* 다음 단계로 이동될 단계 조회
|
||||
*
|
||||
@@ -88,12 +64,12 @@ public class DailyRecordDto {
|
||||
*/
|
||||
public String getNextStep() {
|
||||
String returnValue = null;
|
||||
if (targetList != null) {
|
||||
if (stepList != null) {
|
||||
int index = 0;
|
||||
int size = targetList.size();
|
||||
for (DailySort target : targetList) {
|
||||
int size = stepList.size();
|
||||
for (DailySort target : stepList) {
|
||||
if (target.equals(currentStep) && (index + 1) != size) {
|
||||
returnValue = targetList.get(index + 1).name();
|
||||
returnValue = stepList.get(index + 1).name();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ public class DailyRecordController {
|
||||
formVO.setDayGroupNo(reqVO.getGroupNo());
|
||||
formVO.setStartDate(detail.getStartDate());
|
||||
formVO.setEndDate(detail.getEndDate());
|
||||
formVO.setFarmingStatus(detail.isFarmingOpen());
|
||||
formVO.setFarming(detail.isFarmingOpen());
|
||||
log.debug("formVO: {}", formVO);
|
||||
|
||||
dailyRecordPortIn.create(formVO);
|
||||
|
||||
@@ -22,8 +22,14 @@ public class CreateDailyRecordReqVO {
|
||||
private DailyTargetStatus forestryStatus;
|
||||
private DailyTargetStatus farmingStatus;
|
||||
|
||||
/**
|
||||
* 금일 데이터 없음으로 각 항목 상태 일괄 변경
|
||||
*
|
||||
* @param todayNone 상태
|
||||
*/
|
||||
public void setTodayNone(String todayNone) {
|
||||
this.todayNone = todayNone;
|
||||
|
||||
if ("Y".equals(todayNone)) {
|
||||
this.allStatus = DailyStatus.TODAY_NONE;
|
||||
this.incomeStatus = DailyTargetStatus.TODAY_NONE;
|
||||
@@ -35,32 +41,37 @@ public class CreateDailyRecordReqVO {
|
||||
this.allStatus = DailyStatus.WAITING;
|
||||
|
||||
if (incomeStatus == null) {
|
||||
this.incomeStatus = DailyTargetStatus.NONE;
|
||||
this.incomeStatus = DailyTargetStatus.TODAY_NONE;
|
||||
}
|
||||
if (workStatus == null) {
|
||||
this.workStatus = DailyTargetStatus.NONE;
|
||||
this.workStatus = DailyTargetStatus.TODAY_NONE;
|
||||
}
|
||||
if (expenseStatus == null) {
|
||||
this.expenseStatus = DailyTargetStatus.NONE;
|
||||
this.expenseStatus = DailyTargetStatus.TODAY_NONE;
|
||||
}
|
||||
if (powerStatus == null) {
|
||||
this.powerStatus = DailyTargetStatus.NONE;
|
||||
this.powerStatus = DailyTargetStatus.TODAY_NONE;
|
||||
}
|
||||
if (forestryStatus == null) {
|
||||
this.forestryStatus = DailyTargetStatus.NONE;
|
||||
this.forestryStatus = DailyTargetStatus.TODAY_NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setFarmingStatus(boolean isOpen) {
|
||||
if ("Y".equals(todayNone)) {
|
||||
/**
|
||||
* 농업 생산물 입력 상태 변경
|
||||
*
|
||||
* @param isOpen 자가농업 항목 오픈 여부
|
||||
*/
|
||||
public void setFarming(boolean isOpen) {
|
||||
if (farmingStatus == null) {
|
||||
if (isOpen) {
|
||||
this.farmingStatus = DailyTargetStatus.TODAY_NONE;
|
||||
} else {
|
||||
this.farmingStatus = DailyTargetStatus.NONE;
|
||||
}
|
||||
} else if (farmingStatus == null) {
|
||||
this.farmingStatus = DailyTargetStatus.NONE;
|
||||
} else {
|
||||
this.farmingStatus = DailyTargetStatus.TARGET;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package app.module.front.usecase.daily.record.adapters.web.model;
|
||||
|
||||
import app.module.front.config.application.util.AuthUtil;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class DailyCmd {
|
||||
/**
|
||||
* 검색 월(yyyyMM)
|
||||
*/
|
||||
private String searchMonth;
|
||||
/**
|
||||
* 검색 그룸번호
|
||||
*/
|
||||
private Integer groupNo;
|
||||
/**
|
||||
* 임가 일련번호
|
||||
*/
|
||||
private Long householdSeq;
|
||||
}
|
||||
@@ -2,7 +2,7 @@ package app.module.front.usecase.daily.record.adapters.web.model;
|
||||
|
||||
public enum DailyStatus {
|
||||
/**
|
||||
* 입력중
|
||||
* 미완료
|
||||
*/
|
||||
WAITING,
|
||||
/**
|
||||
|
||||
@@ -2,20 +2,16 @@ package app.module.front.usecase.daily.record.adapters.web.model;
|
||||
|
||||
public enum DailyTargetStatus {
|
||||
/**
|
||||
* 등록 대상
|
||||
* 등록 대상 (테이터 건 수 체크)
|
||||
*/
|
||||
TARGET,
|
||||
/**
|
||||
* 금일 없음
|
||||
* 금일 없음 (데이터 건 수 체크하지 않음)
|
||||
*/
|
||||
TODAY_NONE,
|
||||
/**
|
||||
* 등록 없음
|
||||
* 대상 아님
|
||||
*/
|
||||
NONE,
|
||||
// /**
|
||||
// * 등록 완료
|
||||
// */
|
||||
// DONE,
|
||||
;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.thymeleaf.util.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@@ -37,12 +38,14 @@ public class DailyWorkUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
* @param searchType 수정여부
|
||||
* @param targetList 다음 단계
|
||||
*/
|
||||
@GetMapping(path = "/{searchMonth}/{groupNo}")
|
||||
public String index(Model model, @PathVariable("searchMonth") String searchMonth, @PathVariable("groupNo") String groupNo
|
||||
, @RequestParam(name = "type", required = false) String searchType) {
|
||||
, @RequestParam(name = "type", required = false) String searchType
|
||||
, @RequestParam(name = "target", required = false) String targetList) {
|
||||
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo);
|
||||
DailyRecordDto dailyRecord = this.vaildGetDailyRecord(searchMonth, groupNo, targetList);
|
||||
|
||||
DailyWorkUIReqVO reqVO = new DailyWorkUIReqVO(searchMonth, groupNo);
|
||||
log.debug("reqVO: {}", reqVO);
|
||||
@@ -52,7 +55,8 @@ public class DailyWorkUIController {
|
||||
model.addAttribute("reqVO", reqVO);
|
||||
model.addAttribute("dailyRecord", dailyRecord);
|
||||
model.addAttribute("workList", workList);
|
||||
model.addAttribute("moveStep", !"update".equals(searchType));
|
||||
model.addAttribute("targetList", targetList);
|
||||
model.addAttribute("moveStep", "step".equals(searchType));
|
||||
|
||||
return "record/work/index";
|
||||
}
|
||||
@@ -101,7 +105,7 @@ public class DailyWorkUIController {
|
||||
* @param searchMonth 검색 월(yyyyMM)
|
||||
* @param groupNo 검색 그룹
|
||||
*/
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo) {
|
||||
private DailyRecordDto vaildGetDailyRecord(String searchMonth, String groupNo, String targetList) {
|
||||
DailyUIReqVO reqVO = new DailyUIReqVO(searchMonth, groupNo);
|
||||
log.debug("getRecordUIReq: {}", reqVO);
|
||||
|
||||
@@ -110,6 +114,20 @@ public class DailyWorkUIController {
|
||||
throw new NoRecordDataException();
|
||||
}
|
||||
|
||||
if (!org.apache.commons.lang3.StringUtils.isBlank(targetList)) {
|
||||
List<DailySort> list = new ArrayList<>();
|
||||
for (DailySort type : DailySort.values()) {
|
||||
for (String target : targetList.split(",")) {
|
||||
if (type.name().equalsIgnoreCase(target)) {
|
||||
list.add(type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dailyRecord.setStepList(list);
|
||||
}
|
||||
|
||||
dailyRecord.setCurrentStep(DailySort.WORK);
|
||||
|
||||
return dailyRecord;
|
||||
|
||||
@@ -27,7 +27,7 @@ krip.daily.goToPrev = function() {
|
||||
* @param searchMonth
|
||||
* @param groupNo
|
||||
*/
|
||||
krip.daily.goToNext = function(target, searchMonth, groupNo) {
|
||||
krip.daily.goToNext = function(target, searchMonth, groupNo, targetList) {
|
||||
if (target == null) {
|
||||
if ($('._nextStep').data('last')) {
|
||||
target = 'LAST';
|
||||
@@ -53,7 +53,7 @@ krip.daily.goToNext = function(target, searchMonth, groupNo) {
|
||||
url = url.replace('{groupNo}', groupNo);
|
||||
url = url.replace('{target}', target.toLowerCase());
|
||||
|
||||
location.href = url;
|
||||
location.href = url + '?type=step&target=' + (targetList !== undefined ? targetList : '');
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -66,7 +66,7 @@ krip.daily.goToDone = function(searchMonth, groupNo) {
|
||||
url = url.replace('{month}', searchMonth);
|
||||
url = url.replace('{groupNo}', groupNo);
|
||||
|
||||
location.replace(url);
|
||||
location.href = url;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -769,10 +769,6 @@
|
||||
if (rowdata == null) {
|
||||
kri.logger.error('달력 선택 데이터 없음.')
|
||||
}
|
||||
// if (rowdata != null && typeof rowdata === 'object' && rowdata.children !== undefined) {
|
||||
// rowList = rowdata.children.filter(f => !(f.code === 'MONTHLY' || f.code === 'BANK'));
|
||||
// monthlyList = rowdata.children.filter(f => f.code === 'MONTHLY' || f.code === 'BANK');
|
||||
// }
|
||||
|
||||
let tmpl = $.templates('#dailyNoneTmpl');
|
||||
let html = '';
|
||||
@@ -782,6 +778,8 @@
|
||||
no: rowdata.no,
|
||||
date: currentDate,
|
||||
monthlyList: monthlyList,
|
||||
registrable: rowdata.registrable,
|
||||
modifiable: rowdata.modifiable,
|
||||
});
|
||||
} else {
|
||||
tmpl = $.templates('#dailyListTmpl');
|
||||
@@ -791,6 +789,8 @@
|
||||
date: currentDate,
|
||||
list: childList,
|
||||
monthlyList: monthlyList,
|
||||
registrable: rowdata.registrable,
|
||||
modifiable: rowdata.modifiable,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -804,11 +804,13 @@
|
||||
<script id="dailyNoneTmpl" type="text/x-jsrender">
|
||||
{{include tmpl="#titleTmpl" /}}
|
||||
|
||||
{{if registrable}}
|
||||
<div class="component-btns btn-add">
|
||||
<button type="button" onclick="formControl.recordCreate('{{:month}}', {{:no}});">
|
||||
<p class="txt">일계부 등록하기</p>
|
||||
</button>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{include tmpl="#etcRowTmpl" /}}
|
||||
</script>
|
||||
@@ -816,7 +818,11 @@
|
||||
{{include tmpl="#titleTmpl" /}}
|
||||
|
||||
<ul class="btn-column-list">
|
||||
{{for list tmpl="#basicRowTmpl" /}}
|
||||
{{if modifiable}}
|
||||
{{for list tmpl="#basicRowTmpl1" /}}
|
||||
{{else}}
|
||||
{{for list tmpl="#basicRowTmpl2" /}}
|
||||
{{/if}}
|
||||
</ul>
|
||||
|
||||
{{include tmpl="#etcRowTmpl" /}}
|
||||
@@ -828,24 +834,42 @@
|
||||
<p class="date">{{:date.start}} ~ {{:date.end}}</p>
|
||||
{{/if}}
|
||||
</script>
|
||||
<script id="basicRowTmpl" type="text/x-jsrender">
|
||||
<script id="basicRowTmpl1" type="text/x-jsrender">
|
||||
<li>
|
||||
<a href="{{:path}}?type=update">
|
||||
<p class="label">{{:codeLabel}}</p>
|
||||
{{if total != null && total != 0}}
|
||||
{{if status == null}}
|
||||
<p class="value">미작성</p>
|
||||
{{else status == 'TARGET' && total != 0}}
|
||||
<p class="value"><em>총 <b>{{:total}}</b>건</em></p>
|
||||
{{else}}
|
||||
{{else status == 'TARGET' && total == 0}}
|
||||
<p class="value">미완료</p>
|
||||
{{else status == 'TODAY_NONE'}}
|
||||
<p class="value">없음</p>
|
||||
{{/if}}
|
||||
</a>
|
||||
</li>
|
||||
</script>
|
||||
<script id="basicRowTmpl2" type="text/x-jsrender">
|
||||
<li>
|
||||
<a href="{{:path}}?type=update">
|
||||
<p class="label">{{:codeLabel}}, TODO: 수정버튼삭제필요</p>
|
||||
{{if status == null}}
|
||||
<p class="value">미작성</p>
|
||||
{{else status == 'TARGET' && total != 0}}
|
||||
<p class="value"><em>총 <b>{{:total}}</b>건</em></p>
|
||||
{{else status == 'TARGET' && total == 0}}
|
||||
<p class="value">미완료</p>
|
||||
{{else status == 'TODAY_NONE'}}
|
||||
<p class="value">없음</p>
|
||||
{{/if}}
|
||||
</a>
|
||||
</li>
|
||||
</script>
|
||||
<script id="etcRowTmpl" type="text/x-jsrender">
|
||||
<div class="regist-btn-area">
|
||||
{{for monthlyList}}
|
||||
<a href="{{:path ? path : 'javascript:void(0);'}}" class="btn{{if total != null && total != 0}} complete{{/if}}">
|
||||
|
||||
|
||||
<p>{{:codeLabel}}</p>
|
||||
{{if total != null && total != 0}}
|
||||
<span>등록완료</span>
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
<ul class="detail-list"
|
||||
th:if="${item.name eq 'WORK'}"
|
||||
>
|
||||
<th:block th:if="${#strings.isEmpty(workList)}">
|
||||
<th:block th:if="${#lists.isEmpty(workList)}">
|
||||
<li>
|
||||
<p>없음</p>
|
||||
</li>
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
</main>
|
||||
|
||||
<div class="component-btns fixed"
|
||||
th:if="${dailyRecord.modifiable}">
|
||||
th:if="${dailyRecord.registrable || dailyRecord.modifiable}">
|
||||
<div class="btns-row">
|
||||
<button type="button" class="btn btn-l btn-primary _nextStep"
|
||||
th:data-last="${dailyRecord.lastDay}"
|
||||
@@ -164,11 +164,16 @@
|
||||
create() {
|
||||
const f = document.reqForm;
|
||||
|
||||
let checkedArray = [];
|
||||
const $checked = $(f).find('input:checked');
|
||||
if ($checked.length === 0) {
|
||||
f.todayNone.value = 'Y';
|
||||
}
|
||||
|
||||
$(f).find('input:checked').each(function() {
|
||||
checkedArray.push($(this).data('target'));
|
||||
})
|
||||
|
||||
const obj = $(f).serializeObject();
|
||||
ajaxUtil._ajaxAsync(
|
||||
ENV.httpUrl.create,
|
||||
@@ -176,12 +181,12 @@
|
||||
function () {
|
||||
if (f.todayNone.value === 'Y') {
|
||||
if ($('._nextStep').data('last')) {
|
||||
krip.daily.goToNext('LAST', ENV.month, ENV.groupNo);
|
||||
krip.daily.goToNext('LAST', ENV.month, ENV.groupNo, checkedArray.join(','));
|
||||
} else {
|
||||
krip.daily.goToDone(ENV.month, ENV.groupNo);
|
||||
}
|
||||
} else if ($checked.data('target') !== undefined) {
|
||||
krip.daily.goToNext($checked.data('target'), ENV.month, ENV.groupNo);
|
||||
krip.daily.goToNext($checked.data('target'), ENV.month, ENV.groupNo, checkedArray.join(','));
|
||||
} else {
|
||||
krip.daily.goToMain();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
|
||||
<div layout:fragment="content" th:classappend="acco-wrap">
|
||||
<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)}
|
||||
th:with="btnActive=${(dailyRecord.registrable && moveStep) || dailyRecord.modifiable }
|
||||
, btnDisabled=${(not btnActive)
|
||||
|| #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">
|
||||
<hgroup class="tit-group">
|
||||
@@ -33,7 +35,7 @@
|
||||
<label class="checkbox-inner" id="todayNone">
|
||||
<input type="checkbox" name="todayNone"
|
||||
data-type="EXPENSE"
|
||||
th:disabled="${not dailyRecord.modifiable}"
|
||||
th:disabled="${not btnActive}"
|
||||
th:checked="${#strings.equals(dailyRecord.expenseStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}">
|
||||
<span class="checkbox-item">
|
||||
<span class="checkbox-txt">금일 등록내용 없음</span>
|
||||
@@ -47,7 +49,7 @@
|
||||
<p class="total">
|
||||
<span>총 <strong>[[${#lists.size(expenseList)}]]</strong>건</span>
|
||||
<button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<i class="ico-reset ico-small" aria-hidden="true"></i>
|
||||
<span>초기화</span>
|
||||
</button>
|
||||
@@ -58,7 +60,7 @@
|
||||
<div class="item-tit-group">
|
||||
<p class="item-name">[[${item.expenseKind}]]</p>
|
||||
<div class="btn-group"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<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>
|
||||
</div>
|
||||
@@ -98,7 +100,7 @@
|
||||
|
||||
<!--/* 하단 고정 버튼 */-->
|
||||
<div class="component-btns fixed"
|
||||
th:if="${dailyRecord.modifiable && moveStep}">
|
||||
th:if="${(dailyRecord.registrable && moveStep)}">
|
||||
<div class="btns-row">
|
||||
<button type="button" class="btn btn-l btn-secondary" onclick="krip.daily.goToPrev();">
|
||||
<span class="btn-txt">이전 단계로 이동</span>
|
||||
|
||||
@@ -3,9 +3,19 @@
|
||||
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
||||
|
||||
<div layout:fragment="content" th:classappend="acco-wrap">
|
||||
[[${dailyRecord.registrable}]]
|
||||
[[${moveStep}]],
|
||||
[[${dailyRecord.modifiable}]]
|
||||
--
|
||||
[[${(not dailyRecord.modifiable)}]]
|
||||
|
||||
<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)}
|
||||
th:with="btnActive=${(dailyRecord.registrable && moveStep) || dailyRecord.modifiable }
|
||||
, btnDisabled=${(not btnActive)
|
||||
|| #strings.equals(dailyRecord.farmingStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}
|
||||
, btnIcoClass=${btnDisabled ? 'ico-add-disabled' : 'ico-add'}">
|
||||
|
||||
[[${btnActive}]], [[${btnDisabled}]], [[${btnIcoClass}]]
|
||||
<div class="inner">
|
||||
<hgroup class="tit-group">
|
||||
<h3>
|
||||
@@ -33,7 +43,7 @@
|
||||
<label class="checkbox-inner" id="todayNone">
|
||||
<input type="checkbox" name="todayNone"
|
||||
data-type="FARMING"
|
||||
th:disabled="${not dailyRecord.modifiable}"
|
||||
th:disabled="${not btnActive}"
|
||||
th:checked="${#strings.equals(dailyRecord.farmingStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}">
|
||||
<span class="checkbox-item">
|
||||
<span class="checkbox-txt">금일 등록내용 없음</span>
|
||||
@@ -53,7 +63,7 @@
|
||||
<p class="total">
|
||||
<span>총 <strong>[[${#lists.size(farmingList)}]]</strong>건</span>
|
||||
<button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<i class="ico-reset ico-small" aria-hidden="true"></i>
|
||||
<span>초기화</span>
|
||||
</button>
|
||||
@@ -64,7 +74,7 @@
|
||||
<div class="item-tit-group">
|
||||
<p class="item-name">[[${item.productLabel}]]</p>
|
||||
<div class="btn-group"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<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>
|
||||
</div>
|
||||
@@ -101,14 +111,14 @@
|
||||
|
||||
<!--/* 하단 고정 버튼 */-->
|
||||
<div class="component-btns fixed"
|
||||
th:if="${dailyRecord.modifiable && moveStep}">
|
||||
th:if="${(dailyRecord.registrable && moveStep)}">
|
||||
<div class="btns-row">
|
||||
<button type="button" class="btn btn-l btn-secondary" onclick="krip.daily.goToPrev();">
|
||||
<span class="btn-txt">이전 단계로 이동</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-l btn-primary"
|
||||
th:disabled="${not #strings.equals(dailyRecord.farmingStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE) and #lists.isEmpty(farmingList)}"
|
||||
th:onclick="krip.daily.goToNext([[${dailyRecord.nextStep}]], [[${reqVO.searchMonth}]], [[${reqVO.groupNo}]])">
|
||||
th:onclick="krip.daily.goToNext([[${dailyRecord.nextStep}]], [[${reqVO.searchMonth}]], [[${reqVO.groupNo}]], [[${targetList}]])">
|
||||
<span class="btn-txt">다음 단계로 이동</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
|
||||
<div layout:fragment="content" th:classappend="acco-wrap">
|
||||
<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)}
|
||||
th:with="btnActive=${(dailyRecord.registrable && moveStep) || dailyRecord.modifiable }
|
||||
, btnDisabled=${(not btnActive)
|
||||
|| #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">
|
||||
<hgroup class="tit-group">
|
||||
@@ -33,7 +35,7 @@
|
||||
<label class="checkbox-inner" id="todayNone">
|
||||
<input type="checkbox" name="todayNone"
|
||||
data-type="FORESTRY"
|
||||
th:disabled="${not dailyRecord.modifiable}"
|
||||
th:disabled="${not btnActive}"
|
||||
th:checked="${#strings.equals(dailyRecord.forestryStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}">
|
||||
<span class="checkbox-item">
|
||||
<span class="checkbox-txt">금일 등록내용 없음</span>
|
||||
@@ -53,7 +55,7 @@
|
||||
<p class="total">
|
||||
<span>총 <strong>[[${#lists.size(forestryList)}]]</strong>건</span>
|
||||
<button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<i class="ico-reset ico-small" aria-hidden="true"></i>
|
||||
<span>초기화</span>
|
||||
</button>
|
||||
@@ -64,7 +66,7 @@
|
||||
<div class="item-tit-group">
|
||||
<p class="item-name">[[${item.productName}]]</p>
|
||||
<div class="btn-group"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<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>
|
||||
</div>
|
||||
@@ -101,7 +103,7 @@
|
||||
|
||||
<!--/* 하단 고정 버튼 */-->
|
||||
<div class="component-btns fixed"
|
||||
th:if="${dailyRecord.modifiable && moveStep}">
|
||||
th:if="${(dailyRecord.registrable && moveStep)}">
|
||||
<div class="btns-row">
|
||||
<button type="button" class="btn btn-l btn-secondary" onclick="krip.daily.goToPrev();">
|
||||
<span class="btn-txt">이전 단계로 이동</span>
|
||||
|
||||
@@ -3,8 +3,25 @@
|
||||
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
||||
|
||||
<div layout:fragment="content" th:classappend="acco-wrap">
|
||||
<th:block th:if="${@systemProperties['spring.profiles.active'] eq 'local'}">
|
||||
<div>
|
||||
reqVO: [[${reqVO}]]
|
||||
</div>
|
||||
<div>
|
||||
detail: [[${dailyRecord}]]
|
||||
</div>
|
||||
<div>
|
||||
[[${dailyRecord.registrable}]]
|
||||
[[${moveStep}]],
|
||||
[[${dailyRecord.modifiable}]]
|
||||
<br>
|
||||
//http://localhost:8080/record/income/202505/12?type=step1&target=income
|
||||
</div>
|
||||
</th:block>
|
||||
<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)}
|
||||
th:with="btnActive=${(dailyRecord.registrable && moveStep) || dailyRecord.modifiable }
|
||||
, btnDisabled=${(not btnActive)
|
||||
|| #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">
|
||||
<hgroup class="tit-group">
|
||||
@@ -34,7 +51,7 @@
|
||||
<label class="checkbox-inner" id="todayNone">
|
||||
<input type="checkbox" name="todayNone"
|
||||
data-type="INCOME"
|
||||
th:disabled="${not dailyRecord.modifiable}"
|
||||
th:disabled="${not btnActive}"
|
||||
th:checked="${#strings.equals(dailyRecord.incomeStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}">
|
||||
<span class="checkbox-item">
|
||||
<span class="checkbox-txt">금일 등록내용 없음</span>
|
||||
@@ -48,7 +65,7 @@
|
||||
<p class="total">
|
||||
<span>총 <strong>[[${#lists.size(incomeList)}]]</strong>건</span>
|
||||
<button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<i class="ico-reset ico-small" aria-hidden="true"></i>
|
||||
<span>초기화</span>
|
||||
</button>
|
||||
@@ -59,7 +76,7 @@
|
||||
<div class="item-tit-group">
|
||||
<p class="item-name">[[${item.incomeKind}]]</p>
|
||||
<div class="btn-group"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<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>
|
||||
</div>
|
||||
@@ -94,7 +111,7 @@
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-m btn-secondary btn-full button-modal01" data-testid="button-modal01"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<i class="ico-add ico-small" aria-hidden="true"></i>
|
||||
<span class="btn-txt">추가 등록</span>
|
||||
</button>
|
||||
@@ -105,14 +122,14 @@
|
||||
|
||||
<!--/* 하단 고정 버튼 */-->
|
||||
<div class="component-btns fixed"
|
||||
th:if="${dailyRecord.modifiable && moveStep}">
|
||||
th:if="${(dailyRecord.registrable && moveStep)}">
|
||||
<div class="btns-row">
|
||||
<button type="button" class="btn btn-l btn-secondary" onclick="krip.daily.goToPrev();">
|
||||
<span class="btn-txt">이전 단계로 이동</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-l btn-primary"
|
||||
th:disabled="${not #strings.equals(dailyRecord.incomeStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE) and #lists.isEmpty(incomeList)}"
|
||||
th:onclick="krip.daily.goToNext([[${dailyRecord.nextStep}]], [[${reqVO.searchMonth}]], [[${reqVO.groupNo}]])">
|
||||
th:onclick="krip.daily.goToNext([[${dailyRecord.nextStep}]], [[${reqVO.searchMonth}]], [[${reqVO.groupNo}]], [[${targetList}]])">
|
||||
<span class="btn-txt">다음 단계로 이동</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
|
||||
<div layout:fragment="content" th:classappend="acco-wrap">
|
||||
<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)}
|
||||
th:with="btnActive=${(dailyRecord.registrable && moveStep) || dailyRecord.modifiable }
|
||||
, btnDisabled=${(not btnActive)
|
||||
|| #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">
|
||||
<hgroup class="tit-group">
|
||||
@@ -33,7 +35,7 @@
|
||||
<label class="checkbox-inner" id="todayNone">
|
||||
<input type="checkbox" name="todayNone"
|
||||
data-type="POWER"
|
||||
th:disabled="${not dailyRecord.modifiable}"
|
||||
th:disabled="${not btnActive}"
|
||||
th:checked="${#strings.equals(dailyRecord.powerStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}">
|
||||
<span class="checkbox-item">
|
||||
<span class="checkbox-txt">금일 등록내용 없음</span>
|
||||
@@ -47,7 +49,7 @@
|
||||
<p class="total">
|
||||
<span>총 <strong>[[${#lists.size(powerList)}]]</strong>건</span>
|
||||
<button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<i class="ico-reset ico-small" aria-hidden="true"></i>
|
||||
<span>초기화</span>
|
||||
</button>
|
||||
@@ -58,7 +60,7 @@
|
||||
<div class="item-tit-group">
|
||||
<p class="item-name">[[${item.equipmentName}]]</p>
|
||||
<div class="btn-group"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<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>
|
||||
</div>
|
||||
@@ -86,7 +88,7 @@
|
||||
|
||||
<!--/* 하단 고정 버튼 */-->
|
||||
<div class="component-btns fixed"
|
||||
th:if="${dailyRecord.modifiable && moveStep}">
|
||||
th:if="${(dailyRecord.registrable && moveStep)}">
|
||||
<div class="btns-row">
|
||||
<button type="button" class="btn btn-l btn-secondary" onclick="krip.daily.goToPrev();">
|
||||
<span class="btn-txt">이전 단계로 이동</span>
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
|
||||
<div layout:fragment="content" th:classappend="acco-wrap">
|
||||
<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)}
|
||||
th:with="btnActive=${(dailyRecord.registrable && moveStep) || dailyRecord.modifiable }
|
||||
, btnDisabled=${(not btnActive)
|
||||
|| #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">
|
||||
<hgroup class="tit-group">
|
||||
@@ -33,7 +35,7 @@
|
||||
<label class="checkbox-inner" id="todayNone">
|
||||
<input type="checkbox" name="todayNone"
|
||||
data-type="WORK"
|
||||
th:disabled="${not dailyRecord.modifiable}"
|
||||
th:disabled="${not btnActive}"
|
||||
th:checked="${#strings.equals(dailyRecord.workStatus, T(app.module.front.usecase.daily.record.adapters.web.model.DailyTargetStatus).TODAY_NONE)}">
|
||||
<span class="checkbox-item">
|
||||
<span class="checkbox-txt">금일 등록내용 없음</span>
|
||||
@@ -55,7 +57,7 @@
|
||||
<p class="total">
|
||||
<span>총 <strong>[[${#lists.size(workList)}]]</strong>건</span>
|
||||
<button type="button" class="btn-reset" onclick="krip.daily.resetConfirm()"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<i class="ico-reset ico-small" aria-hidden="true"></i>
|
||||
<span>초기화</span>
|
||||
</button>
|
||||
@@ -66,7 +68,7 @@
|
||||
<div class="item-tit-group">
|
||||
<p class="item-name">[[${item.itemName}]]</p>
|
||||
<div class="btn-group"
|
||||
th:if="${not btnDisabled}">
|
||||
th:if="${btnActive}">
|
||||
<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>
|
||||
</div>
|
||||
@@ -147,7 +149,7 @@
|
||||
|
||||
<!--/* 하단 고정 버튼 */-->
|
||||
<div class="component-btns fixed"
|
||||
th:if="${dailyRecord.modifiable && moveStep}">
|
||||
th:if="${(dailyRecord.registrable && moveStep)}">
|
||||
<div class="btns-row">
|
||||
<button type="button" class="btn btn-l btn-secondary" onclick="krip.daily.goToPrev();">
|
||||
<span class="btn-txt">이전 단계로 이동</span>
|
||||
|
||||
Reference in New Issue
Block a user