[2차][FO] 입력현황
This commit is contained in:
@@ -15,22 +15,27 @@ import java.util.List;
|
|||||||
@Repository
|
@Repository
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class DailyExpenseDao implements DailyExpensePortOut {
|
public class DailyExpenseDao implements DailyExpensePortOut {
|
||||||
private final DailyExpenseMapper dailyExpenseMapper;
|
private final DailyExpenseMapper mapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DailyExpenseDto> list(GetDailyExpenseCmd command) {
|
public List<DailyExpenseDto> list(GetDailyExpenseCmd command) {
|
||||||
return dailyExpenseMapper.getDailyExpenseList(command);
|
return mapper.getDailyExpenseList(command);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DailyExpenseDto> monthList(GetDailyExpenseCmd command) {
|
||||||
|
return mapper.getDailyExpenseMonthList(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void create(GetDailyExpenseCmd findCmd, CreateDailyExpenseCmd command) {
|
public void create(GetDailyExpenseCmd findCmd, CreateDailyExpenseCmd command) {
|
||||||
Integer existCount = dailyExpenseMapper.getRecordExistCount(findCmd);
|
Integer existCount = mapper.getRecordExistCount(findCmd);
|
||||||
if (existCount == 0) {
|
if (existCount == 0) {
|
||||||
dailyExpenseMapper.createDailyExpense(command);
|
mapper.createDailyExpense(command);
|
||||||
|
|
||||||
log.debug("[CreateDailyExpense] record={}", command);
|
log.debug("[CreateDailyExpense] record={}", command);
|
||||||
} else {
|
} else {
|
||||||
dailyExpenseMapper.updateDailyExpense(command);
|
mapper.updateDailyExpense(command);
|
||||||
|
|
||||||
log.debug("[UpdateDailyExpense] record={}", command);
|
log.debug("[UpdateDailyExpense] record={}", command);
|
||||||
}
|
}
|
||||||
@@ -38,9 +43,9 @@ public class DailyExpenseDao implements DailyExpensePortOut {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void remove(GetDailyExpenseCmd findCmd, RemoveDailyExpenseCmd command) {
|
public void remove(GetDailyExpenseCmd findCmd, RemoveDailyExpenseCmd command) {
|
||||||
Integer existCount = dailyExpenseMapper.getRecordExistCount(findCmd);
|
Integer existCount = mapper.getRecordExistCount(findCmd);
|
||||||
if (existCount != 0) {
|
if (existCount != 0) {
|
||||||
dailyExpenseMapper.removeDailyExpense(command);
|
mapper.removeDailyExpense(command);
|
||||||
|
|
||||||
log.debug("[RemoveDailyExpense] record={}", command);
|
log.debug("[RemoveDailyExpense] record={}", command);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import app.module.front.usecase.daily.expense.adapters.persistence.model.DailyEx
|
|||||||
import app.module.front.usecase.daily.expense.ports.application.domain.GetDailyExpenseCmd;
|
import app.module.front.usecase.daily.expense.ports.application.domain.GetDailyExpenseCmd;
|
||||||
import app.module.front.usecase.daily.expense.ports.application.domain.RemoveDailyExpenseCmd;
|
import app.module.front.usecase.daily.expense.ports.application.domain.RemoveDailyExpenseCmd;
|
||||||
import app.module.front.usecase.daily.expense.adapters.web.model.DailyExpenseUIReqVO;
|
import app.module.front.usecase.daily.expense.adapters.web.model.DailyExpenseUIReqVO;
|
||||||
|
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto;
|
||||||
|
import app.module.front.usecase.daily.income.ports.application.domain.GetDailyIncomeCmd;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -12,13 +14,21 @@ import java.util.List;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface DailyExpenseMapper {
|
public interface DailyExpenseMapper {
|
||||||
/**
|
/**
|
||||||
* 일계부 지출 목록 조회
|
* 특정 그룹일의 일계부 지출 목록 조회
|
||||||
*
|
*
|
||||||
* @param command 검색 조건
|
* @param command 검색 조건
|
||||||
* @return 수입 목록
|
* @return 수입 목록
|
||||||
*/
|
*/
|
||||||
List<DailyExpenseDto> getDailyExpenseList(GetDailyExpenseCmd command);
|
List<DailyExpenseDto> getDailyExpenseList(GetDailyExpenseCmd command);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 특정월의 일계부 지출 목록 조회
|
||||||
|
*
|
||||||
|
* @param command 검색 조건
|
||||||
|
* @return 지출 목록
|
||||||
|
*/
|
||||||
|
List<DailyExpenseDto> getDailyExpenseMonthList(GetDailyExpenseCmd command);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 지출 데이터 존재 여부
|
* 일계부 지출 데이터 존재 여부
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import app.module.front.usecase.daily.income.adapters.web.model.DailyInputType;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class DailyExpenseDto {
|
public class DailyExpenseDto {
|
||||||
@@ -19,6 +21,8 @@ public class DailyExpenseDto {
|
|||||||
private String unitSelf;
|
private String unitSelf;
|
||||||
private Long price;
|
private Long price;
|
||||||
private Long estimatedValue;
|
private Long estimatedValue;
|
||||||
|
private LocalDate startDate;
|
||||||
|
private LocalDate endDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 수정 가능 여부
|
* 수정 가능 여부
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package app.module.front.usecase.daily.expense.adapters.persistence.model;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class DailyExpenseMonthDto {
|
||||||
|
private Long dailyRecordSeq;
|
||||||
|
private LocalDate startDate;
|
||||||
|
private LocalDate endDate;
|
||||||
|
private List<DailyExpenseDto> children;
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package app.module.front.usecase.daily.expense.ports;
|
package app.module.front.usecase.daily.expense.ports;
|
||||||
|
|
||||||
import app.module.front.usecase.daily.expense.adapters.persistence.model.DailyExpenseDto;
|
import app.module.front.usecase.daily.expense.adapters.persistence.model.DailyExpenseDto;
|
||||||
|
import app.module.front.usecase.daily.expense.adapters.persistence.model.DailyExpenseMonthDto;
|
||||||
import app.module.front.usecase.daily.expense.adapters.web.model.CreateDailyExpenseReqVO;
|
import app.module.front.usecase.daily.expense.adapters.web.model.CreateDailyExpenseReqVO;
|
||||||
import app.module.front.usecase.daily.expense.adapters.web.model.DailyExpenseUIReqVO;
|
import app.module.front.usecase.daily.expense.adapters.web.model.DailyExpenseUIReqVO;
|
||||||
import app.module.front.usecase.daily.expense.adapters.web.model.RemoveDailyExpenseReqVO;
|
import app.module.front.usecase.daily.expense.adapters.web.model.RemoveDailyExpenseReqVO;
|
||||||
@@ -9,13 +10,21 @@ import java.util.List;
|
|||||||
|
|
||||||
public interface DailyExpensePortIn {
|
public interface DailyExpensePortIn {
|
||||||
/**
|
/**
|
||||||
* 일계부 지출 조회
|
* 특정 그룹일의 일계부 지출 조회
|
||||||
*
|
*
|
||||||
* @param reqVO 검색 조건
|
* @param reqVO 검색 조건
|
||||||
* @return 지출 목록
|
* @return 지출 목록
|
||||||
*/
|
*/
|
||||||
List<DailyExpenseDto> list(DailyExpenseUIReqVO reqVO);
|
List<DailyExpenseDto> list(DailyExpenseUIReqVO reqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 특정월의 일계부 수입 조회
|
||||||
|
*
|
||||||
|
* @param reqVO 검색 조건
|
||||||
|
* @return 수입 목록
|
||||||
|
*/
|
||||||
|
List<DailyExpenseMonthDto> monthList(DailyExpenseUIReqVO reqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 지출 조회
|
* 일계부 지출 조회
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import app.module.front.usecase.daily.expense.adapters.persistence.model.DailyEx
|
|||||||
import app.module.front.usecase.daily.expense.ports.application.domain.CreateDailyExpenseCmd;
|
import app.module.front.usecase.daily.expense.ports.application.domain.CreateDailyExpenseCmd;
|
||||||
import app.module.front.usecase.daily.expense.ports.application.domain.GetDailyExpenseCmd;
|
import app.module.front.usecase.daily.expense.ports.application.domain.GetDailyExpenseCmd;
|
||||||
import app.module.front.usecase.daily.expense.ports.application.domain.RemoveDailyExpenseCmd;
|
import app.module.front.usecase.daily.expense.ports.application.domain.RemoveDailyExpenseCmd;
|
||||||
|
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto;
|
||||||
|
import app.module.front.usecase.daily.income.ports.application.domain.GetDailyIncomeCmd;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -16,6 +18,14 @@ public interface DailyExpensePortOut {
|
|||||||
*/
|
*/
|
||||||
List<DailyExpenseDto> list(GetDailyExpenseCmd command);
|
List<DailyExpenseDto> list(GetDailyExpenseCmd command);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 지출 조회
|
||||||
|
*
|
||||||
|
* @param command 검색 조건
|
||||||
|
* @return 지출 목록
|
||||||
|
*/
|
||||||
|
List<DailyExpenseDto> monthList(GetDailyExpenseCmd command);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 지출 등록
|
* 일계부 지출 등록
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import app.module.core.usecase.uicode.list.ports.application.domain.UICodeElemen
|
|||||||
import app.module.front.config.application.util.AuditUtil;
|
import app.module.front.config.application.util.AuditUtil;
|
||||||
import app.module.front.config.constants.CommonConstants;
|
import app.module.front.config.constants.CommonConstants;
|
||||||
import app.module.front.usecase.daily.expense.adapters.persistence.model.DailyExpenseDto;
|
import app.module.front.usecase.daily.expense.adapters.persistence.model.DailyExpenseDto;
|
||||||
|
import app.module.front.usecase.daily.expense.adapters.persistence.model.DailyExpenseMonthDto;
|
||||||
import app.module.front.usecase.daily.expense.adapters.web.model.CreateDailyExpenseReqVO;
|
import app.module.front.usecase.daily.expense.adapters.web.model.CreateDailyExpenseReqVO;
|
||||||
import app.module.front.usecase.daily.expense.adapters.web.model.DailyExpenseUIReqVO;
|
import app.module.front.usecase.daily.expense.adapters.web.model.DailyExpenseUIReqVO;
|
||||||
import app.module.front.usecase.daily.expense.adapters.web.model.RemoveDailyExpenseReqVO;
|
import app.module.front.usecase.daily.expense.adapters.web.model.RemoveDailyExpenseReqVO;
|
||||||
@@ -15,11 +16,13 @@ import app.module.front.usecase.daily.expense.ports.DailyExpensePortOut;
|
|||||||
import app.module.front.usecase.daily.expense.ports.application.domain.CreateDailyExpenseCmd;
|
import app.module.front.usecase.daily.expense.ports.application.domain.CreateDailyExpenseCmd;
|
||||||
import app.module.front.usecase.daily.expense.ports.application.domain.GetDailyExpenseCmd;
|
import app.module.front.usecase.daily.expense.ports.application.domain.GetDailyExpenseCmd;
|
||||||
import app.module.front.usecase.daily.expense.ports.application.domain.RemoveDailyExpenseCmd;
|
import app.module.front.usecase.daily.expense.ports.application.domain.RemoveDailyExpenseCmd;
|
||||||
import app.module.core.usecase.daily.record.ports.application.DailyRecordService;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@@ -30,12 +33,30 @@ public class DailyExpenseService implements DailyExpensePortIn {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DailyExpenseDto> list(DailyExpenseUIReqVO reqVO) {
|
public List<DailyExpenseDto> list(DailyExpenseUIReqVO reqVO) {
|
||||||
return this.getRefineList(reqVO);
|
return this.getRefineList(reqVO, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DailyExpenseMonthDto> monthList(DailyExpenseUIReqVO reqVO) {
|
||||||
|
List<DailyExpenseDto> list = this.getRefineList(reqVO, false);
|
||||||
|
|
||||||
|
List<DailyExpenseMonthDto> monthList = new ArrayList<>();
|
||||||
|
List<Long> recordSeqList = list.stream().map(DailyExpenseDto::getDailyRecordSeq).distinct().toList();
|
||||||
|
for (Long seq : recordSeqList) {
|
||||||
|
DailyExpenseMonthDto month = new DailyExpenseMonthDto();
|
||||||
|
month.setDailyRecordSeq(seq);
|
||||||
|
month.setStartDate(list.stream().filter(f -> Objects.equals(f.getDailyRecordSeq(), seq)).map(DailyExpenseDto::getStartDate).findFirst().orElse(null));
|
||||||
|
month.setEndDate(list.stream().filter(f -> Objects.equals(f.getDailyRecordSeq(), seq)).map(DailyExpenseDto::getEndDate).findFirst().orElse(null));
|
||||||
|
month.setChildren(list.stream().filter(f -> Objects.equals(f.getDailyRecordSeq(), seq)).collect(Collectors.toList()));
|
||||||
|
monthList.add(month);
|
||||||
|
}
|
||||||
|
|
||||||
|
return monthList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DailyExpenseDto detail(DailyExpenseUIReqVO reqVO) {
|
public DailyExpenseDto detail(DailyExpenseUIReqVO reqVO) {
|
||||||
List<DailyExpenseDto> list = this.getRefineList(reqVO);
|
List<DailyExpenseDto> list = this.getRefineList(reqVO, true);
|
||||||
if (list.isEmpty()) {
|
if (list.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -47,13 +68,16 @@ public class DailyExpenseService implements DailyExpensePortIn {
|
|||||||
* 목록 데이터 조회
|
* 목록 데이터 조회
|
||||||
*
|
*
|
||||||
* @param reqVO 검색 조건
|
* @param reqVO 검색 조건
|
||||||
|
* @param dayGroup 일 그룹 조건(true=일, false=월)
|
||||||
* @return 공통 처리된 목록
|
* @return 공통 처리된 목록
|
||||||
*/
|
*/
|
||||||
private List<DailyExpenseDto> getRefineList(DailyExpenseUIReqVO reqVO) {
|
private List<DailyExpenseDto> getRefineList(DailyExpenseUIReqVO reqVO, boolean dayGroup) {
|
||||||
List<DailyExpenseDto> list = portOut.list(new GetDailyExpenseCmd(reqVO.getSearchMonth(),
|
GetDailyExpenseCmd command = new GetDailyExpenseCmd(reqVO.getSearchMonth(),
|
||||||
reqVO.getGroupNo(),
|
reqVO.getGroupNo(),
|
||||||
reqVO.getHouseholdSeq(),
|
reqVO.getHouseholdSeq(),
|
||||||
reqVO.getId()));
|
reqVO.getId());
|
||||||
|
|
||||||
|
List<DailyExpenseDto> list = dayGroup ? portOut.list(command) : portOut.monthList(command);
|
||||||
|
|
||||||
List<UICodeElement> recordUnit = uiCodeListPortIn.connect("code.record.unit");
|
List<UICodeElement> recordUnit = uiCodeListPortIn.connect("code.record.unit");
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,11 @@ public class DailyFarmingDao implements DailyFarmingPortOut {
|
|||||||
return mapper.getDailyFarmingList(command);
|
return mapper.getDailyFarmingList(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DailyFarmingDto> monthList(GetDailyFarmingCmd command) {
|
||||||
|
return mapper.getDailyFarmingMonthList(command);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void create(GetDailyFarmingCmd findCmd, CreateDailyFarmingCmd command) {
|
public void create(GetDailyFarmingCmd findCmd, CreateDailyFarmingCmd command) {
|
||||||
Integer existCount = mapper.getRecordExistCount(findCmd);
|
Integer existCount = mapper.getRecordExistCount(findCmd);
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import app.module.front.usecase.daily.farming.adapters.persistence.model.DailyFa
|
|||||||
import app.module.front.usecase.daily.farming.ports.application.domain.CreateDailyFarmingCmd;
|
import app.module.front.usecase.daily.farming.ports.application.domain.CreateDailyFarmingCmd;
|
||||||
import app.module.front.usecase.daily.farming.ports.application.domain.GetDailyFarmingCmd;
|
import app.module.front.usecase.daily.farming.ports.application.domain.GetDailyFarmingCmd;
|
||||||
import app.module.front.usecase.daily.farming.ports.application.domain.RemoveDailyFarmingCmd;
|
import app.module.front.usecase.daily.farming.ports.application.domain.RemoveDailyFarmingCmd;
|
||||||
|
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto;
|
||||||
|
import app.module.front.usecase.daily.income.ports.application.domain.GetDailyIncomeCmd;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -11,13 +13,21 @@ import java.util.List;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface DailyFarmingMapper {
|
public interface DailyFarmingMapper {
|
||||||
/**
|
/**
|
||||||
* 일계부 자가농업 목록 조회
|
* 특정 그룹일의 일계부 자가농업 목록 조회
|
||||||
*
|
*
|
||||||
* @param command 검색 조건
|
* @param command 검색 조건
|
||||||
* @return 수입 목록
|
* @return 자가농업 목록
|
||||||
*/
|
*/
|
||||||
List<DailyFarmingDto> getDailyFarmingList(GetDailyFarmingCmd command);
|
List<DailyFarmingDto> getDailyFarmingList(GetDailyFarmingCmd command);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 특정월의 일계부 자가농업 목록 조회
|
||||||
|
*
|
||||||
|
* @param command 검색 조건
|
||||||
|
* @return 자가농업 목록
|
||||||
|
*/
|
||||||
|
List<DailyFarmingDto> getDailyFarmingMonthList(GetDailyFarmingCmd command);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 자가농업 데이터 존재 여부
|
* 일계부 자가농업 데이터 존재 여부
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package app.module.front.usecase.daily.farming.adapters.persistence.model;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class DailyFarmingDto {
|
public class DailyFarmingDto {
|
||||||
@@ -17,6 +19,8 @@ public class DailyFarmingDto {
|
|||||||
private String unitLabel;
|
private String unitLabel;
|
||||||
private String unitSelf;
|
private String unitSelf;
|
||||||
private Long estimatedValue;
|
private Long estimatedValue;
|
||||||
|
private LocalDate startDate;
|
||||||
|
private LocalDate endDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 수정 가능 여부
|
* 수정 가능 여부
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package app.module.front.usecase.daily.farming.adapters.persistence.model;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class DailyFarmingMonthDto {
|
||||||
|
private Long dailyRecordSeq;
|
||||||
|
private LocalDate startDate;
|
||||||
|
private LocalDate endDate;
|
||||||
|
private List<DailyFarmingDto> children;
|
||||||
|
}
|
||||||
@@ -2,21 +2,32 @@ package app.module.front.usecase.daily.farming.ports;
|
|||||||
|
|
||||||
|
|
||||||
import app.module.front.usecase.daily.farming.adapters.persistence.model.DailyFarmingDto;
|
import app.module.front.usecase.daily.farming.adapters.persistence.model.DailyFarmingDto;
|
||||||
|
import app.module.front.usecase.daily.farming.adapters.persistence.model.DailyFarmingMonthDto;
|
||||||
import app.module.front.usecase.daily.farming.adapters.web.model.CreateDailyFarmingReqVO;
|
import app.module.front.usecase.daily.farming.adapters.web.model.CreateDailyFarmingReqVO;
|
||||||
import app.module.front.usecase.daily.farming.adapters.web.model.DailyFarmingUIReqVO;
|
import app.module.front.usecase.daily.farming.adapters.web.model.DailyFarmingUIReqVO;
|
||||||
import app.module.front.usecase.daily.farming.adapters.web.model.RemoveDailyFarmingReqVO;
|
import app.module.front.usecase.daily.farming.adapters.web.model.RemoveDailyFarmingReqVO;
|
||||||
|
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeMonthDto;
|
||||||
|
import app.module.front.usecase.daily.income.adapters.web.model.DailyIncomeUIReqVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface DailyFarmingPortIn {
|
public interface DailyFarmingPortIn {
|
||||||
/**
|
/**
|
||||||
* 일계부 자가농업 조회
|
* 특정 그룹일의 일계부 자가농업 조회
|
||||||
*
|
*
|
||||||
* @param reqVO 검색 조건
|
* @param reqVO 검색 조건
|
||||||
* @return 자가농업 목록
|
* @return 자가농업 목록
|
||||||
*/
|
*/
|
||||||
List<DailyFarmingDto> list(DailyFarmingUIReqVO reqVO);
|
List<DailyFarmingDto> list(DailyFarmingUIReqVO reqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 특정월의 일계부 자가농업 조회
|
||||||
|
*
|
||||||
|
* @param reqVO 검색 조건
|
||||||
|
* @return 자가농업 목록
|
||||||
|
*/
|
||||||
|
List<DailyFarmingMonthDto> monthList(DailyFarmingUIReqVO reqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 자가농업 조회
|
* 일계부 자가농업 조회
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import app.module.front.usecase.daily.farming.adapters.persistence.model.DailyFa
|
|||||||
import app.module.front.usecase.daily.farming.ports.application.domain.CreateDailyFarmingCmd;
|
import app.module.front.usecase.daily.farming.ports.application.domain.CreateDailyFarmingCmd;
|
||||||
import app.module.front.usecase.daily.farming.ports.application.domain.GetDailyFarmingCmd;
|
import app.module.front.usecase.daily.farming.ports.application.domain.GetDailyFarmingCmd;
|
||||||
import app.module.front.usecase.daily.farming.ports.application.domain.RemoveDailyFarmingCmd;
|
import app.module.front.usecase.daily.farming.ports.application.domain.RemoveDailyFarmingCmd;
|
||||||
|
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto;
|
||||||
|
import app.module.front.usecase.daily.income.ports.application.domain.GetDailyIncomeCmd;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -17,6 +19,14 @@ public interface DailyFarmingPortOut {
|
|||||||
*/
|
*/
|
||||||
List<DailyFarmingDto> list(GetDailyFarmingCmd command);
|
List<DailyFarmingDto> list(GetDailyFarmingCmd command);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 자가농업 조회
|
||||||
|
*
|
||||||
|
* @param command 검색 조건
|
||||||
|
* @return 자가농업 목록
|
||||||
|
*/
|
||||||
|
List<DailyFarmingDto> monthList(GetDailyFarmingCmd command);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 자가농업 등록
|
* 일계부 자가농업 등록
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import app.module.core.usecase.uicode.list.ports.application.domain.UICodeElemen
|
|||||||
import app.module.front.config.application.util.AuditUtil;
|
import app.module.front.config.application.util.AuditUtil;
|
||||||
import app.module.front.config.constants.CommonConstants;
|
import app.module.front.config.constants.CommonConstants;
|
||||||
import app.module.front.usecase.daily.farming.adapters.persistence.model.DailyFarmingDto;
|
import app.module.front.usecase.daily.farming.adapters.persistence.model.DailyFarmingDto;
|
||||||
|
import app.module.front.usecase.daily.farming.adapters.persistence.model.DailyFarmingMonthDto;
|
||||||
import app.module.front.usecase.daily.farming.adapters.web.model.CreateDailyFarmingReqVO;
|
import app.module.front.usecase.daily.farming.adapters.web.model.CreateDailyFarmingReqVO;
|
||||||
import app.module.front.usecase.daily.farming.adapters.web.model.DailyFarmingUIReqVO;
|
import app.module.front.usecase.daily.farming.adapters.web.model.DailyFarmingUIReqVO;
|
||||||
import app.module.front.usecase.daily.farming.adapters.web.model.RemoveDailyFarmingReqVO;
|
import app.module.front.usecase.daily.farming.adapters.web.model.RemoveDailyFarmingReqVO;
|
||||||
@@ -19,8 +20,11 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@@ -33,12 +37,30 @@ public class DailyFarmingService implements DailyFarmingPortIn {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DailyFarmingDto> list(DailyFarmingUIReqVO reqVO) {
|
public List<DailyFarmingDto> list(DailyFarmingUIReqVO reqVO) {
|
||||||
return this.getRefineList(reqVO);
|
return this.getRefineList(reqVO, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DailyFarmingMonthDto> monthList(DailyFarmingUIReqVO reqVO) {
|
||||||
|
List<DailyFarmingDto> list = this.getRefineList(reqVO, false);
|
||||||
|
|
||||||
|
List<DailyFarmingMonthDto> monthList = new ArrayList<>();
|
||||||
|
List<Long> recordSeqList = list.stream().map(DailyFarmingDto::getDailyRecordSeq).distinct().toList();
|
||||||
|
for (Long seq : recordSeqList) {
|
||||||
|
DailyFarmingMonthDto month = new DailyFarmingMonthDto();
|
||||||
|
month.setDailyRecordSeq(seq);
|
||||||
|
month.setStartDate(list.stream().filter(f -> Objects.equals(f.getDailyRecordSeq(), seq)).map(DailyFarmingDto::getStartDate).findFirst().orElse(null));
|
||||||
|
month.setEndDate(list.stream().filter(f -> Objects.equals(f.getDailyRecordSeq(), seq)).map(DailyFarmingDto::getEndDate).findFirst().orElse(null));
|
||||||
|
month.setChildren(list.stream().filter(f -> Objects.equals(f.getDailyRecordSeq(), seq)).collect(Collectors.toList()));
|
||||||
|
monthList.add(month);
|
||||||
|
}
|
||||||
|
|
||||||
|
return monthList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DailyFarmingDto detail(DailyFarmingUIReqVO reqVO) {
|
public DailyFarmingDto detail(DailyFarmingUIReqVO reqVO) {
|
||||||
List<DailyFarmingDto> list = this.getRefineList(reqVO);
|
List<DailyFarmingDto> list = this.getRefineList(reqVO, true);
|
||||||
if (list.isEmpty()) {
|
if (list.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -50,13 +72,16 @@ public class DailyFarmingService implements DailyFarmingPortIn {
|
|||||||
* 목록 데이터 조회
|
* 목록 데이터 조회
|
||||||
*
|
*
|
||||||
* @param reqVO 검색 조건
|
* @param reqVO 검색 조건
|
||||||
|
* @param dayGroup 일 그룹 조건(true=일, false=월)
|
||||||
* @return 공통 처리된 목록
|
* @return 공통 처리된 목록
|
||||||
*/
|
*/
|
||||||
private List<DailyFarmingDto> getRefineList(DailyFarmingUIReqVO reqVO) {
|
private List<DailyFarmingDto> getRefineList(DailyFarmingUIReqVO reqVO, boolean dayGroup) {
|
||||||
List<DailyFarmingDto> list = portOut.list(new GetDailyFarmingCmd(reqVO.getSearchMonth(),
|
GetDailyFarmingCmd command = new GetDailyFarmingCmd(reqVO.getSearchMonth(),
|
||||||
reqVO.getGroupNo(),
|
reqVO.getGroupNo(),
|
||||||
reqVO.getHouseholdSeq(),
|
reqVO.getHouseholdSeq(),
|
||||||
reqVO.getId()));
|
reqVO.getId());
|
||||||
|
|
||||||
|
List<DailyFarmingDto> list = dayGroup ? portOut.list(command) : portOut.monthList(command);
|
||||||
|
|
||||||
List<UICodeElement> recordFarming = uiCodeListPortIn.connect("code.record.farming");
|
List<UICodeElement> recordFarming = uiCodeListPortIn.connect("code.record.farming");
|
||||||
List<UICodeElement> recordUnit = uiCodeListPortIn.connect("code.record.unit");
|
List<UICodeElement> recordUnit = uiCodeListPortIn.connect("code.record.unit");
|
||||||
|
|||||||
@@ -22,6 +22,11 @@ public class DailyForestryDao implements DailyForestryPortOut {
|
|||||||
return mapper.getDailyForestryList(command);
|
return mapper.getDailyForestryList(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DailyForestryDto> monthList(GetDailyForestryCmd command) {
|
||||||
|
return mapper.getDailyForestryMonthList(command);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void create(GetDailyForestryCmd findCmd, CreateDailyForestryCmd command) {
|
public void create(GetDailyForestryCmd findCmd, CreateDailyForestryCmd command) {
|
||||||
Integer existCount = mapper.getRecordExistCount(findCmd);
|
Integer existCount = mapper.getRecordExistCount(findCmd);
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import app.module.front.usecase.daily.forestry.adapters.persistence.model.DailyF
|
|||||||
import app.module.front.usecase.daily.forestry.ports.application.domain.CreateDailyForestryCmd;
|
import app.module.front.usecase.daily.forestry.ports.application.domain.CreateDailyForestryCmd;
|
||||||
import app.module.front.usecase.daily.forestry.ports.application.domain.GetDailyForestryCmd;
|
import app.module.front.usecase.daily.forestry.ports.application.domain.GetDailyForestryCmd;
|
||||||
import app.module.front.usecase.daily.forestry.ports.application.domain.RemoveDailyForestryCmd;
|
import app.module.front.usecase.daily.forestry.ports.application.domain.RemoveDailyForestryCmd;
|
||||||
|
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto;
|
||||||
|
import app.module.front.usecase.daily.income.ports.application.domain.GetDailyIncomeCmd;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -12,13 +14,21 @@ import java.util.List;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface DailyForestryMapper {
|
public interface DailyForestryMapper {
|
||||||
/**
|
/**
|
||||||
* 일계부 자가임업 목록 조회
|
* 특정 그룹일의 일계부 자가임업 목록 조회
|
||||||
*
|
*
|
||||||
* @param command 검색 조건
|
* @param command 검색 조건
|
||||||
* @return 수입 목록
|
* @return 자가임업 목록
|
||||||
*/
|
*/
|
||||||
List<DailyForestryDto> getDailyForestryList(GetDailyForestryCmd command);
|
List<DailyForestryDto> getDailyForestryList(GetDailyForestryCmd command);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 특정월의 일계부 자가임업 목록 조회
|
||||||
|
*
|
||||||
|
* @param command 검색 조건
|
||||||
|
* @return 자가임업 목록
|
||||||
|
*/
|
||||||
|
List<DailyForestryDto> getDailyForestryMonthList(GetDailyForestryCmd command);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 자가임업 데이터 존재 여부
|
* 일계부 자가임업 데이터 존재 여부
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package app.module.front.usecase.daily.forestry.adapters.persistence.model;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class DailyForestryDto {
|
public class DailyForestryDto {
|
||||||
@@ -15,6 +17,8 @@ public class DailyForestryDto {
|
|||||||
private String unitLabel;
|
private String unitLabel;
|
||||||
private String unitSelf;
|
private String unitSelf;
|
||||||
private Long estimatedValue;
|
private Long estimatedValue;
|
||||||
|
private LocalDate startDate;
|
||||||
|
private LocalDate endDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 수정 가능 여부
|
* 수정 가능 여부
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package app.module.front.usecase.daily.forestry.adapters.persistence.model;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class DailyForestryMonthDto {
|
||||||
|
private Long dailyRecordSeq;
|
||||||
|
private LocalDate startDate;
|
||||||
|
private LocalDate endDate;
|
||||||
|
private List<DailyForestryDto> children;
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package app.module.front.usecase.daily.forestry.ports;
|
package app.module.front.usecase.daily.forestry.ports;
|
||||||
|
|
||||||
import app.module.front.usecase.daily.forestry.adapters.persistence.model.DailyForestryDto;
|
import app.module.front.usecase.daily.forestry.adapters.persistence.model.DailyForestryDto;
|
||||||
|
import app.module.front.usecase.daily.forestry.adapters.persistence.model.DailyForestryMonthDto;
|
||||||
import app.module.front.usecase.daily.forestry.adapters.web.model.CreateDailyForestryReqVO;
|
import app.module.front.usecase.daily.forestry.adapters.web.model.CreateDailyForestryReqVO;
|
||||||
import app.module.front.usecase.daily.forestry.adapters.web.model.DailyForestryUIReqVO;
|
import app.module.front.usecase.daily.forestry.adapters.web.model.DailyForestryUIReqVO;
|
||||||
import app.module.front.usecase.daily.forestry.adapters.web.model.RemoveDailyForestryReqVO;
|
import app.module.front.usecase.daily.forestry.adapters.web.model.RemoveDailyForestryReqVO;
|
||||||
@@ -9,13 +10,21 @@ import java.util.List;
|
|||||||
|
|
||||||
public interface DailyForestryPortIn {
|
public interface DailyForestryPortIn {
|
||||||
/**
|
/**
|
||||||
* 일계부 자가임업 조회
|
* 특정 그룹일의 일계부 자가임업 조회
|
||||||
*
|
*
|
||||||
* @param reqVO 검색 조건
|
* @param reqVO 검색 조건
|
||||||
* @return 자가임업 목록
|
* @return 자가임업 목록
|
||||||
*/
|
*/
|
||||||
List<DailyForestryDto> list(DailyForestryUIReqVO reqVO);
|
List<DailyForestryDto> list(DailyForestryUIReqVO reqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 특정월의 일계부 자가임업 조회
|
||||||
|
*
|
||||||
|
* @param reqVO 검색 조건
|
||||||
|
* @return 자가임업 목록
|
||||||
|
*/
|
||||||
|
List<DailyForestryMonthDto> monthList(DailyForestryUIReqVO reqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 자가임업 조회
|
* 일계부 자가임업 조회
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import app.module.front.usecase.daily.forestry.adapters.persistence.model.DailyF
|
|||||||
import app.module.front.usecase.daily.forestry.ports.application.domain.CreateDailyForestryCmd;
|
import app.module.front.usecase.daily.forestry.ports.application.domain.CreateDailyForestryCmd;
|
||||||
import app.module.front.usecase.daily.forestry.ports.application.domain.GetDailyForestryCmd;
|
import app.module.front.usecase.daily.forestry.ports.application.domain.GetDailyForestryCmd;
|
||||||
import app.module.front.usecase.daily.forestry.ports.application.domain.RemoveDailyForestryCmd;
|
import app.module.front.usecase.daily.forestry.ports.application.domain.RemoveDailyForestryCmd;
|
||||||
|
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto;
|
||||||
|
import app.module.front.usecase.daily.income.ports.application.domain.GetDailyIncomeCmd;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -16,6 +18,14 @@ public interface DailyForestryPortOut {
|
|||||||
*/
|
*/
|
||||||
List<DailyForestryDto> list(GetDailyForestryCmd command);
|
List<DailyForestryDto> list(GetDailyForestryCmd command);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 자가임업 조회
|
||||||
|
*
|
||||||
|
* @param command 검색 조건
|
||||||
|
* @return 자가임업 목록
|
||||||
|
*/
|
||||||
|
List<DailyForestryDto> monthList(GetDailyForestryCmd command);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 자가임업 등록
|
* 일계부 자가임업 등록
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import app.module.core.usecase.uicode.list.ports.application.domain.UICodeElemen
|
|||||||
import app.module.front.config.application.util.AuditUtil;
|
import app.module.front.config.application.util.AuditUtil;
|
||||||
import app.module.front.config.constants.CommonConstants;
|
import app.module.front.config.constants.CommonConstants;
|
||||||
import app.module.front.usecase.daily.forestry.adapters.persistence.model.DailyForestryDto;
|
import app.module.front.usecase.daily.forestry.adapters.persistence.model.DailyForestryDto;
|
||||||
|
import app.module.front.usecase.daily.forestry.adapters.persistence.model.DailyForestryMonthDto;
|
||||||
import app.module.front.usecase.daily.forestry.adapters.web.model.CreateDailyForestryReqVO;
|
import app.module.front.usecase.daily.forestry.adapters.web.model.CreateDailyForestryReqVO;
|
||||||
import app.module.front.usecase.daily.forestry.adapters.web.model.DailyForestryUIReqVO;
|
import app.module.front.usecase.daily.forestry.adapters.web.model.DailyForestryUIReqVO;
|
||||||
import app.module.front.usecase.daily.forestry.adapters.web.model.RemoveDailyForestryReqVO;
|
import app.module.front.usecase.daily.forestry.adapters.web.model.RemoveDailyForestryReqVO;
|
||||||
@@ -15,12 +16,14 @@ import app.module.front.usecase.daily.forestry.ports.DailyForestryPortOut;
|
|||||||
import app.module.front.usecase.daily.forestry.ports.application.domain.CreateDailyForestryCmd;
|
import app.module.front.usecase.daily.forestry.ports.application.domain.CreateDailyForestryCmd;
|
||||||
import app.module.front.usecase.daily.forestry.ports.application.domain.GetDailyForestryCmd;
|
import app.module.front.usecase.daily.forestry.ports.application.domain.GetDailyForestryCmd;
|
||||||
import app.module.front.usecase.daily.forestry.ports.application.domain.RemoveDailyForestryCmd;
|
import app.module.front.usecase.daily.forestry.ports.application.domain.RemoveDailyForestryCmd;
|
||||||
import app.module.core.usecase.daily.record.ports.application.DailyRecordService;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
@@ -32,12 +35,30 @@ public class DailyForestryService implements DailyForestryPortIn {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DailyForestryDto> list(DailyForestryUIReqVO reqVO) {
|
public List<DailyForestryDto> list(DailyForestryUIReqVO reqVO) {
|
||||||
return this.getRefineList(reqVO);
|
return this.getRefineList(reqVO, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DailyForestryMonthDto> monthList(DailyForestryUIReqVO reqVO) {
|
||||||
|
List<DailyForestryDto> list = this.getRefineList(reqVO, false);
|
||||||
|
|
||||||
|
List<DailyForestryMonthDto> monthList = new ArrayList<>();
|
||||||
|
List<Long> recordSeqList = list.stream().map(DailyForestryDto::getDailyRecordSeq).distinct().toList();
|
||||||
|
for (Long seq : recordSeqList) {
|
||||||
|
DailyForestryMonthDto month = new DailyForestryMonthDto();
|
||||||
|
month.setDailyRecordSeq(seq);
|
||||||
|
month.setStartDate(list.stream().filter(f -> Objects.equals(f.getDailyRecordSeq(), seq)).map(DailyForestryDto::getStartDate).findFirst().orElse(null));
|
||||||
|
month.setEndDate(list.stream().filter(f -> Objects.equals(f.getDailyRecordSeq(), seq)).map(DailyForestryDto::getEndDate).findFirst().orElse(null));
|
||||||
|
month.setChildren(list.stream().filter(f -> Objects.equals(f.getDailyRecordSeq(), seq)).collect(Collectors.toList()));
|
||||||
|
monthList.add(month);
|
||||||
|
}
|
||||||
|
|
||||||
|
return monthList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DailyForestryDto detail(DailyForestryUIReqVO reqVO) {
|
public DailyForestryDto detail(DailyForestryUIReqVO reqVO) {
|
||||||
List<DailyForestryDto> list = this.getRefineList(reqVO);
|
List<DailyForestryDto> list = this.getRefineList(reqVO, true);
|
||||||
if (list.isEmpty()) {
|
if (list.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -49,13 +70,16 @@ public class DailyForestryService implements DailyForestryPortIn {
|
|||||||
* 목록 데이터 조회
|
* 목록 데이터 조회
|
||||||
*
|
*
|
||||||
* @param reqVO 검색 조건
|
* @param reqVO 검색 조건
|
||||||
|
* @param dayGroup 일 그룹 조건(true=일, false=월)
|
||||||
* @return 공통 처리된 목록
|
* @return 공통 처리된 목록
|
||||||
*/
|
*/
|
||||||
private List<DailyForestryDto> getRefineList(DailyForestryUIReqVO reqVO) {
|
private List<DailyForestryDto> getRefineList(DailyForestryUIReqVO reqVO, boolean dayGroup) {
|
||||||
List<DailyForestryDto> list = portOut.list(new GetDailyForestryCmd(reqVO.getSearchMonth(),
|
GetDailyForestryCmd command = new GetDailyForestryCmd(reqVO.getSearchMonth(),
|
||||||
reqVO.getGroupNo(),
|
reqVO.getGroupNo(),
|
||||||
reqVO.getHouseholdSeq(),
|
reqVO.getHouseholdSeq(),
|
||||||
reqVO.getId()));
|
reqVO.getId());
|
||||||
|
|
||||||
|
List<DailyForestryDto> list = dayGroup ? portOut.list(command) : portOut.monthList(command);
|
||||||
|
|
||||||
List<UICodeElement> recordUnit = uiCodeListPortIn.connect("code.record.unit");
|
List<UICodeElement> recordUnit = uiCodeListPortIn.connect("code.record.unit");
|
||||||
|
|
||||||
|
|||||||
@@ -15,27 +15,27 @@ import java.util.List;
|
|||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class DailyIncomeDao implements DailyIncomePortOut {
|
public class DailyIncomeDao implements DailyIncomePortOut {
|
||||||
private final DailyIncomeMapper dailyIncomeMapper;
|
private final DailyIncomeMapper mapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DailyIncomeDto> list(GetDailyIncomeCmd command) {
|
public List<DailyIncomeDto> list(GetDailyIncomeCmd command) {
|
||||||
return dailyIncomeMapper.getDailyIncomeList(command);
|
return mapper.getDailyIncomeList(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DailyIncomeDto> monthList(GetDailyIncomeCmd command) {
|
public List<DailyIncomeDto> monthList(GetDailyIncomeCmd command) {
|
||||||
return dailyIncomeMapper.getDailyIncomeMonthList(command);
|
return mapper.getDailyIncomeMonthList(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void create(GetDailyIncomeCmd findCmd, CreateDailyIncomeCmd command) {
|
public void create(GetDailyIncomeCmd findCmd, CreateDailyIncomeCmd command) {
|
||||||
Integer existCount = dailyIncomeMapper.getRecordExistCount(findCmd);
|
Integer existCount = mapper.getRecordExistCount(findCmd);
|
||||||
if (existCount == 0) {
|
if (existCount == 0) {
|
||||||
dailyIncomeMapper.createDailyIncome(command);
|
mapper.createDailyIncome(command);
|
||||||
|
|
||||||
log.debug("[CreateDailyIncome] record={}", command);
|
log.debug("[CreateDailyIncome] record={}", command);
|
||||||
} else {
|
} else {
|
||||||
dailyIncomeMapper.updateDailyIncome(command);
|
mapper.updateDailyIncome(command);
|
||||||
|
|
||||||
log.debug("[UpdateDailyIncome] record={}", command);
|
log.debug("[UpdateDailyIncome] record={}", command);
|
||||||
}
|
}
|
||||||
@@ -43,9 +43,9 @@ public class DailyIncomeDao implements DailyIncomePortOut {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void remove(GetDailyIncomeCmd findCmd, RemoveDailyIncomeCmd command) {
|
public void remove(GetDailyIncomeCmd findCmd, RemoveDailyIncomeCmd command) {
|
||||||
Integer existCount = dailyIncomeMapper.getRecordExistCount(findCmd);
|
Integer existCount = mapper.getRecordExistCount(findCmd);
|
||||||
if (existCount != 0) {
|
if (existCount != 0) {
|
||||||
dailyIncomeMapper.removeDailyIncome(command);
|
mapper.removeDailyIncome(command);
|
||||||
|
|
||||||
log.debug("[RemoveDailyIncome] record={}", command);
|
log.debug("[RemoveDailyIncome] record={}", command);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public interface DailyIncomePortOut {
|
|||||||
* @param command 검색 조건
|
* @param command 검색 조건
|
||||||
* @return 수입 목록
|
* @return 수입 목록
|
||||||
*/
|
*/
|
||||||
List<DailyIncomeDto> monthList(GetDailyIncomeCmd command);;
|
List<DailyIncomeDto> monthList(GetDailyIncomeCmd command);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 수입 등록
|
* 일계부 수입 등록
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ public class DailyIncomeService implements DailyIncomePortIn {
|
|||||||
for (Long seq : recordSeqList) {
|
for (Long seq : recordSeqList) {
|
||||||
DailyIncomeMonthDto month = new DailyIncomeMonthDto();
|
DailyIncomeMonthDto month = new DailyIncomeMonthDto();
|
||||||
month.setDailyRecordSeq(seq);
|
month.setDailyRecordSeq(seq);
|
||||||
|
|
||||||
month.setStartDate(list.stream().filter(f -> Objects.equals(f.getDailyRecordSeq(), seq)).map(DailyIncomeDto::getStartDate).findFirst().orElse(null));
|
month.setStartDate(list.stream().filter(f -> Objects.equals(f.getDailyRecordSeq(), seq)).map(DailyIncomeDto::getStartDate).findFirst().orElse(null));
|
||||||
month.setEndDate(list.stream().filter(f -> Objects.equals(f.getDailyRecordSeq(), seq)).map(DailyIncomeDto::getEndDate).findFirst().orElse(null));
|
month.setEndDate(list.stream().filter(f -> Objects.equals(f.getDailyRecordSeq(), seq)).map(DailyIncomeDto::getEndDate).findFirst().orElse(null));
|
||||||
month.setChildren(list.stream().filter(f -> Objects.equals(f.getDailyRecordSeq(), seq)).collect(Collectors.toList()));
|
month.setChildren(list.stream().filter(f -> Objects.equals(f.getDailyRecordSeq(), seq)).collect(Collectors.toList()));
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package app.module.front.usecase.daily.power.adapters.persistence;
|
package app.module.front.usecase.daily.power.adapters.persistence;
|
||||||
|
|
||||||
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
|
||||||
import app.module.front.usecase.daily.power.adapters.persistence.model.DailyPowerDto;
|
import app.module.front.usecase.daily.power.adapters.persistence.model.DailyPowerDto;
|
||||||
import app.module.front.usecase.daily.power.ports.DailyPowerPortOut;
|
import app.module.front.usecase.daily.power.ports.DailyPowerPortOut;
|
||||||
import app.module.front.usecase.daily.power.ports.application.domain.CreateDailyPowerCmd;
|
import app.module.front.usecase.daily.power.ports.application.domain.CreateDailyPowerCmd;
|
||||||
@@ -16,22 +15,27 @@ import java.util.List;
|
|||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class DailyPowerDao implements DailyPowerPortOut {
|
public class DailyPowerDao implements DailyPowerPortOut {
|
||||||
private final DailyPowerMapper dailyPowerMapper;
|
private final DailyPowerMapper mapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DailyPowerDto> list(GetDailyPowerCmd command) {
|
public List<DailyPowerDto> list(GetDailyPowerCmd command) {
|
||||||
return dailyPowerMapper.getDailyPowerList(command);
|
return mapper.getDailyPowerList(command);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DailyPowerDto> monthList(GetDailyPowerCmd command) {
|
||||||
|
return mapper.getDailyPowerMonthList(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void create(GetDailyPowerCmd findCmd, CreateDailyPowerCmd command) {
|
public void create(GetDailyPowerCmd findCmd, CreateDailyPowerCmd command) {
|
||||||
Integer existCount = dailyPowerMapper.getRecordExistCount(findCmd);
|
Integer existCount = mapper.getRecordExistCount(findCmd);
|
||||||
if (existCount == 0) {
|
if (existCount == 0) {
|
||||||
dailyPowerMapper.createDailyPower(command);
|
mapper.createDailyPower(command);
|
||||||
|
|
||||||
log.debug("[CreateDailyPower] record={}", command);
|
log.debug("[CreateDailyPower] record={}", command);
|
||||||
} else {
|
} else {
|
||||||
dailyPowerMapper.updateDailyPower(command);
|
mapper.updateDailyPower(command);
|
||||||
|
|
||||||
log.debug("[UpdateDailyPower] record={}", command);
|
log.debug("[UpdateDailyPower] record={}", command);
|
||||||
}
|
}
|
||||||
@@ -39,9 +43,9 @@ public class DailyPowerDao implements DailyPowerPortOut {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void remove(GetDailyPowerCmd findCmd, RemoveDailyPowerCmd command) {
|
public void remove(GetDailyPowerCmd findCmd, RemoveDailyPowerCmd command) {
|
||||||
Integer existCount = dailyPowerMapper.getRecordExistCount(findCmd);
|
Integer existCount = mapper.getRecordExistCount(findCmd);
|
||||||
if (existCount != 0) {
|
if (existCount != 0) {
|
||||||
dailyPowerMapper.removeDailyPower(command);
|
mapper.removeDailyPower(command);
|
||||||
|
|
||||||
log.debug("[RemoveDailyPower] record={}", command);
|
log.debug("[RemoveDailyPower] record={}", command);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package app.module.front.usecase.daily.power.adapters.persistence;
|
package app.module.front.usecase.daily.power.adapters.persistence;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto;
|
||||||
|
import app.module.front.usecase.daily.income.ports.application.domain.GetDailyIncomeCmd;
|
||||||
import app.module.front.usecase.daily.power.ports.application.domain.CreateDailyPowerCmd;
|
import app.module.front.usecase.daily.power.ports.application.domain.CreateDailyPowerCmd;
|
||||||
import app.module.front.usecase.daily.power.adapters.persistence.model.DailyPowerDto;
|
import app.module.front.usecase.daily.power.adapters.persistence.model.DailyPowerDto;
|
||||||
import app.module.front.usecase.daily.power.ports.application.domain.GetDailyPowerCmd;
|
import app.module.front.usecase.daily.power.ports.application.domain.GetDailyPowerCmd;
|
||||||
@@ -12,13 +14,21 @@ import java.util.List;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface DailyPowerMapper {
|
public interface DailyPowerMapper {
|
||||||
/**
|
/**
|
||||||
* 일계부 동력 사용시간 목록 조회
|
* 특정 그룹일의 일계부 동력 사용시간 목록 조회
|
||||||
*
|
*
|
||||||
* @param command 검색 조건
|
* @param command 검색 조건
|
||||||
* @return 동력 사용시간 목록
|
* @return 동력 사용시간 목록
|
||||||
*/
|
*/
|
||||||
List<DailyPowerDto> getDailyPowerList(GetDailyPowerCmd command);
|
List<DailyPowerDto> getDailyPowerList(GetDailyPowerCmd command);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 특정월의 일계부 동력 사용시간 목록 조회
|
||||||
|
*
|
||||||
|
* @param command 검색 조건
|
||||||
|
* @return 동력 사용시간 목록
|
||||||
|
*/
|
||||||
|
List<DailyPowerDto> getDailyPowerMonthList(GetDailyPowerCmd command);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 동력 사용시간 데이터 존재 여부
|
* 일계부 동력 사용시간 데이터 존재 여부
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package app.module.front.usecase.daily.power.adapters.persistence.model;
|
|||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class DailyPowerDto {
|
public class DailyPowerDto {
|
||||||
@@ -11,6 +13,8 @@ public class DailyPowerDto {
|
|||||||
private String equipmentName;
|
private String equipmentName;
|
||||||
private String ownedHours;
|
private String ownedHours;
|
||||||
private String leasedHours;
|
private String leasedHours;
|
||||||
|
private LocalDate startDate;
|
||||||
|
private LocalDate endDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 수정 가능 여부
|
* 수정 가능 여부
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package app.module.front.usecase.daily.power.adapters.persistence.model;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class DailyPowerMonthDto {
|
||||||
|
private Long dailyRecordSeq;
|
||||||
|
private LocalDate startDate;
|
||||||
|
private LocalDate endDate;
|
||||||
|
private List<DailyPowerDto> children;
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package app.module.front.usecase.daily.power.ports;
|
package app.module.front.usecase.daily.power.ports;
|
||||||
|
|
||||||
|
|
||||||
import app.module.front.usecase.daily.power.adapters.persistence.model.DailyPowerDto;
|
import app.module.front.usecase.daily.power.adapters.persistence.model.DailyPowerDto;
|
||||||
|
import app.module.front.usecase.daily.power.adapters.persistence.model.DailyPowerMonthDto;
|
||||||
import app.module.front.usecase.daily.power.adapters.web.model.CreateDailyPowerReqVO;
|
import app.module.front.usecase.daily.power.adapters.web.model.CreateDailyPowerReqVO;
|
||||||
import app.module.front.usecase.daily.power.adapters.web.model.DailyPowerUIReqVO;
|
import app.module.front.usecase.daily.power.adapters.web.model.DailyPowerUIReqVO;
|
||||||
import app.module.front.usecase.daily.power.adapters.web.model.RemoveDailyPowerReqVO;
|
import app.module.front.usecase.daily.power.adapters.web.model.RemoveDailyPowerReqVO;
|
||||||
@@ -10,13 +10,21 @@ import java.util.List;
|
|||||||
|
|
||||||
public interface DailyPowerPortIn {
|
public interface DailyPowerPortIn {
|
||||||
/**
|
/**
|
||||||
* 일계부 동력 사용시간 조회
|
* 특정 그룹일의 일계부 동력 사용시간 조회
|
||||||
*
|
*
|
||||||
* @param reqVO 검색 조건
|
* @param reqVO 검색 조건
|
||||||
* @return 동력 사용시간 목록
|
* @return 동력 사용시간 목록
|
||||||
*/
|
*/
|
||||||
List<DailyPowerDto> list(DailyPowerUIReqVO reqVO);
|
List<DailyPowerDto> list(DailyPowerUIReqVO reqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 특정월의 일계부 동력 사용시간 조회
|
||||||
|
*
|
||||||
|
* @param reqVO 검색 조건
|
||||||
|
* @return 동력 사용시간 목록
|
||||||
|
*/
|
||||||
|
List<DailyPowerMonthDto> monthList(DailyPowerUIReqVO reqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 동력 사용시간 조회
|
* 일계부 동력 사용시간 조회
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package app.module.front.usecase.daily.power.ports;
|
package app.module.front.usecase.daily.power.ports;
|
||||||
|
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto;
|
||||||
|
import app.module.front.usecase.daily.income.ports.application.domain.GetDailyIncomeCmd;
|
||||||
import app.module.front.usecase.daily.power.adapters.persistence.model.DailyPowerDto;
|
import app.module.front.usecase.daily.power.adapters.persistence.model.DailyPowerDto;
|
||||||
import app.module.front.usecase.daily.power.ports.application.domain.CreateDailyPowerCmd;
|
import app.module.front.usecase.daily.power.ports.application.domain.CreateDailyPowerCmd;
|
||||||
import app.module.front.usecase.daily.power.ports.application.domain.GetDailyPowerCmd;
|
import app.module.front.usecase.daily.power.ports.application.domain.GetDailyPowerCmd;
|
||||||
@@ -17,6 +19,14 @@ public interface DailyPowerPortOut {
|
|||||||
*/
|
*/
|
||||||
List<DailyPowerDto> list(GetDailyPowerCmd command);
|
List<DailyPowerDto> list(GetDailyPowerCmd command);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 동력 사용시간 조회
|
||||||
|
*
|
||||||
|
* @param command 검색 조건
|
||||||
|
* @return 동력 사용시간 목록
|
||||||
|
*/
|
||||||
|
List<DailyPowerDto> monthList(GetDailyPowerCmd command);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 동력 사용시간 등록
|
* 일계부 동력 사용시간 등록
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package app.module.front.usecase.daily.power.ports.application;
|
|||||||
import app.module.core.usecase.daily.record.ports.DailyRecordPortIn;
|
import app.module.core.usecase.daily.record.ports.DailyRecordPortIn;
|
||||||
import app.module.front.config.application.util.AuditUtil;
|
import app.module.front.config.application.util.AuditUtil;
|
||||||
import app.module.front.usecase.daily.power.adapters.persistence.model.DailyPowerDto;
|
import app.module.front.usecase.daily.power.adapters.persistence.model.DailyPowerDto;
|
||||||
|
import app.module.front.usecase.daily.power.adapters.persistence.model.DailyPowerMonthDto;
|
||||||
import app.module.front.usecase.daily.power.adapters.web.model.CreateDailyPowerReqVO;
|
import app.module.front.usecase.daily.power.adapters.web.model.CreateDailyPowerReqVO;
|
||||||
import app.module.front.usecase.daily.power.adapters.web.model.DailyPowerUIReqVO;
|
import app.module.front.usecase.daily.power.adapters.web.model.DailyPowerUIReqVO;
|
||||||
import app.module.front.usecase.daily.power.adapters.web.model.RemoveDailyPowerReqVO;
|
import app.module.front.usecase.daily.power.adapters.web.model.RemoveDailyPowerReqVO;
|
||||||
@@ -11,11 +12,13 @@ import app.module.front.usecase.daily.power.ports.DailyPowerPortOut;
|
|||||||
import app.module.front.usecase.daily.power.ports.application.domain.CreateDailyPowerCmd;
|
import app.module.front.usecase.daily.power.ports.application.domain.CreateDailyPowerCmd;
|
||||||
import app.module.front.usecase.daily.power.ports.application.domain.GetDailyPowerCmd;
|
import app.module.front.usecase.daily.power.ports.application.domain.GetDailyPowerCmd;
|
||||||
import app.module.front.usecase.daily.power.ports.application.domain.RemoveDailyPowerCmd;
|
import app.module.front.usecase.daily.power.ports.application.domain.RemoveDailyPowerCmd;
|
||||||
import app.module.core.usecase.daily.record.ports.application.DailyRecordService;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@@ -25,12 +28,30 @@ public class DailyPowerService implements DailyPowerPortIn {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DailyPowerDto> list(DailyPowerUIReqVO reqVO) {
|
public List<DailyPowerDto> list(DailyPowerUIReqVO reqVO) {
|
||||||
return this.getRefineList(reqVO);
|
return this.getRefineList(reqVO, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DailyPowerMonthDto> monthList(DailyPowerUIReqVO reqVO) {
|
||||||
|
List<DailyPowerDto> list = this.getRefineList(reqVO, false);
|
||||||
|
|
||||||
|
List<DailyPowerMonthDto> monthList = new ArrayList<>();
|
||||||
|
List<Long> recordSeqList = list.stream().map(DailyPowerDto::getDailyRecordSeq).distinct().toList();
|
||||||
|
for (Long seq : recordSeqList) {
|
||||||
|
DailyPowerMonthDto month = new DailyPowerMonthDto();
|
||||||
|
month.setDailyRecordSeq(seq);
|
||||||
|
month.setStartDate(list.stream().filter(f -> Objects.equals(f.getDailyRecordSeq(), seq)).map(DailyPowerDto::getStartDate).findFirst().orElse(null));
|
||||||
|
month.setEndDate(list.stream().filter(f -> Objects.equals(f.getDailyRecordSeq(), seq)).map(DailyPowerDto::getEndDate).findFirst().orElse(null));
|
||||||
|
month.setChildren(list.stream().filter(f -> Objects.equals(f.getDailyRecordSeq(), seq)).collect(Collectors.toList()));
|
||||||
|
monthList.add(month);
|
||||||
|
}
|
||||||
|
|
||||||
|
return monthList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DailyPowerDto detail(DailyPowerUIReqVO reqVO) {
|
public DailyPowerDto detail(DailyPowerUIReqVO reqVO) {
|
||||||
List<DailyPowerDto> list = this.getRefineList(reqVO);
|
List<DailyPowerDto> list = this.getRefineList(reqVO, true);
|
||||||
if (list.isEmpty()) {
|
if (list.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -44,11 +65,13 @@ public class DailyPowerService implements DailyPowerPortIn {
|
|||||||
* @param reqVO 검색 조건
|
* @param reqVO 검색 조건
|
||||||
* @return 공통 처리된 목록
|
* @return 공통 처리된 목록
|
||||||
*/
|
*/
|
||||||
private List<DailyPowerDto> getRefineList(DailyPowerUIReqVO reqVO) {
|
private List<DailyPowerDto> getRefineList(DailyPowerUIReqVO reqVO, boolean dayGroup) {
|
||||||
return portOut.list(new GetDailyPowerCmd(reqVO.getSearchMonth(),
|
GetDailyPowerCmd command = new GetDailyPowerCmd(reqVO.getSearchMonth(),
|
||||||
reqVO.getGroupNo(),
|
reqVO.getGroupNo(),
|
||||||
reqVO.getHouseholdSeq(),
|
reqVO.getHouseholdSeq(),
|
||||||
reqVO.getId()));
|
reqVO.getId());
|
||||||
|
|
||||||
|
return dayGroup ? portOut.list(command) : portOut.monthList(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -2,11 +2,20 @@ package app.module.front.usecase.daily.status.adapters.web;
|
|||||||
|
|
||||||
import app.module.core.config.application.enums.DailySort;
|
import app.module.core.config.application.enums.DailySort;
|
||||||
import app.module.core.config.application.exception.NoMatchingURIException;
|
import app.module.core.config.application.exception.NoMatchingURIException;
|
||||||
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeMonthDto;
|
import app.module.front.usecase.daily.expense.adapters.web.model.DailyExpenseUIReqVO;
|
||||||
|
import app.module.front.usecase.daily.expense.ports.DailyExpensePortIn;
|
||||||
|
import app.module.front.usecase.daily.farming.adapters.web.model.DailyFarmingUIReqVO;
|
||||||
|
import app.module.front.usecase.daily.farming.ports.DailyFarmingPortIn;
|
||||||
|
import app.module.front.usecase.daily.forestry.adapters.web.model.DailyForestryUIReqVO;
|
||||||
|
import app.module.front.usecase.daily.forestry.ports.DailyForestryPortIn;
|
||||||
import app.module.front.usecase.daily.income.adapters.web.model.DailyIncomeUIReqVO;
|
import app.module.front.usecase.daily.income.adapters.web.model.DailyIncomeUIReqVO;
|
||||||
import app.module.front.usecase.daily.income.ports.DailyIncomePortIn;
|
import app.module.front.usecase.daily.income.ports.DailyIncomePortIn;
|
||||||
|
import app.module.front.usecase.daily.power.adapters.web.model.DailyPowerUIReqVO;
|
||||||
|
import app.module.front.usecase.daily.power.ports.DailyPowerPortIn;
|
||||||
import app.module.front.usecase.daily.status.adapters.web.model.DailyStatusUIReqVO;
|
import app.module.front.usecase.daily.status.adapters.web.model.DailyStatusUIReqVO;
|
||||||
import app.module.front.usecase.daily.status.ports.DailyStatusPortIn;
|
import app.module.front.usecase.daily.status.ports.DailyStatusPortIn;
|
||||||
|
import app.module.front.usecase.daily.work.adapters.web.model.DailyWorkUIReqVO;
|
||||||
|
import app.module.front.usecase.daily.work.ports.DailyWorkPortIn;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
@@ -16,8 +25,6 @@ import org.springframework.web.bind.annotation.ModelAttribute;
|
|||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Controller
|
@Controller
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@@ -25,6 +32,11 @@ import java.util.List;
|
|||||||
public class DailyStatusUIController {
|
public class DailyStatusUIController {
|
||||||
private final DailyStatusPortIn dailyStatusPortIn;
|
private final DailyStatusPortIn dailyStatusPortIn;
|
||||||
private final DailyIncomePortIn dailyIncomePortIn;
|
private final DailyIncomePortIn dailyIncomePortIn;
|
||||||
|
private final DailyWorkPortIn dailyWorkPortIn;
|
||||||
|
private final DailyExpensePortIn dailyExpensePortIn;
|
||||||
|
private final DailyPowerPortIn dailyPowerPortIn;
|
||||||
|
private final DailyForestryPortIn dailyForestryPortIn;
|
||||||
|
private final DailyFarmingPortIn dailyFarmingPortIn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 입력 현황 화면
|
* 일계부 입력 현황 화면
|
||||||
@@ -54,31 +66,21 @@ public class DailyStatusUIController {
|
|||||||
if (DailySort.INCOME.name().equalsIgnoreCase(step)) {
|
if (DailySort.INCOME.name().equalsIgnoreCase(step)) {
|
||||||
model.addAttribute("step", DailySort.INCOME);
|
model.addAttribute("step", DailySort.INCOME);
|
||||||
model.addAttribute("list", dailyIncomePortIn.monthList(new DailyIncomeUIReqVO(searchMonth, "")));
|
model.addAttribute("list", dailyIncomePortIn.monthList(new DailyIncomeUIReqVO(searchMonth, "")));
|
||||||
// } else if (DailySort.WORK.name().equalsIgnoreCase(step)) {
|
} else if (DailySort.WORK.name().equalsIgnoreCase(step)) {
|
||||||
// List<DailyMonthIncomeDto> list = dailyIncomePortIn.monthList(new DailyIncomeUIReqVO(searchMonth, ""));
|
model.addAttribute("step", DailySort.WORK);
|
||||||
//
|
model.addAttribute("list", dailyWorkPortIn.monthList(new DailyWorkUIReqVO(searchMonth, "")));
|
||||||
// model.addAttribute("step", DailySort.WORK);
|
} else if (DailySort.EXPENSE.name().equalsIgnoreCase(step)) {
|
||||||
// model.addAttribute("list", list);
|
model.addAttribute("step", DailySort.EXPENSE);
|
||||||
// } else if (DailySort.EXPENSE.name().equalsIgnoreCase(step)) {
|
model.addAttribute("list", dailyExpensePortIn.monthList(new DailyExpenseUIReqVO(searchMonth, "")));
|
||||||
// List<DailyMonthIncomeDto> list = dailyIncomePortIn.monthList(new DailyIncomeUIReqVO(searchMonth, ""));
|
} else if (DailySort.POWER.name().equalsIgnoreCase(step)) {
|
||||||
//
|
model.addAttribute("step", DailySort.POWER);
|
||||||
// model.addAttribute("step", DailySort.EXPENSE);
|
model.addAttribute("list", dailyPowerPortIn.monthList(new DailyPowerUIReqVO(searchMonth, "")));
|
||||||
// model.addAttribute("list", list);
|
} else if (DailySort.FORESTRY.name().equalsIgnoreCase(step)) {
|
||||||
// } else if (DailySort.POWER.name().equalsIgnoreCase(step)) {
|
model.addAttribute("step", DailySort.FORESTRY);
|
||||||
// List<DailyMonthIncomeDto> list = dailyIncomePortIn.monthList(new DailyIncomeUIReqVO(searchMonth, ""));
|
model.addAttribute("list", dailyForestryPortIn.monthList(new DailyForestryUIReqVO(searchMonth, "")));
|
||||||
//
|
} else if (DailySort.FARMING.name().equalsIgnoreCase(step)) {
|
||||||
// model.addAttribute("step", DailySort.POWER);
|
model.addAttribute("step", DailySort.FARMING);
|
||||||
// model.addAttribute("list", list);
|
model.addAttribute("list", dailyFarmingPortIn.monthList(new DailyFarmingUIReqVO(searchMonth, "")));
|
||||||
// } else if (DailySort.FORESTRY.name().equalsIgnoreCase(step)) {
|
|
||||||
// List<DailyMonthIncomeDto> list = dailyIncomePortIn.monthList(new DailyIncomeUIReqVO(searchMonth, ""));
|
|
||||||
//
|
|
||||||
// model.addAttribute("step", DailySort.FORESTRY);
|
|
||||||
// model.addAttribute("list", list);
|
|
||||||
// } else if (DailySort.FARMING.name().equalsIgnoreCase(step)) {
|
|
||||||
// List<DailyMonthIncomeDto> list = dailyIncomePortIn.monthList(new DailyIncomeUIReqVO(searchMonth, ""));
|
|
||||||
//
|
|
||||||
// model.addAttribute("step", DailySort.FARMING);
|
|
||||||
// model.addAttribute("list", list);
|
|
||||||
} else {
|
} else {
|
||||||
throw new NoMatchingURIException("잘못된 접근");
|
throw new NoMatchingURIException("잘못된 접근");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,22 +15,27 @@ import java.util.List;
|
|||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class DailyWorkDao implements DailyWorkPortOut {
|
public class DailyWorkDao implements DailyWorkPortOut {
|
||||||
private final DailyWorkMapper dailyWorkMapper;
|
private final DailyWorkMapper mapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DailyWorkDto> list(GetDailyWorkCmd command) {
|
public List<DailyWorkDto> list(GetDailyWorkCmd command) {
|
||||||
return dailyWorkMapper.getDailyWorkList(command);
|
return mapper.getDailyWorkList(command);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DailyWorkDto> monthList(GetDailyWorkCmd command) {
|
||||||
|
return mapper.getDailyWorkMonthList(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void create(GetDailyWorkCmd findCmd, CreateDailyWorkCmd command) {
|
public void create(GetDailyWorkCmd findCmd, CreateDailyWorkCmd command) {
|
||||||
Integer existCount = dailyWorkMapper.getRecordExistCount(findCmd);
|
Integer existCount = mapper.getRecordExistCount(findCmd);
|
||||||
if (existCount == 0) {
|
if (existCount == 0) {
|
||||||
dailyWorkMapper.createDailyWork(command);
|
mapper.createDailyWork(command);
|
||||||
|
|
||||||
log.debug("[CreateDailyWork] record={}", command);
|
log.debug("[CreateDailyWork] record={}", command);
|
||||||
} else {
|
} else {
|
||||||
dailyWorkMapper.updateDailyWork(command);
|
mapper.updateDailyWork(command);
|
||||||
|
|
||||||
log.debug("[UpdateDailyWork] record={}", command);
|
log.debug("[UpdateDailyWork] record={}", command);
|
||||||
}
|
}
|
||||||
@@ -38,9 +43,9 @@ public class DailyWorkDao implements DailyWorkPortOut {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void remove(GetDailyWorkCmd findCmd, RemoveDailyWorkCmd command) {
|
public void remove(GetDailyWorkCmd findCmd, RemoveDailyWorkCmd command) {
|
||||||
Integer existCount = dailyWorkMapper.getRecordExistCount(findCmd);
|
Integer existCount = mapper.getRecordExistCount(findCmd);
|
||||||
if (existCount != 0) {
|
if (existCount != 0) {
|
||||||
dailyWorkMapper.removeDailyWork(command);
|
mapper.removeDailyWork(command);
|
||||||
|
|
||||||
log.debug("[RemoveDailyWork] record={}", command);
|
log.debug("[RemoveDailyWork] record={}", command);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package app.module.front.usecase.daily.work.adapters.persistence;
|
package app.module.front.usecase.daily.work.adapters.persistence;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto;
|
||||||
|
import app.module.front.usecase.daily.income.ports.application.domain.GetDailyIncomeCmd;
|
||||||
import app.module.front.usecase.daily.work.ports.application.domain.CreateDailyWorkCmd;
|
import app.module.front.usecase.daily.work.ports.application.domain.CreateDailyWorkCmd;
|
||||||
import app.module.front.usecase.daily.work.adapters.persistence.model.DailyWorkDto;
|
import app.module.front.usecase.daily.work.adapters.persistence.model.DailyWorkDto;
|
||||||
import app.module.front.usecase.daily.work.ports.application.domain.GetDailyWorkCmd;
|
import app.module.front.usecase.daily.work.ports.application.domain.GetDailyWorkCmd;
|
||||||
@@ -12,13 +14,21 @@ import java.util.List;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface DailyWorkMapper {
|
public interface DailyWorkMapper {
|
||||||
/**
|
/**
|
||||||
* 일계부 임업노동 목록 조회
|
* 특정 그룹일의 일계부 임업노동 목록 조회
|
||||||
*
|
*
|
||||||
* @param command 검색 조건
|
* @param command 검색 조건
|
||||||
* @return 임업노동 목록
|
* @return 임업노동 목록
|
||||||
*/
|
*/
|
||||||
List<DailyWorkDto> getDailyWorkList(GetDailyWorkCmd command);
|
List<DailyWorkDto> getDailyWorkList(GetDailyWorkCmd command);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 특정월의 일계부 임업노동 목록 조회
|
||||||
|
*
|
||||||
|
* @param command 검색 조건
|
||||||
|
* @return 임업노동 목록
|
||||||
|
*/
|
||||||
|
List<DailyWorkDto> getDailyWorkMonthList(GetDailyWorkCmd command);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 임업노동 데이터 존재 여부
|
* 일계부 임업노동 데이터 존재 여부
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Getter
|
@Getter
|
||||||
@@ -35,6 +36,8 @@ public class DailyWorkDto {
|
|||||||
private String sharedFHours;
|
private String sharedFHours;
|
||||||
private String volunteerMHours;
|
private String volunteerMHours;
|
||||||
private String volunteerFHours;
|
private String volunteerFHours;
|
||||||
|
private LocalDate startDate;
|
||||||
|
private LocalDate endDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 수정 가능 여부
|
* 수정 가능 여부
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package app.module.front.usecase.daily.work.adapters.persistence.model;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class DailyWorkMonthDto {
|
||||||
|
private Long dailyRecordSeq;
|
||||||
|
private LocalDate startDate;
|
||||||
|
private LocalDate endDate;
|
||||||
|
private List<DailyWorkDto> children;
|
||||||
|
}
|
||||||
@@ -1,7 +1,10 @@
|
|||||||
package app.module.front.usecase.daily.work.ports;
|
package app.module.front.usecase.daily.work.ports;
|
||||||
|
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeMonthDto;
|
||||||
|
import app.module.front.usecase.daily.income.adapters.web.model.DailyIncomeUIReqVO;
|
||||||
import app.module.front.usecase.daily.work.adapters.persistence.model.DailyWorkDto;
|
import app.module.front.usecase.daily.work.adapters.persistence.model.DailyWorkDto;
|
||||||
|
import app.module.front.usecase.daily.work.adapters.persistence.model.DailyWorkMonthDto;
|
||||||
import app.module.front.usecase.daily.work.adapters.web.model.CreateDailyWorkReqVO;
|
import app.module.front.usecase.daily.work.adapters.web.model.CreateDailyWorkReqVO;
|
||||||
import app.module.front.usecase.daily.work.adapters.web.model.DailyWorkUIReqVO;
|
import app.module.front.usecase.daily.work.adapters.web.model.DailyWorkUIReqVO;
|
||||||
import app.module.front.usecase.daily.work.adapters.web.model.RemoveDailyWorkReqVO;
|
import app.module.front.usecase.daily.work.adapters.web.model.RemoveDailyWorkReqVO;
|
||||||
@@ -10,13 +13,21 @@ import java.util.List;
|
|||||||
|
|
||||||
public interface DailyWorkPortIn {
|
public interface DailyWorkPortIn {
|
||||||
/**
|
/**
|
||||||
* 일계부 임업노동 조회
|
* 특정 그룹일의 일계부 임업노동 조회
|
||||||
*
|
*
|
||||||
* @param reqVO 검색 조건
|
* @param reqVO 검색 조건
|
||||||
* @return 임업노동 목록
|
* @return 임업노동 목록
|
||||||
*/
|
*/
|
||||||
List<DailyWorkDto> list(DailyWorkUIReqVO reqVO);
|
List<DailyWorkDto> list(DailyWorkUIReqVO reqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 특정월의 일계부 임업노동 조회
|
||||||
|
*
|
||||||
|
* @param reqVO 검색 조건
|
||||||
|
* @return 임업노동 목록
|
||||||
|
*/
|
||||||
|
List<DailyWorkMonthDto> monthList(DailyWorkUIReqVO reqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 임업노동 조회
|
* 일계부 임업노동 조회
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package app.module.front.usecase.daily.work.ports;
|
package app.module.front.usecase.daily.work.ports;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import app.module.front.usecase.daily.work.adapters.persistence.model.DailyWorkDto;
|
import app.module.front.usecase.daily.work.adapters.persistence.model.DailyWorkDto;
|
||||||
import app.module.front.usecase.daily.work.ports.application.domain.CreateDailyWorkCmd;
|
import app.module.front.usecase.daily.work.ports.application.domain.CreateDailyWorkCmd;
|
||||||
import app.module.front.usecase.daily.work.ports.application.domain.GetDailyWorkCmd;
|
import app.module.front.usecase.daily.work.ports.application.domain.GetDailyWorkCmd;
|
||||||
@@ -18,6 +16,14 @@ public interface DailyWorkPortOut {
|
|||||||
*/
|
*/
|
||||||
List<DailyWorkDto> list(GetDailyWorkCmd command);
|
List<DailyWorkDto> list(GetDailyWorkCmd command);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 임업노동 조회
|
||||||
|
*
|
||||||
|
* @param command 검색 조건
|
||||||
|
* @return 임업노동 목록
|
||||||
|
*/
|
||||||
|
List<DailyWorkDto> monthList(GetDailyWorkCmd command);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 임업노동 등록
|
* 일계부 임업노동 등록
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
|||||||
import app.module.core.usecase.uicode.list.ports.application.domain.UICodeElement;
|
import app.module.core.usecase.uicode.list.ports.application.domain.UICodeElement;
|
||||||
import app.module.front.config.application.util.AuditUtil;
|
import app.module.front.config.application.util.AuditUtil;
|
||||||
import app.module.front.config.constants.CommonConstants;
|
import app.module.front.config.constants.CommonConstants;
|
||||||
import app.module.core.usecase.daily.record.ports.application.DailyRecordService;
|
|
||||||
import app.module.front.usecase.daily.work.adapters.persistence.model.DailyWorkDto;
|
import app.module.front.usecase.daily.work.adapters.persistence.model.DailyWorkDto;
|
||||||
|
import app.module.front.usecase.daily.work.adapters.persistence.model.DailyWorkMonthDto;
|
||||||
import app.module.front.usecase.daily.work.adapters.web.model.CreateDailyWorkReqVO;
|
import app.module.front.usecase.daily.work.adapters.web.model.CreateDailyWorkReqVO;
|
||||||
import app.module.front.usecase.daily.work.adapters.web.model.DailyWorkUIReqVO;
|
import app.module.front.usecase.daily.work.adapters.web.model.DailyWorkUIReqVO;
|
||||||
import app.module.front.usecase.daily.work.adapters.web.model.RemoveDailyWorkReqVO;
|
import app.module.front.usecase.daily.work.adapters.web.model.RemoveDailyWorkReqVO;
|
||||||
@@ -18,7 +18,10 @@ import app.module.front.usecase.daily.work.ports.application.domain.RemoveDailyW
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@@ -29,12 +32,30 @@ public class DailyWorkService implements DailyWorkPortIn {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DailyWorkDto> list(DailyWorkUIReqVO reqVO) {
|
public List<DailyWorkDto> list(DailyWorkUIReqVO reqVO) {
|
||||||
return this.getRefineList(reqVO);
|
return this.getRefineList(reqVO, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DailyWorkMonthDto> monthList(DailyWorkUIReqVO reqVO) {
|
||||||
|
List<DailyWorkDto> list = this.getRefineList(reqVO, false);
|
||||||
|
|
||||||
|
List<DailyWorkMonthDto> monthList = new ArrayList<>();
|
||||||
|
List<Long> recordSeqList = list.stream().map(DailyWorkDto::getDailyRecordSeq).distinct().toList();
|
||||||
|
for (Long seq : recordSeqList) {
|
||||||
|
DailyWorkMonthDto month = new DailyWorkMonthDto();
|
||||||
|
month.setDailyRecordSeq(seq);
|
||||||
|
month.setStartDate(list.stream().filter(f -> Objects.equals(f.getDailyRecordSeq(), seq)).map(DailyWorkDto::getStartDate).findFirst().orElse(null));
|
||||||
|
month.setEndDate(list.stream().filter(f -> Objects.equals(f.getDailyRecordSeq(), seq)).map(DailyWorkDto::getEndDate).findFirst().orElse(null));
|
||||||
|
month.setChildren(list.stream().filter(f -> Objects.equals(f.getDailyRecordSeq(), seq)).collect(Collectors.toList()));
|
||||||
|
monthList.add(month);
|
||||||
|
}
|
||||||
|
|
||||||
|
return monthList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DailyWorkDto detail(DailyWorkUIReqVO reqVO) {
|
public DailyWorkDto detail(DailyWorkUIReqVO reqVO) {
|
||||||
List<DailyWorkDto> list = this.getRefineList(reqVO);
|
List<DailyWorkDto> list = this.getRefineList(reqVO, true);
|
||||||
if (list.isEmpty()) {
|
if (list.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -46,13 +67,16 @@ public class DailyWorkService implements DailyWorkPortIn {
|
|||||||
* 목록 데이터 조회
|
* 목록 데이터 조회
|
||||||
*
|
*
|
||||||
* @param reqVO 검색 조건
|
* @param reqVO 검색 조건
|
||||||
|
* @param dayGroup 일 그룹 조건(true=일, false=월)
|
||||||
* @return 공통 처리된 목록
|
* @return 공통 처리된 목록
|
||||||
*/
|
*/
|
||||||
private List<DailyWorkDto> getRefineList(DailyWorkUIReqVO reqVO) {
|
private List<DailyWorkDto> getRefineList(DailyWorkUIReqVO reqVO, boolean dayGroup) {
|
||||||
List<DailyWorkDto> list = portOut.list(new GetDailyWorkCmd(reqVO.getSearchMonth(),
|
GetDailyWorkCmd command = new GetDailyWorkCmd(reqVO.getSearchMonth(),
|
||||||
reqVO.getGroupNo(),
|
reqVO.getGroupNo(),
|
||||||
reqVO.getHouseholdSeq(),
|
reqVO.getHouseholdSeq(),
|
||||||
reqVO.getId()));
|
reqVO.getId());
|
||||||
|
|
||||||
|
List<DailyWorkDto> list = dayGroup ? portOut.list(command) : portOut.monthList(command);
|
||||||
|
|
||||||
List<UICodeElement> recordArea = uiCodeListPortIn.connect("code.record.area");
|
List<UICodeElement> recordArea = uiCodeListPortIn.connect("code.record.area");
|
||||||
List<UICodeElement> recordUnit = uiCodeListPortIn.connect("code.record.unit");
|
List<UICodeElement> recordUnit = uiCodeListPortIn.connect("code.record.unit");
|
||||||
|
|||||||
@@ -17,6 +17,19 @@
|
|||||||
ds.id desc
|
ds.id desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getDailyExpenseMonthList"
|
||||||
|
resultType="app.module.front.usecase.daily.expense.adapters.persistence.model.DailyExpenseDto">
|
||||||
|
select ds.id, ds.daily_record_seq, ds.input_type, ds.is_credit as credit
|
||||||
|
, ds.expense_kind, ds.source_purpose
|
||||||
|
, ds.quantity, ds.unit_code, ds.unit_self, ds.price, ds.estimated_value
|
||||||
|
, dr.start_date, dr.end_date, ddg.group_no
|
||||||
|
from daily_expense ds
|
||||||
|
<include refid="app.module.core.usecase.daily.record.adapters.persistence.DailyRecordMapper.InnerJoinByDailyRecordMonth"/>
|
||||||
|
where ds.is_deleted = false
|
||||||
|
order by
|
||||||
|
ddg.group_no, ds.id
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getRecordExistCount" resultType="int">
|
<select id="getRecordExistCount" resultType="int">
|
||||||
select count(1)
|
select count(1)
|
||||||
from daily_expense ds
|
from daily_expense ds
|
||||||
|
|||||||
@@ -17,6 +17,19 @@
|
|||||||
ds.id desc
|
ds.id desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getDailyFarmingMonthList"
|
||||||
|
resultType="app.module.front.usecase.daily.farming.adapters.persistence.model.DailyFarmingDto">
|
||||||
|
select ds.id, ds.daily_record_seq
|
||||||
|
, ds.product_code, ds.product_self, ds.usage
|
||||||
|
, ds.quantity, ds.unit_code, ds.unit_self, ds.estimated_value
|
||||||
|
, dr.start_date, dr.end_date, ddg.group_no
|
||||||
|
from daily_farming ds
|
||||||
|
<include refid="app.module.core.usecase.daily.record.adapters.persistence.DailyRecordMapper.InnerJoinByDailyRecordMonth"/>
|
||||||
|
where ds.is_deleted = false
|
||||||
|
order by
|
||||||
|
ddg.group_no, ds.id
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getRecordExistCount" resultType="int">
|
<select id="getRecordExistCount" resultType="int">
|
||||||
select count(1)
|
select count(1)
|
||||||
from daily_farming ds
|
from daily_farming ds
|
||||||
|
|||||||
@@ -17,6 +17,19 @@
|
|||||||
ds.id desc
|
ds.id desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getDailyForestryMonthList"
|
||||||
|
resultType="app.module.front.usecase.daily.forestry.adapters.persistence.model.DailyForestryDto">
|
||||||
|
select ds.id, ds.daily_record_seq
|
||||||
|
, ds.product_name, ds.usage
|
||||||
|
, ds.quantity, ds.unit_code, ds.unit_self, ds.estimated_value
|
||||||
|
, dr.start_date, dr.end_date, ddg.group_no
|
||||||
|
from daily_forestry ds
|
||||||
|
<include refid="app.module.core.usecase.daily.record.adapters.persistence.DailyRecordMapper.InnerJoinByDailyRecordMonth"/>
|
||||||
|
where ds.is_deleted = false
|
||||||
|
order by
|
||||||
|
ddg.group_no, ds.id
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getRecordExistCount" resultType="int">
|
<select id="getRecordExistCount" resultType="int">
|
||||||
select count(1)
|
select count(1)
|
||||||
from daily_forestry ds
|
from daily_forestry ds
|
||||||
|
|||||||
@@ -16,6 +16,18 @@
|
|||||||
ds.id desc
|
ds.id desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getDailyPowerMonthList"
|
||||||
|
resultType="app.module.front.usecase.daily.power.adapters.persistence.model.DailyPowerDto">
|
||||||
|
select ds.id, ds.daily_record_seq
|
||||||
|
, ds.equipment_name, ds.owned_hours, ds.leased_hours
|
||||||
|
, dr.start_date, dr.end_date, ddg.group_no
|
||||||
|
from daily_power ds
|
||||||
|
<include refid="app.module.core.usecase.daily.record.adapters.persistence.DailyRecordMapper.InnerJoinByDailyRecordMonth"/>
|
||||||
|
where ds.is_deleted = false
|
||||||
|
order by
|
||||||
|
ddg.group_no, ds.id
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getRecordExistCount" resultType="int">
|
<select id="getRecordExistCount" resultType="int">
|
||||||
select count(1)
|
select count(1)
|
||||||
from daily_power ds
|
from daily_power ds
|
||||||
|
|||||||
@@ -19,6 +19,21 @@
|
|||||||
ds.id desc
|
ds.id desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getDailyWorkMonthList"
|
||||||
|
resultType="app.module.front.usecase.daily.work.adapters.persistence.model.DailyWorkDto">
|
||||||
|
select ds.id, ds.daily_record_seq
|
||||||
|
, ds.item_name, ds.work_name
|
||||||
|
, ds.work_land_area, ds.area_unit_code, ds.area_unit_self, ds.harvest_quantity, ds.harvest_unit_code, ds.harvest_unit_self
|
||||||
|
, ds.owner_time, ds.spouse_time, ds.family_m_hours, ds.family_f_hours, ds.hired_m_hours
|
||||||
|
, ds.hired_f_hours, ds.shared_m_hours, ds.shared_f_hours, ds.volunteer_m_hours, ds.volunteer_f_hours
|
||||||
|
, dr.start_date, dr.end_date, ddg.group_no
|
||||||
|
from daily_work ds
|
||||||
|
<include refid="app.module.core.usecase.daily.record.adapters.persistence.DailyRecordMapper.InnerJoinByDailyRecordMonth"/>
|
||||||
|
where ds.is_deleted = false
|
||||||
|
order by
|
||||||
|
ddg.group_no, ds.id
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getRecordExistCount" resultType="int">
|
<select id="getRecordExistCount" resultType="int">
|
||||||
select count(1)
|
select count(1)
|
||||||
from daily_work ds
|
from daily_work ds
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||||
|
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
||||||
|
|
||||||
|
<div layout:fragment="content" th:classappend="regi-wrap">
|
||||||
|
<div class="modal-content-inner">
|
||||||
|
<hgroup class="tit-group">
|
||||||
|
<h3>
|
||||||
|
[[${#temporals.format(#temporals.createDate(searchMonth+'01', 'yyyyMMdd'), 'yyyy년 M월')}]]의 [[${step.desc2}]] 내역이 <br>
|
||||||
|
<strong>[[${#lists.size(list)}]]건 등록</strong> 되었습니다.
|
||||||
|
</h3>
|
||||||
|
</hgroup>
|
||||||
|
|
||||||
|
<section class="regist-item-area"
|
||||||
|
th:unless="${#lists.isEmpty(list)}">
|
||||||
|
<th:block th:each="recordItem, recordItemStatus : ${list}">
|
||||||
|
<p class="month-tit">
|
||||||
|
<th:block th:if="${recordItem.startDate eq recordItem.endDate}">
|
||||||
|
[[${#temporals.format(recordItem.startDate, 'M월 d일')}]]
|
||||||
|
</th:block>
|
||||||
|
<th:block th:if="not ${recordItem.startDate eq recordItem.endDate}">
|
||||||
|
[[${#temporals.format(recordItem.startDate, 'M월 d일')}]]~[[${#temporals.format(recordItem.endDate, 'd일')}]]
|
||||||
|
</th:block>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<!--/* [INFO] templates/record/xxxx/index.html 의 item-list 와 동일한 HTML */-->
|
||||||
|
<div class="item-list">
|
||||||
|
<div class="list-item"
|
||||||
|
th:each="item, itemStatus : ${recordItem.children}">
|
||||||
|
<div class="item-tit-group">
|
||||||
|
<p class="item-name">[[${item.expenseKind}]]</p>
|
||||||
|
</div>
|
||||||
|
<ul class="detail-list">
|
||||||
|
<li th:if="${item.credit != null}">
|
||||||
|
<p>외상 또는 카드 구입 여부</p>
|
||||||
|
<span th:text="${item.credit ? '예' : '아니오'}">아니오</span>
|
||||||
|
</li>
|
||||||
|
<li th:if="${not #strings.isEmpty(item.sourcePurpose)}">
|
||||||
|
<p>용도</p>
|
||||||
|
<span th:text="${item.sourcePurpose}">소비자</span>
|
||||||
|
</li>
|
||||||
|
<li th:if="${not #strings.isEmpty(item.quantity)}">
|
||||||
|
<p>수량</p>
|
||||||
|
<span th:text="|${@dailyUtil.getStringComma(item.quantity)}${#strings.defaultString(item.unitLabel,'')}|">500g</span>
|
||||||
|
</li>
|
||||||
|
<li th:if="${not #strings.isEmpty(item.price)}">
|
||||||
|
<p>현금 </p>
|
||||||
|
<span th:text="|${#numbers.formatInteger(item.price, 1, 'COMMA')}원|">302,000원</span>
|
||||||
|
</li>
|
||||||
|
<li th:if="${not #strings.isEmpty(item.estimatedValue)}">
|
||||||
|
<p>현물평가액</p>
|
||||||
|
<span th:text="|${#numbers.formatInteger(item.estimatedValue, 1, 'COMMA')}원|">302,000원</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--/* //[INFO] templates/record/xxxx/index.html 의 item-list 와 동일한 HTML */-->
|
||||||
|
</th:block>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||||
|
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
||||||
|
|
||||||
|
<div layout:fragment="content" th:classappend="regi-wrap">
|
||||||
|
<div class="modal-content-inner">
|
||||||
|
<hgroup class="tit-group">
|
||||||
|
<h3>
|
||||||
|
[[${#temporals.format(#temporals.createDate(searchMonth+'01', 'yyyyMMdd'), 'yyyy년 M월')}]]의 [[${step.desc2}]] 내역이 <br>
|
||||||
|
<strong>[[${#lists.size(list)}]]건 등록</strong> 되었습니다.
|
||||||
|
</h3>
|
||||||
|
</hgroup>
|
||||||
|
|
||||||
|
<section class="regist-item-area"
|
||||||
|
th:unless="${#lists.isEmpty(list)}">
|
||||||
|
<th:block th:each="recordItem, recordItemStatus : ${list}">
|
||||||
|
<p class="month-tit">
|
||||||
|
<th:block th:if="${recordItem.startDate eq recordItem.endDate}">
|
||||||
|
[[${#temporals.format(recordItem.startDate, 'M월 d일')}]]
|
||||||
|
</th:block>
|
||||||
|
<th:block th:if="not ${recordItem.startDate eq recordItem.endDate}">
|
||||||
|
[[${#temporals.format(recordItem.startDate, 'M월 d일')}]]~[[${#temporals.format(recordItem.endDate, 'd일')}]]
|
||||||
|
</th:block>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<!--/* [INFO] templates/record/xxxx/index.html 의 item-list 와 동일한 HTML */-->
|
||||||
|
<div class="item-list">
|
||||||
|
<div class="list-item"
|
||||||
|
th:each="item, itemStatus : ${recordItem.children}">
|
||||||
|
<div class="item-tit-group">
|
||||||
|
<p class="item-name">[[${item.productLabel}]]</p>
|
||||||
|
</div>
|
||||||
|
<ul class="detail-list">
|
||||||
|
<li th:if="${not #strings.isEmpty(item.usage)}">
|
||||||
|
<p>용도</p>
|
||||||
|
<span th:text="${item.usage}">0시간</span>
|
||||||
|
</li>
|
||||||
|
<li th:if="${not #strings.isEmpty(item.quantity)}">
|
||||||
|
<p>수량</p>
|
||||||
|
<span th:text="|${@dailyUtil.getStringComma(item.quantity)}${#strings.defaultString(item.unitLabel,'')}|">500g</span>
|
||||||
|
</li>
|
||||||
|
<li th:if="${not #strings.isEmpty(item.estimatedValue)}">
|
||||||
|
<p>현물평가액</p>
|
||||||
|
<span th:text="|${#numbers.formatInteger(item.estimatedValue, 1, 'COMMA')}원|">302,000원</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--/* //[INFO] templates/record/xxxx/index.html 의 item-list 와 동일한 HTML */-->
|
||||||
|
</th:block>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||||
|
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
||||||
|
|
||||||
|
<div layout:fragment="content" th:classappend="regi-wrap">
|
||||||
|
<div class="modal-content-inner">
|
||||||
|
<hgroup class="tit-group">
|
||||||
|
<h3>
|
||||||
|
[[${#temporals.format(#temporals.createDate(searchMonth+'01', 'yyyyMMdd'), 'yyyy년 M월')}]]의 [[${step.desc2}]] 내역이 <br>
|
||||||
|
<strong>[[${#lists.size(list)}]]건 등록</strong> 되었습니다.
|
||||||
|
</h3>
|
||||||
|
</hgroup>
|
||||||
|
|
||||||
|
<section class="regist-item-area"
|
||||||
|
th:unless="${#lists.isEmpty(list)}">
|
||||||
|
<th:block th:each="recordItem, recordItemStatus : ${list}">
|
||||||
|
<p class="month-tit">
|
||||||
|
<th:block th:if="${recordItem.startDate eq recordItem.endDate}">
|
||||||
|
[[${#temporals.format(recordItem.startDate, 'M월 d일')}]]
|
||||||
|
</th:block>
|
||||||
|
<th:block th:if="not ${recordItem.startDate eq recordItem.endDate}">
|
||||||
|
[[${#temporals.format(recordItem.startDate, 'M월 d일')}]]~[[${#temporals.format(recordItem.endDate, 'd일')}]]
|
||||||
|
</th:block>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<!--/* [INFO] templates/record/xxxx/index.html 의 item-list 와 동일한 HTML */-->
|
||||||
|
<div class="item-list">
|
||||||
|
<div class="list-item"
|
||||||
|
th:each="item, itemStatus : ${recordItem.children}">
|
||||||
|
<div class="item-tit-group">
|
||||||
|
<p class="item-name">[[${item.productName}]]</p>
|
||||||
|
</div>
|
||||||
|
<ul class="detail-list">
|
||||||
|
<li th:if="${not #strings.isEmpty(item.usage)}">
|
||||||
|
<p>용도</p>
|
||||||
|
<span th:text="${item.usage}">0시간</span>
|
||||||
|
</li>
|
||||||
|
<li th:if="${not #strings.isEmpty(item.quantity)}">
|
||||||
|
<p>수량</p>
|
||||||
|
<span th:text="|${@dailyUtil.getStringComma(item.quantity)}${#strings.defaultString(item.unitLabel,'')}|">500g</span>
|
||||||
|
</li>
|
||||||
|
<li th:if="${not #strings.isEmpty(item.estimatedValue)}">
|
||||||
|
<p>현물평가액</p>
|
||||||
|
<span th:text="|${#numbers.formatInteger(item.estimatedValue, 1, 'COMMA')}원|">302,000원</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--/* //[INFO] templates/record/xxxx/index.html 의 item-list 와 동일한 HTML */-->
|
||||||
|
</th:block>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||||
|
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
||||||
|
|
||||||
|
<div layout:fragment="content" th:classappend="regi-wrap">
|
||||||
|
<div class="modal-content-inner">
|
||||||
|
<hgroup class="tit-group">
|
||||||
|
<h3>
|
||||||
|
[[${#temporals.format(#temporals.createDate(searchMonth+'01', 'yyyyMMdd'), 'yyyy년 M월')}]]의 [[${step.desc2}]] 내역이 <br>
|
||||||
|
<strong>[[${#lists.size(list)}]]건 등록</strong> 되었습니다.
|
||||||
|
</h3>
|
||||||
|
</hgroup>
|
||||||
|
|
||||||
|
<section class="regist-item-area"
|
||||||
|
th:unless="${#lists.isEmpty(list)}">
|
||||||
|
<th:block th:each="recordItem, recordItemStatus : ${list}">
|
||||||
|
<p class="month-tit">
|
||||||
|
<th:block th:if="${recordItem.startDate eq recordItem.endDate}">
|
||||||
|
[[${#temporals.format(recordItem.startDate, 'M월 d일')}]]
|
||||||
|
</th:block>
|
||||||
|
<th:block th:if="not ${recordItem.startDate eq recordItem.endDate}">
|
||||||
|
[[${#temporals.format(recordItem.startDate, 'M월 d일')}]]~[[${#temporals.format(recordItem.endDate, 'd일')}]]
|
||||||
|
</th:block>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<!--/* [INFO] templates/record/xxxx/index.html 의 item-list 와 동일한 HTML */-->
|
||||||
|
<div class="item-list">
|
||||||
|
<div class="list-item"
|
||||||
|
th:each="item, itemStatus : ${recordItem.children}">
|
||||||
|
<div class="item-tit-group">
|
||||||
|
<p class="item-name">[[${item.equipmentName}]]</p>
|
||||||
|
</div>
|
||||||
|
<ul class="detail-list">
|
||||||
|
<li th:if="${not #strings.isEmpty(item.ownedHours)}">
|
||||||
|
<p>자가 사용시간</p>
|
||||||
|
<span th:text="|${@dailyUtil.getStringComma(item.ownedHours)}시간|">0시간</span>
|
||||||
|
</li>
|
||||||
|
<li th:if="${not #strings.isEmpty(item.leasedHours)}">
|
||||||
|
<p>임차 사용시간</p>
|
||||||
|
<span th:text="|${@dailyUtil.getStringComma(item.leasedHours)}시간|">0시간</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--/* //[INFO] templates/record/xxxx/index.html 의 item-list 와 동일한 HTML */-->
|
||||||
|
</th:block>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||||
|
xmlns:th="http://www.thymeleaf.org" lang="ko">
|
||||||
|
|
||||||
|
<div layout:fragment="content" th:classappend="regi-wrap">
|
||||||
|
<div class="modal-content-inner">
|
||||||
|
<hgroup class="tit-group">
|
||||||
|
<h3>
|
||||||
|
[[${#temporals.format(#temporals.createDate(searchMonth+'01', 'yyyyMMdd'), 'yyyy년 M월')}]]의 [[${step.desc2}]] 내역이 <br>
|
||||||
|
<strong>[[${#lists.size(list)}]]건 등록</strong> 되었습니다.
|
||||||
|
</h3>
|
||||||
|
</hgroup>
|
||||||
|
|
||||||
|
<section class="regist-item-area"
|
||||||
|
th:unless="${#lists.isEmpty(list)}">
|
||||||
|
<th:block th:each="recordItem, recordItemStatus : ${list}">
|
||||||
|
<p class="month-tit">
|
||||||
|
<th:block th:if="${recordItem.startDate eq recordItem.endDate}">
|
||||||
|
[[${#temporals.format(recordItem.startDate, 'M월 d일')}]]
|
||||||
|
</th:block>
|
||||||
|
<th:block th:if="not ${recordItem.startDate eq recordItem.endDate}">
|
||||||
|
[[${#temporals.format(recordItem.startDate, 'M월 d일')}]]~[[${#temporals.format(recordItem.endDate, 'd일')}]]
|
||||||
|
</th:block>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<!--/* [INFO] templates/record/xxxx/index.html 의 item-list 와 동일한 HTML */-->
|
||||||
|
<div class="item-list">
|
||||||
|
<div class="list-item"
|
||||||
|
th:each="item, itemStatus : ${recordItem.children}">
|
||||||
|
<div class="item-tit-group">
|
||||||
|
<p class="item-name">[[${item.itemName}]]</p>
|
||||||
|
</div>
|
||||||
|
<ul class="detail-list">
|
||||||
|
<li th:if="${not #strings.isEmpty(item.workName)}">
|
||||||
|
<p>작업명</p>
|
||||||
|
<span th:text="${item.workName}">수확</span>
|
||||||
|
</li>
|
||||||
|
<li th:if="${not #strings.isEmpty(item.workLandArea)}">
|
||||||
|
<p>작업 면적</p>
|
||||||
|
<span th:text="|${@dailyUtil.getStringComma(item.workLandArea)}${#strings.defaultString(item.areaUnitLabel,'')}|"></span>
|
||||||
|
</li>
|
||||||
|
<li th:if="${not #strings.isEmpty(item.harvestQuantity)}">
|
||||||
|
<p>수확량</p>
|
||||||
|
<span th:text="|${@dailyUtil.getStringComma(item.harvestQuantity)}${#strings.defaultString(item.harvestUnitLabel,'')}|"></span>
|
||||||
|
</li>
|
||||||
|
<li th:if="${not #strings.isEmpty(item.ownerTime)}">
|
||||||
|
<p>경영주 노동투입시간</p>
|
||||||
|
<span th:text="|${@dailyUtil.getStringComma(item.ownerTime)}시간|"></span>
|
||||||
|
</li>
|
||||||
|
<li th:if="${not #strings.isEmpty(item.spouseTime)}">
|
||||||
|
<p>배우자 노동투입시간</p>
|
||||||
|
<span th:text="|${@dailyUtil.getStringComma(item.spouseTime)}시간|"></span>
|
||||||
|
</li>
|
||||||
|
<li th:if="${not #strings.isEmpty(item.familyMHours)}">
|
||||||
|
<p>가족노동(남)</p>
|
||||||
|
<span th:text="|${@dailyUtil.getStringComma(item.familyMHours)}시간|"></span>
|
||||||
|
</li>
|
||||||
|
<li th:if="${not #strings.isEmpty(item.familyFHours)}">
|
||||||
|
<p>가족노동(여)</p>
|
||||||
|
<span th:text="|${@dailyUtil.getStringComma(item.familyFHours)}시간|"></span>
|
||||||
|
</li>
|
||||||
|
<li th:if="${not #strings.isEmpty(item.hiredMHours)}">
|
||||||
|
<p>고용노동(남)</p>
|
||||||
|
<span th:text="|${@dailyUtil.getStringComma(item.hiredMHours)}시간|"></span>
|
||||||
|
</li>
|
||||||
|
<li th:if="${not #strings.isEmpty(item.hiredFHours)}">
|
||||||
|
<p>고용노동(여)</p>
|
||||||
|
<span th:text="|${@dailyUtil.getStringComma(item.hiredFHours)}시간|"></span>
|
||||||
|
</li>
|
||||||
|
<li th:if="${not #strings.isEmpty(item.sharedMHours)}">
|
||||||
|
<p>품앗이(남)</p>
|
||||||
|
<span th:text="|${@dailyUtil.getStringComma(item.sharedMHours)}시간|"></span>
|
||||||
|
</li>
|
||||||
|
<li th:if="${not #strings.isEmpty(item.sharedFHours)}">
|
||||||
|
<p>품앗이(여)</p>
|
||||||
|
<span th:text="|${@dailyUtil.getStringComma(item.sharedFHours)}시간|"></span>
|
||||||
|
</li>
|
||||||
|
<li th:if="${not #strings.isEmpty(item.volunteerMHours)}">
|
||||||
|
<p>일손돕기(남)</p>
|
||||||
|
<span th:text="|${@dailyUtil.getStringComma(item.volunteerMHours)}시간|"></span>
|
||||||
|
</li>
|
||||||
|
<li th:if="${not #strings.isEmpty(item.volunteerFHours)}">
|
||||||
|
<p>일손돕기(여)</p>
|
||||||
|
<span th:text="|${@dailyUtil.getStringComma(item.volunteerFHours)}시간|"></span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--/* //[INFO] templates/record/xxxx/index.html 의 item-list 와 동일한 HTML */-->
|
||||||
|
</th:block>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user