일단 front 내정보쪽 core->front로 이관,, 하나로 합칠지는 조금 생각해보고 정리하겠음
This commit is contained in:
@@ -3,9 +3,9 @@ package app.module.front.usecase.info;
|
||||
import app.module.core.config.application.util.CommonUtil;
|
||||
import app.module.core.usecase.household.getHousehold.ports.GetHouseholdPortIn;
|
||||
import app.module.core.usecase.household.getHousehold.ports.application.domain.GetHouseholdCmd;
|
||||
import app.module.core.usecase.notice.getNotices.ports.GetNoticesPortIn;
|
||||
import app.module.core.usecase.notice.getNotices.ports.application.domain.GetNotices;
|
||||
import app.module.core.usecase.notice.getNotices.ports.application.domain.GetNoticesCmd;
|
||||
import app.module.front.usecase.info.notice.getNotices.ports.GetNoticesPortIn;
|
||||
import app.module.front.usecase.info.notice.getNotices.ports.application.domain.GetNotices;
|
||||
import app.module.front.usecase.info.notice.getNotices.ports.application.domain.GetNoticesCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package app.module.front.usecase.info.bank.getBanksUI.adapters.web;
|
||||
package app.module.front.usecase.info.bankUI.getBanksUI.adapters.web;
|
||||
|
||||
import app.module.core.config.application.util.CommonUtil;
|
||||
import app.module.core.usecase.household.getHousehold.ports.GetHouseholdPortIn;
|
||||
@@ -0,0 +1,28 @@
|
||||
package app.module.front.usecase.info.monthly.getMonthlyInputStatus.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.GetMonthlyInputStatusPortOut;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.application.domain.GetMonthlyInputStatus;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.application.domain.GetMonthlyInputStatusCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class GetMonthlyInputStatusDao implements GetMonthlyInputStatusPortOut {
|
||||
|
||||
private final GetMonthlyInputStatusMapper mapper;
|
||||
|
||||
@Override
|
||||
public Optional<GetMonthlyInputStatus> operate(GetMonthlyInputStatusCmd command) {
|
||||
GetMonthlyInputStatus secArticle = mapper.getMonthlyInputStatus(command);
|
||||
|
||||
|
||||
|
||||
return Optional.of(secArticle);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.module.front.usecase.info.monthly.getMonthlyInputStatus.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.application.domain.GetMonthlyInputStatus;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.application.domain.GetMonthlyInputStatusCmd;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface GetMonthlyInputStatusMapper {
|
||||
|
||||
GetMonthlyInputStatus getMonthlyInputStatus(GetMonthlyInputStatusCmd command);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports;
|
||||
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.application.domain.GetMonthlyInputStatus;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.application.domain.GetMonthlyInputStatusCmd;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public interface GetMonthlyInputStatusPortIn {
|
||||
|
||||
Optional<GetMonthlyInputStatus> operate(GetMonthlyInputStatusCmd command);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports;
|
||||
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.application.domain.GetMonthlyInputStatus;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.application.domain.GetMonthlyInputStatusCmd;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public interface GetMonthlyInputStatusPortOut {
|
||||
|
||||
Optional<GetMonthlyInputStatus> operate(GetMonthlyInputStatusCmd command);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.application;
|
||||
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.GetMonthlyInputStatusPortIn;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.GetMonthlyInputStatusPortOut;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.application.domain.GetMonthlyInputStatus;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.application.domain.GetMonthlyInputStatusCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class GetMonthlyInputStatusService implements GetMonthlyInputStatusPortIn {
|
||||
|
||||
private final GetMonthlyInputStatusPortOut portOut;
|
||||
|
||||
@Override
|
||||
public Optional<GetMonthlyInputStatus> operate(GetMonthlyInputStatusCmd command) {
|
||||
return portOut.operate(command);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.application.domain;
|
||||
|
||||
import app.module.core.config.application.enums.MonthStatus;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetMonthlyInputStatus {
|
||||
private Long id;
|
||||
private Long householdSeq;
|
||||
private String month;
|
||||
private MonthStatus forestProductStatus;
|
||||
private MonthStatus bankAutoTransferInputStatus;
|
||||
private MonthStatus bankAutoTransferOutputStatus;
|
||||
|
||||
private LocalDateTime createdAt;
|
||||
private String createdBy;
|
||||
private LocalDateTime updatedAt;
|
||||
private String updatedBy;
|
||||
|
||||
public String getKoreanMonth() {
|
||||
if (month != null && month.contains("-")) {
|
||||
String[] parts = month.split("-");
|
||||
return parts[0] + "년 " + Integer.parseInt(parts[1]) + "월";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetMonthlyInputStatusCmd {
|
||||
private Long id;
|
||||
private Long householdSeq;
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package app.module.front.usecase.info.monthly.getMonthlyInputStatuss.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.adapters.persistence.model.GetMonthlyInputStatussDto;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.GetMonthlyInputStatussPortOut;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatuss;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatussCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class GetMonthlyInputStatussDao implements GetMonthlyInputStatussPortOut {
|
||||
|
||||
private final GetMonthlyInputStatussMapper mapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Page<GetMonthlyInputStatuss> operate(Pageable pageable, GetMonthlyInputStatussCmd command) {
|
||||
// 게시물 목록 얻기
|
||||
List<GetMonthlyInputStatussDto> contents =
|
||||
ListUtils.emptyIfNull(mapper.getMonthlyInputStatuss(pageable, command));
|
||||
|
||||
return new PageImpl<>(
|
||||
contents.stream()
|
||||
.map(
|
||||
article ->
|
||||
new GetMonthlyInputStatuss(
|
||||
article.getId(),
|
||||
article.getHouseholdSeq(),
|
||||
article.getMonth(),
|
||||
article.getForestProductStatus(),
|
||||
article.getBankAutoTransferInputStatus(),
|
||||
article.getBankAutoTransferOutputStatus(),
|
||||
article.getCreatedAt(),
|
||||
article.getCreatedBy(),
|
||||
article.getUpdatedAt(),
|
||||
article.getUpdatedBy()
|
||||
))
|
||||
.collect(Collectors.toList()),
|
||||
pageable,
|
||||
contents.isEmpty() ? 0 : contents.get(0).getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public List<GetMonthlyInputStatuss> operateList(GetMonthlyInputStatussCmd command) {
|
||||
/*// 검색조건 초기화
|
||||
Specification<Article> spec = (root, query, criteriaBuilder) -> null;
|
||||
|
||||
// 검색어 - like 검색
|
||||
if (!StringUtils.isEmpty(command.getSearchField())) {
|
||||
spec =
|
||||
spec.and(
|
||||
(root, query, builder) ->
|
||||
builder.like(
|
||||
root.get(command.getSearchField()),
|
||||
"%" + command.getSearchValue() + "%"));
|
||||
}
|
||||
|
||||
// 공개여부 검색
|
||||
if (!StringUtils.isEmpty(command.getSearchOpen())) {
|
||||
spec =
|
||||
spec.and(
|
||||
((root, query, criteriaBuilder) ->
|
||||
criteriaBuilder.equal(
|
||||
root.get("visible"), Boolean.valueOf(command.getSearchOpen()))));
|
||||
}
|
||||
|
||||
List<Article> result = getArticlesRepo.findAll(spec);
|
||||
|
||||
return result.stream()
|
||||
.map(
|
||||
article ->
|
||||
new GetArticles(
|
||||
article.getId(),
|
||||
article.getUpdatedBy(),
|
||||
article.getUpdatedAt(),
|
||||
article.getTitle(),
|
||||
article.getContent(),
|
||||
article.getVisible(),
|
||||
article.getStartDate(),
|
||||
article.getEndDate(),
|
||||
article.getOrderNo(),
|
||||
article.getUploadFiles().stream()
|
||||
// 목록에 보여줄 대표이미지만 담는다
|
||||
.filter(
|
||||
uploadFile -> uploadFile.getType()
|
||||
.equals(FileUploadType.EXAMPLE_REP))
|
||||
.map(
|
||||
uploadFile ->
|
||||
new GetArticleFiles(
|
||||
uploadFile.getId(),
|
||||
uploadFile.getType(),
|
||||
uploadFile.getPath(),
|
||||
uploadFile.getName(),
|
||||
uploadFile.getOriginName(),
|
||||
uploadFile.getFileLength()))
|
||||
.findFirst()
|
||||
.orElse(null)))
|
||||
.collect(Collectors.toList());*/
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package app.module.front.usecase.info.monthly.getMonthlyInputStatuss.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.adapters.persistence.model.GetMonthlyInputStatussDto;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatussCmd;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface GetMonthlyInputStatussMapper {
|
||||
List<GetMonthlyInputStatussDto> getMonthlyInputStatuss(
|
||||
@Param("pageable") Pageable pageable, @Param("cmd") GetMonthlyInputStatussCmd cmd);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package app.module.front.usecase.info.monthly.getMonthlyInputStatuss.adapters.persistence.model;
|
||||
|
||||
import app.module.core.config.application.enums.MonthStatus;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class GetMonthlyInputStatussDto {
|
||||
|
||||
private Long id;
|
||||
private Long householdSeq;
|
||||
private String month;
|
||||
private MonthStatus forestProductStatus;
|
||||
private MonthStatus bankAutoTransferInputStatus;
|
||||
private MonthStatus bankAutoTransferOutputStatus;
|
||||
|
||||
private LocalDateTime createdAt;
|
||||
private String createdBy;
|
||||
private LocalDateTime updatedAt;
|
||||
private String updatedBy;
|
||||
|
||||
private Long total;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports;
|
||||
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatuss;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatussCmd;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface GetMonthlyInputStatussPortIn {
|
||||
|
||||
Page<GetMonthlyInputStatuss> operate(Pageable pageable, GetMonthlyInputStatussCmd command);
|
||||
|
||||
List<GetMonthlyInputStatuss> operateList(GetMonthlyInputStatussCmd command);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports;
|
||||
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatuss;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatussCmd;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface GetMonthlyInputStatussPortOut {
|
||||
|
||||
Page<GetMonthlyInputStatuss> operate(Pageable pageable, GetMonthlyInputStatussCmd command);
|
||||
|
||||
List<GetMonthlyInputStatuss> operateList(GetMonthlyInputStatussCmd command);
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.application;
|
||||
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.GetMonthlyInputStatussPortIn;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.GetMonthlyInputStatussPortOut;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatuss;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatussCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class GetMonthlyInputStatussService implements GetMonthlyInputStatussPortIn {
|
||||
|
||||
private final GetMonthlyInputStatussPortOut portOut;
|
||||
|
||||
@Override
|
||||
public Page<GetMonthlyInputStatuss> operate(Pageable pageable, GetMonthlyInputStatussCmd command) {
|
||||
return portOut.operate(pageable, command);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GetMonthlyInputStatuss> operateList(GetMonthlyInputStatussCmd command) {
|
||||
return portOut.operateList(command);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.application.domain;
|
||||
|
||||
import app.module.core.config.application.enums.MonthStatus;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetMonthlyInputStatuss {
|
||||
|
||||
private Long id;
|
||||
private Long householdSeq;
|
||||
private String month;
|
||||
private MonthStatus forestProductStatus;
|
||||
private MonthStatus bankAutoTransferInputStatus;
|
||||
private MonthStatus bankAutoTransferOutputStatus;
|
||||
|
||||
private LocalDateTime createdAt;
|
||||
private String createdBy;
|
||||
private LocalDateTime updatedAt;
|
||||
private String updatedBy;
|
||||
|
||||
public String getKoreanMonth() {
|
||||
if (month != null && month.contains("-")) {
|
||||
String[] parts = month.split("-");
|
||||
return parts[0] + "년 " + Integer.parseInt(parts[1]) + "월";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetMonthlyInputStatussCmd {
|
||||
|
||||
private String searchField;
|
||||
private String searchValue;
|
||||
private Long householdSeq;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package app.module.front.usecase.info.monthly.getPrevMonthlyInputStatus.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.info.monthly.getPrevMonthlyInputStatus.ports.GetPrevMonthlyInputStatusPortOut;
|
||||
import app.module.front.usecase.info.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatus;
|
||||
import app.module.front.usecase.info.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatusCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class GetPrevMonthlyInputStatusDao implements GetPrevMonthlyInputStatusPortOut {
|
||||
|
||||
private final GetPrevMonthlyInputStatusMapper mapper;
|
||||
|
||||
@Override
|
||||
public Optional<GetPrevMonthlyInputStatus> operate(GetPrevMonthlyInputStatusCmd command) {
|
||||
GetPrevMonthlyInputStatus secArticle = mapper.getPrevMonthlyInputStatus(command);
|
||||
|
||||
|
||||
|
||||
return Optional.ofNullable(secArticle);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.module.front.usecase.info.monthly.getPrevMonthlyInputStatus.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.info.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatus;
|
||||
import app.module.front.usecase.info.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatusCmd;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface GetPrevMonthlyInputStatusMapper {
|
||||
|
||||
GetPrevMonthlyInputStatus getPrevMonthlyInputStatus(GetPrevMonthlyInputStatusCmd command);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package app.module.front.usecase.info.monthly.getPrevMonthlyInputStatus.ports;
|
||||
|
||||
import app.module.front.usecase.info.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatus;
|
||||
import app.module.front.usecase.info.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatusCmd;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public interface GetPrevMonthlyInputStatusPortIn {
|
||||
|
||||
Optional<GetPrevMonthlyInputStatus> operate(GetPrevMonthlyInputStatusCmd command);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package app.module.front.usecase.info.monthly.getPrevMonthlyInputStatus.ports;
|
||||
|
||||
import app.module.front.usecase.info.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatus;
|
||||
import app.module.front.usecase.info.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatusCmd;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public interface GetPrevMonthlyInputStatusPortOut {
|
||||
|
||||
Optional<GetPrevMonthlyInputStatus> operate(GetPrevMonthlyInputStatusCmd command);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package app.module.front.usecase.info.monthly.getPrevMonthlyInputStatus.ports.application;
|
||||
|
||||
import app.module.front.usecase.info.monthly.getPrevMonthlyInputStatus.ports.GetPrevMonthlyInputStatusPortIn;
|
||||
import app.module.front.usecase.info.monthly.getPrevMonthlyInputStatus.ports.GetPrevMonthlyInputStatusPortOut;
|
||||
import app.module.front.usecase.info.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatus;
|
||||
import app.module.front.usecase.info.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatusCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class GetPrevMonthlyInputStatusService implements GetPrevMonthlyInputStatusPortIn {
|
||||
|
||||
private final GetPrevMonthlyInputStatusPortOut portOut;
|
||||
|
||||
@Override
|
||||
public Optional<GetPrevMonthlyInputStatus> operate(GetPrevMonthlyInputStatusCmd command) {
|
||||
return portOut.operate(command);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package app.module.front.usecase.info.monthly.getPrevMonthlyInputStatus.ports.application.domain;
|
||||
|
||||
import app.module.core.config.application.enums.MonthStatus;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetPrevMonthlyInputStatus {
|
||||
private Long id;
|
||||
private Long householdSeq;
|
||||
private String month;
|
||||
private MonthStatus forestProductStatus;
|
||||
private MonthStatus bankAutoTransferInputStatus;
|
||||
private MonthStatus bankAutoTransferOutputStatus;
|
||||
|
||||
private LocalDateTime createdAt;
|
||||
private String createdBy;
|
||||
private LocalDateTime updatedAt;
|
||||
private String updatedBy;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package app.module.front.usecase.info.monthly.getPrevMonthlyInputStatus.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetPrevMonthlyInputStatusCmd {
|
||||
private Long id;
|
||||
private Long householdSeq;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package app.module.front.usecase.info.monthly.updateMonthlyInputStatus.adapters.persistence;
|
||||
|
||||
import app.module.core.config.application.util.CommonUtil;
|
||||
import app.module.front.usecase.info.monthly.updateMonthlyInputStatus.adapters.persistence.model.UpdateMonthlyInputStatusDto;
|
||||
import app.module.front.usecase.info.monthly.updateMonthlyInputStatus.ports.UpdateMonthlyInputStatusPortOut;
|
||||
import app.module.front.usecase.info.monthly.updateMonthlyInputStatus.ports.application.domain.UpdateMonthlyInputStatusCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class UpdateMonthlyInputStatusDao implements UpdateMonthlyInputStatusPortOut {
|
||||
|
||||
private final UpdateMonthlyInputStatusMapper mapper;
|
||||
|
||||
@Override
|
||||
public void operate(UpdateMonthlyInputStatusCmd command) {
|
||||
mapper.updateMonthlyInputStatus(
|
||||
new UpdateMonthlyInputStatusDto(
|
||||
command.getId(),
|
||||
command.getHouseholdSeq(),
|
||||
command.getMonth(),
|
||||
command.getForestProductStatus(),
|
||||
command.getBankAutoTransferInputStatus(),
|
||||
command.getBankAutoTransferOutputStatus(),
|
||||
LocalDateTime.now(),
|
||||
CommonUtil.getLoginUsername()
|
||||
));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.module.front.usecase.info.monthly.updateMonthlyInputStatus.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.info.monthly.updateMonthlyInputStatus.adapters.persistence.model.UpdateMonthlyInputStatusDto;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface UpdateMonthlyInputStatusMapper {
|
||||
void updateMonthlyInputStatus(UpdateMonthlyInputStatusDto dto);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package app.module.front.usecase.info.monthly.updateMonthlyInputStatus.adapters.persistence.model;
|
||||
|
||||
import app.module.core.config.application.enums.MonthStatus;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UpdateMonthlyInputStatusDto {
|
||||
|
||||
private Long id;
|
||||
private Long householdSeq;
|
||||
private String month;
|
||||
private MonthStatus forestProductStatus;
|
||||
private MonthStatus bankAutoTransferInputStatus;
|
||||
private MonthStatus bankAutoTransferOutputStatus;
|
||||
|
||||
private LocalDateTime updatedAt;
|
||||
private String updatedBy;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package app.module.front.usecase.info.monthly.updateMonthlyInputStatus.ports;
|
||||
|
||||
import app.module.front.usecase.info.monthly.updateMonthlyInputStatus.ports.application.domain.UpdateMonthlyInputStatusCmd;
|
||||
|
||||
public interface UpdateMonthlyInputStatusPortIn {
|
||||
|
||||
void operate(UpdateMonthlyInputStatusCmd command);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package app.module.front.usecase.info.monthly.updateMonthlyInputStatus.ports;
|
||||
|
||||
import app.module.front.usecase.info.monthly.updateMonthlyInputStatus.ports.application.domain.UpdateMonthlyInputStatusCmd;
|
||||
|
||||
public interface UpdateMonthlyInputStatusPortOut {
|
||||
|
||||
void operate(UpdateMonthlyInputStatusCmd command);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package app.module.front.usecase.info.monthly.updateMonthlyInputStatus.ports.application;
|
||||
|
||||
import app.module.front.usecase.info.monthly.updateMonthlyInputStatus.ports.UpdateMonthlyInputStatusPortIn;
|
||||
import app.module.front.usecase.info.monthly.updateMonthlyInputStatus.ports.UpdateMonthlyInputStatusPortOut;
|
||||
import app.module.front.usecase.info.monthly.updateMonthlyInputStatus.ports.application.domain.UpdateMonthlyInputStatusCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class UpdateMonthlyInputStatusService implements UpdateMonthlyInputStatusPortIn {
|
||||
|
||||
private final UpdateMonthlyInputStatusPortOut portOut;
|
||||
|
||||
@Override
|
||||
public void operate(UpdateMonthlyInputStatusCmd command) {
|
||||
portOut.operate(command);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package app.module.front.usecase.info.monthly.updateMonthlyInputStatus.ports.application.domain;
|
||||
|
||||
import app.module.core.config.application.enums.MonthStatus;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class UpdateMonthlyInputStatusCmd {
|
||||
|
||||
private Long id;
|
||||
private Long householdSeq;
|
||||
private String month;
|
||||
private MonthStatus forestProductStatus;
|
||||
private MonthStatus bankAutoTransferInputStatus;
|
||||
private MonthStatus bankAutoTransferOutputStatus;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.createForestProduct.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.createForestProduct.adapters.persistence.model.CreateForestProductDto;
|
||||
import app.module.front.usecase.info.monthlyProduct.createForestProduct.ports.CreateForestProductPortOut;
|
||||
import app.module.front.usecase.info.monthlyProduct.createForestProduct.ports.application.domain.CreateForestProduct;
|
||||
import app.module.front.usecase.info.monthlyProduct.createForestProduct.ports.application.domain.CreateForestProductCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class CreateForestProductDao implements CreateForestProductPortOut {
|
||||
|
||||
private final CreateForestProductMapper mapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Optional<CreateForestProduct> operate(CreateForestProductCmd cmd) {
|
||||
|
||||
|
||||
CreateForestProductDto dto =
|
||||
new CreateForestProductDto(
|
||||
null,
|
||||
cmd.getHouseholdSeq(),
|
||||
cmd.getStreetNum(),
|
||||
cmd.getLandType(),
|
||||
cmd.getTown(),
|
||||
cmd.getAvailableArea(),
|
||||
cmd.getCropName(),
|
||||
cmd.getCropCode(),
|
||||
cmd.getLandArea(),
|
||||
cmd.getMonth(),
|
||||
cmd.getMainYield(),
|
||||
cmd.getMainYieldUnitCode(),
|
||||
cmd.getMainSaleAmount(),
|
||||
cmd.getMainSaleUnitCode(),
|
||||
cmd.getSubYield(),
|
||||
cmd.getSubYieldUnitCode(),
|
||||
cmd.getSubSaleAmount(),
|
||||
cmd.getSubSaleUnitCode(),
|
||||
cmd.getMonthlyInputStatusId(),
|
||||
cmd.getCreatedAt(),
|
||||
cmd.getCreatedBy(),
|
||||
cmd.getUpdatedAt(),
|
||||
cmd.getUpdatedBy()
|
||||
);
|
||||
|
||||
mapper.createForestProduct(dto);
|
||||
|
||||
|
||||
return Optional.of(new CreateForestProduct(dto.getId()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.createForestProduct.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.createForestProduct.adapters.persistence.model.CreateForestProductDto;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface CreateForestProductMapper {
|
||||
void createForestProduct(CreateForestProductDto dto);
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.createForestProduct.adapters.persistence.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CreateForestProductDto {
|
||||
|
||||
private Long id;
|
||||
private Long householdSeq;
|
||||
|
||||
private String streetNum;
|
||||
private String landType;
|
||||
private String town;
|
||||
|
||||
private Integer availableArea;
|
||||
private String cropName;
|
||||
private String cropCode;
|
||||
private Integer landArea;
|
||||
|
||||
private String month;
|
||||
|
||||
private BigDecimal mainYield;
|
||||
private String mainYieldUnitCode;
|
||||
private BigDecimal mainSaleAmount;
|
||||
private String mainSaleUnitCode;
|
||||
|
||||
private BigDecimal subYield;
|
||||
private String subYieldUnitCode;
|
||||
private BigDecimal subSaleAmount;
|
||||
private String subSaleUnitCode;
|
||||
private Long monthlyInputStatusId;
|
||||
|
||||
|
||||
private LocalDateTime createdAt;
|
||||
private String createdBy;
|
||||
private LocalDateTime updatedAt;
|
||||
private String updatedBy;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.createForestProduct.ports;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.createForestProduct.ports.application.domain.CreateForestProduct;
|
||||
import app.module.front.usecase.info.monthlyProduct.createForestProduct.ports.application.domain.CreateForestProductCmd;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public interface CreateForestProductPortIn {
|
||||
|
||||
Optional<CreateForestProduct> operate(CreateForestProductCmd command);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.createForestProduct.ports;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.createForestProduct.ports.application.domain.CreateForestProduct;
|
||||
import app.module.front.usecase.info.monthlyProduct.createForestProduct.ports.application.domain.CreateForestProductCmd;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public interface CreateForestProductPortOut {
|
||||
|
||||
Optional<CreateForestProduct> operate(CreateForestProductCmd command);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.createForestProduct.ports.application;
|
||||
|
||||
import app.module.core.config.application.annotation.CreateCommand;
|
||||
import app.module.front.usecase.info.monthlyProduct.createForestProduct.ports.CreateForestProductPortIn;
|
||||
import app.module.front.usecase.info.monthlyProduct.createForestProduct.ports.CreateForestProductPortOut;
|
||||
import app.module.front.usecase.info.monthlyProduct.createForestProduct.ports.application.domain.CreateForestProduct;
|
||||
import app.module.front.usecase.info.monthlyProduct.createForestProduct.ports.application.domain.CreateForestProductCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class CreateForestProductService implements CreateForestProductPortIn {
|
||||
|
||||
private final CreateForestProductPortOut portOut;
|
||||
|
||||
@Override
|
||||
@CreateCommand
|
||||
public Optional<CreateForestProduct> operate(CreateForestProductCmd command) {
|
||||
return portOut.operate(command);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.createForestProduct.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class CreateForestProduct {
|
||||
private Long id;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.createForestProduct.ports.application.domain;
|
||||
|
||||
import app.module.core.config.adapters.persistence.component.AuditCommand;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class CreateForestProductCmd extends AuditCommand {
|
||||
private Long householdSeq;
|
||||
|
||||
private String streetNum;
|
||||
private String landType;
|
||||
private String town;
|
||||
|
||||
private Integer availableArea;
|
||||
private String cropName;
|
||||
private String cropCode;
|
||||
private Integer landArea;
|
||||
|
||||
private String month;
|
||||
|
||||
private BigDecimal mainYield;
|
||||
private String mainYieldUnitCode;
|
||||
private BigDecimal mainSaleAmount;
|
||||
private String mainSaleUnitCode;
|
||||
|
||||
private BigDecimal subYield;
|
||||
private String subYieldUnitCode;
|
||||
private BigDecimal subSaleAmount;
|
||||
private String subSaleUnitCode;
|
||||
|
||||
private Long monthlyInputStatusId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.getForestProduct.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProduct.ports.GetForestProductPortOut;
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProduct.ports.application.domain.GetForestProduct;
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProduct.ports.application.domain.GetForestProductCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class GetForestProductDao implements GetForestProductPortOut {
|
||||
|
||||
private final GetForestProductMapper mapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Optional<GetForestProduct> operate(GetForestProductCmd command) {
|
||||
GetForestProduct secArticle = mapper.getForestProduct(command);
|
||||
|
||||
|
||||
|
||||
return Optional.of(secArticle);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.getForestProduct.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProduct.ports.application.domain.GetForestProduct;
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProduct.ports.application.domain.GetForestProductCmd;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface GetForestProductMapper {
|
||||
|
||||
GetForestProduct getForestProduct(GetForestProductCmd command);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.getForestProduct.ports;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProduct.ports.application.domain.GetForestProduct;
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProduct.ports.application.domain.GetForestProductCmd;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public interface GetForestProductPortIn {
|
||||
|
||||
Optional<GetForestProduct> operate(GetForestProductCmd command);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.getForestProduct.ports;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProduct.ports.application.domain.GetForestProduct;
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProduct.ports.application.domain.GetForestProductCmd;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public interface GetForestProductPortOut {
|
||||
|
||||
Optional<GetForestProduct> operate(GetForestProductCmd command);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.getForestProduct.ports.application;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProduct.ports.GetForestProductPortIn;
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProduct.ports.GetForestProductPortOut;
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProduct.ports.application.domain.GetForestProduct;
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProduct.ports.application.domain.GetForestProductCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class GetForestProductService implements GetForestProductPortIn {
|
||||
|
||||
private final GetForestProductPortOut portOut;
|
||||
|
||||
@Override
|
||||
public Optional<GetForestProduct> operate(GetForestProductCmd command) {
|
||||
return portOut.operate(command);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.getForestProduct.ports.application.domain;
|
||||
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetForestProduct {
|
||||
private Long id;
|
||||
private Long householdSeq;
|
||||
|
||||
private String streetNum;
|
||||
private String landType;
|
||||
private String town;
|
||||
|
||||
private Integer availableArea;
|
||||
private String cropName;
|
||||
private String cropCode;
|
||||
private Integer landArea;
|
||||
|
||||
private String month;
|
||||
|
||||
private BigDecimal mainYield;
|
||||
private String mainYieldUnitCode;
|
||||
private BigDecimal mainSaleAmount;
|
||||
private String mainSaleUnitCode;
|
||||
|
||||
private BigDecimal subYield;
|
||||
private String subYieldUnitCode;
|
||||
private BigDecimal subSaleAmount;
|
||||
private String subSaleUnitCode;
|
||||
|
||||
private Long monthlyInputStatusId;
|
||||
|
||||
private LocalDateTime createdAt;
|
||||
private String createdBy;
|
||||
private LocalDateTime updatedAt;
|
||||
private String updatedBy;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.getForestProduct.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetForestProductCmd {
|
||||
private Long id;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.getForestProducts.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProducts.adapters.persistence.model.GetForestProductsDto;
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProducts.ports.GetForestProductsPortOut;
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProducts.ports.application.domain.GetForestProducts;
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProducts.ports.application.domain.GetForestProductsCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class GetForestProductsDao implements GetForestProductsPortOut {
|
||||
|
||||
private final GetForestProductsMapper mapper;
|
||||
|
||||
@Override
|
||||
public Page<GetForestProducts> operate(Pageable pageable, GetForestProductsCmd command) {
|
||||
// 게시물 목록 얻기
|
||||
List<GetForestProductsDto> contents =
|
||||
ListUtils.emptyIfNull(mapper.getForestProducts(pageable, command));
|
||||
|
||||
return new PageImpl<>(
|
||||
contents.stream()
|
||||
.map(
|
||||
article ->
|
||||
new GetForestProducts(
|
||||
article.getId(),
|
||||
article.getHouseholdSeq(),
|
||||
article.getStreetNum(),
|
||||
article.getLandType(),
|
||||
article.getTown(),
|
||||
article.getAvailableArea(),
|
||||
article.getCropName(),
|
||||
article.getCropCode(),
|
||||
article.getLandArea(),
|
||||
article.getMonth(),
|
||||
article.getMainYield(),
|
||||
article.getMainYieldUnitCode(),
|
||||
article.getMainSaleAmount(),
|
||||
article.getMainSaleUnitCode(),
|
||||
article.getSubYield(),
|
||||
article.getSubYieldUnitCode(),
|
||||
article.getSubSaleAmount(),
|
||||
article.getSubSaleUnitCode(),
|
||||
article.getMonthlyInputStatusId(),
|
||||
article.getCreatedAt(),
|
||||
article.getCreatedBy(),
|
||||
article.getUpdatedAt(),
|
||||
article.getUpdatedBy()))
|
||||
.collect(Collectors.toList()),
|
||||
pageable,
|
||||
contents.isEmpty() ? 0 : contents.get(0).getTotal());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.getForestProducts.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProducts.adapters.persistence.model.GetForestProductsDto;
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProducts.ports.application.domain.GetForestProductsCmd;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface GetForestProductsMapper {
|
||||
List<GetForestProductsDto> getForestProducts(
|
||||
@Param("pageable") Pageable pageable, @Param("cmd") GetForestProductsCmd cmd);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.getForestProducts.adapters.persistence.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class GetForestProductsDto {
|
||||
|
||||
private Long id;
|
||||
private Long householdSeq;
|
||||
|
||||
private String streetNum;
|
||||
private String landType;
|
||||
private String town;
|
||||
|
||||
private Integer availableArea;
|
||||
private String cropName;
|
||||
private String cropCode;
|
||||
private Integer landArea;
|
||||
|
||||
private String month;
|
||||
|
||||
private BigDecimal mainYield;
|
||||
private String mainYieldUnitCode;
|
||||
private BigDecimal mainSaleAmount;
|
||||
private String mainSaleUnitCode;
|
||||
|
||||
private BigDecimal subYield;
|
||||
private String subYieldUnitCode;
|
||||
private BigDecimal subSaleAmount;
|
||||
private String subSaleUnitCode;
|
||||
|
||||
private Long monthlyInputStatusId;
|
||||
|
||||
private LocalDateTime createdAt;
|
||||
private String createdBy;
|
||||
private LocalDateTime updatedAt;
|
||||
private String updatedBy;
|
||||
|
||||
private Long total;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.getForestProducts.ports;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProducts.ports.application.domain.GetForestProducts;
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProducts.ports.application.domain.GetForestProductsCmd;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
public interface GetForestProductsPortIn {
|
||||
|
||||
Page<GetForestProducts> operate(Pageable pageable, GetForestProductsCmd command);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.getForestProducts.ports;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProducts.ports.application.domain.GetForestProducts;
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProducts.ports.application.domain.GetForestProductsCmd;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
public interface GetForestProductsPortOut {
|
||||
|
||||
Page<GetForestProducts> operate(Pageable pageable, GetForestProductsCmd command);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.getForestProducts.ports.application;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProducts.ports.GetForestProductsPortIn;
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProducts.ports.GetForestProductsPortOut;
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProducts.ports.application.domain.GetForestProducts;
|
||||
import app.module.front.usecase.info.monthlyProduct.getForestProducts.ports.application.domain.GetForestProductsCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class GetForestProductsService implements GetForestProductsPortIn {
|
||||
|
||||
private final GetForestProductsPortOut portOut;
|
||||
|
||||
@Override
|
||||
public Page<GetForestProducts> operate(Pageable pageable, GetForestProductsCmd command) {
|
||||
return portOut.operate(pageable, command);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.getForestProducts.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetForestProducts {
|
||||
|
||||
private Long id;
|
||||
private Long householdSeq;
|
||||
|
||||
private String streetNum;
|
||||
private String landType;
|
||||
private String town;
|
||||
|
||||
private Integer availableArea;
|
||||
private String cropName;
|
||||
private String cropCode;
|
||||
private Integer landArea;
|
||||
|
||||
private String month;
|
||||
|
||||
private BigDecimal mainYield;
|
||||
private String mainYieldUnitCode;
|
||||
private BigDecimal mainSaleAmount;
|
||||
private String mainSaleUnitCode;
|
||||
|
||||
private BigDecimal subYield;
|
||||
private String subYieldUnitCode;
|
||||
private BigDecimal subSaleAmount;
|
||||
private String subSaleUnitCode;
|
||||
|
||||
private Long monthlyInputStatusId;
|
||||
|
||||
private LocalDateTime createdAt;
|
||||
private String createdBy;
|
||||
private LocalDateTime updatedAt;
|
||||
private String updatedBy;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.getForestProducts.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetForestProductsCmd {
|
||||
|
||||
private String searchField;
|
||||
private String searchValue;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.adapters.persistence.model.GetMonthlyForestProductsDto;
|
||||
import app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports.GetMonthlyForestProductsPortOut;
|
||||
import app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProducts;
|
||||
import app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProductsCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.collections4.ListUtils;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class GetMonthlyForestProductsDao implements GetMonthlyForestProductsPortOut {
|
||||
|
||||
private final GetMonthlyForestProductsMapper mapper;
|
||||
|
||||
@Override
|
||||
public Page<GetMonthlyForestProducts> operate(Pageable pageable, GetMonthlyForestProductsCmd command) {
|
||||
// 게시물 목록 얻기
|
||||
List<GetMonthlyForestProductsDto> contents =
|
||||
ListUtils.emptyIfNull(mapper.getMonthlyForestProducts(pageable, command));
|
||||
|
||||
return new PageImpl<>(
|
||||
contents.stream()
|
||||
.map(
|
||||
article ->
|
||||
new GetMonthlyForestProducts(
|
||||
article.getId(),
|
||||
article.getHouseholdSeq(),
|
||||
article.getStreetNum(),
|
||||
article.getLandType(),
|
||||
article.getTown(),
|
||||
article.getAvailableArea(),
|
||||
article.getCropName(),
|
||||
article.getCropCode(),
|
||||
article.getLandArea(),
|
||||
article.getMonth(),
|
||||
article.getMainYield(),
|
||||
article.getMainYieldUnitCode(),
|
||||
article.getMainSaleAmount(),
|
||||
article.getMainSaleUnitCode(),
|
||||
article.getSubYield(),
|
||||
article.getSubYieldUnitCode(),
|
||||
article.getSubSaleAmount(),
|
||||
article.getSubSaleUnitCode(),
|
||||
article.getMonthlyInputStatusId(),
|
||||
article.getCreatedAt(),
|
||||
article.getCreatedBy(),
|
||||
article.getUpdatedAt(),
|
||||
article.getUpdatedBy()))
|
||||
.collect(Collectors.toList()),
|
||||
pageable,
|
||||
contents.isEmpty() ? 0 : contents.get(0).getTotal());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.adapters.persistence.model.GetMonthlyForestProductsDto;
|
||||
import app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProductsCmd;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface GetMonthlyForestProductsMapper {
|
||||
List<GetMonthlyForestProductsDto> getMonthlyForestProducts(
|
||||
@Param("pageable") Pageable pageable, @Param("cmd") GetMonthlyForestProductsCmd cmd);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.adapters.persistence.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class GetMonthlyForestProductsDto {
|
||||
|
||||
private Long id;
|
||||
private Long householdSeq;
|
||||
|
||||
private String streetNum;
|
||||
private String landType;
|
||||
private String town;
|
||||
|
||||
private Integer availableArea;
|
||||
private String cropName;
|
||||
private String cropCode;
|
||||
private Integer landArea;
|
||||
|
||||
private String month;
|
||||
|
||||
private BigDecimal mainYield;
|
||||
private String mainYieldUnitCode;
|
||||
private BigDecimal mainSaleAmount;
|
||||
private String mainSaleUnitCode;
|
||||
|
||||
private BigDecimal subYield;
|
||||
private String subYieldUnitCode;
|
||||
private BigDecimal subSaleAmount;
|
||||
private String subSaleUnitCode;
|
||||
|
||||
private Long monthlyInputStatusId;
|
||||
|
||||
private LocalDateTime createdAt;
|
||||
private String createdBy;
|
||||
private LocalDateTime updatedAt;
|
||||
private String updatedBy;
|
||||
|
||||
private Long total;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProducts;
|
||||
import app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProductsCmd;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
public interface GetMonthlyForestProductsPortIn {
|
||||
|
||||
Page<GetMonthlyForestProducts> operate(Pageable pageable, GetMonthlyForestProductsCmd command);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProducts;
|
||||
import app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProductsCmd;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
public interface GetMonthlyForestProductsPortOut {
|
||||
|
||||
Page<GetMonthlyForestProducts> operate(Pageable pageable, GetMonthlyForestProductsCmd command);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports.application;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports.GetMonthlyForestProductsPortIn;
|
||||
import app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports.GetMonthlyForestProductsPortOut;
|
||||
import app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProducts;
|
||||
import app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProductsCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class GetMonthlyForestProductsService implements GetMonthlyForestProductsPortIn {
|
||||
|
||||
private final GetMonthlyForestProductsPortOut portOut;
|
||||
|
||||
@Override
|
||||
public Page<GetMonthlyForestProducts> operate(Pageable pageable, GetMonthlyForestProductsCmd command) {
|
||||
return portOut.operate(pageable, command);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetMonthlyForestProducts {
|
||||
|
||||
private Long id;
|
||||
private Long householdSeq;
|
||||
|
||||
private String streetNum;
|
||||
private String landType;
|
||||
private String town;
|
||||
|
||||
private Integer availableArea;
|
||||
private String cropName;
|
||||
private String cropCode;
|
||||
private Integer landArea;
|
||||
|
||||
private String month;
|
||||
|
||||
private BigDecimal mainYield;
|
||||
private String mainYieldUnitCode;
|
||||
private BigDecimal mainSaleAmount;
|
||||
private String mainSaleUnitCode;
|
||||
|
||||
private BigDecimal subYield;
|
||||
private String subYieldUnitCode;
|
||||
private BigDecimal subSaleAmount;
|
||||
private String subSaleUnitCode;
|
||||
|
||||
private Long monthlyInputStatusId;
|
||||
|
||||
private LocalDateTime createdAt;
|
||||
private String createdBy;
|
||||
private LocalDateTime updatedAt;
|
||||
private String updatedBy;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class GetMonthlyForestProductsCmd {
|
||||
|
||||
private Long monthlyInputStatusId;
|
||||
private Long householdSeq;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.removeForestProducts.adapters.persistence;
|
||||
|
||||
import app.module.core.config.application.util.CommonUtil;
|
||||
import app.module.front.usecase.info.monthlyProduct.removeForestProducts.adapters.persistence.model.RemoveForestProductsParam;
|
||||
import app.module.front.usecase.info.monthlyProduct.removeForestProducts.ports.RemoveForestProductsPortOut;
|
||||
import app.module.front.usecase.info.monthlyProduct.removeForestProducts.ports.application.domain.RemoveForestProductsCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class RemoveForestProductsDao implements RemoveForestProductsPortOut {
|
||||
|
||||
private final RemoveForestProductsMapper mapper;
|
||||
|
||||
@Override
|
||||
public void operate(RemoveForestProductsCmd command) {
|
||||
String loginUser = CommonUtil.getLoginUsername();;
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
|
||||
mapper.deleteForestProducts(
|
||||
new RemoveForestProductsParam(command.getRemoveIds(), now, loginUser, now, loginUser));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.removeForestProducts.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.removeForestProducts.adapters.persistence.model.RemoveForestProductsParam;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface RemoveForestProductsMapper {
|
||||
void deleteForestProducts(RemoveForestProductsParam param);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.removeForestProducts.adapters.persistence.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Set;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class RemoveForestProductsParam {
|
||||
private Set<Long> removeIds;
|
||||
private LocalDateTime updatedAt;
|
||||
private String updatedBy;
|
||||
private LocalDateTime deletedAt;
|
||||
private String deletedBy;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.removeForestProducts.ports;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.removeForestProducts.ports.application.domain.RemoveForestProductsCmd;
|
||||
|
||||
public interface RemoveForestProductsPortIn {
|
||||
void operate(RemoveForestProductsCmd command);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.removeForestProducts.ports;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.removeForestProducts.ports.application.domain.RemoveForestProductsCmd;
|
||||
|
||||
public interface RemoveForestProductsPortOut {
|
||||
void operate(RemoveForestProductsCmd command);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.removeForestProducts.ports.application;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.removeForestProducts.ports.RemoveForestProductsPortIn;
|
||||
import app.module.front.usecase.info.monthlyProduct.removeForestProducts.ports.RemoveForestProductsPortOut;
|
||||
import app.module.front.usecase.info.monthlyProduct.removeForestProducts.ports.application.domain.RemoveForestProductsCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class RemoveForestProductsService implements RemoveForestProductsPortIn {
|
||||
|
||||
private final RemoveForestProductsPortOut portOut;
|
||||
|
||||
@Override
|
||||
public void operate(RemoveForestProductsCmd command) {
|
||||
portOut.operate(command);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.removeForestProducts.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class RemoveForestProductsCmd {
|
||||
private Set<Long> removeIds;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.removeMonthForestProducts.adapters.persistence;
|
||||
|
||||
import app.module.core.config.application.util.CommonUtil;
|
||||
import app.module.front.usecase.info.monthlyProduct.removeMonthForestProducts.adapters.persistence.model.RemoveMonthForestProductsParam;
|
||||
import app.module.front.usecase.info.monthlyProduct.removeMonthForestProducts.ports.RemoveMonthForestProductsPortOut;
|
||||
import app.module.front.usecase.info.monthlyProduct.removeMonthForestProducts.ports.application.domain.RemoveMonthForestProductsCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class RemoveMonthForestProductsDao implements RemoveMonthForestProductsPortOut {
|
||||
|
||||
private final RemoveMonthForestProductsMapper mapper;
|
||||
|
||||
@Override
|
||||
public void operate(RemoveMonthForestProductsCmd command) {
|
||||
String loginUser = CommonUtil.getLoginUsername();;
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
|
||||
mapper.deleteForestProducts(
|
||||
new RemoveMonthForestProductsParam(command.getId(), command.getHouseholdSeq(), now, loginUser, now, loginUser));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.removeMonthForestProducts.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.removeMonthForestProducts.adapters.persistence.model.RemoveMonthForestProductsParam;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface RemoveMonthForestProductsMapper {
|
||||
void deleteForestProducts(RemoveMonthForestProductsParam param);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.removeMonthForestProducts.adapters.persistence.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
public class RemoveMonthForestProductsParam {
|
||||
private Long id;
|
||||
private Long householdSeq;
|
||||
private LocalDateTime updatedAt;
|
||||
private String updatedBy;
|
||||
private LocalDateTime deletedAt;
|
||||
private String deletedBy;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.removeMonthForestProducts.ports;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.removeMonthForestProducts.ports.application.domain.RemoveMonthForestProductsCmd;
|
||||
|
||||
public interface RemoveMonthForestProductsPortIn {
|
||||
void operate(RemoveMonthForestProductsCmd command);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.removeMonthForestProducts.ports;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.removeMonthForestProducts.ports.application.domain.RemoveMonthForestProductsCmd;
|
||||
|
||||
public interface RemoveMonthForestProductsPortOut {
|
||||
void operate(RemoveMonthForestProductsCmd command);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.removeMonthForestProducts.ports.application;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.removeMonthForestProducts.ports.RemoveMonthForestProductsPortIn;
|
||||
import app.module.front.usecase.info.monthlyProduct.removeMonthForestProducts.ports.RemoveMonthForestProductsPortOut;
|
||||
import app.module.front.usecase.info.monthlyProduct.removeMonthForestProducts.ports.application.domain.RemoveMonthForestProductsCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class RemoveMonthForestProductsService implements RemoveMonthForestProductsPortIn {
|
||||
|
||||
private final RemoveMonthForestProductsPortOut portOut;
|
||||
|
||||
@Override
|
||||
public void operate(RemoveMonthForestProductsCmd command) {
|
||||
portOut.operate(command);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.removeMonthForestProducts.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class RemoveMonthForestProductsCmd {
|
||||
private Long id;
|
||||
private Long householdSeq;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.updateForestProduct.adapters.persistence;
|
||||
|
||||
import app.module.core.config.application.util.CommonUtil;
|
||||
import app.module.front.usecase.info.monthlyProduct.updateForestProduct.adapters.persistence.model.UpdateForestProductDto;
|
||||
import app.module.front.usecase.info.monthlyProduct.updateForestProduct.ports.UpdateForestProductPortOut;
|
||||
import app.module.front.usecase.info.monthlyProduct.updateForestProduct.ports.application.domain.UpdateForestProductCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class UpdateForestProductDao implements UpdateForestProductPortOut {
|
||||
|
||||
private final UpdateForestProductMapper mapper;
|
||||
|
||||
@Override
|
||||
public void operate(UpdateForestProductCmd command) {
|
||||
mapper.updateForestProduct(
|
||||
new UpdateForestProductDto(
|
||||
command.getId(),
|
||||
command.getHouseholdSeq(),
|
||||
command.getStreetNum(),
|
||||
command.getLandType(),
|
||||
command.getTown(),
|
||||
command.getAvailableArea(),
|
||||
command.getCropName(),
|
||||
command.getCropCode(),
|
||||
command.getLandArea(),
|
||||
command.getMonth(),
|
||||
command.getMainYield(),
|
||||
command.getMainYieldUnitCode(),
|
||||
command.getMainSaleAmount(),
|
||||
command.getMainSaleUnitCode(),
|
||||
command.getSubYield(),
|
||||
command.getSubYieldUnitCode(),
|
||||
command.getSubSaleAmount(),
|
||||
command.getSubSaleUnitCode(),
|
||||
command.getMonthlyInputStatusId(),
|
||||
LocalDateTime.now(),
|
||||
CommonUtil.getLoginUsername()
|
||||
));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.updateForestProduct.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.updateForestProduct.adapters.persistence.model.UpdateForestProductDto;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface UpdateForestProductMapper {
|
||||
void updateForestProduct(UpdateForestProductDto dto);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.updateForestProduct.adapters.persistence.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UpdateForestProductDto {
|
||||
|
||||
private Long id;
|
||||
private Long householdSeq;
|
||||
|
||||
private String streetNum;
|
||||
private String landType;
|
||||
private String town;
|
||||
|
||||
private Integer availableArea;
|
||||
private String cropName;
|
||||
private String cropCode;
|
||||
private Integer landArea;
|
||||
|
||||
private String month;
|
||||
|
||||
private BigDecimal mainYield;
|
||||
private String mainYieldUnitCode;
|
||||
private BigDecimal mainSaleAmount;
|
||||
private String mainSaleUnitCode;
|
||||
|
||||
private BigDecimal subYield;
|
||||
private String subYieldUnitCode;
|
||||
private BigDecimal subSaleAmount;
|
||||
private String subSaleUnitCode;
|
||||
|
||||
private Long monthlyInputStatusId;
|
||||
|
||||
private LocalDateTime updatedAt;
|
||||
private String updatedBy;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.updateForestProduct.ports;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.updateForestProduct.ports.application.domain.UpdateForestProductCmd;
|
||||
|
||||
public interface UpdateForestProductPortIn {
|
||||
|
||||
void operate(UpdateForestProductCmd command);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.updateForestProduct.ports;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.updateForestProduct.ports.application.domain.UpdateForestProductCmd;
|
||||
|
||||
public interface UpdateForestProductPortOut {
|
||||
|
||||
void operate(UpdateForestProductCmd command);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.updateForestProduct.ports.application;
|
||||
|
||||
import app.module.front.usecase.info.monthlyProduct.updateForestProduct.ports.UpdateForestProductPortIn;
|
||||
import app.module.front.usecase.info.monthlyProduct.updateForestProduct.ports.UpdateForestProductPortOut;
|
||||
import app.module.front.usecase.info.monthlyProduct.updateForestProduct.ports.application.domain.UpdateForestProductCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class UpdateForestProductService implements UpdateForestProductPortIn {
|
||||
|
||||
private final UpdateForestProductPortOut portOut;
|
||||
|
||||
@Override
|
||||
public void operate(UpdateForestProductCmd command) {
|
||||
portOut.operate(command);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package app.module.front.usecase.info.monthlyProduct.updateForestProduct.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class UpdateForestProductCmd {
|
||||
|
||||
private Long id;
|
||||
private Long householdSeq;
|
||||
|
||||
private String streetNum;
|
||||
private String landType;
|
||||
private String town;
|
||||
|
||||
private Integer availableArea;
|
||||
private String cropName;
|
||||
private String cropCode;
|
||||
private Integer landArea;
|
||||
|
||||
private String month;
|
||||
|
||||
private BigDecimal mainYield;
|
||||
private String mainYieldUnitCode;
|
||||
private BigDecimal mainSaleAmount;
|
||||
private String mainSaleUnitCode;
|
||||
|
||||
private BigDecimal subYield;
|
||||
private String subYieldUnitCode;
|
||||
private BigDecimal subSaleAmount;
|
||||
private String subSaleUnitCode;
|
||||
|
||||
private Long monthlyInputStatusId;
|
||||
|
||||
}
|
||||
@@ -1,20 +1,20 @@
|
||||
package app.module.front.usecase.info.monthly.createMonthlyUI.adapters.web;
|
||||
package app.module.front.usecase.info.monthlyUI.createMonthlyUI.adapters.web;
|
||||
|
||||
import app.module.core.config.application.enums.MonthStatus;
|
||||
import app.module.core.config.application.util.CoreUtil;
|
||||
import app.module.core.usecase.monthly.getMonthlyInputStatus.ports.GetMonthlyInputStatusPortIn;
|
||||
import app.module.core.usecase.monthly.getMonthlyInputStatus.ports.application.domain.GetMonthlyInputStatus;
|
||||
import app.module.core.usecase.monthly.getMonthlyInputStatus.ports.application.domain.GetMonthlyInputStatusCmd;
|
||||
import app.module.core.usecase.monthly.updateMonthlyInputStatus.ports.UpdateMonthlyInputStatusPortIn;
|
||||
import app.module.core.usecase.monthly.updateMonthlyInputStatus.ports.application.domain.UpdateMonthlyInputStatusCmd;
|
||||
import app.module.core.usecase.product.createForestProduct.ports.CreateForestProductPortIn;
|
||||
import app.module.core.usecase.product.createForestProduct.ports.application.domain.CreateForestProductCmd;
|
||||
import app.module.core.usecase.product.removeMonthForestProducts.ports.RemoveMonthForestProductsPortIn;
|
||||
import app.module.core.usecase.product.removeMonthForestProducts.ports.application.domain.RemoveMonthForestProductsCmd;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.GetMonthlyInputStatusPortIn;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.application.domain.GetMonthlyInputStatus;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.application.domain.GetMonthlyInputStatusCmd;
|
||||
import app.module.front.usecase.info.monthly.updateMonthlyInputStatus.ports.UpdateMonthlyInputStatusPortIn;
|
||||
import app.module.front.usecase.info.monthly.updateMonthlyInputStatus.ports.application.domain.UpdateMonthlyInputStatusCmd;
|
||||
import app.module.front.usecase.info.monthlyProduct.createForestProduct.ports.CreateForestProductPortIn;
|
||||
import app.module.front.usecase.info.monthlyProduct.createForestProduct.ports.application.domain.CreateForestProductCmd;
|
||||
import app.module.front.usecase.info.monthlyProduct.removeMonthForestProducts.ports.RemoveMonthForestProductsPortIn;
|
||||
import app.module.front.usecase.info.monthlyProduct.removeMonthForestProducts.ports.application.domain.RemoveMonthForestProductsCmd;
|
||||
import app.module.front.config.application.response.ApiResponse;
|
||||
import app.module.front.config.application.util.AuthUtil;
|
||||
import app.module.front.usecase.info.monthly.createMonthlyUI.adapters.web.model.CreateMonthlyProductReqVO;
|
||||
import app.module.front.usecase.info.monthly.createMonthlyUI.adapters.web.model.CreateMonthlyReqVO;
|
||||
import app.module.front.usecase.info.monthlyUI.createMonthlyUI.adapters.web.model.CreateMonthlyProductReqVO;
|
||||
import app.module.front.usecase.info.monthlyUI.createMonthlyUI.adapters.web.model.CreateMonthlyReqVO;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
@@ -1,20 +1,18 @@
|
||||
package app.module.front.usecase.info.monthly.createMonthlyUI.adapters.web;
|
||||
package app.module.front.usecase.info.monthlyUI.createMonthlyUI.adapters.web;
|
||||
|
||||
import app.module.core.config.application.enums.MonthStatus;
|
||||
import app.module.core.usecase.monthly.getMonthlyInputStatus.ports.GetMonthlyInputStatusPortIn;
|
||||
import app.module.core.usecase.monthly.getMonthlyInputStatus.ports.application.domain.GetMonthlyInputStatus;
|
||||
import app.module.core.usecase.monthly.getMonthlyInputStatus.ports.application.domain.GetMonthlyInputStatusCmd;
|
||||
import app.module.core.usecase.monthly.getMonthlyInputStatuss.ports.GetMonthlyInputStatussPortIn;
|
||||
import app.module.core.usecase.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatuss;
|
||||
import app.module.core.usecase.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatussCmd;
|
||||
import app.module.core.usecase.monthly.getPrevMonthlyInputStatus.ports.GetPrevMonthlyInputStatusPortIn;
|
||||
import app.module.core.usecase.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatus;
|
||||
import app.module.core.usecase.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatusCmd;
|
||||
import app.module.core.usecase.product.getForestProduct.ports.GetForestProductPortIn;
|
||||
import app.module.core.usecase.product.getForestProducts.ports.GetForestProductsPortIn;
|
||||
import app.module.core.usecase.product.getMonthlyForestProducts.ports.GetMonthlyForestProductsPortIn;
|
||||
import app.module.core.usecase.product.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProducts;
|
||||
import app.module.core.usecase.product.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProductsCmd;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.GetMonthlyInputStatusPortIn;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.application.domain.GetMonthlyInputStatus;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatus.ports.application.domain.GetMonthlyInputStatusCmd;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.GetMonthlyInputStatussPortIn;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatuss;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatussCmd;
|
||||
import app.module.front.usecase.info.monthly.getPrevMonthlyInputStatus.ports.GetPrevMonthlyInputStatusPortIn;
|
||||
import app.module.front.usecase.info.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatus;
|
||||
import app.module.front.usecase.info.monthly.getPrevMonthlyInputStatus.ports.application.domain.GetPrevMonthlyInputStatusCmd;
|
||||
import app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports.GetMonthlyForestProductsPortIn;
|
||||
import app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProducts;
|
||||
import app.module.front.usecase.info.monthlyProduct.getMonthlyForestProducts.ports.application.domain.GetMonthlyForestProductsCmd;
|
||||
import app.module.core.usecase.uicode.list.ports.UICodeListPortIn;
|
||||
import app.module.front.config.application.util.AuthUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -29,9 +27,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.YearMonth;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.Optional;
|
||||
|
||||
@Controller
|
||||
@RequiredArgsConstructor
|
||||
@@ -1,9 +1,8 @@
|
||||
package app.module.front.usecase.info.monthly.createMonthlyUI.adapters.web.model;
|
||||
package app.module.front.usecase.info.monthlyUI.createMonthlyUI.adapters.web.model;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@@ -1,9 +1,7 @@
|
||||
package app.module.front.usecase.info.monthly.createMonthlyUI.adapters.web.model;
|
||||
package app.module.front.usecase.info.monthlyUI.createMonthlyUI.adapters.web.model;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package app.module.front.usecase.info.monthly.getMonthlysUI.adapters.web;
|
||||
package app.module.front.usecase.info.monthlyUI.getMonthlysUI.adapters.web;
|
||||
|
||||
import app.module.core.config.application.enums.MonthStatus;
|
||||
import app.module.core.usecase.monthly.getMonthlyInputStatuss.ports.GetMonthlyInputStatussPortIn;
|
||||
import app.module.core.usecase.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatuss;
|
||||
import app.module.core.usecase.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatussCmd;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.GetMonthlyInputStatussPortIn;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatuss;
|
||||
import app.module.front.usecase.info.monthly.getMonthlyInputStatuss.ports.application.domain.GetMonthlyInputStatussCmd;
|
||||
import app.module.front.config.application.util.AuthUtil;
|
||||
import app.module.front.usecase.info.monthly.getMonthlysUI.adapters.web.model.GetMonthlyssReqVO;
|
||||
import app.module.front.usecase.info.monthlyUI.getMonthlysUI.adapters.web.model.GetMonthlyssReqVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -1,4 +1,4 @@
|
||||
package app.module.front.usecase.info.monthly.getMonthlysUI.adapters.web.model;
|
||||
package app.module.front.usecase.info.monthlyUI.getMonthlysUI.adapters.web.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -0,0 +1,57 @@
|
||||
package app.module.front.usecase.info.notice.createNotice.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.info.notice.createNotice.adapters.persistence.model.CreateNoticeDto;
|
||||
import app.module.front.usecase.info.notice.createNotice.adapters.persistence.model.CreateNoticeHasUploadFilesParam;
|
||||
import app.module.front.usecase.info.notice.createNotice.ports.CreateNoticePortOut;
|
||||
import app.module.front.usecase.info.notice.createNotice.ports.application.domain.CreateNotice;
|
||||
import app.module.front.usecase.info.notice.createNotice.ports.application.domain.CreateNoticeCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class CreateNoticeDao implements CreateNoticePortOut {
|
||||
|
||||
private final CreateNoticeMapper mapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Optional<CreateNotice> operate(CreateNoticeCmd command) {
|
||||
|
||||
|
||||
CreateNoticeDto dto =
|
||||
new CreateNoticeDto(
|
||||
null,
|
||||
command.getTitle(),
|
||||
command.getContent(),
|
||||
command.getVisible(),
|
||||
command.getStartDate(),
|
||||
command.getEndDate(),
|
||||
command.getFileMappingId(),
|
||||
command.getCreatedAt(),
|
||||
command.getCreatedBy(),
|
||||
command.getUpdatedAt(),
|
||||
command.getUpdatedBy());
|
||||
|
||||
mapper.createNotice(dto);
|
||||
|
||||
if (dto.getFileMappingId() != null && !dto.getFileMappingId().isEmpty()) {
|
||||
mapper.createNoticeHasUploadFile(new CreateNoticeHasUploadFilesParam(
|
||||
dto.getId(),
|
||||
dto.getFileMappingId().stream()
|
||||
.map(Long::parseLong)
|
||||
.collect(Collectors.toList()),
|
||||
dto.getCreatedAt(),
|
||||
dto.getCreatedBy(),
|
||||
dto.getUpdatedAt(),
|
||||
dto.getUpdatedBy()
|
||||
));
|
||||
}
|
||||
|
||||
return Optional.of(new CreateNotice(dto.getId()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package app.module.front.usecase.info.notice.createNotice.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.info.notice.createNotice.adapters.persistence.model.CreateNoticeDto;
|
||||
import app.module.front.usecase.info.notice.createNotice.adapters.persistence.model.CreateNoticeHasUploadFilesParam;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface CreateNoticeMapper {
|
||||
void createNotice(CreateNoticeDto dto);
|
||||
void createNoticeHasUploadFile(CreateNoticeHasUploadFilesParam param);
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package app.module.front.usecase.info.notice.createNotice.adapters.persistence.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CreateNoticeDto {
|
||||
private Long id;
|
||||
private String title;
|
||||
private String content;
|
||||
private Boolean visible;
|
||||
private LocalDateTime startDate;
|
||||
private LocalDateTime endDate;
|
||||
private List<String> fileMappingId;
|
||||
private LocalDateTime createdAt;
|
||||
private String createdBy;
|
||||
private LocalDateTime updatedAt;
|
||||
private String updatedBy;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package app.module.front.usecase.info.notice.createNotice.adapters.persistence.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CreateNoticeHasUploadFilesParam {
|
||||
private Long id;
|
||||
private List<Long> fileMappingIds;
|
||||
private LocalDateTime createdAt;
|
||||
private String createdBy;
|
||||
private LocalDateTime updatedAt;
|
||||
private String updatedBy;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package app.module.front.usecase.info.notice.createNotice.ports;
|
||||
|
||||
import app.module.front.usecase.info.notice.createNotice.ports.application.domain.CreateNotice;
|
||||
import app.module.front.usecase.info.notice.createNotice.ports.application.domain.CreateNoticeCmd;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public interface CreateNoticePortIn {
|
||||
|
||||
Optional<CreateNotice> operate(CreateNoticeCmd command);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package app.module.front.usecase.info.notice.createNotice.ports;
|
||||
|
||||
import app.module.front.usecase.info.notice.createNotice.ports.application.domain.CreateNotice;
|
||||
import app.module.front.usecase.info.notice.createNotice.ports.application.domain.CreateNoticeCmd;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public interface CreateNoticePortOut {
|
||||
|
||||
Optional<CreateNotice> operate(CreateNoticeCmd command);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package app.module.front.usecase.info.notice.createNotice.ports.application;
|
||||
|
||||
import app.module.core.config.application.annotation.CreateCommand;
|
||||
import app.module.front.usecase.info.notice.createNotice.ports.CreateNoticePortIn;
|
||||
import app.module.front.usecase.info.notice.createNotice.ports.CreateNoticePortOut;
|
||||
import app.module.front.usecase.info.notice.createNotice.ports.application.domain.CreateNotice;
|
||||
import app.module.front.usecase.info.notice.createNotice.ports.application.domain.CreateNoticeCmd;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
class CreateNoticeService implements CreateNoticePortIn {
|
||||
|
||||
private final CreateNoticePortOut portOut;
|
||||
|
||||
@Override
|
||||
@CreateCommand
|
||||
public Optional<CreateNotice> operate(CreateNoticeCmd command) {
|
||||
return portOut.operate(command);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package app.module.front.usecase.info.notice.createNotice.ports.application.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class CreateNotice {
|
||||
private Long id;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package app.module.front.usecase.info.notice.createNotice.ports.application.domain;
|
||||
|
||||
import app.module.core.config.adapters.persistence.component.AuditCommand;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class CreateNoticeCmd extends AuditCommand {
|
||||
private String title;
|
||||
private String content;
|
||||
private Boolean visible;
|
||||
private LocalDateTime startDate;
|
||||
private LocalDateTime endDate;
|
||||
private List<String> fileMappingId;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package app.module.front.usecase.info.notice.getNotice.adapters.persistence;
|
||||
|
||||
import app.module.core.usecase.file.url.application.port.in.FileUrlPortIn;
|
||||
import app.module.front.usecase.info.notice.getNotice.ports.GetNoticePortOut;
|
||||
import app.module.front.usecase.info.notice.getNotice.ports.application.domain.GetNotice;
|
||||
import app.module.front.usecase.info.notice.getNotice.ports.application.domain.GetNoticeCmd;
|
||||
import app.module.front.usecase.info.notice.getNotice.ports.application.domain.GetNoticeUploadFile;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Repository;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class GetNoticeDao implements GetNoticePortOut {
|
||||
|
||||
private final GetNoticeMapper mapper;
|
||||
private final FileUrlPortIn fileUrlPortIn;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Optional<GetNotice> operate(GetNoticeCmd command) {
|
||||
GetNotice secArticle = mapper.getNotice(command);
|
||||
|
||||
List<GetNoticeUploadFile> setArticleUploadFile =
|
||||
mapper.getUploadFiles(command.getId());
|
||||
|
||||
secArticle.setUploadFiles(
|
||||
setArticleUploadFile.stream()
|
||||
.map(
|
||||
uploadFile -> {
|
||||
// 참조 URL 전달
|
||||
uploadFile.setReferURL(
|
||||
fileUrlPortIn.getInline(
|
||||
uploadFile.getType().getFileStorageType(),
|
||||
uploadFile.getPath(),
|
||||
uploadFile.getName()));
|
||||
// attachment URL 전달
|
||||
uploadFile.setAttachmentURL(
|
||||
fileUrlPortIn.getAttachment(
|
||||
uploadFile.getType().getFileStorageType(), uploadFile.getId()));
|
||||
|
||||
return uploadFile;
|
||||
})
|
||||
.collect(Collectors.toList()));
|
||||
|
||||
return Optional.of(secArticle);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package app.module.front.usecase.info.notice.getNotice.adapters.persistence;
|
||||
|
||||
import app.module.front.usecase.info.notice.getNotice.ports.application.domain.GetNotice;
|
||||
import app.module.front.usecase.info.notice.getNotice.ports.application.domain.GetNoticeCmd;
|
||||
import app.module.front.usecase.info.notice.getNotice.ports.application.domain.GetNoticeUploadFile;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface GetNoticeMapper {
|
||||
|
||||
GetNotice getNotice(GetNoticeCmd command);
|
||||
|
||||
List<GetNoticeUploadFile> getUploadFiles(Long id);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user