260408_01_ENH: 리스트 업로드, 조회, 삭제 1차 구현 완료
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package com.kri.contact.server.dto.auth;
|
||||
|
||||
|
||||
import com.kri.common.auth.dto.JwtUserClaimsDto;
|
||||
import com.kri.common.feature.auth.dto.JwtUserClaimsDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.kri.contact.server.dto.excel;
|
||||
|
||||
import com.kri.common.excel.ExcelColumn;
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@@ -8,7 +8,7 @@ import lombok.Setter;
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
public class ExcelUploadResponseDto {
|
||||
public class ExcelUploadResultDto {
|
||||
|
||||
@Schema(description = "전체 읽은 행 수 (헤더 제외)")
|
||||
private int totalCount;
|
||||
@@ -27,4 +27,14 @@ public class ExcelUploadResponseDto {
|
||||
|
||||
@Schema(description = "에러 엑셀 파일 (xlsx)의 Base64 문자열 (hasErrorFile == true일 때만 세팅)")
|
||||
private String errorFileBase64;
|
||||
|
||||
public static ExcelUploadResultDto success(int totalCount, int successCount) {
|
||||
return ExcelUploadResultDto.builder()
|
||||
.totalCount(totalCount)
|
||||
.successCount(successCount)
|
||||
.failCount(0)
|
||||
.hasErrorFile(false)
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.kri.contact.server.dto.excel;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@SuperBuilder
|
||||
@Getter
|
||||
@Setter
|
||||
public class ListUploadErrorDto extends ExcelErrorDto {
|
||||
public static ListUploadErrorDto of(int rowNumber, String fieldName, String errorMessage) {
|
||||
return ListUploadErrorDto.builder()
|
||||
.rowNumber(rowNumber)
|
||||
.fieldName(fieldName)
|
||||
.errorMessage(errorMessage)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.kri.contact.server.dto.excel;
|
||||
|
||||
import com.kri.common.excel.ExcelColumn;
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "")
|
||||
public class ListAssignInfoDto {
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "리스트 id")
|
||||
private Integer sid;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "배정될 사용자 id")
|
||||
private String userId;
|
||||
|
||||
public static ListAssignInfoDto from(Integer sid, String userId) {
|
||||
return ListAssignInfoDto.builder()
|
||||
.sid(sid)
|
||||
.userId(userId)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.persistence.entity.TListEventHistEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "컨택/방문 면접 결과")
|
||||
public class ListContactResultDto extends ListResultBaseDto {
|
||||
|
||||
@Schema(description = "컨택/방문면접 시도 횟수")
|
||||
private Integer attemptCount;
|
||||
|
||||
@Schema(description = "마지막 컨택/방문면접 자")
|
||||
private String lastUser;
|
||||
|
||||
@Schema(description = "할당된 컨택/방문면접자")
|
||||
private String assignUser;
|
||||
|
||||
public static ListContactResultDto from(TListEventHistEntity entity) {
|
||||
if (entity == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return ListContactResultDto.builder()
|
||||
.lastResultCd(entity.getResultCd() == null ? null : entity.getResultCd().shortValue())
|
||||
.lastResultDt(entity.getRegDt())
|
||||
.lastUser(entity.getRegUser())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.common.enums.ListIsUse;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Schema(description = "리스트 필터 Dto")
|
||||
public class ListFilterDto {
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "sid 목록")
|
||||
private Set<Integer> sidSet;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "리스트 사용 여부 목록")
|
||||
private Set<ListIsUse> listUseSet;
|
||||
|
||||
@Schema(description = "중요 메모")
|
||||
private String memo;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "그 외 필터 정보")
|
||||
private Map<Integer, Set<String>> otherItems;
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import com.kri.contact.server.persistence.entity.TListHeaderEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.NotNull.List;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Objects;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -45,9 +46,6 @@ public class ListHeaderDto {
|
||||
@Schema(description = "헤더 타입")
|
||||
private ListHeaderType listHderTy;
|
||||
|
||||
@Schema(description = "|로 이어 붙은 필터 값")
|
||||
private String filterValue;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "필터 사용 여부")
|
||||
private Boolean useFilter = false;
|
||||
@@ -72,7 +70,6 @@ public class ListHeaderDto {
|
||||
.listHderGrad(ListHeaderGrade.fromCode(entity.getListHderGrad()))
|
||||
.listHderNm(entity.getListHderNm())
|
||||
.listHderTy(ListHeaderType.fromCode(entity.getListHderTy()))
|
||||
.filterValue(entity.getFilterValue())
|
||||
.useFilter(entity.getUseFilter())
|
||||
.useColView(entity.getUseColView())
|
||||
.useIntrvwerView(entity.getUseIntrvwerView())
|
||||
@@ -80,6 +77,36 @@ public class ListHeaderDto {
|
||||
.build();
|
||||
}
|
||||
|
||||
public static ListHeaderDto fromDto(Long prjctIdx, ListHeaderDto src) {
|
||||
return ListHeaderDto.builder()
|
||||
.prjctIdx(prjctIdx)
|
||||
.listHderId(src.getListHderId())
|
||||
.listHderOrder(src.getListHderOrder())
|
||||
.listHderGrad(src.getListHderGrad())
|
||||
.listHderNm(src.getListHderNm())
|
||||
.listHderTy(src.getListHderTy())
|
||||
.useFilter(src.getUseFilter())
|
||||
.useColView(src.getUseColView())
|
||||
.useIntrvwerView(src.getUseIntrvwerView())
|
||||
.useIntrvwerEdit(src.getUseIntrvwerEdit())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static ListHeaderDto newCommon(Long prjctIdx, int headerId, String headerName, ListHeaderType type){
|
||||
return ListHeaderDto.builder()
|
||||
.prjctIdx(prjctIdx)
|
||||
.listHderId(headerId)
|
||||
.listHderOrder((short) headerId)
|
||||
.listHderGrad(ListHeaderGrade.COMMON)
|
||||
.listHderNm(headerName)
|
||||
.listHderTy(type)
|
||||
.useFilter(false)
|
||||
.useColView(false)
|
||||
.useIntrvwerView(false)
|
||||
.useIntrvwerEdit(false)
|
||||
.build();
|
||||
}
|
||||
|
||||
public boolean isEqualHard(ListHeaderDto dto) {
|
||||
return Objects.equals(listHderId, dto.listHderId) &&
|
||||
Objects.equals(listHderOrder, dto.listHderOrder) &&
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.persistence.entity.TListEventHistEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "결과에 대한 기본 정보")
|
||||
public class ListResultBaseDto {
|
||||
|
||||
@Schema(description = "최종 결과값")
|
||||
private Short lastResultCd;
|
||||
|
||||
@Schema(description = "최종 결과값 일시")
|
||||
private LocalDateTime lastResultDt;
|
||||
|
||||
public static ListResultBaseDto from(TListEventHistEntity entity) {
|
||||
if (entity == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return ListResultBaseDto.builder()
|
||||
.lastResultCd(entity.getResultCd() == null ? null : entity.getResultCd().shortValue())
|
||||
.lastResultDt(entity.getRegDt())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.persistence.entity.TListEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.util.Map;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "리스트 조회 기본")
|
||||
public class ListSearchBaseDto {
|
||||
|
||||
@Schema(description = "프로젝트 고유키")
|
||||
private Long prjctIdx;
|
||||
|
||||
@Schema(description = "SID")
|
||||
private Integer sid;
|
||||
|
||||
@Schema(description = "사용 여부")
|
||||
private Short use;
|
||||
|
||||
@Schema(description = "메모")
|
||||
private String memo;
|
||||
|
||||
@Schema(description = "리스트 값 정보")
|
||||
private Map<Integer, String> itemList;
|
||||
|
||||
public static ListSearchBaseDto from(TListEntity entity, Map<Integer, String> itemList) {
|
||||
if (entity == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return ListSearchBaseDto.builder()
|
||||
.prjctIdx(entity.getPrjctIdx())
|
||||
.sid(entity.getSid())
|
||||
.use(entity.getUse())
|
||||
.memo(entity.getMemo())
|
||||
.itemList(itemList)
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.common.feature.web.page.PageRequestDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Schema(description = "리스트 검색 조건")
|
||||
public class ListSearchRequestDto {
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "리스트 필터")
|
||||
private ListFilterDto listFilter;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "페이지네이션 정보")
|
||||
private PageRequestDto pageRequest;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "리스트 조회 응답(기본 + 결과 + 발송 결과)")
|
||||
public class ListSearchResponseDto extends ListSearchWithResultDto {
|
||||
|
||||
@Schema(description = "메일 발송 결과")
|
||||
private ListResultBaseDto mailSendResult;
|
||||
|
||||
@Schema(description = "문자 발송 결과")
|
||||
private ListResultBaseDto smsSendResult;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.persistence.entity.TListEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.util.Map;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "리스트 조회 기본 + 결과")
|
||||
public class ListSearchWithResultDto extends ListSearchBaseDto {
|
||||
@Schema(description = "컨택 결과")
|
||||
private ListContactResultDto contactResult;
|
||||
|
||||
@Schema(description = "대면 면접 결과")
|
||||
private ListContactResultDto interviewResult;
|
||||
|
||||
@Schema(description = "온라인 설문 결과")
|
||||
private ListResultBaseDto surveyResult;
|
||||
|
||||
public static ListSearchWithResultDto from(
|
||||
TListEntity entity,
|
||||
Map<Integer, String> itemList,
|
||||
ListContactResultDto contactResult,
|
||||
ListContactResultDto interviewResult,
|
||||
ListResultBaseDto surveyResult
|
||||
) {
|
||||
if (entity == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return ListSearchWithResultDto.builder()
|
||||
.prjctIdx(entity.getPrjctIdx())
|
||||
.sid(entity.getSid())
|
||||
.use(entity.getUse())
|
||||
.memo(entity.getMemo())
|
||||
.itemList(itemList)
|
||||
.contactResult(contactResult)
|
||||
.interviewResult(interviewResult)
|
||||
.surveyResult(surveyResult)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.common.enums.ListHeaderTypeSpecific;
|
||||
import com.kri.contact.server.common.enums.ListUploadMode;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.Map;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@Schema(description = "리스트 업로드 요청 DTO")
|
||||
public class ListUploadRequestDto {
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "업로드 모드")
|
||||
private ListUploadMode uploadMode;
|
||||
|
||||
@Schema(description = "이메일 중복 체크")
|
||||
private boolean checkDuplicateEmail;
|
||||
|
||||
@Schema(description = "전화번호 중복 체크")
|
||||
private boolean checkDuplicatePhone;
|
||||
|
||||
@Schema(description = "특수 헤더 정보")
|
||||
private Map<String, ListHeaderTypeSpecific> specificHeader;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.kri.contact.server.dto.project;
|
||||
|
||||
import com.kri.common.webmvc.page.PageRequestDto;
|
||||
import com.kri.common.feature.web.page.PageRequestDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
@@ -25,4 +25,4 @@ public class ProjectSearchRequestDto {
|
||||
|
||||
@Schema(description = "페이지네이션 정보")
|
||||
private PageRequestDto pageRequest;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.kri.contact.server.dto.project;
|
||||
|
||||
import com.kri.common.feature.util.CommonUtil;
|
||||
import com.kri.contact.server.common.enums.ResultCodeType;
|
||||
import com.kri.contact.server.persistence.entity.TResultCodeEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.util.UUID;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -31,7 +31,7 @@ public class ResultCodeDto {
|
||||
|
||||
public static ResultCodeDto from(TResultCodeEntity entity) {
|
||||
return ResultCodeDto.builder()
|
||||
.resultCdUUID(UUID.randomUUID().toString())
|
||||
.resultCdUUID(CommonUtil.uuid32())
|
||||
.prjctIdx(entity.getPrjctIdx())
|
||||
.resultCdTy(entity.getResultCdTy())
|
||||
.resultCd(entity.getResultCd())
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.kri.contact.server.dto.user;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.kri.common.datetime.DateTimeUtil;
|
||||
import com.kri.common.feature.datetime.DateTimeUtil;
|
||||
import com.kri.contact.server.dto.excel.UserUploadDto;
|
||||
import com.kri.contact.server.persistence.entity.TUserEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
Reference in New Issue
Block a user