260714_01_ENH: 테스트 서버에서 기동 후 중간 테스트를 위한 커밋
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -21,6 +21,7 @@ bin/
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
.idea_bak
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
@@ -38,7 +38,7 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "com.kri.common:starter:beta.1.1.15"
|
||||
implementation "com.kri.common:starter:latest.release"
|
||||
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-security'
|
||||
|
||||
@@ -7,36 +7,40 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.stream.Stream;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@NoArgsConstructor
|
||||
public final class ContactConstant {
|
||||
public static final int INSERT_CHUNK_SIZE = 1_000;
|
||||
public static final int LIST_SELECT_CHUNK_SIZE = 1_000;
|
||||
public static final String SYSTEM_USER_NAME = "SYSTEM";
|
||||
public static final String DEFAULT_COMPANY_NAME = "KRI";
|
||||
public static final String DEFAULT_USER_TEAM = "S101";
|
||||
|
||||
public static final int OUTSOURCE_USER_ROLE = 4000;
|
||||
public static final int FIELDWORK_USER_ROLE = 9000;
|
||||
|
||||
public static final StreamingReadOptions LOWER_CASE_HEADER_OPTIONS =
|
||||
new StreamingReadOptions(null, 0, 1, header -> header == null ? null : header.toLowerCase(
|
||||
public static final int CONTACT_INTERVIEWER_ROLE = 9002;
|
||||
public static final int FIELD_INTERVIEWER_ROLE = 9003;
|
||||
public static final StreamingReadOptions UPPER_CASE_HEADER_OPTIONS =
|
||||
new StreamingReadOptions(null, 0, 1, header -> header == null ? null : header.toUpperCase(
|
||||
Locale.ROOT));
|
||||
|
||||
public static final String LIST_TEXT_REGEX = "^[가-힣a-zA-Z0-9()_\\-\\[\\] ]+$";
|
||||
public static final String LIST_HEADER_ACCEPT_REGEX = "^[가-힣a-zA-Z0-9()_\\-\\[\\] ]+$";
|
||||
|
||||
public static final List<ListHeaderType> DEFAULT_AND_FILE_TYPE = Stream.concat(
|
||||
Arrays.stream(ListHeaderTypeDefault.values())
|
||||
.map(defaultType -> ListHeaderType.fromCode(defaultType.getCode())),
|
||||
Stream.of(ListHeaderType.FILE)
|
||||
).toList();
|
||||
|
||||
public static final List<ListHeaderType> ASSIGN_TYPE = List.of(
|
||||
ListHeaderType.OUTSOURCE,
|
||||
ListHeaderType.FIELDWORK
|
||||
);
|
||||
public static final List<ListHeaderType> EMAIL_TELNUM_TYPE = List.of(
|
||||
ListHeaderType.EMAIL,
|
||||
ListHeaderType.TEL_NUM
|
||||
ListHeaderType.CONTACT_INTERVIEWER,
|
||||
ListHeaderType.FIELD_INTERVIEWER
|
||||
);
|
||||
|
||||
private ContactConstant() {
|
||||
}
|
||||
public static final List<ListHeaderType> EXACT_MATCH_HEADER_TYPE = List.of(
|
||||
ListHeaderType.CONTENT_ITEM
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@@ -19,10 +19,6 @@ public enum ChannelType implements CodeEnum<Short> {
|
||||
|
||||
private final Short code;
|
||||
|
||||
ChannelType(CodeEnum<Short> source) {
|
||||
this.code = source.getCode();
|
||||
}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static ChannelType fromCode(Short code) {
|
||||
if (code == null) {
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.kri.contact.server.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.kri.common.feature.enums.CodeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Getter(onMethod_ = @JsonValue)
|
||||
@RequiredArgsConstructor
|
||||
@Schema(description = "리스트 배정 타입")
|
||||
public enum ListAssignType implements CodeEnum<Short> {
|
||||
@Schema(description = "외주사")
|
||||
OUTSOURCE(ListHeaderType.OUTSOURCE.getCode()),
|
||||
@Schema(description = "컨택원")
|
||||
CONTACT_INTERVIEWER(ListHeaderType.CONTACT_INTERVIEWER.getCode()),
|
||||
@Schema(description = "현장 면접원")
|
||||
FIELD_INTERVIEWER(ListHeaderType.FIELD_INTERVIEWER.getCode());
|
||||
|
||||
private final Short code;
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static ListAssignType fromCode(Short code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (ListAssignType value : values()) {
|
||||
if (value.code.equals(code)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown ListAssignType code: " + code);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.kri.contact.server.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.kri.common.feature.enums.CodeEnum;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Getter(onMethod_ = @JsonValue)
|
||||
@RequiredArgsConstructor
|
||||
public enum ListEventHistoryBase implements CodeEnum<Short> {
|
||||
ALL((short) 1),
|
||||
LATEST((short) 2);
|
||||
|
||||
private final Short code;
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static ListEventHistoryBase fromCode(Short code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (ListEventHistoryBase value : values()) {
|
||||
if (value.code.equals(code)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown ListEventHistoryBase code: " + code);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.kri.contact.server.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.kri.common.feature.enums.CodeEnum;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Getter(onMethod_ = @JsonValue)
|
||||
@RequiredArgsConstructor
|
||||
public enum ListEventHistoryExternalEntryType implements CodeEnum<Short> {
|
||||
REDIRECT((short) 10),
|
||||
API((short) 20);
|
||||
|
||||
private final Short code;
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static ListEventHistoryExternalEntryType fromCode(Short code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (ListEventHistoryExternalEntryType value : values()) {
|
||||
if (value.code.equals(code)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown ListEventHistoryExternalEntryType code: " + code);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.kri.contact.server.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.kri.common.feature.enums.CodeEnum;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Getter(onMethod_ = @JsonValue)
|
||||
@RequiredArgsConstructor
|
||||
public enum ListEventHistorySurveyType implements CodeEnum<Short> {
|
||||
START((short) 1),
|
||||
COMPLETE((short) 10),
|
||||
SCREEN((short) 99),
|
||||
QUOTA((short) 98);
|
||||
|
||||
private final Short code;
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static ListEventHistorySurveyType fromCode(Short code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (ListEventHistorySurveyType value : values()) {
|
||||
if (value.code.equals(code)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown ListEventHistorySurveyType code: " + code);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.kri.contact.server.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.kri.common.feature.enums.CodeEnum;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Getter(onMethod_ = @JsonValue)
|
||||
@RequiredArgsConstructor
|
||||
public enum ListFilterMatchType implements CodeEnum<Short> {
|
||||
EXACT((short) 1),
|
||||
CONTAINS((short) 2),
|
||||
EMPTY((short) 3);
|
||||
|
||||
private final Short code;
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static ListFilterMatchType fromCode(Short code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (ListFilterMatchType value : values()) {
|
||||
if (value.code.equals(code)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown ListFilterMatchType code: " + code);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.kri.contact.server.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.kri.common.feature.enums.CodeEnum;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Getter(onMethod_ = @JsonValue)
|
||||
@RequiredArgsConstructor
|
||||
public enum ListFilterOperator implements CodeEnum<Short> {
|
||||
POSITIVE((short) 1),
|
||||
NEGATIVE((short) 2);
|
||||
|
||||
private final Short code;
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static ListFilterOperator fromCode(Short code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (ListFilterOperator value : values()) {
|
||||
if (value.code.equals(code)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown ListFilterOperator code: " + code);
|
||||
}
|
||||
}
|
||||
@@ -3,11 +3,13 @@ package com.kri.contact.server.common.enums;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.kri.common.feature.enums.CodeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Getter(onMethod_ = @JsonValue)
|
||||
@RequiredArgsConstructor
|
||||
@Schema(description = "리스트 헤더 등급")
|
||||
public enum ListHeaderGrade implements CodeEnum<Short> {
|
||||
|
||||
IMMUTABLE((short) 0), // 불변 헤더 (옵션 변경 불가)
|
||||
|
||||
@@ -3,22 +3,26 @@ package com.kri.contact.server.common.enums;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.kri.common.feature.enums.CodeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Getter(onMethod_ = @JsonValue)
|
||||
@RequiredArgsConstructor
|
||||
@Schema(description = "리스트 헤더 타입")
|
||||
public enum ListHeaderType implements CodeEnum<Short> {
|
||||
|
||||
SID(ListHeaderTypeDefault.SID), //11 : SID
|
||||
IS_USE(ListHeaderTypeDefault.IS_USE), //12 : 사용여부
|
||||
OUTSOURCE(ListHeaderTypeDefault.OUTSOURCE), //13 : 외주사
|
||||
FIELDWORK(ListHeaderTypeDefault.FIELDWORK), //14 : 컨택원/면접원
|
||||
CONTACT_INTERVIEWER(ListHeaderTypeDefault.CONTACT_INTERVIEWER), //14 : 면접원
|
||||
FIELD_INTERVIEWER(ListHeaderTypeDefault.FIELD_INTERVIEWER), //15 : 컨택원
|
||||
MEMO(ListHeaderTypeDefault.MEMO), //19 : 메모
|
||||
TEL_NUM(ListHeaderTypeSpecific.TEL_NUM), //21 : 전화번호
|
||||
EMAIL(ListHeaderTypeSpecific.EMAIL), //31 : 이메일
|
||||
FILE(ListHeaderTypeSpecific.FILE), //81 : 파일업로드
|
||||
TEXT((short) 91); //91 : 텍스트
|
||||
CONTENT_ITEM(ListHeaderTypeSpecific.CONTENT_ITEM), //91 : 목록형
|
||||
TEXT((short) 99); //99 : 텍스트
|
||||
|
||||
private final Short code;
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.kri.contact.server.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.kri.common.feature.enums.CodeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Getter(onMethod_ = @JsonValue)
|
||||
@RequiredArgsConstructor
|
||||
@Schema(description = "리스트 헤더 타입(배정 관련)")
|
||||
public enum ListHeaderTypeAssign implements CodeEnum<Short> {
|
||||
OUTSOURCE((short) 13), //13 : 외주사
|
||||
CONTACT_INTERVIEWER((short) 14), //14 : 면접원
|
||||
FIELD_INTERVIEWER((short) 15); //15 : 컨택원
|
||||
|
||||
private final Short code;
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static ListHeaderTypeAssign fromCode(Short code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (ListHeaderTypeAssign s : values()) {
|
||||
if (s.code.equals(code)) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown ListHeaderTypeAssign code: " + code);
|
||||
}
|
||||
}
|
||||
@@ -3,21 +3,26 @@ package com.kri.contact.server.common.enums;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.kri.common.feature.enums.CodeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Getter(onMethod_ = @JsonValue)
|
||||
@RequiredArgsConstructor
|
||||
@Schema(description = "리스트 헤더 타입(기본)")
|
||||
public enum ListHeaderTypeDefault implements CodeEnum<Short> {
|
||||
|
||||
SID((short) 11), //11 : SID
|
||||
IS_USE((short) 12), //12 : 사용여부
|
||||
OUTSOURCE((short) 13), //13 : 외주사
|
||||
FIELDWORK((short) 14), //14 : 컨택원/면접원
|
||||
OUTSOURCE(ListHeaderTypeAssign.OUTSOURCE), //13 : 외주사
|
||||
CONTACT_INTERVIEWER(ListHeaderTypeAssign.CONTACT_INTERVIEWER), //14 : 면접원
|
||||
FIELD_INTERVIEWER(ListHeaderTypeAssign.FIELD_INTERVIEWER), //15 : 컨택원
|
||||
MEMO((short) 19); //19 : 메모
|
||||
|
||||
private final Short code;
|
||||
|
||||
ListHeaderTypeDefault(CodeEnum<Short> source) { this.code = source.getCode();}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static ListHeaderTypeDefault fromCode(Short code) {
|
||||
if (code == null) {
|
||||
@@ -28,6 +33,6 @@ public enum ListHeaderTypeDefault implements CodeEnum<Short> {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown ListHeaderType code: " + code);
|
||||
throw new IllegalArgumentException("Unknown ListHeaderTypeDefault code: " + code);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,16 +3,19 @@ package com.kri.contact.server.common.enums;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.kri.common.feature.enums.CodeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Getter(onMethod_ = @JsonValue)
|
||||
@RequiredArgsConstructor
|
||||
@Schema(description = "리스트 헤더 타입(특수)")
|
||||
public enum ListHeaderTypeSpecific implements CodeEnum<Short> {
|
||||
|
||||
TEL_NUM((short) 21), //21 : 전화번호
|
||||
EMAIL((short) 31), //31 : 이메일
|
||||
FILE((short) 81); //81 : 파일업로드
|
||||
FILE((short) 81), //81 : 파일업로드
|
||||
CONTENT_ITEM((short) 91); //목록형
|
||||
|
||||
private final Short code;
|
||||
|
||||
|
||||
@@ -3,11 +3,13 @@ package com.kri.contact.server.common.enums;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.kri.common.feature.enums.CodeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Getter(onMethod_ = @JsonValue)
|
||||
@RequiredArgsConstructor
|
||||
@Schema(description = "리스트 사용 여부")
|
||||
public enum ListIsUse implements CodeEnum<Short> {
|
||||
|
||||
UNUSABLE((short) 0), //0 : 사용 안함
|
||||
|
||||
@@ -2,11 +2,13 @@ package com.kri.contact.server.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Getter(onMethod_ = @JsonValue)
|
||||
@RequiredArgsConstructor
|
||||
@Schema(description = "리스트 초기화 모드")
|
||||
public enum ListResetMode {
|
||||
|
||||
ALL((short) 0),
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.kri.contact.server.common.enums;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "리스트 조회 응답 타입")
|
||||
public enum ListSearchResponseType {
|
||||
BASE,
|
||||
WITH_RESULT,
|
||||
|
||||
@@ -9,10 +9,11 @@ import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Getter(onMethod_ = @JsonValue)
|
||||
@RequiredArgsConstructor
|
||||
@Schema(description = "리스트 업로드 모드")
|
||||
public enum ListUploadMode implements CodeEnum<Short> {
|
||||
|
||||
CHANGE((short) 0),
|
||||
ADD((short) 1);
|
||||
RESET_AND_INSERT((short) 0),
|
||||
ADD_AND_CHANGE((short) 1);
|
||||
|
||||
private final Short code;
|
||||
|
||||
|
||||
@@ -3,15 +3,17 @@ package com.kri.contact.server.common.enums;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.kri.common.feature.enums.CodeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Getter(onMethod_ = @JsonValue) // Lombok이 생성하는 getCode()에 @JsonValue 부착
|
||||
@RequiredArgsConstructor
|
||||
@Schema(description = "프로젝트 상태")
|
||||
public enum ProjectStatus implements CodeEnum<Short> {
|
||||
STANDBY((short) 0), // 대기
|
||||
PROGRESS((short) 1), // 진행
|
||||
COMPELETE((short) 10); // 완료
|
||||
COMPLETE((short) 10); // 완료
|
||||
|
||||
private final Short code;
|
||||
|
||||
|
||||
@@ -3,16 +3,18 @@ package com.kri.contact.server.common.enums;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.kri.common.feature.enums.CodeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Getter(onMethod_ = @JsonValue)
|
||||
@RequiredArgsConstructor
|
||||
@Schema(description = "결과값")
|
||||
public enum ResultCodeType implements CodeEnum<Short> {
|
||||
|
||||
CONTACT((short) 0), // 컨택 결과코드
|
||||
INTERVIEW((short) 1), // 면접 결과코드
|
||||
SURVEY((short) 2); // 설문 결과코드
|
||||
CONTACT((short) 21), // 컨택 결과코드
|
||||
INTERVIEW((short) 22), // 면접 결과코드
|
||||
SURVEY((short) 99); // 설문 결과코드
|
||||
|
||||
private final Short code;
|
||||
|
||||
|
||||
@@ -3,11 +3,13 @@ package com.kri.contact.server.common.enums;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.kri.common.feature.enums.CodeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Getter(onMethod_ = @JsonValue)
|
||||
@RequiredArgsConstructor
|
||||
@Schema(description = "설문 타입")
|
||||
public enum SurveyType implements CodeEnum<Short> {
|
||||
|
||||
NONE((short) 0), // 없음
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.kri.contact.server.common.enums;
|
||||
|
||||
import com.kri.common.feature.enums.CodeEnum;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
@Getter
|
||||
@RequiredArgsConstructor
|
||||
@Schema(description = "시스템 이벤트 타입")
|
||||
public enum SystemEventType implements CodeEnum<Short> {
|
||||
//1의 자리 1 insert, 2 update, 3 delete, 4 upload
|
||||
//100의 자리 대분류, 10의 자리 소분류
|
||||
@@ -16,7 +18,7 @@ public enum SystemEventType implements CodeEnum<Short> {
|
||||
CREATE_PROJECT((short) 211), // 프로젝트 생성
|
||||
UPDATE_PROJECT((short) 212), // 프로젝트 수정
|
||||
DELETE_PROJECT((short) 213), // 프로젝트 삭제
|
||||
ASSIGN_PROJECT_USER((short) 222), // 프로젝트 배정
|
||||
ASSIGN_PROJECT((short) 222), // 프로젝트 배정
|
||||
UPDATE_PROJECT_DEFAULT_TEMPLATE((short) 232), // 기본 템플릿 수정
|
||||
|
||||
CREATE_USER((short) 311), // 사용자 생성
|
||||
@@ -28,10 +30,14 @@ public enum SystemEventType implements CodeEnum<Short> {
|
||||
UPDATE_ROLE((short) 412), // 권한 수정
|
||||
DELETE_ROLE((short) 413), // 권한 삭제
|
||||
|
||||
UPSERT_LIST_HEADER((short) 1011), //리스트 헤더 수정
|
||||
UPLOAD_LIST((short) 1021), //리스트 업로드
|
||||
UPDATE_LIST((short) 1022), //리스트 수정
|
||||
RESET_LIST((short) 1023), //리스트 삭제
|
||||
UPSERT_LIST_HEADER((short) 1012), //리스트 헤더 수정
|
||||
|
||||
UPLOAD_LIST((short) 1111), //리스트 업로드
|
||||
UPDATE_LIST((short) 1112), //리스트 수정
|
||||
RESET_LIST((short) 1113), //리스트 삭제
|
||||
LIST_ASSIGN((short) 1122), //리스트 배정
|
||||
LIST_ASSIGN_RESET((short) 1123), //리스트 배정 초기화
|
||||
UPLOAD_LIST_ITEM_FILE((short) 1211), //리스트별 파일 업로드
|
||||
|
||||
DUMMY((short) 9999);
|
||||
|
||||
|
||||
125
src/main/java/com/kri/contact/server/common/external/notihub/NotiHubApiClient.java
vendored
Normal file
125
src/main/java/com/kri/contact/server/common/external/notihub/NotiHubApiClient.java
vendored
Normal file
@@ -0,0 +1,125 @@
|
||||
package com.kri.contact.server.common.external.notihub;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.kri.common.feature.http.ExternalApiClient;
|
||||
import com.kri.common.feature.http.ExternalApiResponse;
|
||||
import com.kri.common.feature.web.BusinessException;
|
||||
import com.kri.common.feature.web.RequestUserContext;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.util.UriComponentsBuilder;
|
||||
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class NotiHubApiClient {
|
||||
|
||||
private final ExternalApiClient externalApiClient = new ExternalApiClient();
|
||||
private final ObjectMapper objectMapper;
|
||||
|
||||
@Value("${kri.api-url.noti-hub}")
|
||||
private String notiHubBaseUrl;
|
||||
|
||||
@Value("${kri.auth.apikey.header-name:X-API-Key}")
|
||||
private String apiKeyHeaderName;
|
||||
|
||||
@Value("${kri.auth.apikey.key}")
|
||||
private String apiKey;
|
||||
|
||||
public NotiHubTemplateDto getTemplate(Long tmplatIdx) {
|
||||
String url = notiHubBaseUrl + "/template/" + tmplatIdx;
|
||||
try {
|
||||
ExternalApiResponse response = externalApiClient.get(url, headers());
|
||||
return objectMapper.readValue(response.getBody(), NotiHubTemplateDto.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw BusinessException.badRequest("NOTI_HUB_RESPONSE_PARSE_FAILED", "noti-hub 응답을 해석할 수 없습니다.")
|
||||
.with("url", url);
|
||||
}
|
||||
}
|
||||
|
||||
public void sendEmailSingle(NotiHubSendRequestSingleDto request, RequestUserContext ctx) {
|
||||
postSingle("/send-email/single", request, ctx);
|
||||
}
|
||||
|
||||
public void sendSmsSingle(NotiHubSendRequestSingleDto request, RequestUserContext ctx) {
|
||||
postSingle("/send-sms/single", request, ctx);
|
||||
}
|
||||
|
||||
public String createEmailBulk(NotiHubBulkSendCreateRequestDto request) {
|
||||
return createBulk("/send-email/create/bulk", request);
|
||||
}
|
||||
|
||||
public String createSmsBulk(NotiHubBulkSendCreateRequestDto request) {
|
||||
return createBulk("/send-sms/create/bulk", request);
|
||||
}
|
||||
|
||||
public NotiHubBulkSendResponseDto sendEmailBulk(NotiHubSendRequestBulkDto request) {
|
||||
return sendBulk("/send-email/bulk", request);
|
||||
}
|
||||
|
||||
public NotiHubBulkSendResponseDto sendSmsBulk(NotiHubSendRequestBulkDto request) {
|
||||
return sendBulk("/send-sms/bulk", request);
|
||||
}
|
||||
|
||||
private void postSingle(String path, NotiHubSendRequestSingleDto request, RequestUserContext ctx) {
|
||||
post(urlWithContext(path, ctx), request);
|
||||
}
|
||||
|
||||
private String createBulk(String path, NotiHubBulkSendCreateRequestDto request) {
|
||||
ExternalApiResponse response = put(notiHubBaseUrl + path, request);
|
||||
return response.getBody();
|
||||
}
|
||||
|
||||
private NotiHubBulkSendResponseDto sendBulk(String path, NotiHubSendRequestBulkDto request) {
|
||||
String url = notiHubBaseUrl + path;
|
||||
try {
|
||||
ExternalApiResponse response = post(url, request);
|
||||
return objectMapper.readValue(response.getBody(), NotiHubBulkSendResponseDto.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw BusinessException.badRequest("NOTI_HUB_RESPONSE_PARSE_FAILED", "noti-hub 응답을 해석할 수 없습니다.")
|
||||
.with("url", url);
|
||||
}
|
||||
}
|
||||
|
||||
private ExternalApiResponse post(String url, Object request) {
|
||||
try {
|
||||
return externalApiClient.post(url, headers(), objectMapper.writeValueAsString(request));
|
||||
} catch (JsonProcessingException e) {
|
||||
throw BusinessException.badRequest("NOTI_HUB_REQUEST_SERIALIZE_FAILED", "noti-hub 요청을 생성할 수 없습니다.")
|
||||
.with("url", url);
|
||||
}
|
||||
}
|
||||
|
||||
private ExternalApiResponse put(String url, Object request) {
|
||||
try {
|
||||
return externalApiClient.put(url, headers(), objectMapper.writeValueAsString(request));
|
||||
} catch (JsonProcessingException e) {
|
||||
throw BusinessException.badRequest("NOTI_HUB_REQUEST_SERIALIZE_FAILED", "noti-hub 요청을 생성할 수 없습니다.")
|
||||
.with("url", url);
|
||||
}
|
||||
}
|
||||
|
||||
private String urlWithContext(String path, RequestUserContext ctx) {
|
||||
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(notiHubBaseUrl + path);
|
||||
if (ctx != null) {
|
||||
builder.queryParam("userId", ctx.getUserId());
|
||||
builder.queryParam("userCmpn", ctx.getUserCmpn());
|
||||
builder.queryParam("userTeam", ctx.getUserTeam());
|
||||
builder.queryParam("userName", ctx.getUserName());
|
||||
builder.queryParam("userRole", ctx.getUserRole());
|
||||
builder.queryParam("clientIp", ctx.getClientIp());
|
||||
builder.queryParam("authenticated", ctx.isAuthenticated());
|
||||
}
|
||||
return builder.build().toUriString();
|
||||
}
|
||||
|
||||
private Map<String, String> headers() {
|
||||
Map<String, String> headers = new HashMap<>();
|
||||
headers.put(apiKeyHeaderName, apiKey);
|
||||
headers.put("Content-Type", "application/json");
|
||||
return headers;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.kri.contact.server.common.external.notihub;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class NotiHubBulkSendCreateRequestDto {
|
||||
|
||||
private String reqstCmpn;
|
||||
private String reqstUser;
|
||||
private String reqstSvc;
|
||||
private String prjctCd;
|
||||
private Long tmplatIdx;
|
||||
private Boolean resve;
|
||||
private LocalDateTime sendDt;
|
||||
private Integer trgtCnt;
|
||||
}
|
||||
18
src/main/java/com/kri/contact/server/common/external/notihub/NotiHubBulkSendResponseDto.java
vendored
Normal file
18
src/main/java/com/kri/contact/server/common/external/notihub/NotiHubBulkSendResponseDto.java
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
package com.kri.contact.server.common.external.notihub;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class NotiHubBulkSendResponseDto {
|
||||
|
||||
private String bulkSendKey;
|
||||
private Integer requestCount;
|
||||
private Integer acceptCount;
|
||||
private Integer failCount;
|
||||
}
|
||||
16
src/main/java/com/kri/contact/server/common/external/notihub/NotiHubDestInfoDto.java
vendored
Normal file
16
src/main/java/com/kri/contact/server/common/external/notihub/NotiHubDestInfoDto.java
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
package com.kri.contact.server.common.external.notihub;
|
||||
|
||||
import java.util.Map;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class NotiHubDestInfoDto {
|
||||
|
||||
private String sid;
|
||||
private String destEml;
|
||||
private String destTel;
|
||||
private String destNm;
|
||||
private Map<String, String> msgParam;
|
||||
}
|
||||
16
src/main/java/com/kri/contact/server/common/external/notihub/NotiHubSendRequestBulkDto.java
vendored
Normal file
16
src/main/java/com/kri/contact/server/common/external/notihub/NotiHubSendRequestBulkDto.java
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
package com.kri.contact.server.common.external.notihub;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class NotiHubSendRequestBulkDto {
|
||||
|
||||
private String sendEml;
|
||||
private String sendTel;
|
||||
private String sendNm;
|
||||
private String bulkSendKey;
|
||||
private List<NotiHubDestInfoDto> destInfoList;
|
||||
}
|
||||
20
src/main/java/com/kri/contact/server/common/external/notihub/NotiHubSendRequestSingleDto.java
vendored
Normal file
20
src/main/java/com/kri/contact/server/common/external/notihub/NotiHubSendRequestSingleDto.java
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
package com.kri.contact.server.common.external.notihub;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class NotiHubSendRequestSingleDto {
|
||||
|
||||
private String sendEml;
|
||||
private String sendTel;
|
||||
private String sendNm;
|
||||
private NotiHubDestInfoDto destInfo;
|
||||
private Long tmplatIdx;
|
||||
private String reqstSvc;
|
||||
private String prjctCd;
|
||||
private Boolean resve;
|
||||
private LocalDateTime sendDt;
|
||||
}
|
||||
19
src/main/java/com/kri/contact/server/common/external/notihub/NotiHubTemplateDto.java
vendored
Normal file
19
src/main/java/com/kri/contact/server/common/external/notihub/NotiHubTemplateDto.java
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
package com.kri.contact.server.common.external.notihub;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class NotiHubTemplateDto {
|
||||
|
||||
private Long tmplatIdx;
|
||||
private String tmplatBody;
|
||||
private String sendTel;
|
||||
private String sendEml;
|
||||
private String sendNm;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.kri.contact.server.common.validation;
|
||||
|
||||
import static com.kri.common.feature.util.StringUtil.normalizeBlank;
|
||||
|
||||
import com.kri.contact.server.common.enums.ListFilterMatchType;
|
||||
import com.kri.contact.server.dto.list.ListFilterConditionDto;
|
||||
import jakarta.validation.ConstraintValidator;
|
||||
import jakarta.validation.ConstraintValidatorContext;
|
||||
|
||||
public class ListFilterConditionValidator
|
||||
implements ConstraintValidator<ValidListFilterCondition, ListFilterConditionDto> {
|
||||
|
||||
@Override
|
||||
public boolean isValid(ListFilterConditionDto value, ConstraintValidatorContext context) {
|
||||
if (value == null || value.getMatchType() == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (value.getMatchType() == ListFilterMatchType.EMPTY) {
|
||||
return value.getValues() == null || value.getValues().isEmpty();
|
||||
}
|
||||
|
||||
if (value.getValues() == null || value.getValues().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return value.getValues().stream()
|
||||
.anyMatch(raw -> normalizeBlank(raw) != null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.kri.contact.server.common.validation;
|
||||
|
||||
import jakarta.validation.Constraint;
|
||||
import jakarta.validation.Payload;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Constraint(validatedBy = ListFilterConditionValidator.class)
|
||||
public @interface ValidListFilterCondition {
|
||||
|
||||
String message() default "Invalid list filter condition.";
|
||||
|
||||
Class<?>[] groups() default {};
|
||||
|
||||
Class<? extends Payload>[] payload() default {};
|
||||
}
|
||||
@@ -2,14 +2,17 @@ package com.kri.contact.server.controller;
|
||||
|
||||
import com.kri.common.feature.datetime.DateTimeUtil;
|
||||
import com.kri.common.feature.web.RequestUserContext;
|
||||
import com.kri.contact.server.dto.list.ListAssignRequestDto;
|
||||
import com.kri.contact.server.dto.list.ListAssignResetRequestDto;
|
||||
import com.kri.contact.server.service.AssignService;
|
||||
import com.kri.contact.server.service.SystemEventLogService;
|
||||
import com.kri.contact.server.service.common.SystemEventLogService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
@@ -26,19 +29,19 @@ public class AssignController {
|
||||
private final SystemEventLogService systemEventLogService;
|
||||
private final AssignService assignService;
|
||||
|
||||
@Operation(summary = "배정된 외주사 조회")
|
||||
@GetMapping("/prjct-outsource/{prjctIdx}")
|
||||
public List<String> getPrjctOutsourceAssign(@PathVariable Long prjctIdx) {
|
||||
return assignService.getPrjctOutsourceAssign(prjctIdx);
|
||||
}
|
||||
|
||||
@Operation(summary = "배정된 컨택원/면접원 조회")
|
||||
@Operation(summary = "프로젝트 fieldwork 배정 조회")
|
||||
@GetMapping("/prjct-fieldwork/{prjctIdx}")
|
||||
public List<String> getPrjctFieldworkAssign(@PathVariable Long prjctIdx) {
|
||||
return assignService.getPrjctFieldworkAssign(prjctIdx);
|
||||
}
|
||||
|
||||
@Operation(summary = "컨택원/면접원 배정")
|
||||
@Operation(summary = "프로젝트 회사 배정 조회")
|
||||
@GetMapping("/prjct-cmpn/{prjctIdx}")
|
||||
public List<String> getPrjctCmpnAssign(@PathVariable Long prjctIdx) {
|
||||
return assignService.getPrjctCmpnAssign(prjctIdx);
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트 fieldwork 배정")
|
||||
@PutMapping("/prjct-fieldwork/{prjctIdx}")
|
||||
public void upsertPrjctFieldworkAssign(
|
||||
@PathVariable Long prjctIdx,
|
||||
@@ -50,4 +53,46 @@ public class AssignController {
|
||||
systemEventLogService.writeAssignUserProject(ctx.getUserId(), now, ctx.getClientIp(), prjctIdx,
|
||||
assignUserIdList);
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트 회사 배정")
|
||||
@PutMapping("/prjct-cmpn/{prjctIdx}")
|
||||
public void upsertPrjctCmpnAssign(
|
||||
@PathVariable Long prjctIdx,
|
||||
@Valid @RequestBody List<String> assignCmpnIdList,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
assignService.upsertPrjctCmpnAssign(prjctIdx, assignCmpnIdList, ctx.getUserId(), now);
|
||||
systemEventLogService.writeAssignCmpnProject(ctx.getUserId(), now, ctx.getClientIp(), prjctIdx,
|
||||
assignCmpnIdList);
|
||||
}
|
||||
|
||||
@Operation(summary = "리스트 배정")
|
||||
@PutMapping("/list/{prjctIdx}/{assignId}")
|
||||
public Integer upsertListAssign(
|
||||
@PathVariable Long prjctIdx,
|
||||
@PathVariable String assignId,
|
||||
@Valid @RequestBody ListAssignRequestDto req,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
Integer assignCnt = assignService.upsertListAssign(prjctIdx, assignId, req, ctx.getUserId(), now);
|
||||
systemEventLogService.writeAssignList(ctx.getUserId(), now, ctx.getClientIp(), prjctIdx, req);
|
||||
|
||||
return assignCnt;
|
||||
}
|
||||
|
||||
@Operation(summary = "리스트 배정 초기화")
|
||||
@DeleteMapping("/list/reset/{prjctIdx}")
|
||||
public Integer resetListAssign(
|
||||
@PathVariable Long prjctIdx,
|
||||
@Valid @RequestBody ListAssignResetRequestDto req,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
Integer resetCnt = assignService.resetListAssign(prjctIdx, req);
|
||||
systemEventLogService.writeAssignListReset(ctx.getUserId(), now, ctx.getClientIp(), prjctIdx, req);
|
||||
|
||||
return resetCnt;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.kri.common.feature.web.RequestUserContext;
|
||||
import com.kri.contact.server.dto.auth.LoginRequestDto;
|
||||
import com.kri.contact.server.dto.auth.LoginResponseDto;
|
||||
import com.kri.contact.server.service.AuthService;
|
||||
import com.kri.contact.server.service.SystemEventLogService;
|
||||
import com.kri.contact.server.service.common.SystemEventLogService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.kri.contact.server.controller;
|
||||
|
||||
import com.kri.common.feature.datetime.DateTimeUtil;
|
||||
import com.kri.common.feature.web.RequestUserContext;
|
||||
import com.kri.contact.server.dto.cmpn.CmpnInfoDto;
|
||||
import com.kri.contact.server.dto.common.DataVerificationDto;
|
||||
import com.kri.contact.server.service.CmpnService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PatchMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/cmpn")
|
||||
@RequiredArgsConstructor
|
||||
@Tag(name = "Cmpn", description = "회사 관리 API")
|
||||
public class CmpnController {
|
||||
|
||||
private final CmpnService cmpnService;
|
||||
|
||||
@Operation(summary = "회사 ID 사용 가능 여부 확인")
|
||||
@GetMapping("/check-cmpn-id")
|
||||
public DataVerificationDto checkCmpnId(@RequestParam String cmpnId) {
|
||||
return cmpnService.checkCmpnId(cmpnId);
|
||||
}
|
||||
|
||||
@Operation(summary = "회사 정보 조회")
|
||||
@GetMapping("/{cmpnId}")
|
||||
public CmpnInfoDto getCmpn(@PathVariable String cmpnId) {
|
||||
return cmpnService.getCmpn(cmpnId);
|
||||
}
|
||||
|
||||
@Operation(summary = "회사 목록 조회")
|
||||
@GetMapping
|
||||
public List<CmpnInfoDto> getCmpnList() {
|
||||
return cmpnService.getCmpnList();
|
||||
}
|
||||
|
||||
@Operation(summary = "회사 생성")
|
||||
@PutMapping
|
||||
public void createCmpn(
|
||||
@Valid @RequestBody CmpnInfoDto cmpnInfo,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
cmpnService.createCmpn(cmpnInfo, ctx.getUserId(), now);
|
||||
}
|
||||
|
||||
@Operation(summary = "회사 정보 수정")
|
||||
@PatchMapping
|
||||
public void updateCmpn(
|
||||
@Valid @RequestBody CmpnInfoDto dto,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
cmpnService.updateCmpn(dto, ctx.getUserId(), now);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.kri.contact.server.controller;
|
||||
|
||||
import com.kri.common.feature.datetime.DateTimeUtil;
|
||||
import com.kri.common.feature.web.RequestUserContext;
|
||||
import com.kri.contact.server.dto.list.ListCallHistDto;
|
||||
import com.kri.contact.server.dto.list.ListCallHistRequestDto;
|
||||
import com.kri.contact.server.service.ListCallHistService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/list-call-hist")
|
||||
@RequiredArgsConstructor
|
||||
@Tag(name = "ListCallHistory", description = "List call history API")
|
||||
public class ListCallHistController {
|
||||
|
||||
private final ListCallHistService listCallHistService;
|
||||
|
||||
@Operation(summary = "Save list call history")
|
||||
@PutMapping("/{prjctIdx}/{sid}")
|
||||
public ListCallHistDto saveCallHistory(
|
||||
@PathVariable Long prjctIdx,
|
||||
@PathVariable Integer sid,
|
||||
@Valid @RequestBody ListCallHistRequestDto request,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
return listCallHistService.saveCallHistory(prjctIdx, sid, request, ctx.getUserId(), now);
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.kri.contact.server.controller;
|
||||
import static com.kri.contact.server.common.util.ExcelResponseBuilder.buildExcelResponse;
|
||||
|
||||
import com.kri.common.feature.datetime.DateTimeUtil;
|
||||
import com.kri.common.feature.util.CollectionUtil;
|
||||
import com.kri.common.feature.web.BusinessException;
|
||||
import com.kri.common.feature.web.RequestUserContext;
|
||||
import com.kri.common.feature.web.page.PageResponseDto;
|
||||
@@ -13,20 +14,30 @@ import com.kri.contact.server.dto.list.ListResetRequestDto;
|
||||
import com.kri.contact.server.dto.list.ListSearchRequestDto;
|
||||
import com.kri.contact.server.dto.list.ListSearchWithFullResultDto;
|
||||
import com.kri.contact.server.dto.list.ListUpdateRequestDto;
|
||||
import com.kri.contact.server.dto.list.ListUploadFileInfoDto;
|
||||
import com.kri.contact.server.dto.list.ListUploadHistoryDto;
|
||||
import com.kri.contact.server.dto.list.ListUploadRequestDto;
|
||||
import com.kri.contact.server.dto.project.ProjectInfoDto;
|
||||
import com.kri.contact.server.dto.systemlog.UploadContentDto;
|
||||
import com.kri.contact.server.service.ListDownloadService;
|
||||
import com.kri.contact.server.service.ListResetService;
|
||||
import com.kri.contact.server.service.ListSearchService;
|
||||
import com.kri.contact.server.service.ListUpdateService;
|
||||
import com.kri.contact.server.service.ListUploadService;
|
||||
import com.kri.contact.server.service.ProjectService;
|
||||
import com.kri.contact.server.service.SystemEventLogService;
|
||||
import com.kri.contact.server.service.common.SystemEventLogService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
@@ -56,7 +67,7 @@ public class ListController {
|
||||
private final SystemEventLogService systemEventLogService;
|
||||
|
||||
@Operation(summary = "리스트 정보 조회 With Sid")
|
||||
@GetMapping("/search/{prjctIdx}/{sid}")
|
||||
@GetMapping("/search-sid/{prjctIdx}/{sid}")
|
||||
public ListSearchWithFullResultDto searchListWithSid(
|
||||
@PathVariable Long prjctIdx,
|
||||
@PathVariable Integer sid
|
||||
@@ -65,7 +76,7 @@ public class ListController {
|
||||
}
|
||||
|
||||
@Operation(summary = "리스트 정보 조회 With Filter")
|
||||
@PostMapping("/search/{prjctIdx}")
|
||||
@PostMapping("/search-filter/{prjctIdx}")
|
||||
public PageResponseDto<ListSearchWithFullResultDto> searchListWithFilter(
|
||||
@PathVariable Long prjctIdx,
|
||||
@Valid @RequestBody ListSearchRequestDto request
|
||||
@@ -85,11 +96,29 @@ public class ListController {
|
||||
return buildExcelResponse(projectInfoDto.getPrjctName() + " upload_template.xlsx", bytes);
|
||||
}
|
||||
|
||||
@Operation(summary = "리스트 업로드 이력 조회")
|
||||
@GetMapping("/excel/upload-history/{prjctIdx}")
|
||||
public List<ListUploadHistoryDto> findUploadHistories(@PathVariable Long prjctIdx) {
|
||||
getProjectOrThrow(prjctIdx);
|
||||
return listUploadService.findUploadHistories(prjctIdx);
|
||||
}
|
||||
|
||||
@Operation(summary = "리스트 업로드 파일 다운로드")
|
||||
@PostMapping("/excel/upload-history/file/{prjctIdx}/{listUploadLogId}")
|
||||
public ResponseEntity<byte[]> downloadUploadFile(
|
||||
@PathVariable Long prjctIdx,
|
||||
@PathVariable String listUploadLogId
|
||||
) {
|
||||
getProjectOrThrow(prjctIdx);
|
||||
ListUploadFileInfoDto uploadFile = listUploadService.downloadUploadFile(prjctIdx, listUploadLogId);
|
||||
return buildExcelResponse(uploadFile.getFileName(), uploadFile.getBytes());
|
||||
}
|
||||
|
||||
@Operation(summary = "리스트 다운로드")
|
||||
@PostMapping("/excel/download/{prjctIdx}")
|
||||
public ResponseEntity<byte[]> downloadList(
|
||||
@PathVariable Long prjctIdx,
|
||||
@RequestBody(required = false) ListFilterDto listFilter
|
||||
@Valid @RequestBody(required = false) ListFilterDto listFilter
|
||||
) {
|
||||
ProjectInfoDto projectInfoDto = getProjectOrThrow(prjctIdx);
|
||||
byte[] bytes = listDownloadService.downloadList(prjctIdx, listFilter);
|
||||
@@ -100,7 +129,7 @@ public class ListController {
|
||||
@PostMapping("/excel/download/update/{prjctIdx}")
|
||||
public ResponseEntity<byte[]> downloadListUpdateHistory(
|
||||
@PathVariable Long prjctIdx,
|
||||
@RequestBody(required = false) ListFilterDto listFilter
|
||||
@Valid @RequestBody(required = false) ListFilterDto listFilter
|
||||
) {
|
||||
ProjectInfoDto projectInfoDto = getProjectOrThrow(prjctIdx);
|
||||
byte[] bytes = listDownloadService.downloadSidWithUpdateHist(prjctIdx, listFilter);
|
||||
@@ -119,7 +148,7 @@ public class ListController {
|
||||
|
||||
LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
ExcelUploadResultDto result = listUploadService.uploadExcel(prjctIdx, file, request, ctx.getUserId(), now);
|
||||
systemEventLogService.writeUploadList(ctx.getUserId(), now, ctx.getClientIp(), prjctIdx, file.getOriginalFilename());
|
||||
systemEventLogService.writeUploadList(ctx.getUserId(), now, ctx.getClientIp(), prjctIdx, UploadContentDto.from(file));
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -130,12 +159,46 @@ public class ListController {
|
||||
@Valid @RequestBody ListUpdateRequestDto request,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
validateListUpdateRequest(request);
|
||||
|
||||
LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
int updateCount = listUpdateService.updateList(prjctIdx, request, ctx.getUserRole(), ctx.getUserId(), now);
|
||||
systemEventLogService.writeUpdateList(ctx.getUserId(), now, ctx.getClientIp(), prjctIdx, request);
|
||||
return updateCount;
|
||||
}
|
||||
|
||||
@Operation(summary = "리스트 별 파일 업로드")
|
||||
@PostMapping(value = "/item-file/upload/{prjctIdx}/{sid}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
public void uploadItemFile(
|
||||
@PathVariable Long prjctIdx,
|
||||
@PathVariable Integer sid,
|
||||
@RequestParam Map<String, MultipartFile> files,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
getProjectOrThrow(prjctIdx);
|
||||
LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
listUploadService.uploadItemFile(prjctIdx, sid, files, ctx.getUserRole(), ctx.getUserId(), now);
|
||||
|
||||
Map<String, UploadContentDto> contents = files.entrySet().stream()
|
||||
.filter(e -> e.getValue() != null)
|
||||
.collect(Collectors.toMap(
|
||||
Map.Entry::getKey,
|
||||
e -> UploadContentDto.from(e.getValue())
|
||||
));
|
||||
systemEventLogService.writeUploadListItemFiles(ctx.getUserId(), now, ctx.getClientIp(), prjctIdx, contents);
|
||||
}
|
||||
|
||||
@Operation(summary = "리스트 별 업로드 파일 다운로드")
|
||||
@PostMapping("/item-file/download/{prjctIdx}")
|
||||
public ResponseEntity<byte[]> downloadItemFile(
|
||||
@PathVariable Long prjctIdx,
|
||||
@Valid @RequestBody(required = false) ListFilterDto listFilter
|
||||
){
|
||||
ProjectInfoDto projectInfoDto = getProjectOrThrow(prjctIdx);
|
||||
byte[] bytes = listDownloadService.downloadItemFile(prjctIdx, listFilter);
|
||||
return buildZipResponse(projectInfoDto.getPrjctName() + " item_files.zip", bytes);
|
||||
}
|
||||
|
||||
@Operation(summary = "리스트 초기화")
|
||||
@DeleteMapping("/{prjctIdx}")
|
||||
public int resetList(
|
||||
@@ -162,4 +225,23 @@ public class ListController {
|
||||
}
|
||||
return projectInfoDto;
|
||||
}
|
||||
|
||||
private void validateListUpdateRequest(ListUpdateRequestDto request){
|
||||
if(
|
||||
CollectionUtil.isEmpty(request.getUpdateContents()) &&
|
||||
CollectionUtil.isEmpty(request.getUpdateResultCodes())
|
||||
){
|
||||
throw BusinessException.badRequest("EMPTY_UPDATE_CONTENT","리스트 수정내용이 없습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
private ResponseEntity<byte[]> buildZipResponse(String fileName, byte[] bytes) {
|
||||
String contentDisposition = "attachment; filename*=UTF-8''" +
|
||||
URLEncoder.encode(fileName, StandardCharsets.UTF_8).replace("+", "%20");
|
||||
|
||||
return ResponseEntity.ok()
|
||||
.header(HttpHeaders.CONTENT_DISPOSITION, contentDisposition)
|
||||
.contentType(MediaType.parseMediaType("application/zip"))
|
||||
.body(bytes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,8 +3,9 @@ package com.kri.contact.server.controller;
|
||||
import com.kri.common.feature.datetime.DateTimeUtil;
|
||||
import com.kri.common.feature.web.RequestUserContext;
|
||||
import com.kri.contact.server.dto.list.ListHeaderDto;
|
||||
import com.kri.contact.server.dto.list.ListHeaderWithFilterContentDto;
|
||||
import com.kri.contact.server.service.ListHeaderService;
|
||||
import com.kri.contact.server.service.SystemEventLogService;
|
||||
import com.kri.contact.server.service.common.SystemEventLogService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
@@ -24,12 +25,12 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@Tag(name = "ListHeader", description = "리스트 헤더 API")
|
||||
public class ListHeaderController {
|
||||
|
||||
ListHeaderService listHeaderService;
|
||||
SystemEventLogService systemEventLogService;
|
||||
private final ListHeaderService listHeaderService;
|
||||
private final SystemEventLogService systemEventLogService;
|
||||
|
||||
@Operation(summary = "리스트 헤더 조회")
|
||||
@GetMapping("/{prjctIdx}")
|
||||
public List<ListHeaderDto> getListHeader (@PathVariable Long prjctIdx) {
|
||||
public List<ListHeaderWithFilterContentDto> getListHeader (@PathVariable Long prjctIdx) {
|
||||
return listHeaderService.getHeader(prjctIdx);
|
||||
}
|
||||
|
||||
@@ -41,7 +42,7 @@ public class ListHeaderController {
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
listHeaderService.upsertHeader(prjctIdx, headerList, ctx.getUserId(), now);
|
||||
listHeaderService.updateListHeader(prjctIdx, headerList, ctx.getUserId(), now);
|
||||
|
||||
systemEventLogService.writeUpsertListHeader(ctx.getUserId(), now, ctx.getClientIp(), prjctIdx,
|
||||
headerList);
|
||||
|
||||
@@ -2,30 +2,64 @@ package com.kri.contact.server.controller;
|
||||
|
||||
import static com.kri.contact.server.common.util.ExcelResponseBuilder.buildExcelResponse;
|
||||
|
||||
import com.kri.common.feature.datetime.DateTimeUtil;
|
||||
import com.kri.common.feature.web.BusinessException;
|
||||
import com.kri.common.feature.web.RequestUserContext;
|
||||
import com.kri.contact.server.common.enums.ResultCodeType;
|
||||
import com.kri.contact.server.dto.list.ListEventHistDownloadRequestDto;
|
||||
import com.kri.contact.server.dto.list.ListEventHistFromSurveyDto;
|
||||
import com.kri.contact.server.dto.list.ListEventHistInsertRequestDto;
|
||||
import com.kri.contact.server.dto.list.ListEventHistSurveyMetaDto;
|
||||
import com.kri.contact.server.dto.list.ListEventHistoryDto;
|
||||
import com.kri.contact.server.dto.list.ListUpdateHistoryDto;
|
||||
import com.kri.contact.server.dto.project.ProjectInfoDto;
|
||||
import com.kri.contact.server.service.ListDownloadService;
|
||||
import com.kri.contact.server.service.ListHistoryQueryService;
|
||||
import com.kri.contact.server.service.ListUpdateService;
|
||||
import com.kri.contact.server.service.ProjectService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/list")
|
||||
@RequestMapping("/api/v1/list-hist")
|
||||
@RequiredArgsConstructor
|
||||
@Tag(name = "ListHistory", description = "리스트 이력 API")
|
||||
public class ListHistoryController {
|
||||
|
||||
private final ProjectService projectService;
|
||||
private final ListDownloadService listDownloadService;
|
||||
private final ListHistoryQueryService listHistoryQueryService;
|
||||
private final ListUpdateService listUpdateService;
|
||||
|
||||
@Operation(summary = "List event history")
|
||||
@GetMapping("/event/{prjctIdx}/{sid}")
|
||||
public List<ListEventHistoryDto> findListEventHistories(
|
||||
@PathVariable Long prjctIdx,
|
||||
@PathVariable Integer sid
|
||||
) {
|
||||
return listHistoryQueryService.findEventHistories(prjctIdx, sid);
|
||||
}
|
||||
|
||||
@Operation(summary = "List update history")
|
||||
@GetMapping("/update/{prjctIdx}/{sid}")
|
||||
public List<ListUpdateHistoryDto> findListUpdateHistories(
|
||||
@PathVariable Long prjctIdx,
|
||||
@PathVariable Integer sid
|
||||
) {
|
||||
return listHistoryQueryService.findUpdateHistories(prjctIdx, sid);
|
||||
}
|
||||
|
||||
@Operation(summary = "리스트 이벤트 이력 다운로드")
|
||||
@PostMapping("/excel/download/event/{prjctIdx}")
|
||||
@@ -38,11 +72,52 @@ public class ListHistoryController {
|
||||
prjctIdx,
|
||||
request.getListFilter(),
|
||||
request.getResultCodeTypes(),
|
||||
request.getSearchBase(),
|
||||
request.getDateRange()
|
||||
);
|
||||
return buildExcelResponse(projectInfoDto.getPrjctName() + " 컨택 이력.xlsx", bytes);
|
||||
}
|
||||
|
||||
@Operation(description = "설문 상태 추가")
|
||||
@PostMapping("/survey")
|
||||
public void putSurveyHistory(
|
||||
@Valid @RequestBody ListEventHistFromSurveyDto request,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
if (request.getMeta().getRemoteAddr() == null) {
|
||||
request.getMeta().setRemoteAddr(ctx.getClientIp());
|
||||
}
|
||||
String regUser = resolveRegUser(request, ctx);
|
||||
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
listUpdateService.putSurveyHistory(request, regUser, now);
|
||||
}
|
||||
|
||||
@Operation(description = "리스트 이벤트 이력 추가")
|
||||
@PutMapping("/event")
|
||||
public void putInternalEventHistory(
|
||||
@Valid @RequestBody ListEventHistInsertRequestDto request,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
listUpdateService.putInternalEventHistory(
|
||||
request,
|
||||
ctx.getClientIp(),
|
||||
ctx.getUserId(),
|
||||
now
|
||||
);
|
||||
}
|
||||
|
||||
private String resolveRegUser(ListEventHistFromSurveyDto request, RequestUserContext ctx) {
|
||||
if (ctx.getUserId() != null) {
|
||||
return ctx.getUserId();
|
||||
}
|
||||
ListEventHistSurveyMetaDto meta = request.getMeta();
|
||||
if (meta != null && meta.getEntryType() != null) {
|
||||
return meta.getEntryType().name();
|
||||
}
|
||||
return "SYSTEM";
|
||||
}
|
||||
|
||||
private ProjectInfoDto getProjectOrThrow(Long prjctIdx) {
|
||||
ProjectInfoDto projectInfoDto = projectService.getProject(prjctIdx);
|
||||
if (projectInfoDto == null) {
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.kri.contact.server.controller;
|
||||
|
||||
import com.kri.common.feature.web.RequestUserContext;
|
||||
import com.kri.contact.server.dto.message.MessageBulkSendResponseDto;
|
||||
import com.kri.contact.server.dto.message.MessageSendBulkRequestDto;
|
||||
import com.kri.contact.server.dto.message.MessageSendSingleRequestDto;
|
||||
import com.kri.contact.server.service.MessageService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/message")
|
||||
@RequiredArgsConstructor
|
||||
@Tag(name = "Message", description = "Message send API")
|
||||
public class MessageController {
|
||||
|
||||
private final MessageService messageService;
|
||||
|
||||
@Operation(summary = "Email single send")
|
||||
@PostMapping("/email/single/{prjctIdx}")
|
||||
public void sendEmailSingle(
|
||||
@PathVariable Long prjctIdx,
|
||||
@Valid @RequestBody MessageSendSingleRequestDto request,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
messageService.sendEmailSingle(prjctIdx, request, ctx);
|
||||
}
|
||||
|
||||
@Operation(summary = "Email bulk send")
|
||||
@PostMapping("/email/bulk/{prjctIdx}")
|
||||
public MessageBulkSendResponseDto sendEmailBulk(
|
||||
@PathVariable Long prjctIdx,
|
||||
@Valid @RequestBody MessageSendBulkRequestDto request,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
return messageService.sendEmailBulk(prjctIdx, request, ctx);
|
||||
}
|
||||
|
||||
@Operation(summary = "SMS single send")
|
||||
@PostMapping("/sms/single/{prjctIdx}")
|
||||
public void sendSmsSingle(
|
||||
@PathVariable Long prjctIdx,
|
||||
@Valid @RequestBody MessageSendSingleRequestDto request,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
messageService.sendSmsSingle(prjctIdx, request, ctx);
|
||||
}
|
||||
|
||||
@Operation(summary = "SMS bulk send")
|
||||
@PostMapping("/sms/bulk/{prjctIdx}")
|
||||
public MessageBulkSendResponseDto sendSmsBulk(
|
||||
@PathVariable Long prjctIdx,
|
||||
@Valid @RequestBody MessageSendBulkRequestDto request,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
return messageService.sendSmsBulk(prjctIdx, request, ctx);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.kri.contact.server.controller;
|
||||
|
||||
import com.kri.contact.server.dto.progress.ProgressDateResponseDto;
|
||||
import com.kri.contact.server.dto.progress.ProgressSearchRequestDto;
|
||||
import com.kri.contact.server.dto.progress.ProgressUserResponseDto;
|
||||
import com.kri.contact.server.service.ProgressService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/progress")
|
||||
@RequiredArgsConstructor
|
||||
@Tag(name = "Progress", description = "진행 현황 API")
|
||||
public class ProgressController {
|
||||
|
||||
private final ProgressService progressService;
|
||||
|
||||
@Operation(summary = "사용자별 컨택 진행 현황")
|
||||
@PostMapping("/user/{prjctIdx}/{eventTy}")
|
||||
public List<ProgressUserResponseDto> getUserProgress(
|
||||
@PathVariable Long prjctIdx,
|
||||
@PathVariable Short eventTy,
|
||||
@RequestBody(required = false) ProgressSearchRequestDto request
|
||||
) {
|
||||
return progressService.getUserProgress(prjctIdx, eventTy, request);
|
||||
}
|
||||
|
||||
@Operation(summary = "날짜별 전체 컨택 진행 현황")
|
||||
@PostMapping("/date/{prjctIdx}/{eventTy}")
|
||||
public List<ProgressDateResponseDto> getDateProgress(
|
||||
@PathVariable Long prjctIdx,
|
||||
@PathVariable Short eventTy,
|
||||
@RequestBody(required = false) ProgressSearchRequestDto request
|
||||
) {
|
||||
return progressService.getDateProgress(prjctIdx, eventTy, request);
|
||||
}
|
||||
|
||||
@Operation(summary = "날짜별 마지막 컨택 진행 현황")
|
||||
@PostMapping("/last-date/{prjctIdx}/{eventTy}")
|
||||
public List<ProgressDateResponseDto> getLastDateProgress(
|
||||
@PathVariable Long prjctIdx,
|
||||
@PathVariable Short eventTy,
|
||||
@RequestBody(required = false) ProgressSearchRequestDto request
|
||||
) {
|
||||
return progressService.getLastDateProgress(prjctIdx, eventTy, request);
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ import com.kri.contact.server.dto.project.ProjectSearchRequestDto;
|
||||
import com.kri.contact.server.dto.project.ProjectUpdateRequestDto;
|
||||
import com.kri.contact.server.service.file.ContactScenarioFileService;
|
||||
import com.kri.contact.server.service.ProjectService;
|
||||
import com.kri.contact.server.service.SystemEventLogService;
|
||||
import com.kri.contact.server.service.common.SystemEventLogService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
@@ -54,7 +54,8 @@ public class ProjectController {
|
||||
@RequestParam(required = false) String keyword,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
return projectService.getTopProject(topCount, keyword, ctx.getUserId(), ctx.getUserRole());
|
||||
return projectService.getTopProject(topCount, keyword, ctx.getUserId(), ctx.getUserCmpn(),
|
||||
ctx.getUserRole());
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트 목록 조회")
|
||||
@@ -63,7 +64,7 @@ public class ProjectController {
|
||||
@Valid @RequestBody ProjectSearchRequestDto req,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
return projectService.searchProject(req, ctx.getUserId(), ctx.getUserRole());
|
||||
return projectService.searchProject(req, ctx.getUserId(), ctx.getUserCmpn(), ctx.getUserRole());
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트를 소유하고 있는 모든 부서/실사 목록 조회")
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.kri.contact.server.controller;
|
||||
|
||||
import com.kri.common.feature.datetime.DateTimeUtil;
|
||||
import com.kri.common.feature.web.RequestUserContext;
|
||||
import com.kri.contact.server.dto.reserve.ListReserveDto;
|
||||
import com.kri.contact.server.dto.reserve.ListReserveRequestDto;
|
||||
import com.kri.contact.server.service.ReserveService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/reserve")
|
||||
@RequiredArgsConstructor
|
||||
@Tag(name = "Reserve", description = "List reserve API")
|
||||
public class ReserveController {
|
||||
|
||||
private final ReserveService reserveService;
|
||||
|
||||
@Operation(summary = "Reserve list")
|
||||
@PutMapping
|
||||
public ListReserveDto reserve(
|
||||
@Valid @RequestBody ListReserveRequestDto request,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
return reserveService.reserve(request, ctx.getUserId(), now);
|
||||
}
|
||||
|
||||
@Operation(summary = "Find reserves by user")
|
||||
@GetMapping("/{prjctIdx}/user/{userId}")
|
||||
public List<ListReserveDto> findByUser(
|
||||
@PathVariable Long prjctIdx,
|
||||
@PathVariable String userId
|
||||
) {
|
||||
return reserveService.findByUser(prjctIdx, userId);
|
||||
}
|
||||
|
||||
@Operation(summary = "Find reserves by sid")
|
||||
@GetMapping("/{prjctIdx}/sid/{sid}")
|
||||
public List<ListReserveDto> findBySid(
|
||||
@PathVariable Long prjctIdx,
|
||||
@PathVariable Integer sid
|
||||
) {
|
||||
return reserveService.findBySid(prjctIdx, sid);
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package com.kri.contact.server.controller;
|
||||
import com.kri.contact.server.common.enums.ResultCodeType;
|
||||
import com.kri.contact.server.dto.project.ResultCodeDto;
|
||||
import com.kri.contact.server.service.ResultCodeService;
|
||||
import com.kri.contact.server.service.SystemEventLogService;
|
||||
import com.kri.contact.server.service.common.SystemEventLogService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
package com.kri.contact.server.controller;
|
||||
|
||||
import static com.kri.contact.server.common.util.ExcelResponseBuilder.buildExcelResponse;
|
||||
|
||||
import com.kri.common.feature.datetime.DateTimeUtil;
|
||||
import com.kri.common.feature.web.RequestUserContext;
|
||||
import com.kri.contact.server.common.consts.ContactConstant;
|
||||
import com.kri.contact.server.dto.common.DataVerificationDto;
|
||||
import com.kri.contact.server.dto.excel.ExcelUploadResultDto;
|
||||
import com.kri.contact.server.dto.systemlog.UploadUserContentDto;
|
||||
import com.kri.contact.server.dto.systemlog.UploadContentDto;
|
||||
import com.kri.contact.server.dto.user.UserInfoDto;
|
||||
import com.kri.contact.server.service.SystemEventLogService;
|
||||
import com.kri.contact.server.service.common.SystemEventLogService;
|
||||
import com.kri.contact.server.service.UserService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@@ -28,7 +30,6 @@ import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RequestPart;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@@ -122,12 +123,7 @@ public class UserController {
|
||||
|
||||
ExcelUploadResultDto result = userService.createUsersFromExcel(file, regId, now, forceCmpn);
|
||||
|
||||
UploadUserContentDto content = new UploadUserContentDto(
|
||||
file.getOriginalFilename(),
|
||||
file.getContentType(),
|
||||
file.getSize()
|
||||
);
|
||||
systemEventLogService.writeUploadUserLog(regId, now, clientIp, content);
|
||||
systemEventLogService.writeUploadUserLog(regId, now, clientIp, UploadContentDto.from(file));
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -137,12 +133,7 @@ public class UserController {
|
||||
public ResponseEntity<byte[]> exportUserTemplate() {
|
||||
byte[] bytes = userService.exportUserTemplate();
|
||||
|
||||
return ResponseEntity.ok()
|
||||
.header(HttpHeaders.CONTENT_DISPOSITION,
|
||||
"attachment; filename=\"user_upload_template.xlsx\"")
|
||||
.contentType(MediaType.parseMediaType(
|
||||
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"))
|
||||
.body(bytes);
|
||||
return buildExcelResponse("user_upload_template.xlsx", bytes);
|
||||
}
|
||||
|
||||
@Operation(summary = "사용자 정보 수정")
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.kri.contact.server.dto.cmpn;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.kri.contact.server.persistence.entity.TCmpnEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "회사 정보")
|
||||
public class CmpnInfoDto {
|
||||
|
||||
@Size(max = 32)
|
||||
@NotBlank
|
||||
@Schema(description = "회사 id(회사이름)")
|
||||
private String cmpnId;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotBlank
|
||||
@Schema(description = "회사 별칭")
|
||||
private String cmpnAlias;
|
||||
|
||||
@Size(max = 16)
|
||||
@Schema(description = "회사 전화번호")
|
||||
private String cmpnTel;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "자사 여부")
|
||||
private Boolean ownCmpn;
|
||||
|
||||
@Schema(description = "메모")
|
||||
private String memo;
|
||||
|
||||
@Size(max = 32)
|
||||
@Schema(description = "등록자", accessMode = Schema.AccessMode.READ_ONLY)
|
||||
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
||||
private String regUser;
|
||||
|
||||
@Schema(description = "등록일시", accessMode = Schema.AccessMode.READ_ONLY)
|
||||
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
||||
private LocalDateTime regDt;
|
||||
|
||||
@Size(max = 32)
|
||||
@Schema(description = "수정자", accessMode = Schema.AccessMode.READ_ONLY)
|
||||
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
||||
private String modUser;
|
||||
|
||||
@Schema(description = "수정일시", accessMode = Schema.AccessMode.READ_ONLY)
|
||||
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
|
||||
private LocalDateTime modDt;
|
||||
|
||||
public static CmpnInfoDto from(TCmpnEntity entity) {
|
||||
return CmpnInfoDto.builder()
|
||||
.cmpnId(entity.getCmpnId())
|
||||
.cmpnAlias(entity.getCmpnAlias())
|
||||
.cmpnTel(entity.getCmpnTel())
|
||||
.ownCmpn(entity.getOwnCmpn())
|
||||
.memo(entity.getMemo())
|
||||
.regUser(entity.getRegUser())
|
||||
.regDt(entity.getRegDt())
|
||||
.modUser(entity.getModUser())
|
||||
.modDt(entity.getModDt())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.common.enums.ListHeaderTypeAssign;
|
||||
import com.kri.contact.server.common.validation.ValidListFilterCondition;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@ValidListFilterCondition
|
||||
@Schema(description = "배정 필터 조건")
|
||||
public class ListAssignFilterConditionDto extends ListFilterConditionDto {
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "배정 타입")
|
||||
private ListHeaderTypeAssign assignType;
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
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,35 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.common.enums.ListAssignType;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "리스트 배정 요청 Dto")
|
||||
public class ListAssignRequestDto {
|
||||
|
||||
@Valid
|
||||
@NotNull
|
||||
@Schema(description = "배정 타입")
|
||||
private ListAssignType assignType;
|
||||
|
||||
@Valid
|
||||
@NotNull
|
||||
@Schema(description = "배정시 예약 이관 여부")
|
||||
private Boolean transferResve;
|
||||
|
||||
@Valid
|
||||
@Schema(description = "리스트 필터")
|
||||
private ListFilterDto listFilter;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.common.enums.ListAssignType;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "리스트 배정 초기화 요청 Dto")
|
||||
public class ListAssignResetRequestDto {
|
||||
|
||||
@Valid
|
||||
@NotNull
|
||||
@Schema(description = "배정 타입")
|
||||
private ListAssignType assignType;
|
||||
|
||||
@Valid
|
||||
@Schema(description = "리스트 필터")
|
||||
private ListFilterDto listFilter;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.persistence.entity.TListCallHistEntity;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class ListCallHistDto {
|
||||
|
||||
private Long listCallHistIdx;
|
||||
private Long prjctIdx;
|
||||
private Integer sid;
|
||||
private Integer listHderId;
|
||||
private String destNum;
|
||||
private String agentNum;
|
||||
private String aniNum;
|
||||
private String agentSessionId;
|
||||
private String destSessionId;
|
||||
private String callTy;
|
||||
private LocalDateTime startDt;
|
||||
private Integer totalTime;
|
||||
private Integer talkTime;
|
||||
private Integer mediaServerId;
|
||||
private String mediaServerName;
|
||||
private String recordFileName;
|
||||
private String regUser;
|
||||
private LocalDateTime regDt;
|
||||
|
||||
public static ListCallHistDto from(TListCallHistEntity entity) {
|
||||
return ListCallHistDto.builder()
|
||||
.listCallHistIdx(entity.getId())
|
||||
.prjctIdx(entity.getPrjctIdx())
|
||||
.sid(entity.getSid())
|
||||
.listHderId(entity.getListHderId())
|
||||
.destNum(entity.getDestNum())
|
||||
.agentNum(entity.getAgentNum())
|
||||
.aniNum(entity.getAniNum())
|
||||
.agentSessionId(entity.getAgentSessionId())
|
||||
.destSessionId(entity.getDestSessionId())
|
||||
.callTy(entity.getCallTy())
|
||||
.startDt(entity.getStartDt())
|
||||
.totalTime(entity.getTotalTime())
|
||||
.talkTime(entity.getTalkTime())
|
||||
.mediaServerId(entity.getMediaServerId())
|
||||
.mediaServerName(entity.getMediaServerName())
|
||||
.recordFileName(entity.getRecordFileName())
|
||||
.regUser(entity.getRegUser())
|
||||
.regDt(entity.getRegDt())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public class ListCallHistRequestDto {
|
||||
|
||||
@NotNull
|
||||
private Integer listHderId;
|
||||
|
||||
@NotBlank
|
||||
@Size(max = 64)
|
||||
private String destNum;
|
||||
|
||||
@NotBlank
|
||||
@Size(max = 64)
|
||||
private String agentNum;
|
||||
|
||||
@NotBlank
|
||||
@Size(max = 64)
|
||||
private String aniNum;
|
||||
|
||||
@NotBlank
|
||||
@Size(max = 64)
|
||||
private String agentSessionId;
|
||||
|
||||
@NotBlank
|
||||
@Size(max = 64)
|
||||
private String destSessionId;
|
||||
|
||||
@NotBlank
|
||||
@Size(max = 64)
|
||||
private String callTy;
|
||||
|
||||
@NotNull
|
||||
private LocalDateTime startDt;
|
||||
|
||||
@NotNull
|
||||
private Integer totalTime;
|
||||
|
||||
@NotNull
|
||||
private Integer talkTime;
|
||||
|
||||
@NotNull
|
||||
private Integer mediaServerId;
|
||||
|
||||
@NotBlank
|
||||
@Size(max = 64)
|
||||
private String mediaServerName;
|
||||
|
||||
@NotBlank
|
||||
@Size(max = 256)
|
||||
private String recordFileName;
|
||||
}
|
||||
@@ -16,16 +16,13 @@ import lombok.experimental.SuperBuilder;
|
||||
@Schema(description = "컨택/방문 면접 결과")
|
||||
public class ListContactResultDto extends ListResultBaseDto {
|
||||
|
||||
@Schema(description = "컨택/방문면접 시도 횟수")
|
||||
private Integer attemptCount;
|
||||
|
||||
@Schema(description = "마지막 컨택/방문면접 자")
|
||||
@Schema(description = "마지막 컨택/방문면접원")
|
||||
private String lastUser;
|
||||
|
||||
@Schema(description = "할당된 컨택/방문면접자")
|
||||
@Schema(description = "할당된 컨택/방문면접원")
|
||||
private String assignUser;
|
||||
|
||||
public static ListContactResultDto from(TListEventHistEntity entity) {
|
||||
public static ListContactResultDto from(TListEventHistEntity entity, Integer attemptCount) {
|
||||
if (entity == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -33,6 +30,7 @@ public class ListContactResultDto extends ListResultBaseDto {
|
||||
return ListContactResultDto.builder()
|
||||
.lastResultCd(entity.getResultCd() == null ? null : entity.getResultCd().shortValue())
|
||||
.lastResultDt(entity.getRegDt())
|
||||
.attemptCount(attemptCount)
|
||||
.lastUser(entity.getRegUser())
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.common.enums.ListEventHistoryBase;
|
||||
import com.kri.contact.server.common.enums.ResultCodeType;
|
||||
import com.kri.contact.server.dto.common.DateRangeDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -17,6 +18,7 @@ import lombok.Setter;
|
||||
@Schema(description = "리스트 + 컨택이력 다운로드 요청 DTO")
|
||||
public class ListEventHistDownloadRequestDto {
|
||||
|
||||
@Valid
|
||||
@NotNull
|
||||
@Schema(description = "리스트 필터")
|
||||
private ListFilterDto listFilter;
|
||||
@@ -25,6 +27,10 @@ public class ListEventHistDownloadRequestDto {
|
||||
@Schema(description = "조회할 ResultCodeType 목록")
|
||||
private List<ResultCodeType> resultCodeTypes;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "조회 기준")
|
||||
private ListEventHistoryBase searchBase;
|
||||
|
||||
@Valid
|
||||
@Schema(description = "조회 기간")
|
||||
private DateRangeDto dateRange;
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.common.enums.ListEventHistorySurveyType;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@Schema(description = "설문 결과 입력 Dto")
|
||||
public class ListEventHistFromSurveyDto {
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "입력 action 코드")
|
||||
private ListEventHistorySurveyType action;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "프로젝트 고유 번호")
|
||||
private Long prjctIdx;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "리스트 고유 번호")
|
||||
private Integer sid;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "메타 데이터")
|
||||
@Valid
|
||||
private ListEventHistSurveyMetaDto meta;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.common.enums.ResultCodeType;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@Schema(description = "내부 리스트 이벤트 이력 추가 요청 DTO")
|
||||
public class ListEventHistInsertRequestDto {
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "프로젝트 고유 번호")
|
||||
private Long prjctIdx;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "리스트 고유 번호")
|
||||
private Integer sid;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "결과 코드 타입")
|
||||
private ResultCodeType resultCodeType;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "결과 코드")
|
||||
private Integer resultCd;
|
||||
|
||||
@Valid
|
||||
@Schema(description = "메타 데이터")
|
||||
private ListEventHistInternalMetaDto meta;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "사용자 메모")
|
||||
private String memo;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public class ListEventHistInternalMetaDto {
|
||||
|
||||
@Schema(description = "GPS 위도")
|
||||
private Double latitude;
|
||||
|
||||
@Schema(description = "GPS 경도")
|
||||
private Double longitude;
|
||||
|
||||
@Schema(description = "GPS 위치 정확도(미터)")
|
||||
private Double accuracy;
|
||||
|
||||
@Schema(description = "요청 클라이언트 IP 주소")
|
||||
private String remoteAddr;
|
||||
|
||||
@Builder(access = AccessLevel.PRIVATE)
|
||||
private ListEventHistInternalMetaDto(
|
||||
Double latitude,
|
||||
Double longitude,
|
||||
Double accuracy,
|
||||
String remoteAddr
|
||||
) {
|
||||
this.latitude = latitude;
|
||||
this.longitude = longitude;
|
||||
this.accuracy = accuracy;
|
||||
this.remoteAddr = remoteAddr;
|
||||
}
|
||||
|
||||
public static ListEventHistInternalMetaDto withRemoteAddr(
|
||||
ListEventHistInternalMetaDto meta,
|
||||
String remoteAddr
|
||||
) {
|
||||
if (meta == null) {
|
||||
meta = new ListEventHistInternalMetaDto();
|
||||
}
|
||||
return ListEventHistInternalMetaDto.builder()
|
||||
.latitude(meta.getLatitude())
|
||||
.longitude(meta.getLongitude())
|
||||
.accuracy(meta.getAccuracy())
|
||||
.remoteAddr(remoteAddr)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.common.enums.ListEventHistoryExternalEntryType;
|
||||
import com.kri.contact.server.common.enums.ListEventHistorySurveyType;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public class ListEventHistSurveyMetaDto {
|
||||
@NotNull
|
||||
@Schema(description = "진입 유형")
|
||||
private ListEventHistoryExternalEntryType entryType;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "입력 action 코드")
|
||||
private ListEventHistorySurveyType action;
|
||||
|
||||
@Schema(description = "프로젝트 고유 번호")
|
||||
private String pid;
|
||||
|
||||
@Schema(description = "리스트 고유 번호")
|
||||
private String sid;
|
||||
|
||||
@Schema(description = "요청 클라이언트 IP 주소")
|
||||
private String remoteAddr;
|
||||
|
||||
@Schema(description = "요청 URI 경로")
|
||||
private String uri;
|
||||
|
||||
@Schema(description = "쿼리스트링을 포함한 전체 요청 URL")
|
||||
private String url;
|
||||
|
||||
@Schema(description = "요청 User-Agent 헤더")
|
||||
private String userAgent;
|
||||
|
||||
@Schema(description = "요청 Referer 헤더")
|
||||
private String referer;
|
||||
|
||||
@Schema(description = "요청 Origin 헤더")
|
||||
private String origin;
|
||||
|
||||
@Schema(description = "프록시 또는 로드밸런서를 통해 전달된 X-Forwarded-For 헤더")
|
||||
private String xForwardedFor;
|
||||
|
||||
@Schema(description = "프록시 표준 전달 정보인 Forwarded 헤더")
|
||||
private String forwarded;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.persistence.entity.TListEventHistEntity;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class ListEventHistoryDto {
|
||||
|
||||
private Long listEventHistIdx;
|
||||
private Short eventTy;
|
||||
private Long prjctIdx;
|
||||
private Integer sid;
|
||||
private Integer resultCd;
|
||||
private String metaData;
|
||||
private Long listCallHistIdx;
|
||||
private String memo;
|
||||
private String regUser;
|
||||
private LocalDateTime regDt;
|
||||
|
||||
public static ListEventHistoryDto from(TListEventHistEntity entity) {
|
||||
return ListEventHistoryDto.builder()
|
||||
.listEventHistIdx(entity.getListEventHistIdx())
|
||||
.eventTy(entity.getEventTy())
|
||||
.prjctIdx(entity.getPrjctIdx())
|
||||
.sid(entity.getSid())
|
||||
.resultCd(entity.getResultCd())
|
||||
.metaData(entity.getMetaData())
|
||||
.listCallHistIdx(entity.getListCallHistIdx())
|
||||
.memo(entity.getMemo())
|
||||
.regUser(entity.getRegUser())
|
||||
.regDt(entity.getRegDt())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.common.enums.ListFilterMatchType;
|
||||
import com.kri.contact.server.common.enums.ListFilterOperator;
|
||||
import com.kri.contact.server.common.validation.ValidListFilterCondition;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ValidListFilterCondition
|
||||
@Schema(description = "List filter condition")
|
||||
public class ListFilterConditionDto {
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "Filter operator")
|
||||
private ListFilterOperator operator;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "Filter match type")
|
||||
private ListFilterMatchType matchType;
|
||||
|
||||
@Schema(description = "Filter values")
|
||||
private List<String> values;
|
||||
}
|
||||
@@ -1,8 +1,12 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.common.enums.ListHeaderTypeAssign;
|
||||
import com.kri.contact.server.common.enums.ListIsUse;
|
||||
import com.kri.contact.server.common.enums.ResultCodeType;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -20,26 +24,47 @@ import lombok.Setter;
|
||||
public class ListFilterDto {
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "sid 목록")
|
||||
private Set<Integer> sidSet;
|
||||
@Schema(description = "SID 목록. 숫자 또는 숫자~숫자 형식")
|
||||
private Set<String> sidSet;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "리스트 사용 여부 목록")
|
||||
private Set<ListIsUse> listUseSet;
|
||||
|
||||
@Schema(description = "중요 메모")
|
||||
private String memo;
|
||||
@NotNull
|
||||
@Schema(description = "List use filter conditions")
|
||||
private List<@Valid ListFilterConditionDto> listUseConditions;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "그 외 필터 정보")
|
||||
private Map<Integer, Set<String>> otherItems;
|
||||
@Schema(description = "배정 사용자 필터. key: ListHeaderTypeAssign 코드")
|
||||
private Map<ListHeaderTypeAssign, Set<String>> assignUserMap;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "배정 필터 조건")
|
||||
private List<@Valid ListAssignFilterConditionDto> assignConditions;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "List 결과값 필터 key: ResultCodeType code, value: result code list")
|
||||
private Map<ResultCodeType, Set<Integer>> resultCodeMap;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "메모 필터 조건")
|
||||
private List<@Valid ListFilterConditionDto> memoConditions;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "기타 항목 필터 조건")
|
||||
private List<@Valid ListOtherItemFilterConditionDto> otherItemConditions;
|
||||
|
||||
public static ListFilterDto onlyOneSid(Integer sid) {
|
||||
return ListFilterDto.builder()
|
||||
.sidSet(Set.of(sid))
|
||||
.sidSet(Set.of(String.valueOf(sid)))
|
||||
.listUseSet(Set.of())
|
||||
.memo("")
|
||||
.otherItems(Map.of())
|
||||
.listUseConditions(List.of())
|
||||
.assignUserMap(Map.of())
|
||||
.assignConditions(List.of())
|
||||
.resultCodeMap(Map.of())
|
||||
.memoConditions(List.of())
|
||||
.otherItemConditions(List.of())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,18 +5,16 @@ import com.kri.contact.server.common.enums.ListHeaderType;
|
||||
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;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "리스트 헤더")
|
||||
@@ -100,9 +98,9 @@ public class ListHeaderDto {
|
||||
.listHderGrad(ListHeaderGrade.COMMON)
|
||||
.listHderNm(headerName)
|
||||
.listHderTy(type)
|
||||
.useFilter(false)
|
||||
.useColView(false)
|
||||
.useIntrvwerView(false)
|
||||
.useFilter(true)
|
||||
.useColView(true)
|
||||
.useIntrvwerView(true)
|
||||
.useIntrvwerEdit(false)
|
||||
.build();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.common.enums.ListHeaderGrade;
|
||||
import com.kri.contact.server.common.enums.ListHeaderType;
|
||||
import com.kri.contact.server.persistence.entity.TListHeaderEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.util.List;
|
||||
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 ListHeaderWithFilterContentDto extends ListHeaderDto {
|
||||
private List<String> filterContents;
|
||||
|
||||
public static ListHeaderWithFilterContentDto fromEntity(
|
||||
TListHeaderEntity entity,
|
||||
List<String> filterContents
|
||||
) {
|
||||
return ListHeaderWithFilterContentDto.builder()
|
||||
.prjctIdx(entity.getPrjctIdx())
|
||||
.listHderId(entity.getListHderId())
|
||||
.listHderOrder(entity.getListHderOrder())
|
||||
.listHderGrad(ListHeaderGrade.fromCode(entity.getListHderGrad()))
|
||||
.listHderNm(entity.getListHderNm())
|
||||
.listHderTy(ListHeaderType.fromCode(entity.getListHderTy()))
|
||||
.useFilter(entity.getUseFilter())
|
||||
.useColView(entity.getUseColView())
|
||||
.useIntrvwerView(entity.getUseIntrvwerView())
|
||||
.useIntrvwerEdit(entity.getUseIntrvwerEdit())
|
||||
.filterContents(filterContents)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
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.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "기타 항목 필터 조건")
|
||||
public class ListOtherItemFilterConditionDto extends ListFilterConditionDto {
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "리스트 헤더 ID")
|
||||
private Integer listHderId;
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.common.enums.ListResetMode;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
@@ -17,6 +18,7 @@ public class ListResetRequestDto {
|
||||
@Schema(description = "초기화 범위")
|
||||
private ListResetMode resetMode;
|
||||
|
||||
@Valid
|
||||
@NotNull
|
||||
@Schema(description = "리스트 필터")
|
||||
private ListFilterDto listFilter;
|
||||
|
||||
@@ -14,7 +14,7 @@ import lombok.experimental.SuperBuilder;
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "결과에 대한 기본 정보")
|
||||
@Schema(description = "결과 코드 기본 정보")
|
||||
public class ListResultBaseDto {
|
||||
|
||||
@Schema(description = "최종 결과값")
|
||||
@@ -23,7 +23,10 @@ public class ListResultBaseDto {
|
||||
@Schema(description = "최종 결과값 일시")
|
||||
private LocalDateTime lastResultDt;
|
||||
|
||||
public static ListResultBaseDto from(TListEventHistEntity entity) {
|
||||
@Schema(description = "시도 횟수")
|
||||
private Integer attemptCount;
|
||||
|
||||
public static ListResultBaseDto from(TListEventHistEntity entity, Integer attemptCount) {
|
||||
if (entity == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -31,7 +34,7 @@ public class ListResultBaseDto {
|
||||
return ListResultBaseDto.builder()
|
||||
.lastResultCd(entity.getResultCd() == null ? null : entity.getResultCd().shortValue())
|
||||
.lastResultDt(entity.getRegDt())
|
||||
.attemptCount(attemptCount)
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.common.enums.ListHeaderTypeAssign;
|
||||
import com.kri.contact.server.common.enums.ListIsUse;
|
||||
import com.kri.contact.server.persistence.entity.TListEntity;
|
||||
import com.kri.contact.server.service.ListSearchService.AssignValues;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
@@ -24,7 +29,10 @@ public class ListSearchBaseDto {
|
||||
private Integer sid;
|
||||
|
||||
@Schema(description = "사용 여부")
|
||||
private Short use;
|
||||
private ListIsUse use;
|
||||
|
||||
@Schema(description = "배정 사용자 목록. key: ListHeaderTypeAssign 코드(13=외주사, 14=컨택원, 15=면접원)")
|
||||
private Map<ListHeaderTypeAssign, String> assignList;
|
||||
|
||||
@Schema(description = "메모")
|
||||
private String memo;
|
||||
@@ -32,18 +40,37 @@ public class ListSearchBaseDto {
|
||||
@Schema(description = "리스트 값 정보")
|
||||
private Map<Integer, String> itemList;
|
||||
|
||||
public static ListSearchBaseDto from(TListEntity entity, Map<Integer, String> itemList) {
|
||||
public static ListSearchBaseDto from(TListEntity entity, Map<Integer, String> itemList, AssignValues assignValues) {
|
||||
if (entity == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
AssignValues values = assignValues == null ? AssignValues.empty() : assignValues;
|
||||
return ListSearchBaseDto.builder()
|
||||
.prjctIdx(entity.getPrjctIdx())
|
||||
.sid(entity.getSid())
|
||||
.use(entity.getUse())
|
||||
.use(ListIsUse.fromCode(entity.getUse()))
|
||||
.assignList(toAssignList(values))
|
||||
.memo(entity.getMemo())
|
||||
.itemList(itemList)
|
||||
.build();
|
||||
}
|
||||
|
||||
protected static Map<ListHeaderTypeAssign, String> toAssignList(AssignValues values) {
|
||||
Map<ListHeaderTypeAssign, String> assignList = new LinkedHashMap<>();
|
||||
putFirst(assignList, ListHeaderTypeAssign.OUTSOURCE, values.outsourceUserIds());
|
||||
putFirst(assignList, ListHeaderTypeAssign.CONTACT_INTERVIEWER, values.contactInterviewerIds());
|
||||
putFirst(assignList, ListHeaderTypeAssign.FIELD_INTERVIEWER, values.fieldInterviewerIds());
|
||||
return assignList;
|
||||
}
|
||||
|
||||
private static void putFirst(
|
||||
Map<ListHeaderTypeAssign, String> assignList,
|
||||
ListHeaderTypeAssign type,
|
||||
List<String> values
|
||||
) {
|
||||
if (values != null && !values.isEmpty()) {
|
||||
assignList.put(type, values.get(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ 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.Valid;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -19,6 +20,7 @@ import lombok.Setter;
|
||||
@Schema(description = "리스트 검색 조건")
|
||||
public class ListSearchRequestDto {
|
||||
|
||||
@Valid
|
||||
@NotNull
|
||||
@Schema(description = "리스트 필터")
|
||||
private ListFilterDto listFilter;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.common.enums.ListIsUse;
|
||||
import com.kri.contact.server.persistence.entity.TListEntity;
|
||||
import com.kri.contact.server.service.ListSearchService.AssignValues;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.util.Map;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -18,28 +20,31 @@ import lombok.experimental.SuperBuilder;
|
||||
public class ListSearchWithFullResultDto extends ListSearchWithResultDto {
|
||||
|
||||
@Schema(description = "메일 발송 결과")
|
||||
private ListResultBaseDto mailSendResult;
|
||||
private ListSendResultDto mailSendResult;
|
||||
|
||||
@Schema(description = "문자 발송 결과")
|
||||
private ListResultBaseDto smsSendResult;
|
||||
private ListSendResultDto smsSendResult;
|
||||
|
||||
public static ListSearchWithFullResultDto from(
|
||||
TListEntity entity,
|
||||
Map<Integer, String> itemList,
|
||||
AssignValues assignValues,
|
||||
ListContactResultDto contactResult,
|
||||
ListContactResultDto interviewResult,
|
||||
ListResultBaseDto surveyResult,
|
||||
ListResultBaseDto mailSendResult,
|
||||
ListResultBaseDto smsSendResult
|
||||
ListSendResultDto mailSendResult,
|
||||
ListSendResultDto smsSendResult
|
||||
) {
|
||||
if (entity == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
AssignValues values = assignValues == null ? AssignValues.empty() : assignValues;
|
||||
return ListSearchWithFullResultDto.builder()
|
||||
.prjctIdx(entity.getPrjctIdx())
|
||||
.sid(entity.getSid())
|
||||
.use(entity.getUse())
|
||||
.use(ListIsUse.fromCode(entity.getUse()))
|
||||
.assignList(toAssignList(values))
|
||||
.memo(entity.getMemo())
|
||||
.itemList(itemList)
|
||||
.contactResult(contactResult)
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.common.enums.ListIsUse;
|
||||
import com.kri.contact.server.persistence.entity.TListEntity;
|
||||
import com.kri.contact.server.service.ListSearchService.AssignValues;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.util.Map;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -28,6 +30,7 @@ public class ListSearchWithResultDto extends ListSearchBaseDto {
|
||||
public static ListSearchWithResultDto from(
|
||||
TListEntity entity,
|
||||
Map<Integer, String> itemList,
|
||||
AssignValues assignValues,
|
||||
ListContactResultDto contactResult,
|
||||
ListContactResultDto interviewResult,
|
||||
ListResultBaseDto surveyResult
|
||||
@@ -36,10 +39,12 @@ public class ListSearchWithResultDto extends ListSearchBaseDto {
|
||||
return null;
|
||||
}
|
||||
|
||||
AssignValues values = assignValues == null ? AssignValues.empty() : assignValues;
|
||||
return ListSearchWithResultDto.builder()
|
||||
.prjctIdx(entity.getPrjctIdx())
|
||||
.sid(entity.getSid())
|
||||
.use(entity.getUse())
|
||||
.use(ListIsUse.fromCode(entity.getUse()))
|
||||
.assignList(toAssignList(values))
|
||||
.memo(entity.getMemo())
|
||||
.itemList(itemList)
|
||||
.contactResult(contactResult)
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
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 ListSendResultDto extends ListResultBaseDto {
|
||||
|
||||
@Schema(description = "마지막 컨택/방문면접원")
|
||||
private String lastResultLabel;
|
||||
|
||||
/* Todo Noti hub로 부터 받아서 생성하는 static 메소드 필요
|
||||
public static ListSendResultDto from(TListEventHistEntity entity, String resultLabel, Integer attemptCount) {
|
||||
if (entity == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return ListSendResultDto.builder()
|
||||
.lastResultCd(entity.getResultCd() == null ? null : entity.getResultCd().shortValue())
|
||||
.lastResultDt(entity.getRegDt())
|
||||
.attemptCount(attemptCount)
|
||||
.lastResultLabel(resultLabel)
|
||||
.build();
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.persistence.entity.TListUpdateHistEntity;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class ListUpdateHistoryDto {
|
||||
|
||||
private Long listUpdateHistIdx;
|
||||
private Long prjctIdx;
|
||||
private Integer sid;
|
||||
private Integer listHderId;
|
||||
private String beforeVal;
|
||||
private String afterVal;
|
||||
private String regUser;
|
||||
private LocalDateTime regDt;
|
||||
|
||||
public static ListUpdateHistoryDto from(TListUpdateHistEntity entity) {
|
||||
return ListUpdateHistoryDto.builder()
|
||||
.listUpdateHistIdx(entity.getListUpdateHistIdx())
|
||||
.prjctIdx(entity.getPrjctIdx())
|
||||
.sid(entity.getSid())
|
||||
.listHderId(entity.getListHderId())
|
||||
.beforeVal(entity.getBeforeVal())
|
||||
.afterVal(entity.getAfterVal())
|
||||
.regUser(entity.getRegUser())
|
||||
.regDt(entity.getRegDt())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.common.enums.ResultCodeType;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.Map;
|
||||
import lombok.Getter;
|
||||
@@ -13,10 +15,13 @@ import lombok.Setter;
|
||||
@Schema(description = "리스트 정보 수정 요청 DTO")
|
||||
public class ListUpdateRequestDto {
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "리스트 정보 수정내용 sid를 제외한 모든 내용, listHderId by listItemValue")
|
||||
private Map<Integer, String> updateContents;
|
||||
|
||||
@Schema(description = "리스트 결과 코드 수정내용")
|
||||
private Map<ResultCodeType, Integer> updateResultCodes;
|
||||
|
||||
@Valid
|
||||
@NotNull
|
||||
@Schema(description = "리스트 필터")
|
||||
private ListFilterDto listFilter;
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@Schema(description = "리스트 업로드 파일 정보")
|
||||
public class ListUploadFileInfoDto {
|
||||
|
||||
@Schema(description = "파일명")
|
||||
private String fileName;
|
||||
|
||||
@Schema(description = "파일 바이트")
|
||||
private byte[] bytes;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.common.enums.ListUploadMode;
|
||||
import com.kri.contact.server.persistence.entity.TListUploadLogEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@Schema(description = "리스트 업로드 이력")
|
||||
public class ListUploadHistoryDto {
|
||||
|
||||
@Schema(description = "리스트 업로드 로그 ID")
|
||||
private String listUploadLogId;
|
||||
|
||||
@Schema(description = "업로드 차수")
|
||||
private Integer wave;
|
||||
|
||||
@Schema(description = "업로드 파일명")
|
||||
private String fileName;
|
||||
|
||||
@Schema(description = "업로드 리스트 수")
|
||||
private Integer listCount;
|
||||
|
||||
@Schema(description = "업로드 모드")
|
||||
private ListUploadMode uploadMode;
|
||||
|
||||
@Schema(description = "등록 사용자")
|
||||
private String regUser;
|
||||
|
||||
@Schema(description = "등록 일시")
|
||||
private LocalDateTime regDt;
|
||||
|
||||
public static ListUploadHistoryDto fromEntity(TListUploadLogEntity entity) {
|
||||
return ListUploadHistoryDto.builder()
|
||||
.listUploadLogId(entity.getListUploadLogId())
|
||||
.wave(entity.getWave())
|
||||
.fileName(entity.getFileNm())
|
||||
.listCount(entity.getListCnt())
|
||||
.uploadMode(ListUploadMode.fromCode(entity.getMode()))
|
||||
.regUser(entity.getRegUser())
|
||||
.regDt(entity.getRegDt())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.kri.contact.server.dto.message;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class MessageBulkSendResponseDto {
|
||||
|
||||
private String bulkSendKey;
|
||||
private int targetCount;
|
||||
private int requestCount;
|
||||
private int acceptCount;
|
||||
private int failCount;
|
||||
@Builder.Default
|
||||
private List<MessageFailedChunkDto> failedChunks = new ArrayList<>();
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.kri.contact.server.dto.message;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class MessageFailedChunkDto {
|
||||
|
||||
private int chunkIndex;
|
||||
private int from;
|
||||
private int to;
|
||||
private int targetCount;
|
||||
private String errorMessage;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.kri.contact.server.dto.message;
|
||||
|
||||
import com.kri.contact.server.dto.list.ListFilterDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@Schema(description = "Message bulk send request")
|
||||
public class MessageSendBulkRequestDto {
|
||||
|
||||
@NotNull
|
||||
private Long tmplatIdx;
|
||||
|
||||
@NotNull
|
||||
private Boolean resve;
|
||||
|
||||
private LocalDateTime sendDt;
|
||||
|
||||
@Valid
|
||||
private ListFilterDto listFilter;
|
||||
|
||||
@NotEmpty
|
||||
private List<Integer> destHeaderIds;
|
||||
|
||||
private Integer destNameHeaderId;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.kri.contact.server.dto.message;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@Schema(description = "Message single send request")
|
||||
public class MessageSendSingleRequestDto {
|
||||
|
||||
@NotNull
|
||||
private Long tmplatIdx;
|
||||
|
||||
@NotNull
|
||||
private Boolean resve;
|
||||
|
||||
private LocalDateTime sendDt;
|
||||
|
||||
@NotNull
|
||||
private Integer sid;
|
||||
|
||||
@NotEmpty
|
||||
private List<Integer> destHeaderIds;
|
||||
|
||||
private Integer destNameHeaderId;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.kri.contact.server.dto.progress;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@Schema(description = "날짜별 진행 현황")
|
||||
public class ProgressDateResponseDto {
|
||||
|
||||
private String contactDate;
|
||||
|
||||
private String startTime;
|
||||
|
||||
private String endTime;
|
||||
|
||||
private long totalCount;
|
||||
|
||||
@Builder.Default
|
||||
private Map<Integer, Long> resultCodeCountMap = new LinkedHashMap<>();
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.kri.contact.server.dto.progress;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Schema(description = "진행 현황 조회 요청")
|
||||
public class ProgressSearchRequestDto {
|
||||
|
||||
@Schema(description = "사용자 ID")
|
||||
private String userId;
|
||||
|
||||
@Schema(description = "회사 ID")
|
||||
private String cmpnId;
|
||||
|
||||
@Schema(description = "시작일시")
|
||||
private String startDt;
|
||||
|
||||
@Schema(description = "종료일시")
|
||||
private String endDt;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.kri.contact.server.dto.progress;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@Schema(description = "사용자별 진행 현황")
|
||||
public class ProgressUserResponseDto {
|
||||
|
||||
private String userId;
|
||||
|
||||
private long totalCount;
|
||||
|
||||
@Builder.Default
|
||||
private Map<Integer, Long> resultCodeCountMap = new LinkedHashMap<>();
|
||||
}
|
||||
@@ -68,6 +68,10 @@ public class ProjectInfoDto {
|
||||
@Schema(description = "설문 URL")
|
||||
private String surveyUrl;
|
||||
|
||||
@Size(max = 128)
|
||||
@Schema(description = "외부 설문 대시보드 URL. surveyTy가 99(EXTERNAL)일 때만 사용")
|
||||
private String surveyDashboardUrl;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "면접원 확인사항 여부")
|
||||
private Boolean ff;
|
||||
@@ -109,6 +113,7 @@ public class ProjectInfoDto {
|
||||
.surveyTy(SurveyType.fromCode(entity.getSurveyTy()))
|
||||
.surveyPrjctCd(entity.getSurveyPrjctCd())
|
||||
.surveyUrl(entity.getSurveyUrl())
|
||||
.surveyDashboardUrl(entity.getSurveyDashboardUrl())
|
||||
.ff(entity.getFf())
|
||||
.useContactSenario(entity.getUseContactSenario())
|
||||
.contactSenario(entity.getContactSenario())
|
||||
|
||||
@@ -15,9 +15,9 @@ public class ProjectUpdateRequestDto {
|
||||
@Schema(description = "프로젝트 정보")
|
||||
private ProjectInfoDto projectInfo;
|
||||
|
||||
@Schema(description = "프로젝트 수정 되야 할 결과코드")
|
||||
@Schema(description = "프로젝트 수정 대상 결과 코드")
|
||||
private List<ResultCodeDto> resultCodeList;
|
||||
|
||||
@Schema(description = "배정될 외주 업체 목록")
|
||||
private List<String> assignUserIdList;
|
||||
@Schema(description = "프로젝트 배정 회사 목록")
|
||||
private List<String> assignCmpnIdList;
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@ public class ResultCodeDto {
|
||||
@Schema(description = "결과 코드 라벨")
|
||||
private String resultCdLbl;
|
||||
|
||||
private Boolean isDefault;
|
||||
|
||||
public static ResultCodeDto from(TResultCodeEntity entity) {
|
||||
return ResultCodeDto.builder()
|
||||
.resultCdUUID(CommonUtil.uuid32())
|
||||
@@ -36,6 +38,7 @@ public class ResultCodeDto {
|
||||
.resultCdTy(entity.getResultCdTy())
|
||||
.resultCd(entity.getResultCd())
|
||||
.resultCdLbl(entity.getResultCdLbl())
|
||||
.isDefault(Boolean.TRUE.equals(entity.getDefaultCode()))
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.kri.contact.server.dto.reserve;
|
||||
|
||||
import com.kri.contact.server.persistence.entity.TListResveEntity;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
public class ListReserveDto {
|
||||
|
||||
private Long listResveIdx;
|
||||
private Long prjctIdx;
|
||||
private Integer sid;
|
||||
private String memo;
|
||||
private Boolean cnfirm;
|
||||
private LocalDateTime resveDt;
|
||||
private String resveUser;
|
||||
private String regUser;
|
||||
private LocalDateTime regDt;
|
||||
|
||||
public static ListReserveDto from(TListResveEntity entity) {
|
||||
return ListReserveDto.builder()
|
||||
.listResveIdx(entity.getListResveIdx())
|
||||
.prjctIdx(entity.getPrjctIdx())
|
||||
.sid(entity.getSid())
|
||||
.memo(entity.getMemo())
|
||||
.cnfirm(entity.getCnfirm())
|
||||
.resveDt(entity.getResveDt())
|
||||
.resveUser(entity.getResveUser())
|
||||
.regUser(entity.getRegUser())
|
||||
.regDt(entity.getRegDt())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.kri.contact.server.dto.reserve;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
public class ListReserveRequestDto {
|
||||
|
||||
@NotNull
|
||||
private Long prjctIdx;
|
||||
|
||||
@NotNull
|
||||
private Integer sid;
|
||||
|
||||
@NotBlank
|
||||
private String userId;
|
||||
|
||||
@NotNull
|
||||
private LocalDateTime resveDt;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.kri.contact.server.dto.systemlog;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class UploadContentDto {
|
||||
String fileName;
|
||||
String fileType;
|
||||
Long fileSize;
|
||||
|
||||
public static UploadContentDto from(MultipartFile file){
|
||||
return UploadContentDto.builder()
|
||||
.fileName(file.getOriginalFilename())
|
||||
.fileType(file.getContentType())
|
||||
.fileSize(file.getSize())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
package com.kri.contact.server.dto.systemlog;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Setter
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public class UploadUserContentDto {
|
||||
|
||||
String fileName;
|
||||
String fileType;
|
||||
Long fileSize;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import com.kri.contact.server.dto.cmpn.CmpnInfoDto;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Lob;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
import org.hibernate.annotations.Comment;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table(name = "t_cmpn")
|
||||
public class TCmpnEntity {
|
||||
|
||||
@Id
|
||||
@Size(max = 32)
|
||||
@Column(name = "cmpn_id", nullable = false, length = 32, updatable = false)
|
||||
@Comment("회사 id(회사이름)")
|
||||
private String cmpnId;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "cmpn_alias", nullable = false, length = 32)
|
||||
@Comment("회사 별칭")
|
||||
private String cmpnAlias;
|
||||
|
||||
@Size(max = 16)
|
||||
@Column(name = "cmpn_tel", length = 16)
|
||||
@Comment("회사 전화번호")
|
||||
private String cmpnTel;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("0")
|
||||
@Builder.Default
|
||||
@Column(name = "is_own_cmpn", nullable = false, columnDefinition = "tinyint(1)")
|
||||
@Comment("자사 여부")
|
||||
private Boolean ownCmpn = false;
|
||||
|
||||
@Lob
|
||||
@Column(name = "memo")
|
||||
@Comment("메모")
|
||||
private String memo;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "reg_user", nullable = false, length = 32, updatable = false)
|
||||
private String regUser;
|
||||
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false, updatable = false)
|
||||
private LocalDateTime regDt;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "mod_user", length = 32, insertable = false)
|
||||
private String modUser;
|
||||
|
||||
@Column(name = "mod_dt", insertable = false)
|
||||
private LocalDateTime modDt;
|
||||
|
||||
public static TCmpnEntity fromDto(CmpnInfoDto dto, String regUser, LocalDateTime regDt) {
|
||||
return TCmpnEntity.builder()
|
||||
.cmpnId(dto.getCmpnId())
|
||||
.cmpnAlias(dto.getCmpnAlias())
|
||||
.cmpnTel(dto.getCmpnTel())
|
||||
.ownCmpn(Boolean.TRUE.equals(dto.getOwnCmpn()))
|
||||
.memo(dto.getMemo())
|
||||
.regUser(regUser)
|
||||
.regDt(regDt)
|
||||
.build();
|
||||
}
|
||||
|
||||
public void updateFromDto(CmpnInfoDto dto, String modUser, LocalDateTime modDt) {
|
||||
this.cmpnAlias = dto.getCmpnAlias();
|
||||
this.cmpnTel = dto.getCmpnTel();
|
||||
this.ownCmpn = Boolean.TRUE.equals(dto.getOwnCmpn());
|
||||
this.memo = dto.getMemo();
|
||||
this.modUser = modUser;
|
||||
this.modDt = modDt;
|
||||
}
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Lob;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "t_func")
|
||||
public class TFuncEntity {
|
||||
|
||||
@Id
|
||||
@NotNull
|
||||
@Column(name = "func_cd")
|
||||
private Integer funcCd;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "func_nm", nullable = false, length = 32)
|
||||
private String funcNm;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("1")
|
||||
@Column(name = "is_menu", nullable = false)
|
||||
private Boolean menu = false;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "depth", nullable = false)
|
||||
private Integer depth;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "parent", nullable = false)
|
||||
private Integer parent;
|
||||
|
||||
@NotNull
|
||||
@Lob
|
||||
@Column(name = "func_memo", nullable = false)
|
||||
private String funcMemo;
|
||||
|
||||
}
|
||||
@@ -16,8 +16,8 @@ import org.hibernate.annotations.ColumnDefault;
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "t_list_assign")
|
||||
public class TListAssignEntity {
|
||||
@Table(name = "t_list_assign_cmpn")
|
||||
public class TListAssignCmpnEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@@ -32,8 +32,8 @@ public class TListAssignEntity {
|
||||
private Integer sid;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "user_id", length = 32)
|
||||
private String userId;
|
||||
@Column(name = "cmpn_id", length = 32)
|
||||
private String cmpnId;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "reg_user", length = 32)
|
||||
@@ -42,4 +42,4 @@ public class TListAssignEntity {
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt")
|
||||
private LocalDateTime regDt;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "t_list_assign_user")
|
||||
public class TListAssignUserEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "list_assign_idx", nullable = false)
|
||||
private Long listAssignIdx;
|
||||
|
||||
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED not null")
|
||||
private Long prjctIdx;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "sid", nullable = false)
|
||||
private Integer sid;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "user_id", length = 32)
|
||||
private String userId;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "assign_role", nullable = false)
|
||||
private Short assignRole;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "reg_user", length = 32)
|
||||
private String regUser;
|
||||
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt")
|
||||
private LocalDateTime regDt;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "t_list_assign_user_role_map")
|
||||
public class TListAssignUserRoleMapEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id", nullable = false)
|
||||
private Long id;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "list_hder_ty", nullable = false)
|
||||
private Integer listHderTy;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "user_role", nullable = false, length = 32)
|
||||
private String userRole;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32)
|
||||
private String regUser;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private LocalDateTime regDt;
|
||||
|
||||
public Short getAssignRole() {
|
||||
return listHderTy == null ? null : listHderTy.shortValue();
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
@@ -21,7 +22,7 @@ public class TListCallHistEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "list_call_hist_idx", nullable = false)
|
||||
@Column(name = "list_call_hist_idx", nullable = false, insertable = false)
|
||||
private Long id;
|
||||
|
||||
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED not null")
|
||||
@@ -67,7 +68,7 @@ public class TListCallHistEntity {
|
||||
|
||||
@NotNull
|
||||
@Column(name = "start_dt", nullable = false)
|
||||
private Instant startDt;
|
||||
private LocalDateTime startDt;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "total_time", nullable = false)
|
||||
@@ -99,7 +100,7 @@ public class TListCallHistEntity {
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private Instant regDt;
|
||||
private LocalDateTime regDt;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "t_list_content")
|
||||
public class TListContentEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "list_content_idx", nullable = false)
|
||||
private Long id;
|
||||
|
||||
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED not null")
|
||||
private Long prjctIdx;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "list_hder_id", nullable = false)
|
||||
private Integer listHderId;
|
||||
|
||||
@Size(max = 2048)
|
||||
@NotNull
|
||||
@Column(name = "list_content_item", nullable = false, length = 2048)
|
||||
private String listContentItem;
|
||||
|
||||
public static TListContentEntity create(Long prjctIdx, Integer listHderId, String listContentItem) {
|
||||
TListContentEntity entity = new TListContentEntity();
|
||||
entity.setPrjctIdx(prjctIdx);
|
||||
entity.setListHderId(listHderId);
|
||||
entity.setListContentItem(listContentItem);
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,8 @@ public class TListEntity {
|
||||
private Short use;
|
||||
|
||||
@Size(max = 2048)
|
||||
@Column(name = "memo", length = 2048)
|
||||
@NotNull
|
||||
@Column(name = "memo", nullable = false, length = 2048)
|
||||
private String memo;
|
||||
|
||||
@Size(max = 32)
|
||||
@@ -59,4 +60,4 @@ public class TListEntity {
|
||||
public Integer getSid() {
|
||||
return id.getSid();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import com.kri.contact.server.common.enums.ResultCodeType;
|
||||
import com.kri.contact.server.dto.list.ListEventHistFromSurveyDto;
|
||||
import com.kri.contact.server.dto.list.ListEventHistInsertRequestDto;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
@@ -10,13 +13,20 @@ import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder(access = AccessLevel.PRIVATE)
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor(access = AccessLevel.PRIVATE)
|
||||
@Entity
|
||||
@Table(name = "t_list_event_hist")
|
||||
public class TListEventHistEntity {
|
||||
@@ -62,4 +72,40 @@ public class TListEventHistEntity {
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private LocalDateTime regDt;
|
||||
|
||||
}
|
||||
public static TListEventHistEntity fromSurveyHistory(
|
||||
ListEventHistFromSurveyDto request,
|
||||
String metaData,
|
||||
String regUser,
|
||||
LocalDateTime regDt
|
||||
) {
|
||||
return TListEventHistEntity.builder()
|
||||
.eventTy(ResultCodeType.SURVEY.getCode())
|
||||
.prjctIdx(request.getPrjctIdx())
|
||||
.sid(request.getSid())
|
||||
.resultCd(request.getAction().getCode().intValue())
|
||||
.metaData(metaData)
|
||||
.memo(request.getAction().name())
|
||||
.regUser(regUser)
|
||||
.regDt(regDt)
|
||||
.build();
|
||||
}
|
||||
|
||||
public static TListEventHistEntity fromInternalHistory(
|
||||
ListEventHistInsertRequestDto request,
|
||||
String metaData,
|
||||
String regUser,
|
||||
LocalDateTime regDt
|
||||
) {
|
||||
return TListEventHistEntity.builder()
|
||||
.eventTy(request.getResultCodeType().getCode())
|
||||
.prjctIdx(request.getPrjctIdx())
|
||||
.sid(request.getSid())
|
||||
.resultCd(request.getResultCd())
|
||||
.metaData(metaData)
|
||||
.memo(request.getMemo())
|
||||
.regUser(regUser)
|
||||
.regDt(regDt)
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import com.kri.contact.server.persistence.entity.id.TRoleFuncMapEntityId;
|
||||
|
||||
import com.kri.contact.server.persistence.entity.id.TListEventLatestEntityId;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.EmbeddedId;
|
||||
import jakarta.persistence.Entity;
|
||||
@@ -11,16 +10,23 @@ import jakarta.validation.constraints.Size;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "t_role_func_map")
|
||||
public class TRoleFuncMapEntity {
|
||||
@Table(name = "t_list_event_latest")
|
||||
public class TListEventLatestEntity {
|
||||
|
||||
@EmbeddedId
|
||||
private TRoleFuncMapEntityId id;
|
||||
private TListEventLatestEntityId id;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "list_event_hist_idx", nullable = false)
|
||||
private Long listEventHistIdx;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "result_cd", nullable = false)
|
||||
private Integer resultCd;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@@ -28,15 +34,18 @@ public class TRoleFuncMapEntity {
|
||||
private String regUser;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private LocalDateTime regDt;
|
||||
|
||||
public Integer getRoleCd() {
|
||||
return id.getRoleCd();
|
||||
public Long getPrjctIdx() {
|
||||
return id.getPrjctIdx();
|
||||
}
|
||||
|
||||
public Long getFuncCd() {
|
||||
return id.getFuncCd();
|
||||
public Integer getSid() {
|
||||
return id.getSid();
|
||||
}
|
||||
}
|
||||
|
||||
public Short getEventTy() {
|
||||
return id.getEventTy();
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.kri.contact.server.persistence.entity;
|
||||
|
||||
import com.kri.contact.server.persistence.entity.id.TListItemFileEntityId;
|
||||
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.EmbeddedId;
|
||||
import jakarta.persistence.Entity;
|
||||
@@ -9,6 +8,7 @@ import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
@@ -61,4 +61,26 @@ public class TListItemFileEntity {
|
||||
public Integer getListHderId() {
|
||||
return id.getListHderId();
|
||||
}
|
||||
}
|
||||
|
||||
public static TListItemFileEntity create(
|
||||
Long prjctIdx,
|
||||
Integer sid,
|
||||
Integer listHderId,
|
||||
String fileNm,
|
||||
Integer fileSize,
|
||||
String filePath,
|
||||
String regUser,
|
||||
LocalDateTime regDt
|
||||
) {
|
||||
TListItemFileEntity entity = new TListItemFileEntity();
|
||||
entity.setId(TListItemFileEntityId.create(prjctIdx, sid, listHderId));
|
||||
entity.setFileNm(fileNm);
|
||||
entity.setFileSize(fileSize);
|
||||
entity.setFilePath(filePath);
|
||||
entity.setRegUser(regUser);
|
||||
entity.setRegDt(regDt);
|
||||
entity.setModUser(regUser);
|
||||
entity.setModDt(regDt);
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user