[FO] 일계부 월별 현황 package 구조 변경, 달력 UI 적용
This commit is contained in:
@@ -46,16 +46,16 @@ class CreateAdminController {
|
|||||||
return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY).body(bindingResult);
|
return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY).body(bindingResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
String createdId =
|
String createdId = null;
|
||||||
saveAdminPortIn.connect(
|
// saveAdminPortIn.connect(
|
||||||
reqVO.getSeq(),
|
// reqVO.getSeq(),
|
||||||
reqVO.getId(),
|
// reqVO.getId(),
|
||||||
reqVO.getPassword(),
|
// reqVO.getPassword(),
|
||||||
reqVO.getEmail(),
|
// reqVO.getEmail(),
|
||||||
reqVO.getRegionMainCode(),
|
// reqVO.getRegionMainCode(),
|
||||||
reqVO.getAccountDisabled(),
|
// reqVO.getAccountDisabled(),
|
||||||
reqVO.getAccountLocked(),
|
// reqVO.getAccountLocked(),
|
||||||
reqVO.getRoleIds());
|
// reqVO.getRoleIds());
|
||||||
|
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(new CreateAdminResVO(createdId));
|
return ResponseEntity.status(HttpStatus.OK).body(new CreateAdminResVO(createdId));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,16 +52,18 @@ class UpdateAdminController {
|
|||||||
return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY).body(bindingResult);
|
return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY).body(bindingResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
String updatedId =
|
String updatedId = null;
|
||||||
saveAdminPortIn.connect(
|
|
||||||
reqVO.getSeq(),
|
// String updatedId =
|
||||||
reqVO.getId(),
|
// saveAdminPortIn.connect(
|
||||||
reqVO.getUpdatePassword(),
|
// reqVO.getSeq(),
|
||||||
reqVO.getEmail(),
|
// reqVO.getId(),
|
||||||
reqVO.getRegionMainCode(),
|
// reqVO.getUpdatePassword(),
|
||||||
reqVO.getAccountDisabled(),
|
// reqVO.getEmail(),
|
||||||
reqVO.getAccountLocked(),
|
// reqVO.getRegionMainCode(),
|
||||||
reqVO.getRoleIds());
|
// reqVO.getAccountDisabled(),
|
||||||
|
// reqVO.getAccountLocked(),
|
||||||
|
// reqVO.getRoleIds());
|
||||||
|
|
||||||
return ResponseEntity.status(HttpStatus.OK).body(new UpdateAdminResVO(updatedId));
|
return ResponseEntity.status(HttpStatus.OK).body(new UpdateAdminResVO(updatedId));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,37 +1,35 @@
|
|||||||
package app.module.front.usecase.daily.calendar.service;
|
package app.module.front.usecase.daily.calendar.adapters.persistence;
|
||||||
|
|
||||||
import app.module.front.usecase.daily.calendar.persistence.RecordCalendarMapper;
|
import app.module.front.usecase.daily.calendar.adapters.persistence.model.DailyRecordCalendarDto;
|
||||||
import app.module.front.usecase.daily.calendar.persistence.model.DailyRecordCalendarDto;
|
import app.module.front.usecase.daily.calendar.adapters.persistence.model.DailyRecordStatusDto;
|
||||||
import app.module.front.usecase.daily.calendar.persistence.model.DailyRecordStatusDto;
|
import app.module.front.usecase.daily.calendar.ports.RecordCalendarPortOut;
|
||||||
import app.module.front.usecase.daily.calendar.web.model.RecordCalendarChildrenVO;
|
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendar;
|
||||||
import app.module.front.usecase.daily.calendar.web.model.RecordCalendarUIReqVO;
|
import app.module.front.usecase.daily.calendar.ports.application.domain.CalendarChildren;
|
||||||
import app.module.front.usecase.daily.calendar.web.model.RecordCalendarUIResVO;
|
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendarCmd;
|
||||||
import app.module.front.usecase.daily.record.persistence.DailyRecordMapper;
|
|
||||||
import app.module.front.usecase.daily.record.web.model.DailyTargetStatus;
|
import app.module.front.usecase.daily.record.web.model.DailyTargetStatus;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.springframework.stereotype.Repository;
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.util.ArrayList;
|
||||||
import java.time.LocalDate;
|
import java.util.Collections;
|
||||||
import java.util.*;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.Objects;
|
||||||
|
|
||||||
@Service
|
@Repository
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class RecordCalendarServiceImpl implements RecordCalendarService {
|
public class RecordCalendarDao implements RecordCalendarPortOut {
|
||||||
private final RecordCalendarMapper recordCalendarMapper;
|
private final RecordCalendarMapper recordCalendarMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<RecordCalendarUIResVO> getCalendarByDailyRecord(RecordCalendarUIReqVO reqVO) {
|
public List<RecordCalendar> operate(RecordCalendarCmd command) {
|
||||||
List<DailyRecordCalendarDto> calendarList = this.getCalendarList(reqVO);
|
List<DailyRecordCalendarDto> calendarList = this.getCalendarList(command);
|
||||||
List<DailyRecordStatusDto> statusList = this.getDailyRecordStatus(reqVO);
|
List<DailyRecordStatusDto> statusList = this.getDailyRecordStatus(command);
|
||||||
|
|
||||||
String pathFormat = "/record/%s/%s/%s";
|
String pathFormat = "/record/%s/%s/%s";
|
||||||
|
|
||||||
List<RecordCalendarUIResVO> refineList = new ArrayList<>();
|
List<RecordCalendar> refineList = new ArrayList<>();
|
||||||
for (DailyRecordCalendarDto calendar : calendarList) {
|
for (DailyRecordCalendarDto calendar : calendarList) {
|
||||||
RecordCalendarUIResVO refine = new RecordCalendarUIResVO();
|
RecordCalendar refine = new RecordCalendar();
|
||||||
refine.setNo(calendar.getGroupNo());
|
refine.setNo(calendar.getGroupNo());
|
||||||
refine.setStart(calendar.getStartDay());
|
refine.setStart(calendar.getStartDay());
|
||||||
refine.setEnd(calendar.getEndDay());
|
refine.setEnd(calendar.getEndDay());
|
||||||
@@ -43,51 +41,64 @@ public class RecordCalendarServiceImpl implements RecordCalendarService {
|
|||||||
if (findStatus == null) {
|
if (findStatus == null) {
|
||||||
refine.setChildren(new ArrayList<>());
|
refine.setChildren(new ArrayList<>());
|
||||||
} else {
|
} else {
|
||||||
List<RecordCalendarChildrenVO> childList = new ArrayList<>();
|
List<CalendarChildren> childList = new ArrayList<>();
|
||||||
|
|
||||||
if (DailyTargetStatus.TARGET.equals(findStatus.getIncomeStatus())) {
|
if (DailyTargetStatus.TARGET.equals(findStatus.getIncomeStatus())) {
|
||||||
childList.add(new RecordCalendarChildrenVO(
|
childList.add(new CalendarChildren(
|
||||||
"INCOME",
|
"INCOME",
|
||||||
"수입",
|
"수입",
|
||||||
findStatus.getIncomeCount(),
|
findStatus.getIncomeCount(),
|
||||||
String.format(pathFormat, "income", reqVO.getSearchMonth(), findStatus.getDayGroupNo())));
|
String.format(pathFormat, "income", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
||||||
}
|
}
|
||||||
if (DailyTargetStatus.TARGET.equals(findStatus.getWorkStatus())) {
|
if (DailyTargetStatus.TARGET.equals(findStatus.getWorkStatus())) {
|
||||||
childList.add(new RecordCalendarChildrenVO(
|
childList.add(new CalendarChildren(
|
||||||
"WORK",
|
"WORK",
|
||||||
"임업노동 투입 내역",
|
"임업노동 투입 내역",
|
||||||
findStatus.getWorkCount(),
|
findStatus.getWorkCount(),
|
||||||
String.format(pathFormat, "work", reqVO.getSearchMonth(), findStatus.getDayGroupNo())));
|
String.format(pathFormat, "work", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
||||||
}
|
}
|
||||||
if (DailyTargetStatus.TARGET.equals(findStatus.getExpenseStatus())) {
|
if (DailyTargetStatus.TARGET.equals(findStatus.getExpenseStatus())) {
|
||||||
childList.add(new RecordCalendarChildrenVO(
|
childList.add(new CalendarChildren(
|
||||||
"EXPENSE",
|
"EXPENSE",
|
||||||
"지출",
|
"지출",
|
||||||
findStatus.getExpenseCount(),
|
findStatus.getExpenseCount(),
|
||||||
String.format(pathFormat, "expense", reqVO.getSearchMonth(), findStatus.getDayGroupNo())));
|
String.format(pathFormat, "expense", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
||||||
}
|
}
|
||||||
if (DailyTargetStatus.TARGET.equals(findStatus.getPowerStatus())) {
|
if (DailyTargetStatus.TARGET.equals(findStatus.getPowerStatus())) {
|
||||||
childList.add(new RecordCalendarChildrenVO(
|
childList.add(new CalendarChildren(
|
||||||
"POWER",
|
"POWER",
|
||||||
"동력 사용시간",
|
"동력 사용시간",
|
||||||
findStatus.getPowerCount(),
|
findStatus.getPowerCount(),
|
||||||
String.format(pathFormat, "power", reqVO.getSearchMonth(), findStatus.getDayGroupNo())));
|
String.format(pathFormat, "power", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
||||||
}
|
}
|
||||||
if (DailyTargetStatus.TARGET.equals(findStatus.getForestryStatus())) {
|
if (DailyTargetStatus.TARGET.equals(findStatus.getForestryStatus())) {
|
||||||
childList.add(new RecordCalendarChildrenVO(
|
childList.add(new CalendarChildren(
|
||||||
"FORESTRY",
|
"FORESTRY",
|
||||||
"자가임업 생산물 중 자가소비량",
|
"자가임업 생산물 중 자가소비량",
|
||||||
findStatus.getForestryCount(),
|
findStatus.getForestryCount(),
|
||||||
String.format(pathFormat, "forestry", reqVO.getSearchMonth(), findStatus.getDayGroupNo())));
|
String.format(pathFormat, "forestry", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
||||||
}
|
}
|
||||||
if (DailyTargetStatus.TARGET.equals(findStatus.getFarmingStatus())) {
|
if (DailyTargetStatus.TARGET.equals(findStatus.getFarmingStatus())) {
|
||||||
childList.add(new RecordCalendarChildrenVO(
|
childList.add(new CalendarChildren(
|
||||||
"FARMING",
|
"FARMING",
|
||||||
"자가농업 생산물 중 자가소비량",
|
"자가농업 생산물 중 자가소비량",
|
||||||
findStatus.getFarmingCount(),
|
findStatus.getFarmingCount(),
|
||||||
String.format(pathFormat, "farming", reqVO.getSearchMonth(), findStatus.getDayGroupNo())));
|
String.format(pathFormat, "farming", command.getSearchMonth(), findStatus.getDayGroupNo())));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO /info/monthly
|
||||||
|
childList.add(new CalendarChildren(
|
||||||
|
"MONTHLY",
|
||||||
|
"임산물 현황 등록",
|
||||||
|
0,
|
||||||
|
String.format("/info/monthly/month/%s", command.getSearchMonth())));
|
||||||
|
|
||||||
|
childList.add(new CalendarChildren(
|
||||||
|
"BANK",
|
||||||
|
"은행 자동이체 내역 등록",
|
||||||
|
0,
|
||||||
|
"/info/bank"));
|
||||||
|
|
||||||
refine.setChildren(childList);
|
refine.setChildren(childList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,22 +111,20 @@ public class RecordCalendarServiceImpl implements RecordCalendarService {
|
|||||||
/**
|
/**
|
||||||
* 특정월의 일 그룹 조회
|
* 특정월의 일 그룹 조회
|
||||||
*
|
*
|
||||||
* @param reqVO
|
* @param command
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private List<DailyRecordCalendarDto> getCalendarList(RecordCalendarUIReqVO reqVO) {
|
private List<DailyRecordCalendarDto> getCalendarList(RecordCalendarCmd command) {
|
||||||
int lastDay = reqVO.getSearchDate().withDayOfMonth(reqVO.getSearchDate().lengthOfMonth()).getDayOfMonth();
|
List<DailyRecordCalendarDto> calendarList = recordCalendarMapper.getCalendarByDailyRecord(command);
|
||||||
|
|
||||||
List<DailyRecordCalendarDto> calendarList = recordCalendarMapper.getCalendarByDailyRecord(reqVO);
|
|
||||||
|
|
||||||
List<DailyRecordCalendarDto> refineList = new ArrayList<>();
|
List<DailyRecordCalendarDto> refineList = new ArrayList<>();
|
||||||
for (DailyRecordCalendarDto record : calendarList) {
|
for (DailyRecordCalendarDto record : calendarList) {
|
||||||
record.setStartDate(reqVO.getSearchMonth() + String.format("%02d", record.getStartDay()));
|
record.setStartDate(command.getSearchMonth() + String.format("%02d", record.getStartDay()));
|
||||||
|
|
||||||
if ((lastDay == 28 || lastDay == 30) && record.getStartDay() == lastDay) {
|
if ((command.getLastDay() == 28 || command.getLastDay() == 30) && record.getStartDay() == command.getLastDay()) {
|
||||||
record.setEndDay(lastDay);
|
record.setEndDay(command.getLastDay());
|
||||||
refineList.add(record);
|
refineList.add(record);
|
||||||
} else if (record.getStartDay() <= lastDay && record.getEndDay() <= lastDay) {
|
} else if (record.getStartDay() <= command.getLastDay() && record.getEndDay() <= command.getLastDay()) {
|
||||||
refineList.add(record);
|
refineList.add(record);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -126,11 +135,11 @@ public class RecordCalendarServiceImpl implements RecordCalendarService {
|
|||||||
/**
|
/**
|
||||||
* 특정월의 일계부 등록 상태 조회
|
* 특정월의 일계부 등록 상태 조회
|
||||||
*
|
*
|
||||||
* @param reqVO
|
* @param command
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private List<DailyRecordStatusDto> getDailyRecordStatus(RecordCalendarUIReqVO reqVO) {
|
private List<DailyRecordStatusDto> getDailyRecordStatus(RecordCalendarCmd command) {
|
||||||
List<DailyRecordStatusDto> statusList = recordCalendarMapper.getDailyRecordStatus(reqVO);
|
List<DailyRecordStatusDto> statusList = recordCalendarMapper.getDailyRecordStatus(command);
|
||||||
if (statusList == null || statusList.isEmpty()) {
|
if (statusList == null || statusList.isEmpty()) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
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.DailyRecordStatusDto;
|
||||||
|
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendarCmd;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface RecordCalendarMapper {
|
||||||
|
/**
|
||||||
|
* 특정월의 일 그룹 조회
|
||||||
|
*
|
||||||
|
* @param cmd 검색 조건
|
||||||
|
* @return 일(DAY) 그룹 목록
|
||||||
|
*/
|
||||||
|
List<DailyRecordCalendarDto> getCalendarByDailyRecord(RecordCalendarCmd cmd);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 특정일의 일계부 등록 상태 조회
|
||||||
|
*
|
||||||
|
* @param cmd 검색 조건
|
||||||
|
* @return 일계부 등록 현황 목록
|
||||||
|
*/
|
||||||
|
List<DailyRecordStatusDto> getDailyRecordStatus(RecordCalendarCmd cmd);
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package app.module.front.usecase.daily.calendar.adapters.persistence.model;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class DailyRecordCalendarDto {
|
||||||
|
/**
|
||||||
|
* 일 그룹 번호
|
||||||
|
*/
|
||||||
|
private Integer groupNo;
|
||||||
|
/**
|
||||||
|
* 시작일
|
||||||
|
*/
|
||||||
|
private Integer startDay;
|
||||||
|
/**
|
||||||
|
* 종료일
|
||||||
|
*/
|
||||||
|
private Integer endDay;
|
||||||
|
/**
|
||||||
|
* 시작일(yyyy-MM-dd)
|
||||||
|
*/
|
||||||
|
private String startDate;
|
||||||
|
/**
|
||||||
|
* 일계부 항목 일련번호
|
||||||
|
*/
|
||||||
|
private Long dailyId;
|
||||||
|
}
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
package app.module.front.usecase.daily.calendar.persistence.model;
|
package app.module.front.usecase.daily.calendar.adapters.persistence.model;
|
||||||
|
|
||||||
import app.module.front.usecase.daily.record.web.model.DailyStatus;
|
import app.module.front.usecase.daily.record.web.model.DailyStatus;
|
||||||
import app.module.front.usecase.daily.record.web.model.DailyTargetStatus;
|
import app.module.front.usecase.daily.record.web.model.DailyTargetStatus;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package app.module.front.usecase.daily.calendar.adapters.web;
|
||||||
|
|
||||||
|
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.application.domain.RecordCalendar;
|
||||||
|
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendarCmd;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Controller
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RequestMapping(path = "/api/record/calendar")
|
||||||
|
public class RecordCalendarController {
|
||||||
|
private final RecordCalendarPortIn recordCalendarPortIn;
|
||||||
|
|
||||||
|
@GetMapping(path = "/{searchMonth}")
|
||||||
|
public ResponseEntity<?> list(@PathVariable("searchMonth") String searchMonth) {
|
||||||
|
RecordCalendarUIReqVO reqVO = new RecordCalendarUIReqVO(searchMonth);
|
||||||
|
log.debug("reqVO: {}", reqVO);
|
||||||
|
|
||||||
|
List<RecordCalendar> calendarList = recordCalendarPortIn.operate(new RecordCalendarCmd(
|
||||||
|
reqVO.getSearchMonth(),
|
||||||
|
reqVO.getHouseholdSeq(),
|
||||||
|
reqVO.getSearchDate().withDayOfMonth(reqVO.getSearchDate().lengthOfMonth()).getDayOfMonth()
|
||||||
|
));
|
||||||
|
|
||||||
|
return ResponseEntity.status(HttpStatus.OK).body(calendarList);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package app.module.front.usecase.daily.calendar.adapters.web;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.calendar.adapters.web.model.RecordCalendarUIReqVO;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Controller
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RequestMapping(path = "/record/calendar")
|
||||||
|
public class RecordCalendarUIController {
|
||||||
|
|
||||||
|
@GetMapping(path = "")
|
||||||
|
public String index(Model model) {
|
||||||
|
RecordCalendarUIReqVO reqVO = new RecordCalendarUIReqVO();
|
||||||
|
log.debug("reqVO: {}", reqVO);
|
||||||
|
|
||||||
|
model.addAttribute("reqVO", reqVO);
|
||||||
|
|
||||||
|
// TODO : 현재 날짜로부터 3일 이전 날짜에 등록하지 않은 날이 있을 경우
|
||||||
|
|
||||||
|
return "record/calendar";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package app.module.front.usecase.daily.calendar.adapters.web.model;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.record.web.model.DailyUIReqVO;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.ToString;
|
||||||
|
import org.apache.tika.utils.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ToString
|
||||||
|
public class RecordCalendarUIReqVO extends DailyUIReqVO {
|
||||||
|
private static final Logger LOGGER = LoggerFactory.getLogger(RecordCalendarUIReqVO.class);
|
||||||
|
|
||||||
|
public RecordCalendarUIReqVO() {
|
||||||
|
setSearchMonth(LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM")));
|
||||||
|
}
|
||||||
|
|
||||||
|
public RecordCalendarUIReqVO(String searchMonth) {
|
||||||
|
setSearchMonth(searchMonth);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 검색 일(yyyy-MM-dd)
|
||||||
|
*/
|
||||||
|
private LocalDate searchDate;
|
||||||
|
|
||||||
|
public void setSearchMonth(String searchMonth) {
|
||||||
|
if (!StringUtils.isBlank(searchMonth) && searchMonth.length() == 7) {
|
||||||
|
searchMonth = searchMonth + "-01";
|
||||||
|
} else {
|
||||||
|
searchMonth = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyy-MM"));
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
LocalDate formatDate = LocalDate.parse(searchMonth);
|
||||||
|
|
||||||
|
setSearchDate(formatDate);
|
||||||
|
super.setSearchMonth(formatDate.format(DateTimeFormatter.ofPattern("yyyyMM")));
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
LOGGER.warn("[DateParse] target={}", searchMonth, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
package app.module.front.usecase.daily.calendar.persistence;
|
|
||||||
|
|
||||||
import app.module.front.usecase.daily.calendar.persistence.model.DailyRecordCalendarDto;
|
|
||||||
import app.module.front.usecase.daily.calendar.persistence.model.DailyRecordStatusDto;
|
|
||||||
import app.module.front.usecase.daily.calendar.web.model.RecordCalendarUIReqVO;
|
|
||||||
import app.module.front.usecase.daily.record.web.model.CreateDailyRecordReqVO;
|
|
||||||
import app.module.front.usecase.daily.record.persistence.model.UpdateDailyRecordStatusCmd;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface RecordCalendarMapper {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 특정월의 일 그룹 목록 조회
|
|
||||||
*
|
|
||||||
* @param reqVO 검색 조건
|
|
||||||
* @return 특정월의 그룹 목록
|
|
||||||
*/
|
|
||||||
List<DailyRecordCalendarDto> getCalendarByDailyRecord(RecordCalendarUIReqVO reqVO);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 특정일의 일계부 등록 상태 조회
|
|
||||||
*
|
|
||||||
* @param reqVO 검색 조건
|
|
||||||
* @return 일계부 등록 현황 목록
|
|
||||||
*/
|
|
||||||
List<DailyRecordStatusDto> getDailyRecordStatus(RecordCalendarUIReqVO reqVO);
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
package app.module.front.usecase.daily.calendar.persistence.model;
|
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
public class DailyRecordCalendarDto {
|
|
||||||
private Integer groupNo;
|
|
||||||
private Integer startDay;
|
|
||||||
private Integer endDay;
|
|
||||||
private String startDate;
|
|
||||||
private Long dailyId;
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package app.module.front.usecase.daily.calendar.ports;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendar;
|
||||||
|
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendarCmd;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface RecordCalendarPortIn {
|
||||||
|
List<RecordCalendar> operate(RecordCalendarCmd command);
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
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.RecordCalendarCmd;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface RecordCalendarPortOut {
|
||||||
|
List<RecordCalendar> operate(RecordCalendarCmd command);
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package app.module.front.usecase.daily.calendar.ports.application;
|
||||||
|
|
||||||
|
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.RecordCalendar;
|
||||||
|
import app.module.front.usecase.daily.calendar.ports.application.domain.RecordCalendarCmd;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class RecordCalendarService implements RecordCalendarPortIn {
|
||||||
|
private final RecordCalendarPortOut portOut;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<RecordCalendar> operate(RecordCalendarCmd command) {
|
||||||
|
return portOut.operate(command);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package app.module.front.usecase.daily.calendar.ports.application.domain;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class CalendarChildren {
|
||||||
|
private String code;
|
||||||
|
private String codeLabel;
|
||||||
|
private Integer total;
|
||||||
|
private String path;
|
||||||
|
}
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
package app.module.front.usecase.daily.calendar.web.model;
|
package app.module.front.usecase.daily.calendar.ports.application.domain;
|
||||||
|
|
||||||
import app.module.front.usecase.daily.calendar.persistence.model.DailyRecordStatusDto;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@@ -10,10 +9,10 @@ import java.util.List;
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
@ToString
|
@ToString
|
||||||
public class RecordCalendarUIResVO {
|
public class RecordCalendar {
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(RecordCalendarUIResVO.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(RecordCalendar.class);
|
||||||
private Integer no;
|
private Integer no;
|
||||||
private Integer start;
|
private Integer start;
|
||||||
private Integer end;
|
private Integer end;
|
||||||
private List<RecordCalendarChildrenVO> children;
|
private List<CalendarChildren> children;
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package app.module.front.usecase.daily.calendar.ports.application.domain;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.record.web.model.DailyCmd;
|
||||||
|
import app.module.front.usecase.daily.record.web.model.DailyUIReqVO;
|
||||||
|
import lombok.*;
|
||||||
|
import org.apache.tika.utils.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class RecordCalendarCmd {
|
||||||
|
/**
|
||||||
|
* 검색 월(yyyyMM)
|
||||||
|
*/
|
||||||
|
private String searchMonth;
|
||||||
|
/**
|
||||||
|
* 임가 일련번호
|
||||||
|
*/
|
||||||
|
private Long householdSeq;
|
||||||
|
/**
|
||||||
|
* 특정월의 마지막 일
|
||||||
|
*/
|
||||||
|
private int lastDay;
|
||||||
|
}
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
package app.module.front.usecase.daily.calendar.service;
|
|
||||||
|
|
||||||
import app.module.front.usecase.daily.calendar.web.model.RecordCalendarUIReqVO;
|
|
||||||
import app.module.front.usecase.daily.calendar.web.model.RecordCalendarUIResVO;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface RecordCalendarService {
|
|
||||||
/**
|
|
||||||
* 특정월의 일계부 현황 조회
|
|
||||||
*
|
|
||||||
* @param reqVO 검색 조건
|
|
||||||
* @return 월별 일계부 목록
|
|
||||||
*/
|
|
||||||
List<RecordCalendarUIResVO> getCalendarByDailyRecord(RecordCalendarUIReqVO reqVO);
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
package app.module.front.usecase.daily.calendar.web;
|
|
||||||
|
|
||||||
import app.module.front.usecase.daily.calendar.persistence.model.DailyRecordCalendarDto;
|
|
||||||
import app.module.front.usecase.daily.calendar.persistence.model.DailyRecordStatusDto;
|
|
||||||
import app.module.front.usecase.daily.calendar.service.RecordCalendarService;
|
|
||||||
import app.module.front.usecase.daily.calendar.web.model.RecordCalendarChildrenVO;
|
|
||||||
import app.module.front.usecase.daily.calendar.web.model.RecordCalendarUIReqVO;
|
|
||||||
import app.module.front.usecase.daily.calendar.web.model.RecordCalendarUIResVO;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
import org.springframework.ui.Model;
|
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.YearMonth;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Slf4j
|
|
||||||
@Controller
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
@RequestMapping(path = "/record/calendar")
|
|
||||||
public class RecordCalendarController {
|
|
||||||
private final RecordCalendarService recordCalendarService;
|
|
||||||
|
|
||||||
@GetMapping(path = "")
|
|
||||||
public String index(Model model, @RequestParam(value = "searchDay", required = false) String searchDay) {
|
|
||||||
RecordCalendarUIReqVO reqVO = new RecordCalendarUIReqVO(searchDay);
|
|
||||||
log.debug("reqVO: {}", reqVO);
|
|
||||||
|
|
||||||
model.addAttribute("reqVO", reqVO);
|
|
||||||
model.addAttribute("calendarList", recordCalendarService.getCalendarByDailyRecord(reqVO));
|
|
||||||
|
|
||||||
return "record/calendar";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
package app.module.front.usecase.daily.calendar.web.model;
|
|
||||||
|
|
||||||
import app.module.front.usecase.daily.calendar.persistence.model.DailyRecordStatusDto;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.ToString;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class RecordCalendarChildrenVO {
|
|
||||||
private String code;
|
|
||||||
private String codeLabel;
|
|
||||||
private Integer total;
|
|
||||||
private String path;
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
package app.module.front.usecase.daily.calendar.web.model;
|
|
||||||
|
|
||||||
import app.module.front.usecase.daily.record.web.model.DailyUIReqVO;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.ToString;
|
|
||||||
import org.apache.tika.utils.StringUtils;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Locale;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@ToString
|
|
||||||
public class RecordCalendarUIReqVO extends DailyUIReqVO {
|
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(RecordCalendarUIReqVO.class);
|
|
||||||
|
|
||||||
public RecordCalendarUIReqVO() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public RecordCalendarUIReqVO(String searchDay) {
|
|
||||||
if (StringUtils.isBlank(searchDay) || searchDay.length() != 8) {
|
|
||||||
searchDay = LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMMdd"));
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
SimpleDateFormat beforeSdf = new SimpleDateFormat("yyyyMMdd", Locale.KOREAN);
|
|
||||||
SimpleDateFormat afterSdf = new SimpleDateFormat("yyyy-MM-dd", Locale.KOREAN);
|
|
||||||
SimpleDateFormat monthSdf = new SimpleDateFormat("yyyyMM", Locale.KOREAN);
|
|
||||||
|
|
||||||
Date formatDate = beforeSdf.parse(searchDay);
|
|
||||||
|
|
||||||
setSearchDate(LocalDate.parse(afterSdf.format(formatDate)));
|
|
||||||
setSearchMonth(monthSdf.format(formatDate));
|
|
||||||
setSearchDay(beforeSdf.format(formatDate));
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
LOGGER.warn("[DateParse] target={}", searchDay, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 검색 일(yyyyMMdd)
|
|
||||||
*/
|
|
||||||
private String searchDay;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 검색 일(yyyy-MM-dd)
|
|
||||||
*/
|
|
||||||
private LocalDate searchDate;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
package app.module.front.usecase.daily.record.web;
|
package app.module.front.usecase.daily.record.web;
|
||||||
|
|
||||||
import app.module.core.config.application.exception.NoMatchingURIException;
|
import app.module.core.config.application.exception.NoMatchingURIException;
|
||||||
import app.module.front.usecase.daily.calendar.service.RecordCalendarService;
|
|
||||||
import app.module.front.usecase.daily.record.persistence.model.DailyRecordDto;
|
import app.module.front.usecase.daily.record.persistence.model.DailyRecordDto;
|
||||||
import app.module.front.usecase.daily.record.service.DailyRecordService;
|
import app.module.front.usecase.daily.record.service.DailyRecordService;
|
||||||
import app.module.front.usecase.daily.record.web.model.CreateDailyRecordReqVO;
|
import app.module.front.usecase.daily.record.web.model.CreateDailyRecordReqVO;
|
||||||
@@ -23,7 +22,6 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RequestMapping(path = "/api/record/daily")
|
@RequestMapping(path = "/api/record/daily")
|
||||||
public class DailyRecordController {
|
public class DailyRecordController {
|
||||||
private final RecordCalendarService recordCalendarService;
|
|
||||||
private final DailyRecordService dailyRecordService;
|
private final DailyRecordService dailyRecordService;
|
||||||
private final CreateDailyRecordValidator createDailyRecordValidator;
|
private final CreateDailyRecordValidator createDailyRecordValidator;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package app.module.front.usecase.daily.record.web;
|
package app.module.front.usecase.daily.record.web;
|
||||||
|
|
||||||
import app.module.core.config.application.exception.NoMatchingURIException;
|
import app.module.core.config.application.exception.NoMatchingURIException;
|
||||||
import app.module.front.usecase.daily.calendar.service.RecordCalendarService;
|
|
||||||
import app.module.front.usecase.daily.record.persistence.model.DailyRecordDto;
|
import app.module.front.usecase.daily.record.persistence.model.DailyRecordDto;
|
||||||
import app.module.front.usecase.daily.record.service.DailyRecordService;
|
import app.module.front.usecase.daily.record.service.DailyRecordService;
|
||||||
import app.module.front.usecase.daily.record.web.model.CreateDailyRecordReqVO;
|
import app.module.front.usecase.daily.record.web.model.CreateDailyRecordReqVO;
|
||||||
@@ -22,7 +21,6 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RequestMapping(path = "/record/daily")
|
@RequestMapping(path = "/record/daily")
|
||||||
public class DailyRecordUIController {
|
public class DailyRecordUIController {
|
||||||
private final RecordCalendarService recordCalendarService;
|
|
||||||
private final DailyRecordService dailyRecordService;
|
private final DailyRecordService dailyRecordService;
|
||||||
private final CreateDailyRecordValidator createDailyRecordValidator;
|
private final CreateDailyRecordValidator createDailyRecordValidator;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package app.module.front.usecase.daily.record.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;
|
||||||
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
<mapper namespace="app.module.front.usecase.daily.calendar.persistence.RecordCalendarMapper">
|
<mapper namespace="app.module.front.usecase.daily.calendar.adapters.persistence.RecordCalendarMapper">
|
||||||
|
|
||||||
<select id="getCalendarByDailyRecord"
|
<select id="getCalendarByDailyRecord"
|
||||||
resultType="app.module.front.usecase.daily.calendar.persistence.model.DailyRecordCalendarDto">
|
resultType="app.module.front.usecase.daily.calendar.adapters.persistence.model.DailyRecordCalendarDto">
|
||||||
select ddg.group_no, ddg.start_day, ddg.end_day
|
select ddg.group_no, ddg.start_day, ddg.end_day
|
||||||
, dr.id as daily_id
|
, dr.id as daily_id
|
||||||
from daily_day_group ddg
|
from daily_day_group ddg
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getDailyRecordStatus"
|
<select id="getDailyRecordStatus"
|
||||||
resultType="app.module.front.usecase.daily.calendar.persistence.model.DailyRecordStatusDto">
|
resultType="app.module.front.usecase.daily.calendar.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
|
||||||
, dr.all_status
|
, dr.all_status
|
||||||
@@ -37,9 +37,6 @@
|
|||||||
where dr.is_deleted = false
|
where dr.is_deleted = false
|
||||||
and dr.household_seq = #{householdSeq}
|
and dr.household_seq = #{householdSeq}
|
||||||
and dr.record_month = #{searchMonth}
|
and dr.record_month = #{searchMonth}
|
||||||
<if test="groupNo != null and groupNo != 'groupNo'">
|
|
||||||
and dr.day_group_no = #{groupNo}
|
|
||||||
</if>
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
|
||||||
xmlns:th="http://www.thymeleaf.org">
|
|
||||||
|
|
||||||
<div>
|
|
||||||
<div>
|
|
||||||
reqVO: [[${reqVO}]]
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<th:block th:if="${not #strings.isEmpty(detail)}">
|
|
||||||
[[${#temporals.format(detail.startDate, 'yyyy년 MM월 dd일')}]] ~ [[${#temporals.format(detail.endDate, 'yyyy년 MM월 dd일')}]]<br/>
|
|
||||||
|
|
||||||
수입 : [[${detail.incomeStatus}]], [[${detail.incomeCount}]]
|
|
||||||
<span th:onclick="formControl.incomeDetail([[${reqVO.searchDay}]])">수정</span>
|
|
||||||
<br/>
|
|
||||||
|
|
||||||
<br/><br/>
|
|
||||||
detail: [[${detail}]]
|
|
||||||
</th:block>
|
|
||||||
|
|
||||||
<th:block th:if="${#strings.isEmpty(detail)}">
|
|
||||||
<th:block th:with="searchDate=${#temporals.createDate(reqVO.searchDay, 'yyyyMMdd')}">
|
|
||||||
[[${#temporals.format(searchDate, 'yyyy년 MM월 dd일')}]]
|
|
||||||
</th:block>
|
|
||||||
<br/>
|
|
||||||
|
|
||||||
<input type="button" value="등록" th:onclick="formControl.recordCreate([[${reqVO.searchMonth}]], [[${reqVO.groupNo}]])">
|
|
||||||
</th:block>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
@@ -3,36 +3,6 @@
|
|||||||
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">
|
||||||
<th:block th:if="${@systemProperties['spring.profiles.active'] eq 'local'}">
|
|
||||||
<div>
|
|
||||||
reqVO: [[${reqVO}]]
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<th:block th:each="calendar, calendarStatus : ${calendarList}">
|
|
||||||
<th:block th:if="${not #strings.isEmpty(calendar.children)}">
|
|
||||||
<span th:onclick="formControl.getDetail([[${reqVO.searchMonth}]], [[${calendar.no}]])">
|
|
||||||
No=[[${calendar.no}]], Start=[[${calendar.start}]], End=[[${calendar.end}]], children=[[${calendar.children}]]<br/>
|
|
||||||
<th:block th:each="children, childrenStatus : ${calendar.children}">
|
|
||||||
<a th:href="${children.path}">
|
|
||||||
>> Text=[[${children.codeLabel}]], Path=[[${children.path}]], Count=[[${children.total}]]<br/>
|
|
||||||
</a>
|
|
||||||
</th:block>
|
|
||||||
</span>
|
|
||||||
</th:block>
|
|
||||||
<th:block th:if="${#strings.isEmpty(calendar.children)}">
|
|
||||||
<span th:onclick="formControl.getDetail([[${reqVO.searchMonth}]], [[${calendar.no}]])">
|
|
||||||
No=[[${calendar.no}]], Start=[[${calendar.start}]], End=[[${calendar.end}]]<br/>
|
|
||||||
</span>
|
|
||||||
</th:block>
|
|
||||||
</th:block>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<hr/>
|
|
||||||
|
|
||||||
<div id="selectedDay">
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</th:block>
|
|
||||||
<main id="content" role="main">
|
<main id="content" role="main">
|
||||||
<!-- alert-box 클래스 리스트트
|
<!-- alert-box 클래스 리스트트
|
||||||
fail : 실패(빨강)
|
fail : 실패(빨강)
|
||||||
@@ -54,7 +24,7 @@
|
|||||||
<div class="datepicker-loading"><i class="ico-spinner" aria-hidden="true"></i></div>
|
<div class="datepicker-loading"><i class="ico-spinner" aria-hidden="true"></i></div>
|
||||||
<button type="button" class="btn-week-month month"><span>월</span> <span>주</span></button>
|
<button type="button" class="btn-week-month month"><span>월</span> <span>주</span></button>
|
||||||
<div class="component-datepicker kri" data-props-type="inline" data-init="false"></div>
|
<div class="component-datepicker kri" data-props-type="inline" data-init="false"></div>
|
||||||
<script>
|
<script th:inline="javascript">
|
||||||
class DatepickerComponent {
|
class DatepickerComponent {
|
||||||
$datepicker
|
$datepicker
|
||||||
$datepickerLoading
|
$datepickerLoading
|
||||||
@@ -435,13 +405,16 @@
|
|||||||
|
|
||||||
async getData (month) {
|
async getData (month) {
|
||||||
await new Promise(resolve => setTimeout(resolve, 50))
|
await new Promise(resolve => setTimeout(resolve, 50))
|
||||||
const data = await fetch(`http://localhost:8888/assets/json/${month}.json`)
|
const data = await fetch(`/api/record/calendar/${month}`)
|
||||||
return await data.json()
|
return await data.json()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
new DatepickerComponent(function(list, currentDate, viewDate){
|
new DatepickerComponent(function(list, currentDate, viewDate){
|
||||||
console.log('changeDateCallback', list, currentDate, viewDate);
|
console.log('changeDateCallback', list, currentDate, viewDate);
|
||||||
|
|
||||||
|
formControl.setDetail(list, currentDate, viewDate);
|
||||||
|
|
||||||
}, function(monthKey, currentDate){
|
}, function(monthKey, currentDate){
|
||||||
console.log('changeMonthCallback', monthKey, currentDate);
|
console.log('changeMonthCallback', monthKey, currentDate);
|
||||||
});
|
});
|
||||||
@@ -450,63 +423,8 @@
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="daily-report-area bg-gray bg-lround">
|
<section class="daily-report-area bg-gray bg-lround">
|
||||||
<div class="inner">
|
<div class="inner" id="selectedDay">
|
||||||
<p class="date">2025. 5. 19 ~ 2025. 5. 20</p>
|
<!--/* jsRender */-->
|
||||||
<ul class="btn-column-list">
|
|
||||||
<li>
|
|
||||||
<a href="">
|
|
||||||
<p class="label">수입</p>
|
|
||||||
<p class="value"><em>총 <b>4</b>건</em></p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="">
|
|
||||||
<p class="label">노동투입</p>
|
|
||||||
<p class="value">없음</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="">
|
|
||||||
<p class="label">지출</p>
|
|
||||||
<p class="value">없음</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="">
|
|
||||||
<p class="label">동력사용시간</p>
|
|
||||||
<p class="value"><em>총 <b>4</b>건</em></p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="">
|
|
||||||
<p class="label">임업생산물 중 자가소비량</p>
|
|
||||||
<p class="value">없음</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<a href="">
|
|
||||||
<p class="label">농업생산물 중 자가소비량</p>
|
|
||||||
<p class="value">없음</p>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<div class="component-btns btn-add">
|
|
||||||
<button type="button">
|
|
||||||
<p class="txt">일계부 등록하기</p>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="regist-btn-area">
|
|
||||||
<a href="" class="btn complete">
|
|
||||||
<p>임산물 현황 등록</p>
|
|
||||||
<span>등록완료</span>
|
|
||||||
</a>
|
|
||||||
<a href="" class="btn">
|
|
||||||
<p>은행 자동이체 내역 등록</p>
|
|
||||||
<span>미등록</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
@@ -514,6 +432,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<section layout:fragment="script">
|
<section layout:fragment="script">
|
||||||
|
<script th:src="@{/static/library/jsRender/jsrender.min.js}"></script>
|
||||||
<script th:src="@{/static/ui/page/daily-record.js}"></script>
|
<script th:src="@{/static/ui/page/daily-record.js}"></script>
|
||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
let ENV = {
|
let ENV = {
|
||||||
@@ -526,32 +445,89 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
let formControl = {
|
let formControl = {
|
||||||
getDetail(searchMonth, groupNo) {
|
setDetail(list, currentDate, viewDate) {
|
||||||
console.log('searchMonth=', searchMonth, 'groupNo=', groupNo);
|
const todoList = list.filter(f => !(f.code === 'MONTHLY' || f.code === 'BANK'));
|
||||||
|
const etcList = list.filter(f => f.code === 'MONTHLY' || f.code === 'BANK');
|
||||||
|
console.log(todoList)
|
||||||
|
console.log(etcList)
|
||||||
|
|
||||||
ajaxUtil._ajaxAsync(
|
let tmpl = $.templates('#dailyNoneTmpl');
|
||||||
ENV.httpUrl.list.replace('{searchMonth}', searchMonth).replace('{groupNo}', groupNo),
|
let html = '';
|
||||||
{},
|
if (todoList === undefined || todoList.length === 0) {
|
||||||
function(rstHtml, status) {
|
html = tmpl.render({
|
||||||
$('#selectedDay').html(rstHtml);
|
date: currentDate,
|
||||||
},
|
etcList: etcList,
|
||||||
function(code, rstData) {
|
});
|
||||||
kri.logger.error('Do nothing. code: '+ code, rstData);
|
} else {
|
||||||
},
|
tmpl = $.templates('#dailyListTmpl');
|
||||||
'html'
|
html = tmpl.render({
|
||||||
);
|
date: currentDate,
|
||||||
|
list: todoList,
|
||||||
|
etcList: etcList,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
console.log(html)
|
||||||
|
|
||||||
|
$('#selectedDay').html(html);
|
||||||
},
|
},
|
||||||
incomeDetail(selectedDay) {
|
|
||||||
// TODO
|
|
||||||
alert('TODO : ' + selectedDay);
|
|
||||||
},
|
|
||||||
|
|
||||||
recordCreate(searchMonth, groupNo) {
|
recordCreate(searchMonth, groupNo) {
|
||||||
location.href = ENV.httpUrl.create.replace('{searchMonth}', searchMonth).replace('{groupNo}', groupNo);
|
location.href = ENV.httpUrl.create.replace('{searchMonth}', searchMonth).replace('{groupNo}', groupNo);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<script id="dailyNoneTmpl" type="text/x-jsrender">
|
||||||
|
{{include tmpl="#titleTmpl" /}}
|
||||||
|
|
||||||
|
<div class="component-btns btn-add">
|
||||||
|
<button type="button" onclick="alert('TODO');">
|
||||||
|
<p class="txt">일계부 등록하기</p>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{include tmpl="#etcRowTmpl" /}}
|
||||||
|
</script>
|
||||||
|
<script id="dailyListTmpl" type="text/x-jsrender">
|
||||||
|
{{include tmpl="#titleTmpl" /}}
|
||||||
|
|
||||||
|
<ul class="btn-column-list">
|
||||||
|
{{for list tmpl="#basicRowTmpl" /}}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
{{include tmpl="#etcRowTmpl" /}}
|
||||||
|
</script>
|
||||||
|
<script id="titleTmpl" type="text/x-jsrender">
|
||||||
|
{{if date.start == date.end}}
|
||||||
|
<p class="date">{{:date.start}}</p>
|
||||||
|
{{else}}
|
||||||
|
<p class="date">{{:date.start}} ~ {{:date.end}}</p>
|
||||||
|
{{/if}}
|
||||||
|
</script>
|
||||||
|
<script id="basicRowTmpl" type="text/x-jsrender">
|
||||||
|
<li>
|
||||||
|
<a href="{{:path}}">
|
||||||
|
<p class="label">{{:codeLabel}}</p>
|
||||||
|
{{if total != null && total != 0}}
|
||||||
|
<p class="value"><em>총 <b>{{:total}}</b>건</em></p>
|
||||||
|
{{else}}
|
||||||
|
<p class="value">없음</p>
|
||||||
|
{{/if}}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</script>
|
||||||
|
<script id="etcRowTmpl" type="text/x-jsrender">
|
||||||
|
<div class="regist-btn-area">
|
||||||
|
{{for etcList}}
|
||||||
|
<a href="{{:path}}" class="btn{{if total != null && total != 0}} complete{{/if}}">
|
||||||
|
<p>{{:codeLabel}}</p>
|
||||||
|
{{if total != null && total != 0}}
|
||||||
|
<span>등록완료</span>
|
||||||
|
{{else}}
|
||||||
|
<span>미등록</span>
|
||||||
|
{{/if}}
|
||||||
|
</a>
|
||||||
|
{{/for}}
|
||||||
|
</div>
|
||||||
|
</script>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
Reference in New Issue
Block a user