Merge pull request 'develop' (#1) from develop into master
Reviewed-on: #1
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.0.66"
|
||||
implementation "com.kri.common:starter:latest.release"
|
||||
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-security'
|
||||
@@ -56,7 +56,7 @@ dependencies {
|
||||
//MySQL
|
||||
runtimeOnly "com.mysql:mysql-connector-j"
|
||||
// QueryDSL JPA
|
||||
implementation "com.querydsl:querydsl-jpa:5.0.0:jakarta"
|
||||
implementation "io.github.openfeign.querydsl:querydsl-jpa:7.1"
|
||||
|
||||
// QClass 생성용 annotationProcessor
|
||||
annotationProcessor "com.querydsl:querydsl-apt:5.0.0:jakarta"
|
||||
@@ -66,7 +66,7 @@ dependencies {
|
||||
compileOnly 'org.projectlombok:lombok'
|
||||
annotationProcessor 'org.projectlombok:lombok'
|
||||
|
||||
implementation 'org.apache.poi:poi-ooxml:5.2.5'
|
||||
implementation 'org.apache.poi:poi-ooxml:5.5.1'
|
||||
|
||||
developmentOnly 'org.springframework.boot:spring-boot-devtools'
|
||||
|
||||
|
||||
@@ -4,11 +4,13 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.boot.ApplicationRunner;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
||||
@Slf4j
|
||||
@SpringBootApplication
|
||||
@ConfigurationPropertiesScan
|
||||
public class ContactServerApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -1,10 +1,46 @@
|
||||
package com.kri.contact.server.common.consts;
|
||||
|
||||
public final class ContactConstant {
|
||||
import com.kri.common.feature.excel.StreamingReadOptions;
|
||||
import com.kri.contact.server.common.enums.ListHeaderType;
|
||||
import com.kri.contact.server.common.enums.ListHeaderTypeDefault;
|
||||
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;
|
||||
private ContactConstant() {
|
||||
}
|
||||
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_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.CONTACT_INTERVIEWER,
|
||||
ListHeaderType.FIELD_INTERVIEWER
|
||||
);
|
||||
|
||||
public static final List<ListHeaderType> EXACT_MATCH_HEADER_TYPE = List.of(
|
||||
ListHeaderType.CONTENT_ITEM
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@@ -2,30 +2,30 @@ package com.kri.contact.server.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.kri.common.enums.CodeEnum;
|
||||
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 ChannelType implements CodeEnum<Short> {
|
||||
|
||||
@Schema(description = "이메일")
|
||||
EMAIL((short) 1),
|
||||
@Schema(description = "문자")
|
||||
SMS((short) 2);
|
||||
|
||||
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) {
|
||||
return null;
|
||||
}
|
||||
for (ChannelType s : values()) {
|
||||
if (s.code == code) {
|
||||
if (s.code.equals(code)) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
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), // 불변 헤더 (옵션 변경 불가)
|
||||
RESERVED((short) 1), // Default 헤더 (옵션 변경 가능)
|
||||
COMMON((short) 10); // 일반 헤더 (옵션 변경 가능)
|
||||
|
||||
private final Short code;
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static ListHeaderGrade fromCode(Short code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (ListHeaderGrade s : values()) {
|
||||
if (s.code.equals(code)) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown ListHeaderGrade code: " + code);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
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 : 외주사
|
||||
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 : 파일업로드
|
||||
CONTENT_ITEM(ListHeaderTypeSpecific.CONTENT_ITEM), //91 : 목록형
|
||||
TEXT((short) 99); //99 : 텍스트
|
||||
|
||||
private final Short code;
|
||||
|
||||
ListHeaderType(CodeEnum<Short> source) { this.code = source.getCode();}
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static ListHeaderType fromCode(Short code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (ListHeaderType s : values()) {
|
||||
if (s.code.equals(code)) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown ListHeaderType code: " + 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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
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(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) {
|
||||
return null;
|
||||
}
|
||||
for (ListHeaderTypeDefault s : values()) {
|
||||
if (s.code.equals(code)) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown ListHeaderTypeDefault code: " + code);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
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 : 파일업로드
|
||||
CONTENT_ITEM((short) 91); //목록형
|
||||
|
||||
private final Short code;
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static ListHeaderTypeSpecific fromCode(Short code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (ListHeaderTypeSpecific s : values()) {
|
||||
if (s.code.equals(code)) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown ListHeaderSpecificType code: " + code);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
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 : 사용 안함
|
||||
USABLE((short) 1), //1 : 사용
|
||||
TEST((short) 9); //9 : TEST
|
||||
|
||||
private final Short code;
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static ListIsUse fromCode(Short code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (ListIsUse s : values()) {
|
||||
if (s.code.equals(code)) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown ListIsUse code: " + 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 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),
|
||||
HIST((short) 1),
|
||||
LIST_UPLOAD((short) 2);
|
||||
|
||||
private final Short code;
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static ListResetMode fromCode(Short code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (ListResetMode s : values()) {
|
||||
if (s.code.equals(code)) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown ListResetMode code: " + code);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.kri.contact.server.common.enums;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "리스트 조회 응답 타입")
|
||||
public enum ListSearchResponseType {
|
||||
BASE,
|
||||
WITH_RESULT,
|
||||
WITH_FULL_RESULT
|
||||
}
|
||||
@@ -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 ListUploadMode implements CodeEnum<Short> {
|
||||
|
||||
RESET_AND_INSERT((short) 0),
|
||||
ADD_AND_CHANGE((short) 1);
|
||||
|
||||
private final Short code;
|
||||
|
||||
@JsonCreator(mode = JsonCreator.Mode.DELEGATING)
|
||||
public static ListUploadMode fromCode(Short code) {
|
||||
if (code == null) {
|
||||
return null;
|
||||
}
|
||||
for (ListUploadMode s : values()) {
|
||||
if (s.code.equals(code)) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown ListUploadMode code: " + code);
|
||||
}
|
||||
}
|
||||
@@ -2,16 +2,18 @@ package com.kri.contact.server.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.kri.common.enums.CodeEnum;
|
||||
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;
|
||||
|
||||
@@ -21,10 +23,10 @@ public enum ProjectStatus implements CodeEnum<Short> {
|
||||
return null;
|
||||
}
|
||||
for (ProjectStatus s : values()) {
|
||||
if (s.code == code) {
|
||||
if (s.code.equals(code)) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown ProjectStatus code: " + code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,17 +2,19 @@ package com.kri.contact.server.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.kri.common.enums.CodeEnum;
|
||||
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;
|
||||
|
||||
@@ -22,10 +24,10 @@ public enum ResultCodeType implements CodeEnum<Short> {
|
||||
return null;
|
||||
}
|
||||
for (ResultCodeType s : values()) {
|
||||
if (s.code == code) {
|
||||
if (s.code.equals(code)) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Unknown ResultCodeType code: " + code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,13 +2,16 @@ package com.kri.contact.server.common.enums;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
import com.kri.common.enums.CodeEnum;
|
||||
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), // 없음
|
||||
KON((short) 1), // KON
|
||||
KIWI((short) 2), // KIWI
|
||||
@@ -22,7 +25,7 @@ public enum SurveyType implements CodeEnum<Short> {
|
||||
return null;
|
||||
}
|
||||
for (SurveyType s : values()) {
|
||||
if (s.code == code) {
|
||||
if (s.code.equals(code)) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.kri.contact.server.common.enums;
|
||||
|
||||
import com.kri.common.enums.CodeEnum;
|
||||
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,6 +30,15 @@ public enum SystemEventType implements CodeEnum<Short> {
|
||||
UPDATE_ROLE((short) 412), // 권한 수정
|
||||
DELETE_ROLE((short) 413), // 권한 삭제
|
||||
|
||||
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);
|
||||
|
||||
private final Short code;
|
||||
|
||||
@@ -2,9 +2,9 @@ package com.kri.contact.server.common.external.intranet;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.kri.common.http.ExternalApiClient;
|
||||
import com.kri.common.http.ExternalApiResponse;
|
||||
import com.kri.contact.server.dto.LoginRequestDto;
|
||||
import com.kri.common.feature.http.ExternalApiClient;
|
||||
import com.kri.common.feature.http.ExternalApiResponse;
|
||||
import com.kri.contact.server.dto.auth.LoginRequestDto;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
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,30 @@
|
||||
package com.kri.contact.server.common.external.notihub;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@Schema(description = "NotiHubBulkSendCreateRequestDto")
|
||||
public class NotiHubBulkSendCreateRequestDto {
|
||||
|
||||
@Schema(description = "reqstCmpn")
|
||||
private String reqstCmpn;
|
||||
@Schema(description = "reqstUser")
|
||||
private String reqstUser;
|
||||
@Schema(description = "reqstSvc")
|
||||
private String reqstSvc;
|
||||
@Schema(description = "prjctCd")
|
||||
private String prjctCd;
|
||||
@Schema(description = "tmplatIdx")
|
||||
private Long tmplatIdx;
|
||||
@Schema(description = "resve")
|
||||
private Boolean resve;
|
||||
@Schema(description = "sendDt")
|
||||
private LocalDateTime sendDt;
|
||||
@Schema(description = "trgtCnt")
|
||||
private Integer trgtCnt;
|
||||
}
|
||||
25
src/main/java/com/kri/contact/server/common/external/notihub/NotiHubBulkSendResponseDto.java
vendored
Normal file
25
src/main/java/com/kri/contact/server/common/external/notihub/NotiHubBulkSendResponseDto.java
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
package com.kri.contact.server.common.external.notihub;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@Schema(description = "NotiHubBulkSendResponseDto")
|
||||
public class NotiHubBulkSendResponseDto {
|
||||
|
||||
@Schema(description = "bulkSendKey")
|
||||
private String bulkSendKey;
|
||||
@Schema(description = "requestCount")
|
||||
private Integer requestCount;
|
||||
@Schema(description = "acceptCount")
|
||||
private Integer acceptCount;
|
||||
@Schema(description = "failCount")
|
||||
private Integer failCount;
|
||||
}
|
||||
24
src/main/java/com/kri/contact/server/common/external/notihub/NotiHubDestInfoDto.java
vendored
Normal file
24
src/main/java/com/kri/contact/server/common/external/notihub/NotiHubDestInfoDto.java
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
package com.kri.contact.server.common.external.notihub;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import java.util.Map;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@Schema(description = "NotiHubDestInfoDto")
|
||||
public class NotiHubDestInfoDto {
|
||||
|
||||
@Schema(description = "sid")
|
||||
private String sid;
|
||||
@Schema(description = "destEml")
|
||||
private String destEml;
|
||||
@Schema(description = "destTel")
|
||||
private String destTel;
|
||||
@Schema(description = "destNm")
|
||||
private String destNm;
|
||||
@Schema(description = "msgParam")
|
||||
private Map<String, String> msgParam;
|
||||
}
|
||||
24
src/main/java/com/kri/contact/server/common/external/notihub/NotiHubSendRequestBulkDto.java
vendored
Normal file
24
src/main/java/com/kri/contact/server/common/external/notihub/NotiHubSendRequestBulkDto.java
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
package com.kri.contact.server.common.external.notihub;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@Schema(description = "NotiHubSendRequestBulkDto")
|
||||
public class NotiHubSendRequestBulkDto {
|
||||
|
||||
@Schema(description = "sendEml")
|
||||
private String sendEml;
|
||||
@Schema(description = "sendTel")
|
||||
private String sendTel;
|
||||
@Schema(description = "sendNm")
|
||||
private String sendNm;
|
||||
@Schema(description = "bulkSendKey")
|
||||
private String bulkSendKey;
|
||||
@Schema(description = "destInfoList")
|
||||
private List<NotiHubDestInfoDto> destInfoList;
|
||||
}
|
||||
32
src/main/java/com/kri/contact/server/common/external/notihub/NotiHubSendRequestSingleDto.java
vendored
Normal file
32
src/main/java/com/kri/contact/server/common/external/notihub/NotiHubSendRequestSingleDto.java
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
package com.kri.contact.server.common.external.notihub;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@Schema(description = "NotiHubSendRequestSingleDto")
|
||||
public class NotiHubSendRequestSingleDto {
|
||||
|
||||
@Schema(description = "sendEml")
|
||||
private String sendEml;
|
||||
@Schema(description = "sendTel")
|
||||
private String sendTel;
|
||||
@Schema(description = "sendNm")
|
||||
private String sendNm;
|
||||
@Schema(description = "destInfo")
|
||||
private NotiHubDestInfoDto destInfo;
|
||||
@Schema(description = "tmplatIdx")
|
||||
private Long tmplatIdx;
|
||||
@Schema(description = "reqstSvc")
|
||||
private String reqstSvc;
|
||||
@Schema(description = "prjctCd")
|
||||
private String prjctCd;
|
||||
@Schema(description = "resve")
|
||||
private Boolean resve;
|
||||
@Schema(description = "sendDt")
|
||||
private LocalDateTime sendDt;
|
||||
}
|
||||
27
src/main/java/com/kri/contact/server/common/external/notihub/NotiHubTemplateDto.java
vendored
Normal file
27
src/main/java/com/kri/contact/server/common/external/notihub/NotiHubTemplateDto.java
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
package com.kri.contact.server.common.external.notihub;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@Schema(description = "NotiHubTemplateDto")
|
||||
public class NotiHubTemplateDto {
|
||||
|
||||
@Schema(description = "tmplatIdx")
|
||||
private Long tmplatIdx;
|
||||
@Schema(description = "tmplatBody")
|
||||
private String tmplatBody;
|
||||
@Schema(description = "sendTel")
|
||||
private String sendTel;
|
||||
@Schema(description = "sendEml")
|
||||
private String sendEml;
|
||||
@Schema(description = "sendNm")
|
||||
private String sendNm;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.kri.contact.server.common.jpa;
|
||||
|
||||
import com.kri.common.jpa.AbstractCodeEnumConverter;
|
||||
import com.kri.common.feature.jpa.AbstractCodeEnumConverter;
|
||||
import com.kri.contact.server.common.enums.ResultCodeType;
|
||||
import jakarta.persistence.Converter;
|
||||
|
||||
@@ -10,4 +10,4 @@ public class ResultCodeTypeConverter extends AbstractCodeEnumConverter<ResultCod
|
||||
public ResultCodeTypeConverter() {
|
||||
super(ResultCodeType.class);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.kri.contact.server.common.util;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
||||
@NoArgsConstructor
|
||||
public final class ExcelResponseBuilder {
|
||||
public static ResponseEntity<byte[]> buildExcelResponse(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/vnd.openxmlformats-officedocument.spreadsheetml.sheet"))
|
||||
.body(bytes);
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,16 @@
|
||||
package com.kri.contact.server.common.util;
|
||||
|
||||
import com.kri.common.excel.ExcelMapper;
|
||||
import com.kri.contact.server.dto.ExcelUploadResponseDto;
|
||||
import com.kri.common.feature.excel.ExcelMapper;
|
||||
import com.kri.contact.server.dto.excel.ExcelUploadResultDto;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
|
||||
@NoArgsConstructor
|
||||
public final class ExcelUploadResultUtil {
|
||||
|
||||
private ExcelUploadResultUtil() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 엑셀 업로드 결과 + 에러 엑셀 생성까지 공통 처리.
|
||||
*
|
||||
@@ -21,18 +20,19 @@ public final class ExcelUploadResultUtil {
|
||||
* @param errorClass 에러 DTO 타입 (ExcelMapper용)
|
||||
* @param errorFileName 에러 엑셀 파일명
|
||||
*/
|
||||
public static <E> ExcelUploadResponseDto buildUploadResult(
|
||||
public static <E> ExcelUploadResultDto buildUploadResult(
|
||||
int totalCount,
|
||||
int successCount,
|
||||
int failCount,
|
||||
List<E> errorList,
|
||||
Class<E> errorClass,
|
||||
String errorFileName
|
||||
) {
|
||||
int failCount = (errorList != null) ? errorList.size() : 0;
|
||||
int errorListCount = (errorList != null) ? errorList.size() : 0;
|
||||
|
||||
// 1) 에러가 없으면 파일 없이 반환
|
||||
if (failCount == 0) {
|
||||
return ExcelUploadResponseDto.builder()
|
||||
if (errorListCount == 0) {
|
||||
return ExcelUploadResultDto.builder()
|
||||
.totalCount(totalCount)
|
||||
.successCount(successCount)
|
||||
.failCount(0)
|
||||
@@ -41,23 +41,24 @@ public final class ExcelUploadResultUtil {
|
||||
}
|
||||
|
||||
// 2) 에러가 있으면 에러 리스트를 엑셀로 생성
|
||||
try (Workbook errorWb = ExcelMapper.writeToWorkbook(errorList, errorClass);
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream()) {
|
||||
try (
|
||||
Workbook errorWb = ExcelMapper.writeToWorkbook(errorList, errorClass);
|
||||
ByteArrayOutputStream bos = new ByteArrayOutputStream()
|
||||
) {
|
||||
errorWb.write(bos);
|
||||
byte[] bytes = bos.toByteArray();
|
||||
String base64 = Base64.getEncoder().encodeToString(bytes);
|
||||
|
||||
return ExcelUploadResponseDto.builder()
|
||||
return ExcelUploadResultDto.builder()
|
||||
.totalCount(totalCount)
|
||||
.successCount(successCount)
|
||||
.failCount(failCount)
|
||||
.hasErrorFile(true)
|
||||
.errorFileName(errorFileName)
|
||||
.errorFileBase64(base64)
|
||||
.errorFileBase64(Base64.getEncoder().encodeToString(bytes))
|
||||
.build();
|
||||
} catch (Exception e) {
|
||||
// 에러 파일 생성 실패해도 업로드 결과는 그대로 리턴
|
||||
return ExcelUploadResponseDto.builder()
|
||||
return ExcelUploadResultDto.builder()
|
||||
.totalCount(totalCount)
|
||||
.successCount(successCount)
|
||||
.failCount(failCount)
|
||||
|
||||
@@ -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 {};
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.kri.contact.server.config;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ConfigurationProperties(prefix = "kri.file")
|
||||
public class FileStorageProperties {
|
||||
private String listBaseDir;
|
||||
private String listItemBaseDir;
|
||||
private String contactSenarioBaseDir;
|
||||
}
|
||||
15
src/main/java/com/kri/contact/server/config/JdbcConfig.java
Normal file
15
src/main/java/com/kri/contact/server/config/JdbcConfig.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.kri.contact.server.config;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
|
||||
@Configuration
|
||||
public class JdbcConfig {
|
||||
|
||||
@Bean
|
||||
public JdbcTemplate jdbcTemplate(DataSource dataSource) {
|
||||
return new JdbcTemplate(dataSource);
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
@Configuration
|
||||
public class WebResourceConfig implements WebMvcConfigurer {
|
||||
|
||||
@Value("${kri.contact-senario.upload-base-dir}")
|
||||
@Value("${kri.file.contact-senario-base-dir}")
|
||||
private String uploadBaseDir;
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
package com.kri.contact.server.controller;
|
||||
|
||||
import com.kri.common.datetime.DateTimeUtil;
|
||||
import com.kri.common.webmvc.RequestUserContext;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.kri.contact.server.controller;
|
||||
|
||||
import com.kri.common.datetime.DateTimeUtil;
|
||||
import com.kri.common.webmvc.RequestUserContext;
|
||||
import com.kri.contact.server.dto.LoginRequestDto;
|
||||
import com.kri.contact.server.dto.LoginResponseDto;
|
||||
import com.kri.common.feature.datetime.DateTimeUtil;
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,247 @@
|
||||
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;
|
||||
import com.kri.contact.server.common.enums.ListSearchResponseType;
|
||||
import com.kri.contact.server.dto.excel.ExcelUploadResultDto;
|
||||
import com.kri.contact.server.dto.list.ListFilterDto;
|
||||
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.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;
|
||||
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.PostMapping;
|
||||
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.RequestPart;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/list")
|
||||
@RequiredArgsConstructor
|
||||
@Tag(name = "List", description = "리스트 API")
|
||||
public class ListController {
|
||||
|
||||
private final ProjectService projectService;
|
||||
private final ListDownloadService listDownloadService;
|
||||
private final ListSearchService listSearchService;
|
||||
private final ListUploadService listUploadService;
|
||||
private final ListUpdateService listUpdateService;
|
||||
private final ListResetService listResetService;
|
||||
private final SystemEventLogService systemEventLogService;
|
||||
|
||||
@Operation(summary = "리스트 정보 조회 With Sid")
|
||||
@GetMapping("/search-sid/{prjctIdx}/{sid}")
|
||||
public ListSearchWithFullResultDto searchListWithSid(
|
||||
@PathVariable Long prjctIdx,
|
||||
@PathVariable Integer sid
|
||||
) {
|
||||
return listSearchService.searchListWithSid(prjctIdx, sid);
|
||||
}
|
||||
|
||||
@Operation(summary = "리스트 정보 조회 With Filter")
|
||||
@PostMapping("/search-filter/{prjctIdx}")
|
||||
public PageResponseDto<ListSearchWithFullResultDto> searchListWithFilter(
|
||||
@PathVariable Long prjctIdx,
|
||||
@Valid @RequestBody ListSearchRequestDto request
|
||||
) {
|
||||
return listSearchService.searchListWithPaging(
|
||||
prjctIdx,
|
||||
request,
|
||||
ListSearchResponseType.WITH_FULL_RESULT
|
||||
);
|
||||
}
|
||||
|
||||
@Operation(summary = "리스트 파일 업로드 양식 다운로드")
|
||||
@PostMapping("/excel/template/{prjctIdx}")
|
||||
public ResponseEntity<byte[]> downloadExcelTemplate(@PathVariable Long prjctIdx) {
|
||||
ProjectInfoDto projectInfoDto = getProjectOrThrow(prjctIdx);
|
||||
byte[] bytes = listUploadService.downloadExcelTemplate(prjctIdx);
|
||||
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,
|
||||
@Valid @RequestBody(required = false) ListFilterDto listFilter
|
||||
) {
|
||||
ProjectInfoDto projectInfoDto = getProjectOrThrow(prjctIdx);
|
||||
byte[] bytes = listDownloadService.downloadList(prjctIdx, listFilter);
|
||||
return buildExcelResponse(projectInfoDto.getPrjctName() + " list.xlsx", bytes);
|
||||
}
|
||||
|
||||
@Operation(summary = "리스트 수정 이력 다운로드")
|
||||
@PostMapping("/excel/download/update/{prjctIdx}")
|
||||
public ResponseEntity<byte[]> downloadListUpdateHistory(
|
||||
@PathVariable Long prjctIdx,
|
||||
@Valid @RequestBody(required = false) ListFilterDto listFilter
|
||||
) {
|
||||
ProjectInfoDto projectInfoDto = getProjectOrThrow(prjctIdx);
|
||||
byte[] bytes = listDownloadService.downloadSidWithUpdateHist(prjctIdx, listFilter);
|
||||
return buildExcelResponse(projectInfoDto.getPrjctName() + " 수정 이력.xlsx", bytes);
|
||||
}
|
||||
|
||||
@Operation(summary = "리스트 파일 업로드")
|
||||
@PostMapping(value = "/excel/upload/{prjctIdx}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
public ExcelUploadResultDto uploadExcel(
|
||||
@PathVariable Long prjctIdx,
|
||||
@RequestParam("file") MultipartFile file,
|
||||
@Valid @RequestPart("request") ListUploadRequestDto request,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
getProjectOrThrow(prjctIdx);
|
||||
|
||||
LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
ExcelUploadResultDto result = listUploadService.uploadExcel(prjctIdx, file, request, ctx.getUserId(), now);
|
||||
systemEventLogService.writeUploadList(ctx.getUserId(), now, ctx.getClientIp(), prjctIdx, UploadContentDto.from(file));
|
||||
return result;
|
||||
}
|
||||
|
||||
@Operation(summary = "리스트 수정")
|
||||
@PatchMapping("/update/{prjctIdx}")
|
||||
public int updateList(
|
||||
@PathVariable Long prjctIdx,
|
||||
@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(
|
||||
@PathVariable Long prjctIdx,
|
||||
@Valid @RequestBody ListResetRequestDto request,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
int resetCount = listResetService.resetByFilter(
|
||||
prjctIdx,
|
||||
request.getListFilter(),
|
||||
request.getResetMode(),
|
||||
ctx.getUserId(),
|
||||
now
|
||||
);
|
||||
systemEventLogService.writeResetList(ctx.getUserId(), now, ctx.getClientIp(), prjctIdx, request);
|
||||
return resetCount;
|
||||
}
|
||||
|
||||
private ProjectInfoDto getProjectOrThrow(Long prjctIdx) {
|
||||
ProjectInfoDto projectInfoDto = projectService.getProject(prjctIdx);
|
||||
if (projectInfoDto == null) {
|
||||
throw BusinessException.internalError("프로젝트가 없습니다.");
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
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.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.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PatchMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
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-header")
|
||||
@RequiredArgsConstructor
|
||||
@Tag(name = "ListHeader", description = "리스트 헤더 API")
|
||||
public class ListHeaderController {
|
||||
|
||||
private final ListHeaderService listHeaderService;
|
||||
private final SystemEventLogService systemEventLogService;
|
||||
|
||||
@Operation(summary = "리스트 헤더 조회")
|
||||
@GetMapping("/{prjctIdx}")
|
||||
public List<ListHeaderWithFilterContentDto> getListHeader (@PathVariable Long prjctIdx) {
|
||||
return listHeaderService.getHeader(prjctIdx);
|
||||
}
|
||||
|
||||
@Operation(summary = "리스트 헤더 수정")
|
||||
@PatchMapping("/{prjctIdx}")
|
||||
public void updateListHeader (
|
||||
@PathVariable Long prjctIdx,
|
||||
@Valid @RequestBody List<ListHeaderDto> headerList,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
listHeaderService.updateListHeader(prjctIdx, headerList, ctx.getUserId(), now);
|
||||
|
||||
systemEventLogService.writeUpsertListHeader(ctx.getUserId(), now, ctx.getClientIp(), prjctIdx,
|
||||
headerList);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
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.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-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}")
|
||||
public ResponseEntity<byte[]> downloadListWithEventHistory(
|
||||
@PathVariable Long prjctIdx,
|
||||
@Valid @RequestBody ListEventHistDownloadRequestDto request
|
||||
) {
|
||||
ProjectInfoDto projectInfoDto = getProjectOrThrow(prjctIdx);
|
||||
byte[] bytes = listDownloadService.downloadListWithEventHist(
|
||||
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) {
|
||||
throw BusinessException.internalError("프로젝트가 없습니다.");
|
||||
}
|
||||
return projectInfoDto;
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,18 @@
|
||||
package com.kri.contact.server.controller;
|
||||
|
||||
import com.kri.common.datetime.DateTimeUtil;
|
||||
import com.kri.common.webmvc.RequestUserContext;
|
||||
import com.kri.common.webmvc.page.PageResponseDto;
|
||||
import com.kri.common.feature.datetime.DateTimeUtil;
|
||||
import com.kri.common.feature.web.RequestUserContext;
|
||||
import com.kri.common.feature.web.page.PageResponseDto;
|
||||
import com.kri.contact.server.common.enums.ChannelType;
|
||||
import com.kri.contact.server.dto.ProjectCreateRequestDto;
|
||||
import com.kri.contact.server.dto.ProjectInfoDto;
|
||||
import com.kri.contact.server.dto.ProjectMainTemplateUpdateRequestDto;
|
||||
import com.kri.contact.server.dto.ProjectOwnerResponseDto;
|
||||
import com.kri.contact.server.dto.ProjectSearchRequestDto;
|
||||
import com.kri.contact.server.dto.ProjectUpdateRequestDto;
|
||||
import com.kri.contact.server.service.FileService;
|
||||
import com.kri.contact.server.dto.project.ProjectCreateRequestDto;
|
||||
import com.kri.contact.server.dto.project.ProjectInfoDto;
|
||||
import com.kri.contact.server.dto.project.ProjectMainTemplateUpdateRequestDto;
|
||||
import com.kri.contact.server.dto.project.ProjectOwnerResponseDto;
|
||||
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;
|
||||
@@ -39,7 +39,7 @@ public class ProjectController {
|
||||
|
||||
private final SystemEventLogService systemEventLogService;
|
||||
private final ProjectService projectService;
|
||||
private final FileService fileService;
|
||||
private final ContactScenarioFileService contactScenarioFileService;
|
||||
|
||||
@Operation(summary = "프로젝트 조회")
|
||||
@GetMapping("/{prjctIdx}")
|
||||
@@ -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 = "프로젝트를 소유하고 있는 모든 부서/실사 목록 조회")
|
||||
@@ -101,7 +102,7 @@ public class ProjectController {
|
||||
@PutMapping("/senario-image/{prjctCd}")
|
||||
public String uploadContactSenarioImage(@PathVariable String prjctCd,
|
||||
@RequestParam("file") MultipartFile file) {
|
||||
return fileService.storeTempFile(prjctCd, file);
|
||||
return contactScenarioFileService.storeTempFile(prjctCd, file);
|
||||
}
|
||||
|
||||
@Operation(summary = "프로젝트 수정")
|
||||
@@ -113,7 +114,7 @@ public class ProjectController {
|
||||
) {
|
||||
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
|
||||
String newHtml = fileService.syncOnSave(
|
||||
String newHtml = contactScenarioFileService.syncOnSave(
|
||||
req.getProjectInfo().getPrjctCd(),
|
||||
req.getProjectInfo().getContactSenario()
|
||||
);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.kri.contact.server.controller;
|
||||
|
||||
import com.kri.contact.server.common.enums.ResultCodeType;
|
||||
import com.kri.contact.server.dto.ResultCodeDto;
|
||||
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,7 +1,7 @@
|
||||
package com.kri.contact.server.controller;
|
||||
|
||||
import com.kri.common.webmvc.RequestUserContext;
|
||||
import com.kri.contact.server.dto.RoleInfoDto;
|
||||
import com.kri.common.feature.web.RequestUserContext;
|
||||
import com.kri.contact.server.dto.user.RoleInfoDto;
|
||||
import com.kri.contact.server.service.RoleService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
@@ -24,4 +24,4 @@ public class RoleController {
|
||||
public List<RoleInfoDto> getRoleList(RequestUserContext ctx) {
|
||||
return roleService.getRoleList(ctx.getUserRole());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
package com.kri.contact.server.controller;
|
||||
|
||||
import com.kri.common.datetime.DateTimeUtil;
|
||||
import com.kri.common.webmvc.RequestUserContext;
|
||||
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.DataVerificationDto;
|
||||
import com.kri.contact.server.dto.ExcelUploadResponseDto;
|
||||
import com.kri.contact.server.dto.UserInfoDto;
|
||||
import com.kri.contact.server.dto.systemlog.UploadUserContentDto;
|
||||
import com.kri.contact.server.service.SystemEventLogService;
|
||||
import com.kri.contact.server.dto.common.DataVerificationDto;
|
||||
import com.kri.contact.server.dto.excel.ExcelUploadResultDto;
|
||||
import com.kri.contact.server.dto.systemlog.UploadContentDto;
|
||||
import com.kri.contact.server.dto.user.UserInfoDto;
|
||||
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;
|
||||
@@ -25,10 +27,9 @@ import org.springframework.web.bind.annotation.PatchMapping;
|
||||
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.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;
|
||||
|
||||
@@ -64,7 +65,7 @@ public class UserController {
|
||||
}
|
||||
}
|
||||
|
||||
@Operation(summary = "컨택원/면접원 목록 조회")
|
||||
@Operation(summary = "컨택트 면접원 목록 조회")
|
||||
@GetMapping("fieldwork")
|
||||
public List<UserInfoDto> getFiledoworkUserList(RequestUserContext ctx) {
|
||||
String searchCmpn = ctx.getUserCmpn();
|
||||
@@ -75,7 +76,7 @@ public class UserController {
|
||||
return userService.getFieldworkUserListWithCmpn(searchCmpn);
|
||||
}
|
||||
|
||||
@Operation(summary = "외주사 목록 조회")
|
||||
@Operation(summary = "외주 목록 조회")
|
||||
@GetMapping("outsource")
|
||||
List<UserInfoDto> getOutsourceList() {
|
||||
return userService.getOutsourceList();
|
||||
@@ -105,27 +106,24 @@ public class UserController {
|
||||
systemEventLogService.writeCreateUserLog(regId, now, clientIp, userInfo);
|
||||
}
|
||||
|
||||
@Operation(summary = "사용자 일괄 생성(엑셀 업로드)")
|
||||
@PostMapping("/excel")
|
||||
public ExcelUploadResponseDto createUserFromExcel(
|
||||
@RequestPart("file") MultipartFile file,
|
||||
@Operation(
|
||||
summary = "사용자 일괄 생성(엑셀 업로드)",
|
||||
description = "성공하면 JSON, 실패가 있으면 실패 내역 엑셀(xlsx) 반환"
|
||||
)
|
||||
@PostMapping(value = "/excel/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
public ExcelUploadResultDto createUserFromExcel(
|
||||
@RequestParam("file") MultipartFile file,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
String regId = ctx.getUserId();
|
||||
String clientIp = ctx.getClientIp();
|
||||
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
//외주사급이 업로드로 계정을 생성하는 경우 자신의 회사명으로 고정
|
||||
String forceCmpn =
|
||||
ctx.getUserRole() < ContactConstant.OUTSOURCE_USER_ROLE ? "" : ctx.getUserCmpn();
|
||||
|
||||
ExcelUploadResponseDto result = userService.createUsersFromExcel(file, regId, now, forceCmpn);
|
||||
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;
|
||||
}
|
||||
@@ -135,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 = "사용자 정보 수정")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.kri.contact.server.dto;
|
||||
package com.kri.contact.server.dto.auth;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Getter;
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.kri.contact.server.dto;
|
||||
package com.kri.contact.server.dto.auth;
|
||||
|
||||
|
||||
import com.kri.common.auth.dto.JwtUserClaimsDto;
|
||||
import com.kri.common.feature.auth.dto.JwtUserClaimsDto;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.kri.contact.server.dto;
|
||||
package com.kri.contact.server.dto.common;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.kri.contact.server.dto.common;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
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 = "날짜 범위 Dto")
|
||||
public class DateRangeDto {
|
||||
|
||||
@Schema(description = "시작 날짜")
|
||||
private LocalDateTime startDate;
|
||||
@Schema(description = "종료 날짜")
|
||||
private LocalDateTime endDate;
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.kri.contact.server.dto.excel;
|
||||
|
||||
import com.kri.common.excel.ExcelColumn;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
@@ -8,15 +10,19 @@ import lombok.experimental.SuperBuilder;
|
||||
@SuperBuilder
|
||||
@Getter
|
||||
@Setter
|
||||
@Schema(description = "ExcelErrorDto")
|
||||
public class ExcelErrorDto {
|
||||
|
||||
@ExcelColumn(header = "행 번호", order = 0)
|
||||
@Schema(description = "rowNumber")
|
||||
private int rowNumber;
|
||||
|
||||
@ExcelColumn(header = "필드명", order = 1)
|
||||
@Schema(description = "fieldName")
|
||||
private String fieldName;
|
||||
|
||||
@ExcelColumn(header = "에러 메시지", order = 2)
|
||||
@Schema(description = "errorMessage")
|
||||
private String errorMessage;
|
||||
|
||||
public static ExcelErrorDto of(int rowNumber, String fieldName, String errorMessage) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.kri.contact.server.dto;
|
||||
package com.kri.contact.server.dto.excel;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Builder;
|
||||
@@ -8,7 +8,8 @@ import lombok.Setter;
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
public class ExcelUploadResponseDto {
|
||||
@Schema(description = "ExcelUploadResultDto")
|
||||
public class ExcelUploadResultDto {
|
||||
|
||||
@Schema(description = "전체 읽은 행 수 (헤더 제외)")
|
||||
private int totalCount;
|
||||
@@ -27,4 +28,14 @@ public class ExcelUploadResponseDto {
|
||||
|
||||
@Schema(description = "에러 엑셀 파일 (xlsx)의 Base64 문자열 (hasErrorFile == true일 때만 세팅)")
|
||||
private String errorFileBase64;
|
||||
|
||||
public static ExcelUploadResultDto success(int totalCount, int successCount) {
|
||||
return ExcelUploadResultDto.builder()
|
||||
.totalCount(totalCount)
|
||||
.successCount(successCount)
|
||||
.failCount(0)
|
||||
.hasErrorFile(false)
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.kri.contact.server.dto.excel;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@SuperBuilder
|
||||
@Getter
|
||||
@Setter
|
||||
@Schema(description = "ListUploadErrorDto")
|
||||
public class ListUploadErrorDto extends ExcelErrorDto {
|
||||
public static ListUploadErrorDto of(int rowNumber, String fieldName, String errorMessage) {
|
||||
return ListUploadErrorDto.builder()
|
||||
.rowNumber(rowNumber)
|
||||
.fieldName(fieldName)
|
||||
.errorMessage(errorMessage)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.kri.contact.server.dto.excel;
|
||||
|
||||
import com.kri.common.excel.ExcelColumn;
|
||||
import com.kri.common.feature.excel.ExcelColumn;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
@@ -13,6 +13,7 @@ import lombok.Setter;
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "UserUploadDto")
|
||||
public class UserUploadDto {
|
||||
|
||||
@ExcelColumn(header = "사용자 ID", order = 0, width = 11)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.kri.contact.server.dto.excel;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
@@ -7,6 +9,7 @@ import lombok.experimental.SuperBuilder;
|
||||
@SuperBuilder
|
||||
@Getter
|
||||
@Setter
|
||||
@Schema(description = "UserUploadErrorDto")
|
||||
public class UserUploadErrorDto extends ExcelErrorDto {
|
||||
|
||||
public static UserUploadErrorDto of(int rowNumber, String fieldName, String errorMessage) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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,77 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import com.kri.contact.server.persistence.entity.TListCallHistEntity;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@Schema(description = "ListCallHistDto")
|
||||
public class ListCallHistDto {
|
||||
|
||||
@Schema(description = "listCallHistIdx")
|
||||
private Long listCallHistIdx;
|
||||
@Schema(description = "prjctIdx")
|
||||
private Long prjctIdx;
|
||||
@Schema(description = "sid")
|
||||
private Integer sid;
|
||||
@Schema(description = "listHderId")
|
||||
private Integer listHderId;
|
||||
@Schema(description = "destNum")
|
||||
private String destNum;
|
||||
@Schema(description = "agentNum")
|
||||
private String agentNum;
|
||||
@Schema(description = "aniNum")
|
||||
private String aniNum;
|
||||
@Schema(description = "agentSessionId")
|
||||
private String agentSessionId;
|
||||
@Schema(description = "destSessionId")
|
||||
private String destSessionId;
|
||||
@Schema(description = "callTy")
|
||||
private String callTy;
|
||||
@Schema(description = "startDt")
|
||||
private LocalDateTime startDt;
|
||||
@Schema(description = "endDt")
|
||||
private LocalDateTime endDt;
|
||||
@Schema(description = "totalTime")
|
||||
private Integer totalTime;
|
||||
@Schema(description = "talkTime")
|
||||
private Integer talkTime;
|
||||
@Schema(description = "mediaServerId")
|
||||
private Integer mediaServerId;
|
||||
@Schema(description = "mediaServerName")
|
||||
private String mediaServerName;
|
||||
@Schema(description = "recordFileName")
|
||||
private String recordFileName;
|
||||
@Schema(description = "regUser")
|
||||
private String regUser;
|
||||
@Schema(description = "regDt")
|
||||
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())
|
||||
.endDt(entity.getEndDt())
|
||||
.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,78 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
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.Instant;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@Schema(description = "ListCallHistRequestDto")
|
||||
public class ListCallHistRequestDto {
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "listHderId")
|
||||
private Integer listHderId;
|
||||
|
||||
@NotBlank
|
||||
@Size(max = 64)
|
||||
@Schema(description = "destNum")
|
||||
private String destNum;
|
||||
|
||||
@NotBlank
|
||||
@Size(max = 64)
|
||||
@Schema(description = "agentNum")
|
||||
private String agentNum;
|
||||
|
||||
@NotBlank
|
||||
@Size(max = 64)
|
||||
@Schema(description = "aniNum")
|
||||
private String aniNum;
|
||||
|
||||
@NotBlank
|
||||
@Size(max = 64)
|
||||
@Schema(description = "agentSessionId")
|
||||
private String agentSessionId;
|
||||
|
||||
@NotBlank
|
||||
@Size(max = 64)
|
||||
@Schema(description = "destSessionId")
|
||||
private String destSessionId;
|
||||
|
||||
@NotBlank
|
||||
@Size(max = 64)
|
||||
@Schema(description = "callTy")
|
||||
private String callTy;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "startDt")
|
||||
private LocalDateTime startDt;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "totalTime")
|
||||
private Integer totalTime;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "talkTime")
|
||||
private Integer talkTime;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "mediaServerId")
|
||||
private Integer mediaServerId;
|
||||
|
||||
@NotBlank
|
||||
@Size(max = 64)
|
||||
@Schema(description = "mediaServerName")
|
||||
private String mediaServerName;
|
||||
|
||||
@Size(max = 256)
|
||||
@Schema(description = "recordFileName")
|
||||
private String recordFileName;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.persistence.entity.TListEventHistEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "컨택/방문 면접 결과")
|
||||
public class ListContactResultDto extends ListResultBaseDto {
|
||||
|
||||
@Schema(description = "마지막 컨택/방문면접원")
|
||||
private String lastUser;
|
||||
|
||||
@Schema(description = "할당된 컨택/방문면접원")
|
||||
private String assignUser;
|
||||
|
||||
public static ListContactResultDto from(TListEventHistEntity entity, Integer attemptCount) {
|
||||
if (entity == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return ListContactResultDto.builder()
|
||||
.lastResultCd(entity.getResultCd() == null ? null : entity.getResultCd().shortValue())
|
||||
.lastResultDt(entity.getRegDt())
|
||||
.attemptCount(attemptCount)
|
||||
.lastUser(entity.getRegUser())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
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;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@Schema(description = "리스트 + 컨택이력 다운로드 요청 DTO")
|
||||
public class ListEventHistDownloadRequestDto {
|
||||
|
||||
@Valid
|
||||
@NotNull
|
||||
@Schema(description = "리스트 필터")
|
||||
private ListFilterDto listFilter;
|
||||
|
||||
@NotEmpty
|
||||
@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,44 @@
|
||||
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;
|
||||
|
||||
@Schema(description = "전화 이력 id")
|
||||
private Long listCallHistIdx;
|
||||
|
||||
@Valid
|
||||
@Schema(description = "메타 데이터")
|
||||
private ListEventHistInternalMetaDto meta;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "사용자 메모")
|
||||
private String memo;
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
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
|
||||
@Schema(description = "ListEventHistInternalMetaDto")
|
||||
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,53 @@
|
||||
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
|
||||
@Schema(description = "ListEventHistSurveyMetaDto")
|
||||
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,50 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import com.kri.contact.server.persistence.entity.TListEventHistEntity;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@Schema(description = "ListEventHistoryDto")
|
||||
public class ListEventHistoryDto {
|
||||
|
||||
@Schema(description = "listEventHistIdx")
|
||||
private Long listEventHistIdx;
|
||||
@Schema(description = "eventTy")
|
||||
private Short eventTy;
|
||||
@Schema(description = "prjctIdx")
|
||||
private Long prjctIdx;
|
||||
@Schema(description = "sid")
|
||||
private Integer sid;
|
||||
@Schema(description = "resultCd")
|
||||
private Integer resultCd;
|
||||
@Schema(description = "metaData")
|
||||
private String metaData;
|
||||
@Schema(description = "listCallHistIdx")
|
||||
private Long listCallHistIdx;
|
||||
@Schema(description = "memo")
|
||||
private String memo;
|
||||
@Schema(description = "regUser")
|
||||
private String regUser;
|
||||
@Schema(description = "regDt")
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
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;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "리스트 필터 Dto")
|
||||
public class ListFilterDto {
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "SID 목록. 숫자 또는 숫자~숫자 형식")
|
||||
private Set<String> sidSet;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "리스트 사용 여부 목록")
|
||||
private Set<ListIsUse> listUseSet;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "List use filter conditions")
|
||||
private List<@Valid ListFilterConditionDto> listUseConditions;
|
||||
|
||||
@NotNull
|
||||
@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(String.valueOf(sid)))
|
||||
.listUseSet(Set.of())
|
||||
.listUseConditions(List.of())
|
||||
.assignUserMap(Map.of())
|
||||
.assignConditions(List.of())
|
||||
.resultCodeMap(Map.of())
|
||||
.memoConditions(List.of())
|
||||
.otherItemConditions(List.of())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
121
src/main/java/com/kri/contact/server/dto/list/ListHeaderDto.java
Normal file
121
src/main/java/com/kri/contact/server/dto/list/ListHeaderDto.java
Normal file
@@ -0,0 +1,121 @@
|
||||
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 jakarta.validation.constraints.NotNull;
|
||||
import java.util.Objects;
|
||||
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 ListHeaderDto {
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "프로젝트 기본키")
|
||||
private Long prjctIdx;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "리스트 헤더 기본키")
|
||||
private Integer listHderId;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "리스트 헤더 순서")
|
||||
private Short listHderOrder;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "헤더 등급")
|
||||
private ListHeaderGrade listHderGrad;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "헤더 명")
|
||||
private String listHderNm;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "헤더 타입")
|
||||
private ListHeaderType listHderTy;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "필터 사용 여부")
|
||||
private Boolean useFilter = false;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "리스트 노출 여부")
|
||||
private Boolean useColView = false;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "면접원 노출 여부")
|
||||
private Boolean useIntrvwerView = false;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "면접원 수정가능 여부")
|
||||
private Boolean useIntrvwerEdit = false;
|
||||
|
||||
public static ListHeaderDto fromEntity(TListHeaderEntity entity) {
|
||||
return ListHeaderDto.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())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static ListHeaderDto fromDto(Long prjctIdx, ListHeaderDto src) {
|
||||
return ListHeaderDto.builder()
|
||||
.prjctIdx(prjctIdx)
|
||||
.listHderId(src.getListHderId())
|
||||
.listHderOrder(src.getListHderOrder())
|
||||
.listHderGrad(src.getListHderGrad())
|
||||
.listHderNm(src.getListHderNm())
|
||||
.listHderTy(src.getListHderTy())
|
||||
.useFilter(src.getUseFilter())
|
||||
.useColView(src.getUseColView())
|
||||
.useIntrvwerView(src.getUseIntrvwerView())
|
||||
.useIntrvwerEdit(src.getUseIntrvwerEdit())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static ListHeaderDto newCommon(Long prjctIdx, int headerId, String headerName, ListHeaderType type){
|
||||
return ListHeaderDto.builder()
|
||||
.prjctIdx(prjctIdx)
|
||||
.listHderId(headerId)
|
||||
.listHderOrder((short) headerId)
|
||||
.listHderGrad(ListHeaderGrade.COMMON)
|
||||
.listHderNm(headerName)
|
||||
.listHderTy(type)
|
||||
.useFilter(true)
|
||||
.useColView(true)
|
||||
.useIntrvwerView(true)
|
||||
.useIntrvwerEdit(false)
|
||||
.build();
|
||||
}
|
||||
|
||||
public boolean isEqualHard(ListHeaderDto dto) {
|
||||
return Objects.equals(listHderId, dto.listHderId) &&
|
||||
Objects.equals(listHderOrder, dto.listHderOrder) &&
|
||||
Objects.equals(listHderGrad, dto.listHderGrad) &&
|
||||
Objects.equals(listHderNm, dto.listHderNm) &&
|
||||
Objects.equals(listHderTy, dto.listHderTy);
|
||||
}
|
||||
|
||||
public boolean isEqualSimple(ListHeaderDto dto) {
|
||||
return Objects.equals(listHderId, dto.listHderId) &&
|
||||
Objects.equals(listHderGrad, dto.listHderGrad) &&
|
||||
Objects.equals(listHderNm, dto.listHderNm);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
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 {
|
||||
@Schema(description = "filterContents")
|
||||
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;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
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;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@Schema(description = "리스트 초기화 요청 DTO")
|
||||
public class ListResetRequestDto {
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "초기화 범위")
|
||||
private ListResetMode resetMode;
|
||||
|
||||
@Valid
|
||||
@NotNull
|
||||
@Schema(description = "리스트 필터")
|
||||
private ListFilterDto listFilter;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.persistence.entity.TListEventHistEntity;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "결과 코드 기본 정보")
|
||||
public class ListResultBaseDto {
|
||||
|
||||
@Schema(description = "최종 결과값")
|
||||
private Short lastResultCd;
|
||||
|
||||
@Schema(description = "최종 결과값 일시")
|
||||
private LocalDateTime lastResultDt;
|
||||
|
||||
@Schema(description = "시도 횟수")
|
||||
private Integer attemptCount;
|
||||
|
||||
public static ListResultBaseDto from(TListEventHistEntity entity, Integer attemptCount) {
|
||||
if (entity == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return ListResultBaseDto.builder()
|
||||
.lastResultCd(entity.getResultCd() == null ? null : entity.getResultCd().shortValue())
|
||||
.lastResultDt(entity.getRegDt())
|
||||
.attemptCount(attemptCount)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
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;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "리스트 조회 기본")
|
||||
public class ListSearchBaseDto {
|
||||
|
||||
@Schema(description = "프로젝트 고유키")
|
||||
private Long prjctIdx;
|
||||
|
||||
@Schema(description = "SID")
|
||||
private Integer sid;
|
||||
|
||||
@Schema(description = "사용 여부")
|
||||
private ListIsUse use;
|
||||
|
||||
@Schema(description = "배정 사용자 목록. key: ListHeaderTypeAssign 코드(13=외주사, 14=컨택원, 15=면접원)")
|
||||
private Map<ListHeaderTypeAssign, String> assignList;
|
||||
|
||||
@Schema(description = "메모")
|
||||
private String memo;
|
||||
|
||||
@Schema(description = "리스트 값 정보")
|
||||
private 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(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));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
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;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "리스트 검색 조건")
|
||||
public class ListSearchRequestDto {
|
||||
|
||||
@Valid
|
||||
@NotNull
|
||||
@Schema(description = "리스트 필터")
|
||||
private ListFilterDto listFilter;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "페이지네이션 정보")
|
||||
private PageRequestDto pageRequest;
|
||||
|
||||
public static ListSearchRequestDto of(ListFilterDto listFilter, PageRequestDto pageRequest){
|
||||
return ListSearchRequestDto.builder()
|
||||
.listFilter(listFilter)
|
||||
.pageRequest(pageRequest)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
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;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "리스트 조회 응답(기본 + 결과 + 발송 결과)")
|
||||
public class ListSearchWithFullResultDto extends ListSearchWithResultDto {
|
||||
|
||||
@Schema(description = "메일 발송 결과")
|
||||
private ListSendResultDto mailSendResult;
|
||||
|
||||
@Schema(description = "문자 발송 결과")
|
||||
private ListSendResultDto smsSendResult;
|
||||
|
||||
public static ListSearchWithFullResultDto from(
|
||||
TListEntity entity,
|
||||
Map<Integer, String> itemList,
|
||||
AssignValues assignValues,
|
||||
ListContactResultDto contactResult,
|
||||
ListContactResultDto interviewResult,
|
||||
ListResultBaseDto surveyResult,
|
||||
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(ListIsUse.fromCode(entity.getUse()))
|
||||
.assignList(toAssignList(values))
|
||||
.memo(entity.getMemo())
|
||||
.itemList(itemList)
|
||||
.contactResult(contactResult)
|
||||
.interviewResult(interviewResult)
|
||||
.surveyResult(surveyResult)
|
||||
.mailSendResult(mailSendResult)
|
||||
.smsSendResult(smsSendResult)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
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;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "리스트 조회 기본 + 결과")
|
||||
public class ListSearchWithResultDto extends ListSearchBaseDto {
|
||||
@Schema(description = "컨택 결과")
|
||||
private ListContactResultDto contactResult;
|
||||
|
||||
@Schema(description = "대면 면접 결과")
|
||||
private ListContactResultDto interviewResult;
|
||||
|
||||
@Schema(description = "온라인 설문 결과")
|
||||
private ListResultBaseDto surveyResult;
|
||||
|
||||
public static ListSearchWithResultDto from(
|
||||
TListEntity entity,
|
||||
Map<Integer, String> itemList,
|
||||
AssignValues assignValues,
|
||||
ListContactResultDto contactResult,
|
||||
ListContactResultDto interviewResult,
|
||||
ListResultBaseDto surveyResult
|
||||
) {
|
||||
if (entity == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
AssignValues values = assignValues == null ? AssignValues.empty() : assignValues;
|
||||
return ListSearchWithResultDto.builder()
|
||||
.prjctIdx(entity.getPrjctIdx())
|
||||
.sid(entity.getSid())
|
||||
.use(ListIsUse.fromCode(entity.getUse()))
|
||||
.assignList(toAssignList(values))
|
||||
.memo(entity.getMemo())
|
||||
.itemList(itemList)
|
||||
.contactResult(contactResult)
|
||||
.interviewResult(interviewResult)
|
||||
.surveyResult(surveyResult)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -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,44 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import com.kri.contact.server.persistence.entity.TListUpdateHistEntity;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@Schema(description = "ListUpdateHistoryDto")
|
||||
public class ListUpdateHistoryDto {
|
||||
|
||||
@Schema(description = "listUpdateHistIdx")
|
||||
private Long listUpdateHistIdx;
|
||||
@Schema(description = "prjctIdx")
|
||||
private Long prjctIdx;
|
||||
@Schema(description = "sid")
|
||||
private Integer sid;
|
||||
@Schema(description = "listHderId")
|
||||
private Integer listHderId;
|
||||
@Schema(description = "beforeVal")
|
||||
private String beforeVal;
|
||||
@Schema(description = "afterVal")
|
||||
private String afterVal;
|
||||
@Schema(description = "regUser")
|
||||
private String regUser;
|
||||
@Schema(description = "regDt")
|
||||
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();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
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;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@Schema(description = "리스트 정보 수정 요청 DTO")
|
||||
public class ListUpdateRequestDto {
|
||||
|
||||
@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,30 @@
|
||||
package com.kri.contact.server.dto.list;
|
||||
|
||||
import com.kri.contact.server.common.enums.ListHeaderTypeSpecific;
|
||||
import com.kri.contact.server.common.enums.ListUploadMode;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.util.Map;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@Schema(description = "리스트 업로드 요청 DTO")
|
||||
public class ListUploadRequestDto {
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "업로드 모드")
|
||||
private ListUploadMode uploadMode;
|
||||
|
||||
@Schema(description = "이메일 중복 체크")
|
||||
private boolean checkDuplicateEmail;
|
||||
|
||||
@Schema(description = "전화번호 중복 체크")
|
||||
private boolean checkDuplicatePhone;
|
||||
|
||||
@Schema(description = "특수 헤더 정보")
|
||||
private Map<String, ListHeaderTypeSpecific> specificHeader;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.kri.contact.server.dto.message;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@Schema(description = "MessageBulkSendResponseDto")
|
||||
public class MessageBulkSendResponseDto {
|
||||
|
||||
@Schema(description = "bulkSendKey")
|
||||
private String bulkSendKey;
|
||||
@Schema(description = "targetCount")
|
||||
private int targetCount;
|
||||
@Schema(description = "requestCount")
|
||||
private int requestCount;
|
||||
@Schema(description = "acceptCount")
|
||||
private int acceptCount;
|
||||
@Schema(description = "failCount")
|
||||
private int failCount;
|
||||
@Builder.Default
|
||||
@Schema(description = "failedChunks")
|
||||
private List<MessageFailedChunkDto> failedChunks = new ArrayList<>();
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.kri.contact.server.dto.message;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@Builder
|
||||
@Schema(description = "MessageFailedChunkDto")
|
||||
public class MessageFailedChunkDto {
|
||||
|
||||
@Schema(description = "chunkIndex")
|
||||
private int chunkIndex;
|
||||
@Schema(description = "from")
|
||||
private int from;
|
||||
@Schema(description = "to")
|
||||
private int to;
|
||||
@Schema(description = "targetCount")
|
||||
private int targetCount;
|
||||
@Schema(description = "errorMessage")
|
||||
private String errorMessage;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
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
|
||||
@Schema(description = "템플릿 고유 번호", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long tmplatIdx;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "예약 발송 여부", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Boolean resve;
|
||||
|
||||
@Schema(description = "예약 발송 일시")
|
||||
private LocalDateTime sendDt;
|
||||
|
||||
@Valid
|
||||
@Schema(description = "리스트 필터")
|
||||
private ListFilterDto listFilter;
|
||||
|
||||
@NotEmpty
|
||||
@Schema(description = "수신처로 사용할 리스트 헤더 ID 목록", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Integer> destHeaderIds;
|
||||
|
||||
@Schema(description = "수신자 이름으로 사용할 리스트 헤더 ID")
|
||||
private Integer destNameHeaderId;
|
||||
|
||||
@Schema(description = "수신처 중복 제거 여부", defaultValue = "false")
|
||||
private Boolean dedupe = false;
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
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
|
||||
@Schema(description = "tmplatIdx")
|
||||
private Long tmplatIdx;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "resve")
|
||||
private Boolean resve;
|
||||
|
||||
@Schema(description = "sendDt")
|
||||
private LocalDateTime sendDt;
|
||||
|
||||
@NotNull
|
||||
@Schema(description = "sid")
|
||||
private Integer sid;
|
||||
|
||||
@NotEmpty
|
||||
@Schema(description = "destHeaderIds")
|
||||
private List<Integer> destHeaderIds;
|
||||
|
||||
@Schema(description = "destNameHeaderId")
|
||||
private Integer destNameHeaderId;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
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 {
|
||||
|
||||
@Schema(description = "contactDate")
|
||||
private String contactDate;
|
||||
|
||||
@Schema(description = "startTime")
|
||||
private String startTime;
|
||||
|
||||
@Schema(description = "endTime")
|
||||
private String endTime;
|
||||
|
||||
@Schema(description = "totalCount")
|
||||
private long totalCount;
|
||||
|
||||
@Builder.Default
|
||||
@Schema(description = "resultCodeCountMap")
|
||||
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,23 @@
|
||||
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 {
|
||||
|
||||
@Schema(description = "userId")
|
||||
private String userId;
|
||||
|
||||
@Schema(description = "totalCount")
|
||||
private long totalCount;
|
||||
|
||||
@Builder.Default
|
||||
@Schema(description = "resultCodeCountMap")
|
||||
private Map<Integer, Long> resultCodeCountMap = new LinkedHashMap<>();
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user