[2차][FO] 입력현황 WIP
This commit is contained in:
@@ -6,13 +6,14 @@ import lombok.RequiredArgsConstructor;
|
|||||||
@Getter
|
@Getter
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public enum DailySort {
|
public enum DailySort {
|
||||||
INCOME("수입"),
|
INCOME("수입", "수입"),
|
||||||
WORK("임업노동 투입"),
|
WORK("임업노동 투입", "임업노동 투입"),
|
||||||
EXPENSE("지출"),
|
EXPENSE("지출", "지출"),
|
||||||
POWER("동력 사용시간"),
|
POWER("동력 사용시간", "동력사용시간"),
|
||||||
FORESTRY("임업생산물 중 자가소비량"),
|
FORESTRY("임업생산물 중 자가소비량", "자가임업 생산물 중 자가소비량"),
|
||||||
FARMING("농업생산물 중 자가소비량"),
|
FARMING("농업생산물 중 자가소비량", "자가농업 생산물 중 자가소비량"),
|
||||||
;
|
;
|
||||||
|
|
||||||
private final String desc;
|
private final String desc;
|
||||||
|
private final String desc2;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,4 +130,12 @@
|
|||||||
and dr.household_seq = #{householdSeq}
|
and dr.household_seq = #{householdSeq}
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
<sql id="InnerJoinByDailyRecordMonth">
|
||||||
|
inner join daily_record dr on
|
||||||
|
dr.id = ds.daily_record_seq
|
||||||
|
and dr.is_deleted = false
|
||||||
|
and dr.record_month = #{searchMonth}
|
||||||
|
and dr.household_seq = #{householdSeq}
|
||||||
|
</sql>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -22,6 +22,11 @@ public class DailyIncomeDao implements DailyIncomePortOut {
|
|||||||
return dailyIncomeMapper.getDailyIncomeList(command);
|
return dailyIncomeMapper.getDailyIncomeList(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DailyIncomeDto> monthList(GetDailyIncomeCmd command) {
|
||||||
|
return dailyIncomeMapper.getDailyIncomeListByMonth(command);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void create(GetDailyIncomeCmd findCmd, CreateDailyIncomeCmd command) {
|
public void create(GetDailyIncomeCmd findCmd, CreateDailyIncomeCmd command) {
|
||||||
Integer existCount = dailyIncomeMapper.getRecordExistCount(findCmd);
|
Integer existCount = dailyIncomeMapper.getRecordExistCount(findCmd);
|
||||||
|
|||||||
@@ -11,13 +11,21 @@ import java.util.List;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface DailyIncomeMapper {
|
public interface DailyIncomeMapper {
|
||||||
/**
|
/**
|
||||||
* 일계부 수입 목록 조회
|
* 특정 그룹일의 일계부 수입 목록 조회
|
||||||
*
|
*
|
||||||
* @param command 검색 조건
|
* @param command 검색 조건
|
||||||
* @return 수입 목록
|
* @return 수입 목록
|
||||||
*/
|
*/
|
||||||
List<DailyIncomeDto> getDailyIncomeList(GetDailyIncomeCmd command);
|
List<DailyIncomeDto> getDailyIncomeList(GetDailyIncomeCmd command);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 특정월의 일계부 수입 목록 조회
|
||||||
|
*
|
||||||
|
* @param command 검색 조건
|
||||||
|
* @return 수입 목록
|
||||||
|
*/
|
||||||
|
List<DailyIncomeDto> getDailyIncomeListByMonth(GetDailyIncomeCmd command);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 수입 데이터 존재 여부
|
* 일계부 수입 데이터 존재 여부
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -3,9 +3,13 @@ package app.module.front.usecase.daily.income.adapters.persistence.model;
|
|||||||
import app.module.front.usecase.daily.income.adapters.web.model.DailyInputType;
|
import app.module.front.usecase.daily.income.adapters.web.model.DailyInputType;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
@ToString
|
||||||
public class DailyIncomeDto {
|
public class DailyIncomeDto {
|
||||||
private Long id;
|
private Long id;
|
||||||
private Long dailyRecordSeq;
|
private Long dailyRecordSeq;
|
||||||
@@ -21,6 +25,8 @@ public class DailyIncomeDto {
|
|||||||
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,19 @@
|
|||||||
|
package app.module.front.usecase.daily.income.adapters.persistence.model;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.income.adapters.web.model.DailyInputType;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
public class DailyMonthIncomeDto {
|
||||||
|
private Long dailyRecordSeq;
|
||||||
|
private LocalDate startDate;
|
||||||
|
private LocalDate endDate;
|
||||||
|
private List<DailyIncomeDto> children;
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package app.module.front.usecase.daily.income.ports;
|
package app.module.front.usecase.daily.income.ports;
|
||||||
|
|
||||||
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto;
|
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto;
|
||||||
|
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyMonthIncomeDto;
|
||||||
import app.module.front.usecase.daily.income.adapters.web.model.CreateDailyIncomeReqVO;
|
import app.module.front.usecase.daily.income.adapters.web.model.CreateDailyIncomeReqVO;
|
||||||
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.adapters.web.model.RemoveDailyIncomeReqVO;
|
import app.module.front.usecase.daily.income.adapters.web.model.RemoveDailyIncomeReqVO;
|
||||||
@@ -9,13 +10,21 @@ import java.util.List;
|
|||||||
|
|
||||||
public interface DailyIncomePortIn {
|
public interface DailyIncomePortIn {
|
||||||
/**
|
/**
|
||||||
* 일계부 수입 조회
|
* 특정 그룹일의 일계부 수입 조회
|
||||||
*
|
*
|
||||||
* @param reqVO 검색 조건
|
* @param reqVO 검색 조건
|
||||||
* @return 수입 목록
|
* @return 수입 목록
|
||||||
*/
|
*/
|
||||||
List<DailyIncomeDto> list(DailyIncomeUIReqVO reqVO);
|
List<DailyIncomeDto> list(DailyIncomeUIReqVO reqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 특정월의 일계부 수입 조회
|
||||||
|
*
|
||||||
|
* @param reqVO 검색 조건
|
||||||
|
* @return 수입 목록
|
||||||
|
*/
|
||||||
|
List<DailyMonthIncomeDto> monthList(DailyIncomeUIReqVO reqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 일계부 수입 조회
|
* 일계부 수입 조회
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package app.module.front.usecase.daily.income.ports;
|
package app.module.front.usecase.daily.income.ports;
|
||||||
|
|
||||||
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto;
|
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto;
|
||||||
|
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyMonthIncomeDto;
|
||||||
|
import app.module.front.usecase.daily.income.adapters.web.model.DailyIncomeUIReqVO;
|
||||||
import app.module.front.usecase.daily.income.ports.application.domain.CreateDailyIncomeCmd;
|
import app.module.front.usecase.daily.income.ports.application.domain.CreateDailyIncomeCmd;
|
||||||
import app.module.front.usecase.daily.income.ports.application.domain.GetDailyIncomeCmd;
|
import app.module.front.usecase.daily.income.ports.application.domain.GetDailyIncomeCmd;
|
||||||
import app.module.front.usecase.daily.income.ports.application.domain.RemoveDailyIncomeCmd;
|
import app.module.front.usecase.daily.income.ports.application.domain.RemoveDailyIncomeCmd;
|
||||||
@@ -16,6 +18,14 @@ public interface DailyIncomePortOut {
|
|||||||
*/
|
*/
|
||||||
List<DailyIncomeDto> list(GetDailyIncomeCmd command);
|
List<DailyIncomeDto> list(GetDailyIncomeCmd command);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 수입 조회
|
||||||
|
*
|
||||||
|
* @param command 검색 조건
|
||||||
|
* @return 수입 목록
|
||||||
|
*/
|
||||||
|
List<DailyIncomeDto> monthList(GetDailyIncomeCmd 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.income.adapters.persistence.model.DailyIncomeDto;
|
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto;
|
||||||
|
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyMonthIncomeDto;
|
||||||
import app.module.front.usecase.daily.income.adapters.web.model.CreateDailyIncomeReqVO;
|
import app.module.front.usecase.daily.income.adapters.web.model.CreateDailyIncomeReqVO;
|
||||||
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.adapters.web.model.RemoveDailyIncomeReqVO;
|
import app.module.front.usecase.daily.income.adapters.web.model.RemoveDailyIncomeReqVO;
|
||||||
@@ -19,7 +20,9 @@ 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.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@@ -30,12 +33,36 @@ public class DailyIncomeService implements DailyIncomePortIn {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DailyIncomeDto> list(DailyIncomeUIReqVO reqVO) {
|
public List<DailyIncomeDto> list(DailyIncomeUIReqVO reqVO) {
|
||||||
return this.getRefineList(reqVO);
|
return this.getRefineList(reqVO, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DailyMonthIncomeDto> monthList(DailyIncomeUIReqVO reqVO) {
|
||||||
|
|
||||||
|
List<DailyMonthIncomeDto> monthList = new ArrayList<>();
|
||||||
|
|
||||||
|
List<DailyIncomeDto> list = this.getRefineList(reqVO, false);
|
||||||
|
// DailyIncomeDto> children;
|
||||||
|
|
||||||
|
List<Long> seqList = list.stream().map(m -> m.getDailyRecordSeq()).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
|
for (Long seq : seqList) {
|
||||||
|
DailyMonthIncomeDto month = new DailyMonthIncomeDto();
|
||||||
|
month.setDailyRecordSeq(seq);
|
||||||
|
|
||||||
|
month.setStartDate(list.stream().filter(f -> f.getDailyRecordSeq() == seq).map(m -> m.getStartDate()).findFirst().get());
|
||||||
|
month.setEndDate(list.stream().filter(f -> f.getDailyRecordSeq() == seq).map(m -> m.getEndDate()).findFirst().get());
|
||||||
|
|
||||||
|
month.setChildren(list.stream().filter(f -> f.getDailyRecordSeq() == seq).collect(Collectors.toList()));
|
||||||
|
monthList.add(month);
|
||||||
|
}
|
||||||
|
|
||||||
|
return monthList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DailyIncomeDto detail(DailyIncomeUIReqVO reqVO) {
|
public DailyIncomeDto detail(DailyIncomeUIReqVO reqVO) {
|
||||||
List<DailyIncomeDto> list = this.getRefineList(reqVO);
|
List<DailyIncomeDto> list = this.getRefineList(reqVO, true);
|
||||||
if (list.isEmpty()) {
|
if (list.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -46,14 +73,17 @@ public class DailyIncomeService implements DailyIncomePortIn {
|
|||||||
/**
|
/**
|
||||||
* 목록 데이터 조회
|
* 목록 데이터 조회
|
||||||
*
|
*
|
||||||
* @param reqVO 검색 조건
|
* @param reqVO 검색 조건
|
||||||
|
* @param dayGroup 일 그룹 조건
|
||||||
* @return 공통 처리된 목록
|
* @return 공통 처리된 목록
|
||||||
*/
|
*/
|
||||||
private List<DailyIncomeDto> getRefineList(DailyIncomeUIReqVO reqVO) {
|
private List<DailyIncomeDto> getRefineList(DailyIncomeUIReqVO reqVO, boolean dayGroup) {
|
||||||
List<DailyIncomeDto> list = portOut.list(new GetDailyIncomeCmd(reqVO.getSearchMonth(),
|
GetDailyIncomeCmd command = new GetDailyIncomeCmd(reqVO.getSearchMonth(),
|
||||||
reqVO.getGroupNo(),
|
reqVO.getGroupNo(),
|
||||||
reqVO.getHouseholdSeq(),
|
reqVO.getHouseholdSeq(),
|
||||||
reqVO.getId()));
|
reqVO.getId());
|
||||||
|
|
||||||
|
List<DailyIncomeDto> list = dayGroup ? portOut.list(command) : portOut.monthList(command);
|
||||||
|
|
||||||
List<UICodeElement> recordCrop = uiCodeListPortIn.connect("code.record.crop");
|
List<UICodeElement> recordCrop = uiCodeListPortIn.connect("code.record.crop");
|
||||||
List<UICodeElement> recordUnit = uiCodeListPortIn.connect("code.record.unit");
|
List<UICodeElement> recordUnit = uiCodeListPortIn.connect("code.record.unit");
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package app.module.front.usecase.daily.status.adapters.persistence;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.status.adapters.persistence.model.DailyItemStatusDto;
|
||||||
|
import app.module.front.usecase.daily.status.adapters.persistence.model.DailyMonthStatusDto;
|
||||||
|
import app.module.front.usecase.daily.status.ports.DailyStatusPortOut;
|
||||||
|
import app.module.front.usecase.daily.status.ports.application.domain.DailyStatusCmd;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class DailyStatusDao implements DailyStatusPortOut {
|
||||||
|
private final DailyStatusMapper dailyStatusMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DailyMonthStatusDto operate(DailyStatusCmd command) {
|
||||||
|
DailyMonthStatusDto detail = dailyStatusMapper.getDailyStatusByMonth(command);
|
||||||
|
List<DailyItemStatusDto> countList = dailyStatusMapper.getDailyStatusByItemCount(command);
|
||||||
|
List<DailyItemStatusDto> valueList = dailyStatusMapper.getDailyStatusByItemValue(command);
|
||||||
|
|
||||||
|
int totalInput = 0;
|
||||||
|
if (detail != null) {
|
||||||
|
for (DailyItemStatusDto item : countList) {
|
||||||
|
totalInput = totalInput + item.getInputCount();
|
||||||
|
|
||||||
|
for (DailyItemStatusDto value : valueList) {
|
||||||
|
if (item.getStep().equals(value.getStep())) {
|
||||||
|
item.setTotalValue(value.getTotalValue());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
detail.setTotalInput(totalInput);
|
||||||
|
detail.setItemList(countList);
|
||||||
|
}
|
||||||
|
|
||||||
|
return detail;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package app.module.front.usecase.daily.status.adapters.persistence;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.status.adapters.persistence.model.DailyItemStatusDto;
|
||||||
|
import app.module.front.usecase.daily.status.adapters.persistence.model.DailyMonthStatusDto;
|
||||||
|
import app.module.front.usecase.daily.status.ports.application.domain.DailyStatusCmd;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface DailyStatusMapper {
|
||||||
|
/**
|
||||||
|
* 월별 입력 현황 조회
|
||||||
|
* @param command 검색 조건
|
||||||
|
* @return 월별 입력 현황
|
||||||
|
*/
|
||||||
|
DailyMonthStatusDto getDailyStatusByMonth(DailyStatusCmd command);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 항목별 월별 입력 현황 건 수 조회
|
||||||
|
*
|
||||||
|
* @param command 검색 조건
|
||||||
|
* @return 항목별 월별 현황 건 수
|
||||||
|
*/
|
||||||
|
List<DailyItemStatusDto> getDailyStatusByItemCount(DailyStatusCmd command);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 항목별 월별 입력 현황 값(금액/시간) 조회
|
||||||
|
*
|
||||||
|
* @param command 검색 조건
|
||||||
|
* @return 항목별 월별 현황 값(금액/시간)
|
||||||
|
*/
|
||||||
|
List<DailyItemStatusDto> getDailyStatusByItemValue(DailyStatusCmd command);
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package app.module.front.usecase.daily.status.adapters.persistence.model;
|
||||||
|
|
||||||
|
import app.module.core.config.application.enums.DailySort;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class DailyItemStatusDto {
|
||||||
|
/**
|
||||||
|
* 항목
|
||||||
|
*/
|
||||||
|
private DailySort step;
|
||||||
|
/**
|
||||||
|
* 대상일
|
||||||
|
*/
|
||||||
|
private Integer dayCount;
|
||||||
|
/**
|
||||||
|
* 완료일(작성일)
|
||||||
|
*/
|
||||||
|
private Integer doneCount;
|
||||||
|
/**
|
||||||
|
* 작성중일(등록 건수)
|
||||||
|
*/
|
||||||
|
private Integer inputCount;
|
||||||
|
/**
|
||||||
|
* 집계 수
|
||||||
|
*/
|
||||||
|
private String totalValue;
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package app.module.front.usecase.daily.status.adapters.persistence.model;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class DailyMonthStatusDto {
|
||||||
|
/**
|
||||||
|
* 대상일
|
||||||
|
*/
|
||||||
|
private Integer dayCount;
|
||||||
|
/**
|
||||||
|
* 완료일(작성일)
|
||||||
|
*/
|
||||||
|
private Integer doneCount;
|
||||||
|
/**
|
||||||
|
* 총 등록 수
|
||||||
|
*/
|
||||||
|
private Integer totalInput;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 항목별 월별 현황
|
||||||
|
*/
|
||||||
|
List<DailyItemStatusDto> itemList;
|
||||||
|
}
|
||||||
@@ -0,0 +1,91 @@
|
|||||||
|
package app.module.front.usecase.daily.status.adapters.web;
|
||||||
|
|
||||||
|
import app.module.core.config.application.enums.DailySort;
|
||||||
|
import app.module.core.config.application.exception.NoMatchingURIException;
|
||||||
|
import app.module.front.usecase.daily.income.adapters.persistence.model.DailyMonthIncomeDto;
|
||||||
|
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.status.adapters.web.model.DailyStatusUIReqVO;
|
||||||
|
import app.module.front.usecase.daily.status.ports.DailyStatusPortIn;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Controller
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RequestMapping(path = "/status/daily")
|
||||||
|
public class DailyStatusUIController {
|
||||||
|
private final DailyStatusPortIn dailyStatusPortIn;
|
||||||
|
private final DailyIncomePortIn dailyIncomePortIn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 입력 현황 화면
|
||||||
|
*
|
||||||
|
* @param model Model
|
||||||
|
*/
|
||||||
|
@GetMapping(path = "")
|
||||||
|
public String index(Model model, @ModelAttribute DailyStatusUIReqVO reqVO) {
|
||||||
|
log.debug("reqVO: {}", reqVO);
|
||||||
|
|
||||||
|
model.addAttribute("reqVO", reqVO);
|
||||||
|
|
||||||
|
model.addAttribute("detail", dailyStatusPortIn.operate(reqVO));
|
||||||
|
|
||||||
|
return "status/daily";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 일계부 입력 현황 상세 화면
|
||||||
|
*
|
||||||
|
* @param model Model
|
||||||
|
* @param step 조회 항목
|
||||||
|
* @param searchMonth 검색 월
|
||||||
|
*/
|
||||||
|
@GetMapping(path = "/{step}/{searchMonth}")
|
||||||
|
public String detail(Model model, @PathVariable("step") String step, @PathVariable("searchMonth") String searchMonth) {
|
||||||
|
if (DailySort.INCOME.name().equalsIgnoreCase(step)) {
|
||||||
|
List<DailyMonthIncomeDto> list = dailyIncomePortIn.monthList(new DailyIncomeUIReqVO(searchMonth, ""));
|
||||||
|
|
||||||
|
model.addAttribute("step", DailySort.INCOME);
|
||||||
|
model.addAttribute("list", list);
|
||||||
|
// } else if (DailySort.WORK.name().equalsIgnoreCase(step)) {
|
||||||
|
// List<DailyMonthIncomeDto> list = dailyIncomePortIn.monthList(new DailyIncomeUIReqVO(searchMonth, ""));
|
||||||
|
//
|
||||||
|
// model.addAttribute("step", DailySort.WORK);
|
||||||
|
// model.addAttribute("list", list);
|
||||||
|
// } else if (DailySort.EXPENSE.name().equalsIgnoreCase(step)) {
|
||||||
|
// List<DailyMonthIncomeDto> list = dailyIncomePortIn.monthList(new DailyIncomeUIReqVO(searchMonth, ""));
|
||||||
|
//
|
||||||
|
// model.addAttribute("step", DailySort.EXPENSE);
|
||||||
|
// model.addAttribute("list", list);
|
||||||
|
// } else if (DailySort.POWER.name().equalsIgnoreCase(step)) {
|
||||||
|
// List<DailyMonthIncomeDto> list = dailyIncomePortIn.monthList(new DailyIncomeUIReqVO(searchMonth, ""));
|
||||||
|
//
|
||||||
|
// model.addAttribute("step", DailySort.POWER);
|
||||||
|
// model.addAttribute("list", list);
|
||||||
|
// } 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 {
|
||||||
|
throw new NoMatchingURIException("잘못된 접근");
|
||||||
|
}
|
||||||
|
|
||||||
|
model.addAttribute("searchMonth", searchMonth);
|
||||||
|
return String.format("status/daily/detail-%s", step);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package app.module.front.usecase.daily.status.adapters.web.model;
|
||||||
|
|
||||||
|
import app.module.core.config.application.util.DailyUtil;
|
||||||
|
import app.module.front.usecase.daily.calendar.adapters.web.model.RecordCalendarUIReqVO;
|
||||||
|
import app.module.front.usecase.daily.record.adapters.web.model.DailyUIReqVO;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import org.apache.tika.utils.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class DailyStatusUIReqVO extends DailyUIReqVO {
|
||||||
|
private static final Logger LOGGER = LoggerFactory.getLogger(RecordCalendarUIReqVO.class);
|
||||||
|
private static DailyUtil dailyUtil;
|
||||||
|
|
||||||
|
public DailyStatusUIReqVO() {
|
||||||
|
setSearchMonth(LocalDate.now().format(DateTimeFormatter.ofPattern("yyyyMM")));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 검색 월 목록
|
||||||
|
*
|
||||||
|
* @return 현재 날짜 기준 최대 13개월전까지의 검색 월
|
||||||
|
*/
|
||||||
|
public List<LocalDate> getMonthList() {
|
||||||
|
LocalDate currentMonth = LocalDate.now();
|
||||||
|
List<LocalDate> monthList = new ArrayList<>();
|
||||||
|
monthList.add(currentMonth);
|
||||||
|
for (int i = 1 ; i <= 13; i++) {
|
||||||
|
monthList.add(currentMonth.minusMonths(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
return monthList;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package app.module.front.usecase.daily.status.ports;
|
||||||
|
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.status.adapters.persistence.model.DailyMonthStatusDto;
|
||||||
|
import app.module.front.usecase.daily.status.adapters.web.model.DailyStatusUIReqVO;
|
||||||
|
|
||||||
|
public interface DailyStatusPortIn {
|
||||||
|
/**
|
||||||
|
* 특정월의 일계부 입력 현황
|
||||||
|
*
|
||||||
|
* @param reqVO 검색 조건
|
||||||
|
* @return 특정월의 일계부 입력 현황
|
||||||
|
*/
|
||||||
|
DailyMonthStatusDto operate(DailyStatusUIReqVO reqVO);
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package app.module.front.usecase.daily.status.ports;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.status.adapters.persistence.model.DailyMonthStatusDto;
|
||||||
|
import app.module.front.usecase.daily.status.ports.application.domain.DailyStatusCmd;
|
||||||
|
|
||||||
|
public interface DailyStatusPortOut {
|
||||||
|
/**
|
||||||
|
* 특정월의 일계부 입력 현황
|
||||||
|
*
|
||||||
|
* @param command 검색 조건
|
||||||
|
* @return 특정월의 일계부 입력 현황
|
||||||
|
*/
|
||||||
|
DailyMonthStatusDto operate(DailyStatusCmd command);
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package app.module.front.usecase.daily.status.ports.application;
|
||||||
|
|
||||||
|
import app.module.front.usecase.daily.status.adapters.persistence.model.DailyMonthStatusDto;
|
||||||
|
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.DailyStatusPortOut;
|
||||||
|
import app.module.front.usecase.daily.status.ports.application.domain.DailyStatusCmd;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class DailyStatusService implements DailyStatusPortIn {
|
||||||
|
private final DailyStatusPortOut portOut;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DailyMonthStatusDto operate(DailyStatusUIReqVO reqVO) {
|
||||||
|
return portOut.operate(new DailyStatusCmd(reqVO.getSearchMonth(), reqVO.getHouseholdSeq()));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package app.module.front.usecase.daily.status.ports.application.domain;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class DailyStatusCmd {
|
||||||
|
/**
|
||||||
|
* 검색 월(yyyyMM)
|
||||||
|
*/
|
||||||
|
private String recordMonth;
|
||||||
|
/**
|
||||||
|
* 임가 일련번호
|
||||||
|
*/
|
||||||
|
private Long householdSeq;
|
||||||
|
}
|
||||||
@@ -17,6 +17,19 @@
|
|||||||
ds.id desc
|
ds.id desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getDailyIncomeListByMonth"
|
||||||
|
resultType="app.module.front.usecase.daily.income.adapters.persistence.model.DailyIncomeDto">
|
||||||
|
select ds.id, ds.daily_record_seq, ds.input_type, ds.is_credit as credit
|
||||||
|
, ds.crop_code, ds.income_kind, ds.source_purpose
|
||||||
|
, ds.quantity, ds.unit_code, ds.unit_self, ds.price, ds.estimated_value
|
||||||
|
, dr.start_date, dr.end_date
|
||||||
|
from daily_income ds
|
||||||
|
<include refid="app.module.core.usecase.daily.record.adapters.persistence.DailyRecordMapper.InnerJoinByDailyRecordMonth"/>
|
||||||
|
where ds.is_deleted = false
|
||||||
|
order by
|
||||||
|
dr.id, ds.id
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getRecordExistCount" resultType="int">
|
<select id="getRecordExistCount" resultType="int">
|
||||||
select count(1)
|
select count(1)
|
||||||
from daily_income ds
|
from daily_income ds
|
||||||
|
|||||||
142
front/src/main/resources/mappers/daily/DailyStatusMapper.xml
Normal file
142
front/src/main/resources/mappers/daily/DailyStatusMapper.xml
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
|
<mapper namespace="app.module.front.usecase.daily.status.adapters.persistence.DailyStatusMapper">
|
||||||
|
|
||||||
|
<select id="getDailyStatusByMonth"
|
||||||
|
resultType="app.module.front.usecase.daily.status.adapters.persistence.model.DailyMonthStatusDto">
|
||||||
|
<![CDATA[
|
||||||
|
with day_gorup as (
|
||||||
|
select only_day.day, ddg.group_no
|
||||||
|
from (SELECT generate_series(1, 31) as day) as only_day
|
||||||
|
left join
|
||||||
|
daily_day_group ddg on ddg.start_day <= only_day."day" and ddg.end_day >= only_day."day" and ddg.is_deleted = false
|
||||||
|
where only_day.day <= DATE_PART('day', (date_trunc('MONTH', TO_DATE(#{recordMonth}, 'YYYYMM')) + INTERVAL '1 MONTH - 1 day'))
|
||||||
|
)
|
||||||
|
select count(dg.day) as day_count
|
||||||
|
, (count(dg.day) filter (where dr.all_status = 'DONE')) as done_count
|
||||||
|
from day_gorup dg
|
||||||
|
left join
|
||||||
|
daily_record dr on dr.day_group_no = dg.group_no and dr.record_month = to_char(TO_DATE(#{recordMonth}, 'YYYYMM'), 'YYYYMM') and dr.household_seq = #{householdSeq}
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getDailyStatusByItemCount"
|
||||||
|
resultType="app.module.front.usecase.daily.status.adapters.persistence.model.DailyItemStatusDto">
|
||||||
|
<![CDATA[
|
||||||
|
with day_gorup as (
|
||||||
|
select only_day.day, ddg.group_no, dr.id as daily_record_seq
|
||||||
|
, dr.all_status, dr.income_status, dr.work_status, dr.expense_status, dr.power_status, dr.forestry_status, dr.farming_status
|
||||||
|
from (SELECT generate_series(1, 31) as day) as only_day
|
||||||
|
left join
|
||||||
|
daily_day_group ddg on ddg.start_day <= only_day."day" and ddg.end_day >= only_day."day" and ddg.is_deleted = false
|
||||||
|
left join
|
||||||
|
daily_record dr on dr.record_month = #{recordMonth} and dr.household_seq = #{householdSeq} and dr.day_group_no = ddg.group_no and dr.is_deleted = false
|
||||||
|
where only_day.day <= DATE_PART('day', (date_trunc('MONTH', TO_DATE(#{recordMonth}, 'YYYYMM')) + INTERVAL '1 MONTH - 1 day'))
|
||||||
|
)
|
||||||
|
select 'INCOME' as step
|
||||||
|
, count(distinct dg.day) as day_count
|
||||||
|
, count(distinct dg.day) filter (where (dg.income_status = 'TARGET' and di.id is not null) or dg.income_status = 'TODAY_NONE') as done_count
|
||||||
|
, count(distinct di.id) as input_count
|
||||||
|
from day_gorup dg
|
||||||
|
left join
|
||||||
|
daily_income di on di.daily_record_seq = dg.daily_record_seq and di.is_deleted = false
|
||||||
|
union all
|
||||||
|
select 'EXPENSE' as step
|
||||||
|
, count(distinct dg.day) as day_count
|
||||||
|
, count(distinct dg.day) filter (where (dg.expense_status = 'TARGET' and de.id is not null) or dg.expense_status = 'TODAY_NONE') as done_count
|
||||||
|
, count(distinct de.id) as input_count
|
||||||
|
from day_gorup dg
|
||||||
|
left join
|
||||||
|
daily_expense de on de.daily_record_seq = dg.daily_record_seq and de.is_deleted = false
|
||||||
|
union all
|
||||||
|
select 'WORK' as step
|
||||||
|
, count(distinct dg.day) as day_count
|
||||||
|
, count(distinct dg.day) filter (where (dg.work_status = 'TARGET' and dw.id is not null) or dg.work_status = 'TODAY_NONE') as done_count
|
||||||
|
, count(distinct dw.id) as input_count
|
||||||
|
from day_gorup dg
|
||||||
|
left join
|
||||||
|
daily_work dw on dw.daily_record_seq = dg.daily_record_seq and dw.is_deleted = false
|
||||||
|
union all
|
||||||
|
select 'POWER' as step
|
||||||
|
, count(distinct dg.day) as day_count
|
||||||
|
, count(distinct dg.day) filter (where (dg.power_status = 'TARGET' and dp.id is not null) or dg.power_status = 'TODAY_NONE') as done_count
|
||||||
|
, count(distinct dp.id) as input_count
|
||||||
|
from day_gorup dg
|
||||||
|
left join
|
||||||
|
daily_power dp on dp.daily_record_seq = dg.daily_record_seq and dp.is_deleted = false
|
||||||
|
union all
|
||||||
|
select 'FORESTRY' as step
|
||||||
|
, count(distinct dg.day) as day_count
|
||||||
|
, count(distinct dg.day) filter (where (dg.forestry_status = 'TARGET' and df1.id is not null) or dg.forestry_status = 'TODAY_NONE') as done_count
|
||||||
|
, count(distinct df1.id) as input_count
|
||||||
|
from day_gorup dg
|
||||||
|
left join
|
||||||
|
daily_forestry df1 on df1.daily_record_seq = dg.daily_record_seq and df1.is_deleted = false
|
||||||
|
union all
|
||||||
|
select 'FARMING' as step
|
||||||
|
, count(distinct dg.day) as day_count
|
||||||
|
, count(distinct dg.day) filter (where (dg.farming_status = 'TARGET' and df2.id is not null) or dg.farming_status = 'TODAY_NONE') as done_count
|
||||||
|
, count(distinct df2.id) as input_count
|
||||||
|
from day_gorup dg
|
||||||
|
left join
|
||||||
|
daily_farming df2 on df2.daily_record_seq = dg.daily_record_seq and df2.is_deleted = false
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getDailyStatusByItemValue"
|
||||||
|
resultType="app.module.front.usecase.daily.status.adapters.persistence.model.DailyItemStatusDto">
|
||||||
|
<![CDATA[
|
||||||
|
with r_daily_record as (
|
||||||
|
select dr.id from daily_record dr where dr.record_month = #{recordMonth} and dr.household_seq = #{householdSeq} and dr.is_deleted = false
|
||||||
|
)
|
||||||
|
select 'INCOME' as step
|
||||||
|
, COALESCE(sum( COALESCE(di.price, 0) + COALESCE(di.estimated_value, 0) ), 0) as total_value
|
||||||
|
from daily_income di
|
||||||
|
inner join
|
||||||
|
r_daily_record dr on dr.id = di.daily_record_seq
|
||||||
|
where di.is_deleted = false
|
||||||
|
union all
|
||||||
|
select 'EXPENSE' as step
|
||||||
|
, COALESCE(sum( COALESCE(de.price, 0) + COALESCE(de.estimated_value, 0) ), 0) as total_value
|
||||||
|
from daily_expense de
|
||||||
|
inner join
|
||||||
|
r_daily_record dr on dr.id = de.daily_record_seq
|
||||||
|
where de.is_deleted = false
|
||||||
|
union all
|
||||||
|
select 'WORK' as step
|
||||||
|
, COALESCE(sum(
|
||||||
|
COALESCE(cast(dw.owner_time as numeric), 0) + COALESCE(cast(dw.spouse_time as numeric), 0)
|
||||||
|
+ COALESCE(cast(dw.family_f_hours as numeric), 0) + COALESCE(cast(dw.family_m_hours as numeric), 0)
|
||||||
|
+ COALESCE(cast(dw.hired_m_hours as numeric), 0) + COALESCE(cast(dw.hired_f_hours as numeric), 0)
|
||||||
|
+ COALESCE(cast(dw.shared_m_hours as numeric), 0) + COALESCE(cast(dw.shared_f_hours as numeric), 0)
|
||||||
|
+ COALESCE(cast(dw.volunteer_m_hours as numeric), 0) + COALESCE(cast(dw.volunteer_f_hours as numeric), 0)
|
||||||
|
), 0) as total_value
|
||||||
|
from daily_work dw
|
||||||
|
inner join
|
||||||
|
r_daily_record dr on dr.id = dw.daily_record_seq
|
||||||
|
where dw.is_deleted = false
|
||||||
|
union all
|
||||||
|
select 'POWER' as step
|
||||||
|
, COALESCE(sum( COALESCE(cast(dp.owned_hours as numeric), 0) + COALESCE(cast(dp.leased_hours as numeric), 0) ), 0) as total_value
|
||||||
|
from daily_power dp
|
||||||
|
inner join
|
||||||
|
r_daily_record dr on dr.id = dp.daily_record_seq
|
||||||
|
where dp.is_deleted = false
|
||||||
|
union all
|
||||||
|
select 'FORESTRY' as step
|
||||||
|
, COALESCE(sum( COALESCE(df1.estimated_value, 0) ), 0) as total_value
|
||||||
|
from daily_forestry df1
|
||||||
|
inner join
|
||||||
|
r_daily_record dr on dr.id = df1.daily_record_seq
|
||||||
|
where df1.is_deleted = false
|
||||||
|
union all
|
||||||
|
select 'FARMING' as step
|
||||||
|
, COALESCE(sum( COALESCE(df2.estimated_value, 0) ), 0) as total_value
|
||||||
|
from daily_farming df2
|
||||||
|
inner join
|
||||||
|
r_daily_record dr on dr.id = df2.daily_record_seq
|
||||||
|
where df2.is_deleted = false
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -5,10 +5,11 @@ uri.front.login=\uB85C\uADF8\uC778
|
|||||||
|
|
||||||
# \uC785\uB825\uD604\uD669
|
# \uC785\uB825\uD604\uD669
|
||||||
uri.front.status=\uC785\uB825\uD604\uD669
|
uri.front.status=\uC785\uB825\uD604\uD669
|
||||||
|
uri.front.status.path=/status/daily
|
||||||
|
|
||||||
# \uD1B5\uACC4
|
# \uC774\uC6A9\uC548\uB0B4
|
||||||
uri.front.statistics=\uD1B5\uACC4
|
uri.front.guide=\uC774\uC6A9\uC548\uB0B4
|
||||||
|
uri.front.guide.path=/guide
|
||||||
|
|
||||||
# \uB0B4\uC815\uBCF4
|
# \uB0B4\uC815\uBCF4
|
||||||
uri.front.info=\uB0B4 \uC815\uBCF4
|
uri.front.info=\uB0B4 \uC815\uBCF4
|
||||||
|
|||||||
@@ -171,10 +171,16 @@
|
|||||||
or #strings.containsIgnoreCase(currentURI?.uri, '/record/')} ? 'active'">
|
or #strings.containsIgnoreCase(currentURI?.uri, '/record/')} ? 'active'">
|
||||||
<a th:href="#{uri.front.record.calendar.path}">일계부</a>
|
<a th:href="#{uri.front.record.calendar.path}">일계부</a>
|
||||||
</li>
|
</li>
|
||||||
<!--/* TODO : 2차 오픈 s */-->
|
<li class="menu-regi"
|
||||||
<li class="menu-regi disabled"><a href="javascript:void(0)">입력현황</a></li>
|
th:classappend="${#strings.containsIgnoreCase(currentURI?.uri, '/status/')} ? 'active'">
|
||||||
<li class="menu-use disabled"><a href="javascript:void(0)">이용안내</a></li>
|
<a th:href="#{uri.front.status.path}">입력현황</a>
|
||||||
<!--/* TODO : 2차 오픈 e */-->
|
</li>
|
||||||
|
<!--/* TODO */-->
|
||||||
|
<li class="menu-use disabled"><a href="javascript:void(0);">이용안내</a></li>
|
||||||
|
<!--/*<li class="menu-use"
|
||||||
|
th:classappend="${#strings.containsIgnoreCase(currentURI?.uri, '/guide')} ? 'active'">
|
||||||
|
<a th:href="#{uri.front.guide.path}">이용안내</a>
|
||||||
|
</li>*/-->
|
||||||
<li class="menu-info"
|
<li class="menu-info"
|
||||||
th:classappend="${#strings.equals(currentURI?.uri, '/info')
|
th:classappend="${#strings.equals(currentURI?.uri, '/info')
|
||||||
or #strings.containsIgnoreCase(currentURI?.uri, '/info/')} ? 'active'">
|
or #strings.containsIgnoreCase(currentURI?.uri, '/info/')} ? 'active'">
|
||||||
|
|||||||
@@ -15,8 +15,10 @@
|
|||||||
<ul class="allmenu-list" th:if="${topNode != null}">
|
<ul class="allmenu-list" th:if="${topNode != null}">
|
||||||
<li th:each="menu : ${topNode.children}" th:if="${menu.showOnNavi}"
|
<li th:each="menu : ${topNode.children}" th:if="${menu.showOnNavi}"
|
||||||
th:with="accoClass=${#strings.containsIgnoreCase(menu.uri, '/record') ? 'acco': ''}
|
th:with="accoClass=${#strings.containsIgnoreCase(menu.uri, '/record') ? 'acco': ''}
|
||||||
, infoClass=${#strings.containsIgnoreCase(menu.uri, '/info') ? 'info': ''}"
|
, infoClass=${#strings.containsIgnoreCase(menu.uri, '/info') ? 'info': ''}
|
||||||
th:class="|${accoClass}${infoClass}|"
|
, statusClass=${#strings.containsIgnoreCase(menu.uri, '/status') ? 'regi': ''}
|
||||||
|
, guideClass=${#strings.containsIgnoreCase(menu.uri, '/guide') ? 'use': ''}"
|
||||||
|
th:class="|${accoClass}${infoClass}${statusClass}${guideClass}|"
|
||||||
th:classappend="${@coreUtil.containsCurrentURI(menuHierarchy, menu.id)}? 'active'">
|
th:classappend="${@coreUtil.containsCurrentURI(menuHierarchy, menu.id)}? 'active'">
|
||||||
<!--/* 자식 nodes 가 없는 경우 */-->
|
<!--/* 자식 nodes 가 없는 경우 */-->
|
||||||
<a th:classappend="${currentURI.id == menu.id}? 'active'"
|
<a th:classappend="${currentURI.id == menu.id}? 'active'"
|
||||||
|
|||||||
168
front/src/main/resources/templates/status/daily.html
Normal file
168
front/src/main/resources/templates/status/daily.html
Normal file
@@ -0,0 +1,168 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html layout:decorate="~{layout/layout}" 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">
|
||||||
|
<main id="content" role="main">
|
||||||
|
<section class="month-filter">
|
||||||
|
<div class="inner">
|
||||||
|
<div id="searchMonth" class="component-select bottom-sheet" data-props-type="bottomSheet">
|
||||||
|
<button type="button" class="select-box">
|
||||||
|
<span class="select-txt"></span>
|
||||||
|
</button>
|
||||||
|
<div class="select-options">
|
||||||
|
<div class="select-header">
|
||||||
|
<p>월 선택</p>
|
||||||
|
<button type="button" class="select-close">
|
||||||
|
<span class="hide-txt">닫기</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="select-scroll">
|
||||||
|
<ul class="">
|
||||||
|
<li class="option"
|
||||||
|
th:each="item, itemStatus : ${reqVO.monthList}"
|
||||||
|
th:classappend="${#strings.equals(reqVO.searchMonth, #temporals.format(item, 'yyyyMM'))} ? 'current'"
|
||||||
|
th:data-value="${#temporals.format(item, 'yyyyMM')}"
|
||||||
|
th:text="${#temporals.format(item, 'yyyy년 M월')}"></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<ul class="summary">
|
||||||
|
<li>
|
||||||
|
<span>작성일</span>
|
||||||
|
<p><strong>[[${detail.doneCount}]]</strong>일</p>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<span>미작성일</span>
|
||||||
|
<p><strong>[[${detail.dayCount - detail.doneCount}]]</strong>일</p>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<span>총 등록</span>
|
||||||
|
<p><strong>[[${#numbers.formatInteger(detail.totalInput, 1, 'COMMA')}]]</strong>건</p>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section class="month-detail bg-gray bg-lround"
|
||||||
|
th:unless="${#lists.isEmpty(detail.itemList)}">
|
||||||
|
<div class="inner">
|
||||||
|
<p class="tit">항목별 월간 현황</p>
|
||||||
|
<ul class="btn-column-list">
|
||||||
|
<th:block th:each="item, itemStatus : ${detail.itemList}">
|
||||||
|
<li th:classappend="${item.inputCount != 0} ? 'view'">
|
||||||
|
<th:block th:if="${item.inputCount != 0}">
|
||||||
|
<a href="javascript:void(0);" th:onclick="formControl.detailModal([[${#strings.toLowerCase(item.step.name)}]], [[${#strings.toLowerCase(item.step.desc2)}]])">
|
||||||
|
</th:block>
|
||||||
|
<p class="label">[[${item.step.desc2}]]</p>
|
||||||
|
<ul class="value">
|
||||||
|
<li>
|
||||||
|
<span>작성일</span>
|
||||||
|
<span>[[${item.doneCount}]]일</span>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<span>등록 건수</span>
|
||||||
|
<span>[[${item.inputCount}]]건</span>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="total"
|
||||||
|
th:if="${#strings.equals(item.step, T(app.module.core.config.application.enums.DailySort).WORK)}">
|
||||||
|
<span>총 투입 시간</span>
|
||||||
|
<span><strong>[[${@dailyUtil.getStringComma(item.totalValue)}]]</strong>시간</span>
|
||||||
|
</li>
|
||||||
|
<li class="total"
|
||||||
|
th:if="${#strings.equals(item.step, T(app.module.core.config.application.enums.DailySort).POWER)}">
|
||||||
|
<span>총 사용 시간</span>
|
||||||
|
<span><strong>[[${@dailyUtil.getStringComma(item.totalValue)}]]</strong>시간</span>
|
||||||
|
</li>
|
||||||
|
<li class="total"
|
||||||
|
th:unless="${#strings.equals(item.step, T(app.module.core.config.application.enums.DailySort).WORK)
|
||||||
|
or #strings.equals(item.step, T(app.module.core.config.application.enums.DailySort).POWER)}">
|
||||||
|
<span>총 금액</span>
|
||||||
|
<span><strong>[[${#numbers.formatInteger(item.totalValue, 1, 'COMMA')}]]</strong>원</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<th:block th:if="${item.inputCount != 0}">
|
||||||
|
</a >
|
||||||
|
</th:block>
|
||||||
|
</li>
|
||||||
|
</th:block>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<!-- 모달 팝업 -->
|
||||||
|
<div class="layer-wrap">
|
||||||
|
<div class="component-modal regi-wrap detailModal" data-props-dimm-click="true">
|
||||||
|
<div class="modal-dimm"></div>
|
||||||
|
<div class="modal-frame">
|
||||||
|
<div class="modal-container">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h3 class="modal-tit"></h3>
|
||||||
|
</div>
|
||||||
|
<div class="modal-content">
|
||||||
|
<!--/* detail */-->
|
||||||
|
</div>
|
||||||
|
<button type="button" class="modal-close"></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- //모달 팝업 -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<section layout:fragment="script">
|
||||||
|
<script th:inline="javascript">
|
||||||
|
let ENV = {
|
||||||
|
httpUrl: {
|
||||||
|
root: /*[[${currentURI?.uri}]]*/'',
|
||||||
|
detail: /*[[|${currentURI?.uri}/{step}/{month}|]]*/'',
|
||||||
|
},
|
||||||
|
modal: {
|
||||||
|
// 등록 영역
|
||||||
|
selector: '.detailModal',
|
||||||
|
},
|
||||||
|
month: /*[[${reqVO.searchMonth}]]*/'month',
|
||||||
|
submitted: false,
|
||||||
|
};
|
||||||
|
|
||||||
|
let formControl = {
|
||||||
|
init() {
|
||||||
|
this._bindUI();
|
||||||
|
},
|
||||||
|
_bindUI() {
|
||||||
|
console.log('_bindUI()')
|
||||||
|
const $select1 = document.querySelector('#searchMonth');
|
||||||
|
const selectboxInstance1 = $select1.ui;
|
||||||
|
selectboxInstance1.core.init($select1, {
|
||||||
|
selectItemCallback({selectValue, dataValue}){
|
||||||
|
location.href = ENV.httpUrl.root + '?searchMonth=' + dataValue;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
detailModal(step, desc) {
|
||||||
|
ajaxUtil._ajaxAsyncMethod(
|
||||||
|
ENV.httpUrl.detail.replace('{step}', step).replace('{month}', ENV.month),
|
||||||
|
{},
|
||||||
|
function(rstHtml, status) {
|
||||||
|
$(ENV.modal.selector).find('.modal-tit').html(desc + ' 내역');
|
||||||
|
$(ENV.modal.selector).find('.modal-content').html(rstHtml);
|
||||||
|
|
||||||
|
const modal01 = document.querySelector(ENV.modal.selector).ui;
|
||||||
|
modal01.open();
|
||||||
|
},
|
||||||
|
function(code, rstData) {
|
||||||
|
kri.logger.error('Do nothing. code: '+ code, rstData);
|
||||||
|
},
|
||||||
|
'get',
|
||||||
|
'html'
|
||||||
|
);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
<!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.incomeKind}]]</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.cropLabel)}">
|
||||||
|
<p>재배형태</p>
|
||||||
|
<span th:text="${item.cropLabel}">재배형태</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>
|
||||||
|
</th:block>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user