Compare commits

...

60 Commits

Author SHA1 Message Date
ad6a302867 261116_01_ENH: 리스트 헤더 여러 줄 텍스트 타입(MULTILINE_TEXT) 및 헤더 색상(list_hder_color) 추가 2026-11-16 12:29:59 +09:00
548dca52c3 261112_01_CLN: 미사용 통화 이력 세션 조회·사용자 종료 API 및 관련 코드 정리 2026-11-12 14:01:21 +09:00
86e4a02759 261110_01_ENH: 템플릿명 최대 128자로 확대 2026-11-10 17:28:32 +09:00
5f11e3184e 261105_02_CLN: 미사용 동기 처리 메서드 및 관련 코드 정리 2026-11-05 09:39:25 +09:00
3197c4e16f 261105_01_FIX: 리스트 헤더 생성·저장·비교 시 Trim 적용 2026-11-05 09:08:07 +09:00
ab0eed8587 261103_01_ENH: 현재 인증 사용자 정보 조회 API 추가 및 응답 캐시 방지 적용 2026-11-03 14:09:41 +09:00
c4ef361c3d 261102_02_DOC: 테스트용으로 설정했던 로컬 notihub에 대한 경로를 다시 실서비스로 돌림 2026-11-02 12:08:53 +09:00
b15035cb32 261102_01_ENH: 알림톡 발신 프로필 조회 API 추가 및 템플릿 조회 요청에 senderKey 반영 2026-11-02 12:07:55 +09:00
88e0ddc274 Merge pull request '261029_01_HOT: 템플릿 삭제 Notihub 바이패스 추가 및 삭제 성공 시 대표 템플릿 연결 정보 삭제' (#41) from master into develop
Reviewed-on: #41
2026-10-29 09:05:37 +09:00
cdb63683d8 261029_01_HOT: 템플릿 삭제 Notihub 바이패스 추가 및 삭제 성공 시 대표 템플릿 연결 정보 삭제 2026-10-29 09:04:28 +09:00
d5be6c9b8f Merge pull request 'master' (#40) from master into develop
Reviewed-on: #40
2026-10-28 17:18:32 +09:00
774c02f258 261028_01_HOT: 헤더관리에서 사용 허용, 외주사, 컨택원, 면접원은 disabled처리 2026-10-28 17:16:45 +09:00
ab5e2f2b8e Merge pull request '261027_01_ENH: KART 프로젝트 목록 조회 및 공유 URL 생성 연동 추가' (#39) from develop into master
Reviewed-on: #39
2026-10-28 08:34:50 +09:00
9b0d3ad5c2 261027_01_ENH: KART 프로젝트 목록 조회 및 공유 URL 생성 연동 추가 2026-10-27 15:25:34 +09:00
fe7c1b0e75 Merge pull request 'develop' (#38) from develop into master
Reviewed-on: #38
2026-10-26 08:33:07 +09:00
fc62f9cb38 261023_01_ENH: 비동기 메시지 발송 부분 성공 상태 추가 및 수신처 없는 대상 건너뛰기 2026-10-23 15:11:38 +09:00
05b1aca898 261022_03_ENH: 리스트 초기화 범위 세분화 및 설문별 상태이력 초기화 추가 2026-10-22 16:59:04 +09:00
2399b6f352 261022_02_ENH: 예약 취소 추가 2026-10-22 15:48:53 +09:00
645cc71192 261022_01_ENH: Class에서 record로 변경가능한 Dto들 record로 변경 2026-10-22 10:14:05 +09:00
70ddcdd9c3 261020_04_FIX: BusinessException 적용 및 원본 예외 보존, 결과 파일 만료 기준을 최종 수정 시각으로 변경 2026-10-20 16:38:11 +09:00
64d830fe67 261020_03_FIX: 요청 실패 시 원본 IOException 보존 기록 2026-10-20 16:19:44 +09:00
8f9dda7be1 261020_02_FIX: 요청 실패 시 로그축적 빠져있어서 추가 2026-10-20 16:10:54 +09:00
2dbe803972 261020_01_FIX: 짧은 비동기 작업 종료 시 리스트 및 배정 목록이 갱신되지 않는 오류 수정 2026-10-20 11:57:41 +09:00
a1e84b2f51 Merge branch 'feature-async-list-bulk-work' into develop 2026-10-19 16:23:59 +09:00
f649282d2d 261019_02_BUG: 업로드, 헤더 생성시 origin target 모두 upper로 검사 되도록 버그 수정 2026-10-19 16:23:36 +09:00
a1a9a08121 Merge pull request '261013_01_HOT: 리스트 업로드 매 청크마다 헤더를 수정하는 로직오류 수정' (#36) from develop into master
Reviewed-on: #36
2026-10-13 12:29:05 +09:00
27442b2fc0 Merge pull request '261008_01_ENH: 알림톡 템플릿 관련내용 구현 및 발송 구현' (#35) from develop into master
Reviewed-on: #35
2026-10-08 11:36:04 +09:00
5439374711 Merge pull request '261007_02_HOT: 리스트 업데이트 시 listContentItem를 갱신하는 경우 컨택원의 수정으로 인해 항목이 사라질 수 있기 때문에 커맨드 아웃 처리' (#34) from develop into master
Reviewed-on: #34
2026-10-07 15:44:13 +09:00
3c8710f08c Merge pull request '261007_01_ENH: NotiHub 템플릿·발송 리포트 API를 contact-back으로 통합하고 메시지 발송 경로 변경' (#33) from develop into master
Reviewed-on: #33
2026-10-07 11:57:11 +09:00
3cb37c6a6a Merge pull request 'develop' (#32) from develop into master
Reviewed-on: #32
2026-10-07 08:51:03 +09:00
a13007e314 Merge pull request '261002_01_BUG: 동시 설문 이력 요청 시 START가 완료 상태를 덮어쓰는 오류 수정 (semaphore 적용)' (#31) from develop into master
Reviewed-on: #31
2026-10-02 14:58:21 +09:00
34f0f15499 Merge pull request '261001_02_ENH: 사용자 ID 자리수 허용 조건 2~16자리로 변경' (#30) from develop into master
Reviewed-on: #30
2026-10-01 17:08:21 +09:00
c48e1e6ab5 Merge pull request '260929_02_BUG: 로컬 환경 db 경로 수정' (#29) from develop into master
Reviewed-on: #29
2026-10-01 16:20:55 +09:00
006c9d5aa7 Merge pull request '260929_01_ENH: 설문 응답 결과 수정에 대한 기능누락 수정' (#28) from develop into master
Reviewed-on: #28
2026-09-29 11:23:00 +09:00
02551fdc6a Merge pull request 'develop' (#27) from develop into master
Reviewed-on: #27
2026-09-29 10:25:49 +09:00
83b3925467 Merge pull request '260923_01_ENH: kon, kiwi 매핑테이블에 컨택 실행환경을 추가' (#26) from develop into master
Reviewed-on: #26
2026-09-23 08:27:14 +09:00
b171ffd807 Merge pull request 'develop' (#25) from develop into master
Reviewed-on: #25
2026-09-22 15:23:53 +09:00
0106b641cf Merge pull request '260921_02_ENH: survey short url 쓸모가 없어서 폐기' (#24) from develop into master
Reviewed-on: #24
2026-09-21 14:05:36 +09:00
3b95701ed1 Merge pull request '260921_01_ENH: 설문 url 수정 저장시 메타 데이터 없어지는 버그 수정 중' (#23) from develop into master
Reviewed-on: #23
2026-09-21 12:43:26 +09:00
9e0ab9fae6 Merge pull request '260916_01_ENH: SID 대소문자 구분을 위한 임시 테이블 collation 수정' (#22) from develop into master
Reviewed-on: #22
2026-09-16 18:20:16 +09:00
3ca4f72cfa Merge pull request 'develop' (#21) from develop into master
Reviewed-on: #21
2026-09-15 12:33:27 +09:00
969c21b9a5 Merge pull request '260910_01_ENH: 업로드 실패 엑셀에 SID 및 사용자 ID 추가' (#20) from develop into master
Reviewed-on: #20
2026-09-10 12:35:07 +09:00
c9980cc50e Merge pull request '260826_01_ENH: notihub 수정으로 인한 후속 조치' (#19) from develop into master
Reviewed-on: #19
2026-08-26 12:30:46 +09:00
fd9438d619 Merge pull request 'develop' (#18) from develop into master
Reviewed-on: #18
2026-08-20 10:37:41 +09:00
d0d0410f99 Merge pull request 'develop' (#17) from develop into master
Reviewed-on: #17
2026-08-12 08:42:44 +09:00
e785be94b4 Merge pull request '260806_01_ENH: 공용 패키지 업데이트' (#16) from develop into master
Reviewed-on: #16
2026-08-06 14:56:09 +09:00
d17922f137 Merge pull request '260805_02_ENH: 외부 설문에서 리스트 관련 기능 사용시 prjctIdx가 아닌 prjctCd로 동작하게 변경' (#15) from develop into master
Reviewed-on: #15
2026-08-05 16:19:46 +09:00
0106981e7b Merge pull request '260805_01_ENH: 외부 설문에서 리스트 단건 조회, 리스트 헤더조회, 리스트 단건 수정 기능 사용할수 있도록 기능 생성' (#14) from develop into master
Reviewed-on: #14
2026-08-05 12:20:23 +09:00
7df341622e Merge pull request '260803_04_ENH: 문자, 이메일 발송시 타이틀 치환문자 포함하도록 수정' (#13) from develop into master
Reviewed-on: #13
2026-08-03 16:51:14 +09:00
6a72470a3c Merge pull request '260803_03_ENH: 연구는 자기 부서 프로젝트만 보이게 수정' (#12) from develop into master
Reviewed-on: #12
2026-08-03 09:35:02 +09:00
f7c905f9ff Merge pull request '260803_02_ENH: ownerFw 길이 32로 변경' (#11) from develop into master
Reviewed-on: #11
2026-08-03 09:06:01 +09:00
2abd3d8531 Merge pull request '260803_01_ENH: 사용자 id관련 컬럼 길이 증가' (#10) from develop into master
Reviewed-on: #10
2026-08-03 08:55:53 +09:00
aa7d6e4da1 Merge pull request 'develop' (#9) from develop into master
Reviewed-on: #9
2026-07-28 15:17:17 +09:00
91c14eff8c Merge pull request '260727_01_ENH: call history에 상태 추가 및 call start, call close로 분리' (#7) from develop into master
Reviewed-on: #7
2026-07-27 16:39:08 +09:00
82efee2b1f Merge pull request '260724_02_ENH: 메인템플릿 등록/취소 dto body 검증 잘못 되는거 수정' (#6) from develop into master
Reviewed-on: #6
2026-07-24 14:32:32 +09:00
15db53fe9d Merge pull request '260723_01_ENH: 업로드 파일 못찾는 경우 경고 메시지 수정' (#5) from develop into master
Reviewed-on: #5
2026-07-24 14:03:50 +09:00
f15dad9a8b Merge pull request '260716_04_ENH: 리스트 수정 및 리스트 업로드 수정' (#4) from develop into master
Reviewed-on: #4
2026-07-22 16:58:17 +09:00
62ad54107c Merge pull request '260716_03_ENH: 프로젝트 정보에 발신번호 추가' (#3) from develop into master
Reviewed-on: #3
2026-07-16 15:21:17 +09:00
5beb20199f Merge pull request '260716_02_ENH: db source 수정' (#2) from develop into master
Reviewed-on: #2
2026-07-16 10:11:58 +09:00
1738507f83 Merge pull request 'develop' (#1) from develop into master
Reviewed-on: #1
2026-07-16 09:14:07 +09:00
133 changed files with 1638 additions and 1557 deletions

View File

@@ -38,7 +38,7 @@ repositories {
} }
dependencies { dependencies {
implementation "com.kri.common:starter:beta.1.7.0" implementation "com.kri.common:starter:beta.1.7.1"
implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-security' implementation 'org.springframework.boot:spring-boot-starter-security'

View File

@@ -23,10 +23,11 @@ public final class ContactConstant {
public static final int OUTSOURCE_USER_ROLE = 4000; public static final int OUTSOURCE_USER_ROLE = 4000;
public static final int FIELDWORK_USER_ROLE = 9000; public static final int FIELDWORK_USER_ROLE = 9000;
public static final StreamingReadOptions UPPER_CASE_HEADER_OPTIONS = public static final StreamingReadOptions UPPER_CASE_HEADER_OPTIONS =
new StreamingReadOptions(null, 0, 1, header -> header == null ? null : header.toUpperCase( new StreamingReadOptions(null, 0, 1, header -> header == null ? null : header.trim().toUpperCase(
Locale.ROOT)); Locale.ROOT));
public static final String LIST_HEADER_ACCEPT_REGEX = "^[가-힣a-zA-Z0-9()_\\-\\[\\] ]+$"; public static final String LIST_HEADER_ACCEPT_REGEX = "^[가-힣a-zA-Z0-9()_\\-\\[\\] ]+$";
public static final String LIST_HEADER_COLOR_REGEX = "^#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{8})$";
public static final List<ListHeaderType> DEFAULT_AND_FILE_TYPE = Stream.concat( public static final List<ListHeaderType> DEFAULT_AND_FILE_TYPE = Stream.concat(
Arrays.stream(ListHeaderTypeDefault.values()) Arrays.stream(ListHeaderTypeDefault.values())

View File

@@ -3,11 +3,11 @@ package com.kri.contact.server.common.enums;
import java.util.List; import java.util.List;
public enum ListAsyncJobStatus { public enum ListAsyncJobStatus {
QUEUED, RUNNING, CANCEL_REQUESTED, CANCELLED, SUCCEEDED, FAILED; QUEUED, RUNNING, CANCEL_REQUESTED, CANCELLED, SUCCEEDED, FAILED, PARTIALLY_SUCCEEDED;
public static final List<ListAsyncJobStatus> ACTIVE = List.of(QUEUED, RUNNING, CANCEL_REQUESTED); public static final List<ListAsyncJobStatus> ACTIVE = List.of(QUEUED, RUNNING, CANCEL_REQUESTED);
public boolean isTerminal() { public boolean isTerminal() {
return this == CANCELLED || this == SUCCEEDED || this == FAILED; return this == CANCELLED || this == SUCCEEDED || this == FAILED || this == PARTIALLY_SUCCEEDED;
} }
} }

View File

@@ -22,12 +22,18 @@ public enum ListHeaderType implements CodeEnum<Short> {
EMAIL(ListHeaderTypeSpecific.EMAIL), //31 : 이메일 EMAIL(ListHeaderTypeSpecific.EMAIL), //31 : 이메일
FILE(ListHeaderTypeSpecific.FILE), //81 : 파일업로드 FILE(ListHeaderTypeSpecific.FILE), //81 : 파일업로드
CONTENT_ITEM(ListHeaderTypeSpecific.CONTENT_ITEM), //91 : 목록형 CONTENT_ITEM(ListHeaderTypeSpecific.CONTENT_ITEM), //91 : 목록형
MULTILINE_TEXT(ListHeaderTypeSpecific.MULTILINE_TEXT), //98 : 여러 줄 텍스트
TEXT((short) 99); //99 : 텍스트 TEXT((short) 99); //99 : 텍스트
private final Short code; private final Short code;
ListHeaderType(CodeEnum<Short> source) { this.code = source.getCode();} ListHeaderType(CodeEnum<Short> source) { this.code = source.getCode();}
/** 저장·처리 방식이 일반 텍스트와 동일한 타입 여부 */
public boolean isText() {
return this == TEXT || this == MULTILINE_TEXT;
}
@JsonCreator(mode = JsonCreator.Mode.DELEGATING) @JsonCreator(mode = JsonCreator.Mode.DELEGATING)
public static ListHeaderType fromCode(Short code) { public static ListHeaderType fromCode(Short code) {
if (code == null) { if (code == null) {

View File

@@ -15,7 +15,8 @@ public enum ListHeaderTypeSpecific implements CodeEnum<Short> {
TEL_NUM((short) 21), //21 : 전화번호 TEL_NUM((short) 21), //21 : 전화번호
EMAIL((short) 31), //31 : 이메일 EMAIL((short) 31), //31 : 이메일
FILE((short) 81), //81 : 파일업로드 FILE((short) 81), //81 : 파일업로드
CONTENT_ITEM((short) 91); //목록형 CONTENT_ITEM((short) 91), //목록형
MULTILINE_TEXT((short) 98); //98 : 여러 줄 텍스트 (텍스트 계열)
private final Short code; private final Short code;

View File

@@ -117,7 +117,7 @@ public class ContactSurveyApiClient {
} }
} }
throw new IllegalStateException("Unsupported contact survey target profile"); throw BusinessException.internalError("UNSUPPORTED_CONTACT_SURVEY_PROFILE", "Unsupported contact survey target profile");
} }
private Map<String, String> headers() { private Map<String, String> headers() {

View File

@@ -1,30 +1,25 @@
package com.kri.contact.server.common.external.intranet; package com.kri.contact.server.common.external.intranet;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
@Getter
@Builder @Builder
@NoArgsConstructor // Jackson이 빈 객체를 생성할 수 있도록 추가
@AllArgsConstructor // Builder 패턴 사용 시 필요
@Schema(description = "인트라넷 사용자 검색 응답 DTO") @Schema(description = "인트라넷 사용자 검색 응답 DTO")
public class SearchLoginInfoResponseDto { public record SearchLoginInfoResponseDto(
@Schema(description = "사용자 ID") @Schema(description = "사용자 ID")
private String userId; String userId,
@Schema(description = "사용자 소속 회사") @Schema(description = "사용자 소속 회사")
private String userCmpn; String userCmpn,
@Schema(description = "사용자 이름") @Schema(description = "사용자 이름")
private String userNm; String userNm,
@Schema(description = "사용자 팀") @Schema(description = "사용자 팀")
private String userTeam; String userTeam,
@Schema(description = "사용자 역할") @Schema(description = "사용자 역할")
private int userRole; int userRole
) {
} }

View File

@@ -16,10 +16,6 @@ public enum ChannelType implements CodeEnum<Short> {
private final Short code; private final Short code;
ChannelType(CodeEnum<Short> source) {
this.code = source.getCode();
}
@JsonCreator(mode = JsonCreator.Mode.DELEGATING) @JsonCreator(mode = JsonCreator.Mode.DELEGATING)
public static ChannelType fromCode(Short code) { public static ChannelType fromCode(Short code) {
if (code == null) { if (code == null) {

View File

@@ -13,6 +13,7 @@ import com.kri.common.feature.web.RequestUserContext;
import com.kri.contact.server.common.external.notihub.dto.NotiHubBulkSendCreateRequestDto; import com.kri.contact.server.common.external.notihub.dto.NotiHubBulkSendCreateRequestDto;
import com.kri.contact.server.common.external.notihub.dto.NotiHubBulkSendInfoDto; import com.kri.contact.server.common.external.notihub.dto.NotiHubBulkSendInfoDto;
import com.kri.contact.server.common.external.notihub.dto.NotiHubBulkSendResponseDto; import com.kri.contact.server.common.external.notihub.dto.NotiHubBulkSendResponseDto;
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoSenderProfileDto;
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailDto; import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailDto;
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailRequestDto; import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailRequestDto;
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateListRequestDto; import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateListRequestDto;
@@ -31,6 +32,8 @@ import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateBasicDt
import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateDetailDto; import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateDetailDto;
import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateDto; import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateDto;
import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateSummaryDto; import com.kri.contact.server.common.external.notihub.dto.NotiHubTemplateSummaryDto;
import com.kri.contact.server.dto.message.MessageSendCancelBulkRequestDto;
import com.kri.contact.server.dto.message.MessageSendCancelSingleRequestDto;
import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequest;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
@@ -74,6 +77,22 @@ public class NotiHubApiClient {
@Value("${kri.auth.apikey.key}") @Value("${kri.auth.apikey.key}")
private String apiKey; private String apiKey;
public ResponseEntity<byte[]> cancelSingle(
MessageSendCancelSingleRequestDto body,
HttpServletRequest request,
RequestUserContext ctx
) {
return forward(request, toJsonBytes(body), request.getContentType(), ctx);
}
public ResponseEntity<byte[]> cancelBulk(
MessageSendCancelBulkRequestDto body,
HttpServletRequest request,
RequestUserContext ctx
) {
return forward(request, toJsonBytes(body), request.getContentType(), ctx);
}
public NotiHubTemplateDto getTemplate(Long tmplatIdx) { public NotiHubTemplateDto getTemplate(Long tmplatIdx) {
String url = notiHubBaseUrl + "/template/" + tmplatIdx; String url = notiHubBaseUrl + "/template/" + tmplatIdx;
try { try {
@@ -114,6 +133,13 @@ public class NotiHubApiClient {
return sendBulk("/send-kko/bulk", request); return sendBulk("/send-kko/bulk", request);
} }
public ResponseEntity<List<NotiHubKkoSenderProfileDto>> getKkoSenderProfiles(
HttpServletRequest request,
RequestUserContext ctx
) {
return relay(request, null, new ParameterizedTypeReference<>() {}, ctx);
}
public ResponseEntity<NotiHubKkoTemplateListResponseDto> getKkoTemplateList( public ResponseEntity<NotiHubKkoTemplateListResponseDto> getKkoTemplateList(
NotiHubKkoTemplateListRequestDto body, NotiHubKkoTemplateListRequestDto body,
HttpServletRequest request, HttpServletRequest request,
@@ -180,6 +206,13 @@ public class NotiHubApiClient {
return relay(request, null, NotiHubTemplateDetailDto.class, ctx); return relay(request, null, NotiHubTemplateDetailDto.class, ctx);
} }
public ResponseEntity<byte[]> deleteTemplate(
HttpServletRequest request,
RequestUserContext ctx
) {
return forward(request, null, null, ctx);
}
public ResponseEntity<NotiHubTemplateDetailDto> createTemplate( public ResponseEntity<NotiHubTemplateDetailDto> createTemplate(
NotiHubTemplateBasicDto template, NotiHubTemplateBasicDto template,
List<MultipartFile> files, List<MultipartFile> files,
@@ -498,7 +531,8 @@ public class NotiHubApiClient {
} }
private String toNotiHubPath(String path) { private String toNotiHubPath(String path) {
String notiHubPath = replacePathPrefix(path, "/message-template", "/template"); String notiHubPath = replacePathPrefix(path, "/message-send/cancel", "/send/cancel");
notiHubPath = replacePathPrefix(notiHubPath, "/message-template", "/template");
notiHubPath = replacePathPrefix(notiHubPath, "/message-report", "/report"); notiHubPath = replacePathPrefix(notiHubPath, "/message-report", "/report");
return replacePathPrefix(notiHubPath, "/report/bulk-detail-excel", "/report/bulk-detail/excel"); return replacePathPrefix(notiHubPath, "/report/bulk-detail-excel", "/report/bulk-detail/excel");
} }

View File

@@ -5,28 +5,34 @@ import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "NotiHubBulkSendCreateRequestDto") @Schema(description = "NotiHubBulkSendCreateRequestDto")
public class NotiHubBulkSendCreateRequestDto { public record NotiHubBulkSendCreateRequestDto(
@Schema(description = "reqstCmpn") @Schema(description = "reqstCmpn")
private String reqstCmpn; String reqstCmpn,
@Schema(description = "reqstUser") @Schema(description = "reqstUser")
private String reqstUser; String reqstUser,
@Schema(description = "reqstSvc") @Schema(description = "reqstSvc")
private String reqstSvc; String reqstSvc,
@Schema(description = "prjctCd") @Schema(description = "prjctCd")
private String prjctCd; String prjctCd,
@Schema(description = "tmplatIdx") @Schema(description = "tmplatIdx")
private Long tmplatIdx; Long tmplatIdx,
@Schema(description = "resve") @Schema(description = "resve")
private Boolean resve; Boolean resve,
@Schema(description = "sendDt") @Schema(description = "sendDt")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime sendDt; LocalDateTime sendDt,
@Schema(description = "trgtCnt") @Schema(description = "trgtCnt")
private Integer trgtCnt; Integer trgtCnt
) {
} }

View File

@@ -3,23 +3,21 @@ package com.kri.contact.server.common.external.notihub.dto;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@Schema(description = "NotiHubBulkSendResponseDto") @Schema(description = "NotiHubBulkSendResponseDto")
public class NotiHubBulkSendResponseDto { public record NotiHubBulkSendResponseDto(
@Schema(description = "bulkSendKey") @Schema(description = "bulkSendKey")
private String bulkSendKey; String bulkSendKey,
@Schema(description = "requestCount") @Schema(description = "requestCount")
private Integer requestCount; Integer requestCount,
@Schema(description = "acceptCount") @Schema(description = "acceptCount")
private Integer acceptCount; Integer acceptCount,
@Schema(description = "failCount") @Schema(description = "failCount")
private Integer failCount; Integer failCount
) {
} }

View File

@@ -4,21 +4,24 @@ import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Map; import java.util.Map;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "NotiHubDestInfoDto") @Schema(description = "NotiHubDestInfoDto")
public class NotiHubDestInfoDto { public record NotiHubDestInfoDto(
@Schema(description = "sid") @Schema(description = "sid")
private String sid; String sid,
@Schema(description = "destEml") @Schema(description = "destEml")
private String destEml; String destEml,
@Schema(description = "destTel") @Schema(description = "destTel")
private String destTel; String destTel,
@Schema(description = "destNm") @Schema(description = "destNm")
private String destNm; String destNm,
@Schema(description = "msgParam") @Schema(description = "msgParam")
private Map<String, String> msgParam; Map<String, String> msgParam
) {
} }

View File

@@ -0,0 +1,11 @@
package com.kri.contact.server.common.external.notihub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
@Schema(description = "Kakao sender profile")
public record NotiHubKkoSenderProfileDto(
String senderKey,
String name,
String uuid
) {
}

View File

@@ -3,33 +3,50 @@ package com.kri.contact.server.common.external.notihub.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import java.util.List; import java.util.List;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class NotiHubKkoTemplateDetailDto { public record NotiHubKkoTemplateDetailDto(
private String templateCode; String templateCode,
private String templateName;
private String templateContent; String templateName,
private String templatePreviewMessage;
private String templateMessageType; String templateContent,
private String templateEmphasizeType;
private String inspectionStatus; String templatePreviewMessage,
private String status;
private Boolean block; String templateMessageType,
private Boolean dormant;
private String templateExtra; String templateEmphasizeType,
private String templateImageName;
private String templateImageUrl; String inspectionStatus,
private String templateTitle;
private String templateSubtitle; String status,
private String templateHeader;
private JsonNode templateItemHighlight; Boolean block,
private JsonNode templateItem;
private JsonNode templateRepresentLink; Boolean dormant,
private List<JsonNode> buttons;
private List<JsonNode> quickReplies; String templateExtra,
String templateImageName,
String templateImageUrl,
String templateTitle,
String templateSubtitle,
String templateHeader,
JsonNode templateItemHighlight,
JsonNode templateItem,
JsonNode templateRepresentLink,
List<JsonNode> buttons,
List<JsonNode> quickReplies
) {
} }

View File

@@ -1,21 +1,17 @@
package com.kri.contact.server.common.external.notihub.dto; package com.kri.contact.server.common.external.notihub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern; import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size; import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter public record NotiHubKkoTemplateDetailRequestDto(
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class NotiHubKkoTemplateDetailRequestDto {
@Schema(description = "Selected sender profile key; validated by NotiHub", requiredMode = Schema.RequiredMode.REQUIRED)
String senderKey,
@NotBlank @NotBlank
@Size(max = 30) @Size(max = 30)
@Pattern(regexp = "[A-Za-z0-9_-]+") @Pattern(regexp = "[A-Za-z0-9_-]+")
private String templateCode; String templateCode
) {
} }

View File

@@ -1,21 +1,17 @@
package com.kri.contact.server.common.external.notihub.dto; package com.kri.contact.server.common.external.notihub.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Size; import jakarta.validation.constraints.Size;
import lombok.Getter;
import lombok.NoArgsConstructor;
@Getter public record NotiHubKkoTemplateListRequestDto(
@NoArgsConstructor
public class NotiHubKkoTemplateListRequestDto {
@Schema(description = "Selected sender profile key; validated by NotiHub", requiredMode = Schema.RequiredMode.REQUIRED)
String senderKey,
@Size(min = 2, max = 50) @Size(min = 2, max = 50)
private String keyword; String keyword
) {
public NotiHubKkoTemplateListRequestDto(String keyword) { public NotiHubKkoTemplateListRequestDto {
setKeyword(keyword); keyword = keyword == null || keyword.isBlank() ? null : keyword.trim();
}
public void setKeyword(String keyword) {
this.keyword = keyword == null || keyword.isBlank() ? null : keyword.trim();
} }
} }

View File

@@ -1,19 +1,15 @@
package com.kri.contact.server.common.external.notihub.dto; package com.kri.contact.server.common.external.notihub.dto;
import java.util.List; import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter public record NotiHubKkoTemplateListResponseDto(
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class NotiHubKkoTemplateListResponseDto {
private int totalCount; int totalCount,
private int totalPage;
private int currentPage; int totalPage,
private List<NotiHubKkoTemplateSummaryDto> list;
int currentPage,
List<NotiHubKkoTemplateSummaryDto> list
) {
} }

View File

@@ -1,21 +1,18 @@
package com.kri.contact.server.common.external.notihub.dto; package com.kri.contact.server.common.external.notihub.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class NotiHubKkoTemplateSummaryDto { public record NotiHubKkoTemplateSummaryDto(
private String templateCode; String templateCode,
private String templateName;
private String serviceStatus; String templateName,
private String createdAt;
private String modifiedAt; String serviceStatus,
String createdAt,
String modifiedAt
) {
} }

View File

@@ -4,21 +4,24 @@ import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List; import java.util.List;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "NotiHubSendRequestBulkDto") @Schema(description = "NotiHubSendRequestBulkDto")
public class NotiHubSendRequestBulkDto { public record NotiHubSendRequestBulkDto(
@Schema(description = "sendEml") @Schema(description = "sendEml")
private String sendEml; String sendEml,
@Schema(description = "sendTel") @Schema(description = "sendTel")
private String sendTel; String sendTel,
@Schema(description = "sendNm") @Schema(description = "sendNm")
private String sendNm; String sendNm,
@Schema(description = "bulkSendKey") @Schema(description = "bulkSendKey")
private String bulkSendKey; String bulkSendKey,
@Schema(description = "destInfoList") @Schema(description = "destInfoList")
private List<NotiHubDestInfoDto> destInfoList; List<NotiHubDestInfoDto> destInfoList
) {
} }

View File

@@ -4,29 +4,36 @@ import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "NotiHubSendRequestSingleDto") @Schema(description = "NotiHubSendRequestSingleDto")
public class NotiHubSendRequestSingleDto { public record NotiHubSendRequestSingleDto(
@Schema(description = "sendEml") @Schema(description = "sendEml")
private String sendEml; String sendEml,
@Schema(description = "sendTel") @Schema(description = "sendTel")
private String sendTel; String sendTel,
@Schema(description = "sendNm") @Schema(description = "sendNm")
private String sendNm; String sendNm,
@Schema(description = "destInfo") @Schema(description = "destInfo")
private NotiHubDestInfoDto destInfo; NotiHubDestInfoDto destInfo,
@Schema(description = "tmplatIdx") @Schema(description = "tmplatIdx")
private Long tmplatIdx; Long tmplatIdx,
@Schema(description = "reqstSvc") @Schema(description = "reqstSvc")
private String reqstSvc; String reqstSvc,
@Schema(description = "prjctCd") @Schema(description = "prjctCd")
private String prjctCd; String prjctCd,
@Schema(description = "resve") @Schema(description = "resve")
private Boolean resve; Boolean resve,
@Schema(description = "sendDt") @Schema(description = "sendDt")
private LocalDateTime sendDt; LocalDateTime sendDt
) {
} }

View File

@@ -3,32 +3,27 @@ package com.kri.contact.server.common.external.notihub.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@Schema(description = "NotiHubSendResultLastWithSidDto") @Schema(description = "NotiHubSendResultLastWithSidDto")
public class NotiHubSendResultLastWithSidDto { public record NotiHubSendResultLastWithSidDto(
@Schema(description = "sid") @Schema(description = "sid")
private String sid; String sid,
@Schema(description = "lastResultCode") @Schema(description = "lastResultCode")
private Integer lastResultCode; Integer lastResultCode,
@Schema(description = "lastResultLabel") @Schema(description = "lastResultLabel")
private String lastResultLabel; String lastResultLabel,
@Schema(description = "lastResultViewLabel") @Schema(description = "lastResultViewLabel")
private String lastResultViewLabel; String lastResultViewLabel,
@Schema(description = "lastSendDt") @Schema(description = "lastSendDt")
private LocalDateTime lastSendDt; LocalDateTime lastSendDt,
@Schema(description = "totalSendCount") @Schema(description = "totalSendCount")
private Integer totalSendCount; Integer totalSendCount
) {
} }

View File

@@ -3,18 +3,18 @@ package com.kri.contact.server.common.external.notihub.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Map; import java.util.Map;
import lombok.Getter;
import lombok.NoArgsConstructor;
@Getter
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@Schema(description = "NotiHubSendSingleResponseDto") @Schema(description = "NotiHubSendSingleResponseDto")
public class NotiHubSendSingleResponseDto { public record NotiHubSendSingleResponseDto(
@Schema(description = "NotiHub send identifier for single cancellation")
Long sendIdx,
@Schema(description = "cmid") @Schema(description = "cmid")
private String cmid; String cmid,
@Schema(description = "data") @Schema(description = "data")
private Map<String, Object> data; Map<String, Object> data
) {
} }

View File

@@ -27,7 +27,7 @@ public class NotiHubTemplateBasicDto extends NotiHubExtensibleDto {
private Short tmplatPurpose; private Short tmplatPurpose;
@NotBlank @NotBlank
@Size(max = 32) @Size(max = 128)
private String tmplatNm; private String tmplatNm;
@Size(max = 128) @Size(max = 128)

View File

@@ -3,29 +3,30 @@ package com.kri.contact.server.common.external.notihub.dto;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@Schema(description = "NotiHubTemplateDto") @Schema(description = "NotiHubTemplateDto")
public class NotiHubTemplateDto { public record NotiHubTemplateDto(
@Schema(description = "tmplatIdx") @Schema(description = "tmplatIdx")
private Long tmplatIdx; Long tmplatIdx,
@Schema(description = "tmplatPurpose") @Schema(description = "tmplatPurpose")
private Integer tmplatPurpose; Integer tmplatPurpose,
@Schema(description = "tmplatTitle") @Schema(description = "tmplatTitle")
private String tmplatTitle; String tmplatTitle,
@Schema(description = "tmplatBody") @Schema(description = "tmplatBody")
private String tmplatBody; String tmplatBody,
@Schema(description = "sendTel") @Schema(description = "sendTel")
private String sendTel; String sendTel,
@Schema(description = "sendEml") @Schema(description = "sendEml")
private String sendEml; String sendEml,
@Schema(description = "sendNm") @Schema(description = "sendNm")
private String sendNm; String sendNm
) {
} }

View File

@@ -1,12 +1,10 @@
package com.kri.contact.server.common.external.shorturl; package com.kri.contact.server.common.external.shorturl;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter public record ShortUrlCreateRequestDto(
@AllArgsConstructor
public class ShortUrlCreateRequestDto {
private String orgUrl; String orgUrl,
private boolean useParam;
boolean useParam
) {
} }

View File

@@ -1,5 +1,6 @@
package com.kri.contact.server.controller; package com.kri.contact.server.controller;
import com.kri.common.feature.auth.dto.JwtUserClaimsDto;
import com.kri.common.feature.datetime.DateTimeUtil; import com.kri.common.feature.datetime.DateTimeUtil;
import com.kri.common.feature.web.RequestUserContext; import com.kri.common.feature.web.RequestUserContext;
import com.kri.contact.server.dto.auth.LoginRequestDto; import com.kri.contact.server.dto.auth.LoginRequestDto;
@@ -11,6 +12,10 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.CacheControl;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.annotation.CurrentSecurityContext;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@@ -35,11 +40,19 @@ public class AuthController {
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime(); final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
LoginResponseDto response = authService.tryLogin(request); LoginResponseDto response = authService.tryLogin(request);
systemEventLogService.writeLoginLog(response.getUser().getUserId(), now, ctx.getClientIp()); systemEventLogService.writeLoginLog(response.user().getUserId(), now, ctx.getClientIp());
return response; return response;
} }
@Operation(summary = "현재 인증 사용자 조회")
@GetMapping("/my-info")
public ResponseEntity<JwtUserClaimsDto> myInfo(
@CurrentSecurityContext(expression = "authentication.details") JwtUserClaimsDto user
) {
return ResponseEntity.ok().cacheControl(CacheControl.noStore()).body(user);
}
@Operation(summary = "로그아웃 요청") @Operation(summary = "로그아웃 요청")
@PostMapping("/logout/{userId}") @PostMapping("/logout/{userId}")
public boolean logout(@PathVariable String userId, RequestUserContext ctx) { public boolean logout(@PathVariable String userId, RequestUserContext ctx) {

View File

@@ -0,0 +1,48 @@
package com.kri.contact.server.controller;
import com.fasterxml.jackson.databind.JsonNode;
import com.kri.common.feature.web.RequestUserContext;
import com.kri.contact.server.service.KartService;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
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.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/api/v1/kart/project")
@RequiredArgsConstructor
@Validated
public class KartController {
private final KartService kartService;
@GetMapping("/list")
public JsonNode projects(
@RequestParam @NotBlank @Size(max = 32) String intranetCode,
@RequestParam @Min(0) @Max(1) int projectType,
@RequestParam(defaultValue = "") String keyword,
HttpServletRequest request,
RequestUserContext user
) {
return kartService.projects(intranetCode, projectType, keyword, request, user);
}
@PostMapping("/{projectType}/{pkey}/share")
public String reportUrl(
@PathVariable @Min(0) @Max(1) int projectType,
@PathVariable String pkey,
HttpServletRequest request,
RequestUserContext user
) {
return kartService.reportUrl(projectType, pkey, request, user);
}
}

View File

@@ -11,8 +11,6 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.RequiredArgsConstructor; 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.PathVariable;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@@ -66,27 +64,4 @@ public class ListCallHistController {
now now
); );
} }
@Operation(summary = "Find list call history by agent session")
@GetMapping("/session/{agentSessionId}")
public ListCallHistDto findByAgentSessionId(
@PathVariable String agentSessionId,
RequestUserContext ctx
) {
return listCallHistService.findByAgentSessionId(
agentSessionId,
ctx.getUserId(),
ctx.getUserCmpn(),
ctx.getUserRole()
);
}
@Operation(summary = "Update Call History at Client Hangup")
@PatchMapping("hangup/{agentSessionId}")
public boolean hangupClient(
@PathVariable String agentSessionId,
RequestUserContext ctx
) {
return listCallHistService.hangupClient(agentSessionId);
}
} }

View File

@@ -101,7 +101,7 @@ public class ListController {
) { ) {
getProjectOrThrow(prjctIdx); getProjectOrThrow(prjctIdx);
ListUploadFileInfoDto uploadFile = listUploadService.downloadUploadFile(prjctIdx, listUploadLogId); ListUploadFileInfoDto uploadFile = listUploadService.downloadUploadFile(prjctIdx, listUploadLogId);
return buildExcelResponse(uploadFile.getFileName(), uploadFile.getBytes()); return buildExcelResponse(uploadFile.fileName(), uploadFile.bytes());
} }
@Operation(summary = "리스트 수정") @Operation(summary = "리스트 수정")
@@ -147,7 +147,7 @@ public class ListController {
) { ) {
getProjectOrThrow(prjctIdx); getProjectOrThrow(prjctIdx);
ListUploadFileInfoDto file = listDownloadService.downloadItemFile(prjctIdx, sid, listHderId); ListUploadFileInfoDto file = listDownloadService.downloadItemFile(prjctIdx, sid, listHderId);
return buildFileResponse(file.getFileName(), file.getBytes()); return buildFileResponse(file.fileName(), file.bytes());
} }
private ProjectInfoDto getProjectOrThrow(Long prjctIdx) { private ProjectInfoDto getProjectOrThrow(Long prjctIdx) {

View File

@@ -58,8 +58,8 @@ public class ListHistoryController {
@Valid @RequestBody ListEventHistFromSurveyDto request, @Valid @RequestBody ListEventHistFromSurveyDto request,
RequestUserContext ctx RequestUserContext ctx
) { ) {
if (request.getMeta().getRemoteAddr() == null) { if (request.meta().getRemoteAddr() == null) {
request.getMeta().setRemoteAddr(ctx.getClientIp()); request.meta().setRemoteAddr(ctx.getClientIp());
} }
String regUser = resolveRegUser(request, ctx); String regUser = resolveRegUser(request, ctx);
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime(); final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
@@ -103,7 +103,7 @@ public class ListHistoryController {
if (ctx.getUserId() != null) { if (ctx.getUserId() != null) {
return ctx.getUserId(); return ctx.getUserId();
} }
ListEventHistSurveyMetaDto meta = request.getMeta(); ListEventHistSurveyMetaDto meta = request.meta();
if (meta != null && meta.getEntryType() != null) { if (meta != null && meta.getEntryType() != null) {
return meta.getEntryType().name(); return meta.getEntryType().name();
} }

View File

@@ -1,13 +1,22 @@
package com.kri.contact.server.controller; package com.kri.contact.server.controller;
import com.kri.common.feature.web.RequestUserContext; import com.kri.common.feature.web.RequestUserContext;
import com.kri.contact.server.dto.message.MessageSendCancelBulkRequestDto;
import com.kri.contact.server.dto.message.MessageSendCancelResponseDto;
import com.kri.contact.server.dto.message.MessageSendCancelSingleRequestDto;
import com.kri.contact.server.dto.message.MessageSendSingleRequestDto; import com.kri.contact.server.dto.message.MessageSendSingleRequestDto;
import com.kri.contact.server.dto.message.MessageSendSingleResponseDto; import com.kri.contact.server.dto.message.MessageSendSingleResponseDto;
import com.kri.contact.server.service.MessageSendService; import com.kri.contact.server.service.MessageSendService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@@ -22,6 +31,30 @@ public class MessageSendController {
private final MessageSendService messageSendService; private final MessageSendService messageSendService;
@Operation(summary = "Cancel a scheduled message")
@ApiResponse(responseCode = "200", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
schema = @Schema(implementation = MessageSendCancelResponseDto.class)))
@PostMapping(value = "/cancel/single", consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<byte[]> cancelSingle(
@Valid @RequestBody MessageSendCancelSingleRequestDto body,
HttpServletRequest request,
RequestUserContext ctx
) {
return messageSendService.cancelSingle(body, request, ctx);
}
@Operation(summary = "Cancel eligible scheduled messages in a bulk send")
@ApiResponse(responseCode = "200", content = @Content(mediaType = MediaType.APPLICATION_JSON_VALUE,
schema = @Schema(implementation = MessageSendCancelResponseDto.class)))
@PostMapping(value = "/cancel/bulk", consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<byte[]> cancelBulk(
@Valid @RequestBody MessageSendCancelBulkRequestDto body,
HttpServletRequest request,
RequestUserContext ctx
) {
return messageSendService.cancelBulk(body, request, ctx);
}
@Operation(summary = "Email single send") @Operation(summary = "Email single send")
@PostMapping("/email/single/{prjctIdx}") @PostMapping("/email/single/{prjctIdx}")
public MessageSendSingleResponseDto sendEmailSingle( public MessageSendSingleResponseDto sendEmailSingle(

View File

@@ -1,6 +1,7 @@
package com.kri.contact.server.controller; package com.kri.contact.server.controller;
import com.kri.common.feature.web.RequestUserContext; import com.kri.common.feature.web.RequestUserContext;
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoSenderProfileDto;
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailDto; import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailDto;
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailRequestDto; import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateDetailRequestDto;
import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateListRequestDto; import com.kri.contact.server.common.external.notihub.dto.NotiHubKkoTemplateListRequestDto;
@@ -16,6 +17,7 @@ import java.util.List;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; 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.GetMapping;
import org.springframework.web.bind.annotation.PatchMapping; import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
@@ -36,6 +38,14 @@ public class MessageTemplateController {
private final MessageTemplateService messageTemplateService; private final MessageTemplateService messageTemplateService;
@GetMapping("/kko/profiles")
public ResponseEntity<List<NotiHubKkoSenderProfileDto>> getKkoSenderProfiles(
HttpServletRequest request,
RequestUserContext ctx
) {
return messageTemplateService.getKkoSenderProfiles(request, ctx);
}
@PostMapping(value = "/kko/list", consumes = MediaType.APPLICATION_JSON_VALUE) @PostMapping(value = "/kko/list", consumes = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<NotiHubKkoTemplateListResponseDto> getKkoTemplateList( public ResponseEntity<NotiHubKkoTemplateListResponseDto> getKkoTemplateList(
@Valid @RequestBody NotiHubKkoTemplateListRequestDto body, @Valid @RequestBody NotiHubKkoTemplateListRequestDto body,
@@ -72,6 +82,15 @@ public class MessageTemplateController {
return messageTemplateService.getTemplate(request, ctx); return messageTemplateService.getTemplate(request, ctx);
} }
@DeleteMapping("/{tmplatIdx:[0-9]+}")
public ResponseEntity<byte[]> deleteTemplate(
@PathVariable Long tmplatIdx,
HttpServletRequest request,
RequestUserContext ctx
) {
return messageTemplateService.deleteTemplate(tmplatIdx, request, ctx);
}
@GetMapping("/{tmplatIdx:[0-9]+}/attachment") @GetMapping("/{tmplatIdx:[0-9]+}/attachment")
public ResponseEntity<byte[]> getAttachment( public ResponseEntity<byte[]> getAttachment(
@PathVariable Long tmplatIdx, @PathVariable Long tmplatIdx,

View File

@@ -116,10 +116,10 @@ public class ProjectController {
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime(); final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
String newHtml = contactScenarioFileService.syncOnSave( String newHtml = contactScenarioFileService.syncOnSave(
req.getProjectInfo().getPrjctCd(), req.projectInfo().getPrjctCd(),
req.getProjectInfo().getContactSenario() req.projectInfo().getContactSenario()
); );
req.getProjectInfo().setContactSenario(newHtml); req.projectInfo().setContactSenario(newHtml);
projectService.updateProject(prjctIdx, req, ctx.getUserId(), now, ctx); projectService.updateProject(prjctIdx, req, ctx.getUserId(), now, ctx);

View File

@@ -2,14 +2,15 @@ package com.kri.contact.server.dto.assign;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "외주사별 리스트 배정 현황") @Schema(description = "외주사별 리스트 배정 현황")
public class CompanyAssignSummaryItemDto { public record CompanyAssignSummaryItemDto(
private String cmpnId; String cmpnId,
private String cmpnAlias;
private long assignedCount; String cmpnAlias,
long assignedCount
) {
} }

View File

@@ -2,15 +2,17 @@ package com.kri.contact.server.dto.assign;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "필드워커별 리스트 배정 현황") @Schema(description = "필드워커별 리스트 배정 현황")
public class FieldworkAssignSummaryItemDto { public record FieldworkAssignSummaryItemDto(
private String userId; String userId,
private String userName;
private String userCmpn; String userName,
private long assignedCount;
String userCmpn,
long assignedCount
) {
} }

View File

@@ -3,14 +3,15 @@ package com.kri.contact.server.dto.assign;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List; import java.util.List;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "프로젝트 외주사 리스트 배정 요약") @Schema(description = "프로젝트 외주사 리스트 배정 요약")
public class ProjectCompanyAssignSummaryDto { public record ProjectCompanyAssignSummaryDto(
private long totalCount; long totalCount,
private long unassignedCount;
private List<CompanyAssignSummaryItemDto> assignees; long unassignedCount,
List<CompanyAssignSummaryItemDto> assignees
) {
} }

View File

@@ -3,14 +3,15 @@ package com.kri.contact.server.dto.assign;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List; import java.util.List;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "프로젝트 필드워커 리스트 배정 요약") @Schema(description = "프로젝트 필드워커 리스트 배정 요약")
public class ProjectFieldworkAssignSummaryDto { public record ProjectFieldworkAssignSummaryDto(
private long totalCount; long totalCount,
private long unassignedCount;
private List<FieldworkAssignSummaryItemDto> assignees; long unassignedCount,
List<FieldworkAssignSummaryItemDto> assignees
) {
} }

View File

@@ -1,17 +1,19 @@
package com.kri.contact.server.dto.auth; package com.kri.contact.server.dto.auth;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Schema(description = "사용자 로그인 요청") @Schema(description = "사용자 로그인 요청")
public class LoginRequestDto { public record LoginRequestDto(
@Schema(description = "사용자 ID") @Schema(description = "사용자 ID")
private String userId; String userId,
@Schema(description = "사용자 PW") @Schema(description = "사용자 PW")
private String userPw; String userPw
) {
@Override
public String toString() {
return "LoginRequestDto[redacted]";
}
} }

View File

@@ -4,18 +4,17 @@ package com.kri.contact.server.dto.auth;
import com.kri.common.feature.auth.dto.JwtUserClaimsDto; import com.kri.common.feature.auth.dto.JwtUserClaimsDto;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "로그인 응답") @Schema(description = "로그인 응답")
public class LoginResponseDto { public record LoginResponseDto(
@Schema(description = "jwt access 토큰") @Schema(description = "jwt access 토큰")
private String accessToken; String accessToken,
@Schema(description = "사용자 정보") @Schema(description = "사용자 정보")
private JwtUserClaimsDto user; JwtUserClaimsDto user
) {
public static LoginResponseDto from(String accessToken, JwtUserClaimsDto jwtUserClaims) { public static LoginResponseDto from(String accessToken, JwtUserClaimsDto jwtUserClaims) {
return LoginResponseDto.builder() return LoginResponseDto.builder()
@@ -23,4 +22,9 @@ public class LoginResponseDto {
.user(jwtUserClaims) .user(jwtUserClaims)
.build(); .build();
} }
@Override
public String toString() {
return "LoginResponseDto[redacted]";
}
} }

View File

@@ -7,58 +7,51 @@ import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size; import jakarta.validation.constraints.Size;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@Builder @Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "회사 정보") @Schema(description = "회사 정보")
public class CmpnInfoDto { public record CmpnInfoDto(
@Size(max = 32) @Size(max = 32)
@NotBlank @NotBlank
@Schema(description = "회사 id(회사이름)") @Schema(description = "회사 id(회사이름)")
private String cmpnId; String cmpnId,
@Size(max = 32) @Size(max = 32)
@NotBlank @NotBlank
@Schema(description = "회사 별칭") @Schema(description = "회사 별칭")
private String cmpnAlias; String cmpnAlias,
@Size(max = 16) @Size(max = 16)
@Schema(description = "회사 전화번호") @Schema(description = "회사 전화번호")
private String cmpnTel; String cmpnTel,
@NotNull @NotNull
@Schema(description = "자사 여부") @Schema(description = "자사 여부")
private Boolean ownCmpn; Boolean ownCmpn,
@Schema(description = "메모") @Schema(description = "메모")
private String memo; String memo,
@Size(max = 32) @Size(max = 32)
@Schema(description = "등록자", accessMode = Schema.AccessMode.READ_ONLY) @Schema(description = "등록자", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY) @JsonProperty(access = JsonProperty.Access.READ_ONLY)
private String regUser; String regUser,
@Schema(description = "등록일시", accessMode = Schema.AccessMode.READ_ONLY) @Schema(description = "등록일시", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY) @JsonProperty(access = JsonProperty.Access.READ_ONLY)
private LocalDateTime regDt; LocalDateTime regDt,
@Size(max = 32) @Size(max = 32)
@Schema(description = "수정자", accessMode = Schema.AccessMode.READ_ONLY) @Schema(description = "수정자", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY) @JsonProperty(access = JsonProperty.Access.READ_ONLY)
private String modUser; String modUser,
@Schema(description = "수정일시", accessMode = Schema.AccessMode.READ_ONLY) @Schema(description = "수정일시", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY) @JsonProperty(access = JsonProperty.Access.READ_ONLY)
private LocalDateTime modDt; LocalDateTime modDt
) {
public static CmpnInfoDto from(TCmpnEntity entity) { public static CmpnInfoDto from(TCmpnEntity entity) {
return CmpnInfoDto.builder() return CmpnInfoDto.builder()

View File

@@ -1,30 +1,40 @@
package com.kri.contact.server.dto.common; package com.kri.contact.server.dto.common;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Builder @Builder
@AllArgsConstructor @JsonDeserialize(builder = DataVerificationDto.JsonBuilder.class)
@Schema(description = "데이터 검증에 대한 공용 Dto") @Schema(description = "데이터 검증에 대한 공용 Dto")
public class DataVerificationDto { public record DataVerificationDto(
@Schema(description = "데이터 검증 통과 여부") @Schema(description = "데이터 검증 통과 여부")
private boolean success; boolean success,
@Schema(description = "검증 필드명") @Schema(description = "검증 필드명")
private String fieldName; String fieldName,
@Schema(description = "검증 메시지(error)") @Schema(description = "검증 메시지(error)")
private String errMessage; String errMessage
) {
public DataVerificationDto() { public DataVerificationDto() {
this.success = true; this(true, "", "");
this.fieldName = ""; }
this.errMessage = "";
@JsonPOJOBuilder(withPrefix = "")
public static class JsonBuilder {
@JsonSetter(nulls = Nulls.AS_EMPTY)
public boolean success = true;
public String fieldName = "";
public String errMessage = "";
public DataVerificationDto build() {
return new DataVerificationDto(success, fieldName, errMessage);
}
} }
} }

View File

@@ -2,22 +2,16 @@ package com.kri.contact.server.dto.common;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@Builder @Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "날짜 범위 Dto") @Schema(description = "날짜 범위 Dto")
public class DateRangeDto { public record DateRangeDto(
@Schema(description = "시작 날짜") @Schema(description = "시작 날짜")
private LocalDateTime startDate; LocalDateTime startDate,
@Schema(description = "종료 날짜") @Schema(description = "종료 날짜")
private LocalDateTime endDate; LocalDateTime endDate
) {
} }

View File

@@ -2,32 +2,29 @@ package com.kri.contact.server.dto.excel;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Builder @Builder
@Schema(description = "ExcelUploadResultDto") @Schema(description = "ExcelUploadResultDto")
public class ExcelUploadResultDto { public record ExcelUploadResultDto(
@Schema(description = "전체 읽은 행 수 (헤더 제외)") @Schema(description = "전체 읽은 행 수 (헤더 제외)")
private int totalCount; int totalCount,
@Schema(description = "DB에 실제로 insert/update 성공한 개수") @Schema(description = "DB에 실제로 insert/update 성공한 개수")
private int successCount; int successCount,
@Schema(description = "실패(에러) 개수") @Schema(description = "실패(에러) 개수")
private int failCount; int failCount,
@Schema(description = "에러 엑셀 파일이 있는지 여부") @Schema(description = "에러 엑셀 파일이 있는지 여부")
private boolean hasErrorFile; boolean hasErrorFile,
@Schema(description = "프론트가 저장용으로 쓸 파일명") @Schema(description = "프론트가 저장용으로 쓸 파일명")
private String errorFileName; String errorFileName,
@Schema(description = "에러 엑셀 파일 (xlsx)의 Base64 문자열 (hasErrorFile == true일 때만 세팅)") @Schema(description = "에러 엑셀 파일 (xlsx)의 Base64 문자열 (hasErrorFile == true일 때만 세팅)")
private String errorFileBase64; String errorFileBase64
) {
public static ExcelUploadResultDto success(int totalCount, int successCount) { public static ExcelUploadResultDto success(int totalCount, int successCount) {
return ExcelUploadResultDto.builder() return ExcelUploadResultDto.builder()
@@ -37,5 +34,4 @@ public class ExcelUploadResultDto {
.hasErrorFile(false) .hasErrorFile(false)
.build(); .build();
} }
} }

View File

@@ -6,28 +6,23 @@ import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.AssertTrue; import jakarta.validation.constraints.AssertTrue;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "마지막 이벤트 일자 필터 조건") @Schema(description = "마지막 이벤트 일자 필터 조건")
public class LastEventDateRangeDto { public record LastEventDateRangeDto(
@NotNull @NotNull
@Schema(description = "결과 코드 타입") @Schema(description = "결과 코드 타입")
private ResultCodeType resultCodeType; ResultCodeType resultCodeType,
@Schema(description = "프로젝트 설문 고유번호. SURVEY 타입인 경우 필수") @Schema(description = "프로젝트 설문 고유번호. SURVEY 타입인 경우 필수")
private Long prjctSurveyIdx; Long prjctSurveyIdx,
@Schema(description = "시작 일시") @Schema(description = "시작 일시")
private LocalDateTime startDate; LocalDateTime startDate,
@Schema(description = "종료 일시") @Schema(description = "종료 일시")
private LocalDateTime endDate; LocalDateTime endDate
) {
@JsonIgnore @JsonIgnore
@AssertTrue(message = "SURVEY 타입은 prjctSurveyIdx가 필요합니다.") @AssertTrue(message = "SURVEY 타입은 prjctSurveyIdx가 필요합니다.")

View File

@@ -5,53 +5,71 @@ import com.kri.contact.server.persistence.entity.TListCallHistEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "ListCallHistDto") @Schema(description = "ListCallHistDto")
public class ListCallHistDto { public record ListCallHistDto(
@Schema(description = "listCallHistIdx") @Schema(description = "listCallHistIdx")
private Long listCallHistIdx; Long listCallHistIdx,
@Schema(description = "prjctIdx") @Schema(description = "prjctIdx")
private Long prjctIdx; Long prjctIdx,
@Schema(description = "sid") @Schema(description = "sid")
private String sid; String sid,
@Schema(description = "listHderId") @Schema(description = "listHderId")
private Integer listHderId; Integer listHderId,
@Schema(description = "destNum") @Schema(description = "destNum")
private String destNum; String destNum,
@Schema(description = "agentNum") @Schema(description = "agentNum")
private String agentNum; String agentNum,
@Schema(description = "aniNum") @Schema(description = "aniNum")
private String aniNum; String aniNum,
@Schema(description = "agentSessionId") @Schema(description = "agentSessionId")
private String agentSessionId; String agentSessionId,
@Schema(description = "destSessionId") @Schema(description = "destSessionId")
private String destSessionId; String destSessionId,
@Schema(description = "callTy") @Schema(description = "callTy")
private String callTy; String callTy,
@Schema(description = "callStatus") @Schema(description = "callStatus")
private CallStatus callStatus; CallStatus callStatus,
@Schema(description = "startDt") @Schema(description = "startDt")
private LocalDateTime startDt; LocalDateTime startDt,
@Schema(description = "endDt") @Schema(description = "endDt")
private LocalDateTime endDt; LocalDateTime endDt,
@Schema(description = "totalTime") @Schema(description = "totalTime")
private Integer totalTime; Integer totalTime,
@Schema(description = "talkTime") @Schema(description = "talkTime")
private Integer talkTime; Integer talkTime,
@Schema(description = "mediaServerId") @Schema(description = "mediaServerId")
private Integer mediaServerId; Integer mediaServerId,
@Schema(description = "mediaServerName") @Schema(description = "mediaServerName")
private String mediaServerName; String mediaServerName,
@Schema(description = "recordFileName") @Schema(description = "recordFileName")
private String recordFileName; String recordFileName,
@Schema(description = "regUser") @Schema(description = "regUser")
private String regUser; String regUser,
@Schema(description = "regDt") @Schema(description = "regDt")
private LocalDateTime regDt; LocalDateTime regDt
) {
public static ListCallHistDto from(TListCallHistEntity entity) { public static ListCallHistDto from(TListCallHistEntity entity) {
return ListCallHistDto.builder() return ListCallHistDto.builder()

View File

@@ -9,37 +9,32 @@ import jakarta.validation.Valid;
import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import java.util.List; import java.util.List;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "리스트 + 컨택이력 다운로드 요청 DTO") @Schema(description = "리스트 + 컨택이력 다운로드 요청 DTO")
public class ListEventHistDownloadRequestDto { public record ListEventHistDownloadRequestDto(
@Valid @Valid
@NotNull @NotNull
@Schema(description = "리스트 필터") @Schema(description = "리스트 필터")
private ListFilterDto listFilter; ListFilterDto listFilter,
@NotEmpty @NotEmpty
@Schema(description = "조회할 ResultCodeType 목록") @Schema(description = "조회할 ResultCodeType 목록")
private List<ResultCodeType> resultCodeTypes; List<ResultCodeType> resultCodeTypes,
@NotNull @NotNull
@Schema(description = "조회 기준") @Schema(description = "조회 기준")
private ListEventHistoryBase searchBase; ListEventHistoryBase searchBase,
@Schema(description = "이력 정렬 순서. ASC=오래된 이력 우선, DESC=최근 이력 우선", defaultValue = "ASC") @Schema(description = "이력 정렬 순서. ASC=오래된 이력 우선, DESC=최근 이력 우선", defaultValue = "ASC")
private ListEventHistoryOrder historyOrder = ListEventHistoryOrder.ASC; ListEventHistoryOrder historyOrder,
@Valid @Valid
@Schema(description = "조회 기간") @Schema(description = "조회 기간")
private DateRangeDto dateRange; DateRangeDto dateRange
) {
public ListEventHistoryOrder getHistoryOrder() { public ListEventHistoryOrder historyOrder() {
return historyOrder == null ? ListEventHistoryOrder.ASC : historyOrder; return historyOrder == null ? ListEventHistoryOrder.ASC : historyOrder;
} }
} }

View File

@@ -4,30 +4,25 @@ import com.kri.contact.server.common.enums.ListEventHistorySurveyType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "설문 결과 입력 DTO") @Schema(description = "설문 결과 입력 DTO")
public class ListEventHistFromSurveyDto { public record ListEventHistFromSurveyDto(
@NotNull @NotNull
@Schema(description = "설문 action 코드") @Schema(description = "설문 action 코드")
private ListEventHistorySurveyType action; ListEventHistorySurveyType action,
@NotNull @NotNull
@Schema(description = "프로젝트 설문 고유번호") @Schema(description = "프로젝트 설문 고유번호")
private Long prjctSurveyIdx; Long prjctSurveyIdx,
@NotNull @NotNull
@Schema(description = "리스트 고유번호") @Schema(description = "리스트 고유번호")
private String sid; String sid,
@NotNull @NotNull
@Valid @Valid
@Schema(description = "메타 데이터") @Schema(description = "메타 데이터")
private ListEventHistSurveyMetaDto meta; ListEventHistSurveyMetaDto meta
) {
} }

View File

@@ -4,40 +4,35 @@ import com.kri.contact.server.common.enums.ResultCodeType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "내부 리스트 이벤트 이력 추가 요청 DTO") @Schema(description = "내부 리스트 이벤트 이력 추가 요청 DTO")
public class ListEventHistInsertRequestDto { public record ListEventHistInsertRequestDto(
@NotNull @NotNull
@Schema(description = "프로젝트 고유 번호") @Schema(description = "프로젝트 고유 번호")
private Long prjctIdx; Long prjctIdx,
@NotNull @NotNull
@Schema(description = "리스트 고유 번호") @Schema(description = "리스트 고유 번호")
private String sid; String sid,
@NotNull @NotNull
@Schema(description = "결과 코드 타입") @Schema(description = "결과 코드 타입")
private ResultCodeType resultCodeType; ResultCodeType resultCodeType,
@NotNull @NotNull
@Schema(description = "결과 코드") @Schema(description = "결과 코드")
private Integer resultCd; Integer resultCd,
@Schema(description = "전화 이력 id") @Schema(description = "전화 이력 id")
private Long listCallHistIdx; Long listCallHistIdx,
@Valid @Valid
@Schema(description = "메타 데이터") @Schema(description = "메타 데이터")
private ListEventHistInternalMetaDto meta; ListEventHistInternalMetaDto meta,
@NotNull @NotNull
@Schema(description = "사용자 메모") @Schema(description = "사용자 메모")
private String memo; String memo
) {
} }

View File

@@ -1,55 +1,32 @@
package com.kri.contact.server.dto.list; package com.kri.contact.server.dto.list;
import io.swagger.v3.oas.annotations.media.Schema; 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") @Schema(description = "ListEventHistInternalMetaDto")
public class ListEventHistInternalMetaDto { public record ListEventHistInternalMetaDto(
@Schema(description = "GPS 위도") @Schema(description = "GPS 위도")
private Double latitude; Double latitude,
@Schema(description = "GPS 경도") @Schema(description = "GPS 경도")
private Double longitude; Double longitude,
@Schema(description = "GPS 위치 정확도(미터)") @Schema(description = "GPS 위치 정확도(미터)")
private Double accuracy; Double accuracy,
@Schema(description = "요청 클라이언트 IP 주소") @Schema(description = "요청 클라이언트 IP 주소")
private String remoteAddr; 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( public static ListEventHistInternalMetaDto withRemoteAddr(
ListEventHistInternalMetaDto meta, ListEventHistInternalMetaDto meta,
String remoteAddr String remoteAddr
) { ) {
if (meta == null) { return new ListEventHistInternalMetaDto(
meta = new ListEventHistInternalMetaDto(); meta == null ? null : meta.latitude(),
} meta == null ? null : meta.longitude(),
return ListEventHistInternalMetaDto.builder() meta == null ? null : meta.accuracy(),
.latitude(meta.getLatitude()) remoteAddr
.longitude(meta.getLongitude()) );
.accuracy(meta.getAccuracy())
.remoteAddr(remoteAddr)
.build();
} }
} }

View File

@@ -4,35 +4,44 @@ import com.kri.contact.server.persistence.entity.TListEventHistEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "ListEventHistoryDto") @Schema(description = "ListEventHistoryDto")
public class ListEventHistoryDto { public record ListEventHistoryDto(
@Schema(description = "listEventHistIdx") @Schema(description = "listEventHistIdx")
private Long listEventHistIdx; Long listEventHistIdx,
@Schema(description = "eventTy") @Schema(description = "eventTy")
private Short eventTy; Short eventTy,
@Schema(description = "prjctIdx") @Schema(description = "prjctIdx")
private Long prjctIdx; Long prjctIdx,
@Schema(description = "prjctSurveyIdx") @Schema(description = "prjctSurveyIdx")
private Long prjctSurveyIdx; Long prjctSurveyIdx,
@Schema(description = "sid") @Schema(description = "sid")
private String sid; String sid,
@Schema(description = "resultCd") @Schema(description = "resultCd")
private Integer resultCd; Integer resultCd,
@Schema(description = "metaData") @Schema(description = "metaData")
private String metaData; String metaData,
@Schema(description = "listCallHistIdx") @Schema(description = "listCallHistIdx")
private Long listCallHistIdx; Long listCallHistIdx,
@Schema(description = "memo") @Schema(description = "memo")
private String memo; String memo,
@Schema(description = "regUser") @Schema(description = "regUser")
private String regUser; String regUser,
@Schema(description = "regDt") @Schema(description = "regDt")
private LocalDateTime regDt; LocalDateTime regDt
) {
public static ListEventHistoryDto from(TListEventHistEntity entity) { public static ListEventHistoryDto from(TListEventHistEntity entity) {
return ListEventHistoryDto.builder() return ListEventHistoryDto.builder()

View File

@@ -5,6 +5,7 @@ import com.kri.contact.server.common.enums.ListHeaderType;
import com.kri.contact.server.persistence.entity.TListHeaderEntity; import com.kri.contact.server.persistence.entity.TListHeaderEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import java.util.Locale;
import java.util.Objects; import java.util.Objects;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
@@ -44,6 +45,9 @@ public class ListHeaderDto {
@Schema(description = "헤더 타입") @Schema(description = "헤더 타입")
private ListHeaderType listHderTy; private ListHeaderType listHderTy;
@Schema(description = "헤더 색상 hex (#RRGGBB 또는 #RRGGBBAA, null: 기본색)")
private String listHderColor;
@NotNull @NotNull
@Schema(description = "필터 사용 여부") @Schema(description = "필터 사용 여부")
private Boolean useFilter = false; private Boolean useFilter = false;
@@ -60,6 +64,29 @@ public class ListHeaderDto {
@Schema(description = "면접원 수정가능 여부") @Schema(description = "면접원 수정가능 여부")
private Boolean useIntrvwerEdit = false; private Boolean useIntrvwerEdit = false;
public String getListHderNm() {
return listHderNm == null ? null : listHderNm.trim();
}
public void setListHderNm(String listHderNm) {
this.listHderNm = listHderNm == null ? null : listHderNm.trim();
}
public String getListHderColor() {
return normalizeColor(listHderColor);
}
public void setListHderColor(String listHderColor) {
this.listHderColor = normalizeColor(listHderColor);
}
private static String normalizeColor(String color) {
if (color == null || color.isBlank()) {
return null;
}
return color.trim().toUpperCase(Locale.ROOT);
}
public static ListHeaderDto fromEntity(TListHeaderEntity entity) { public static ListHeaderDto fromEntity(TListHeaderEntity entity) {
return ListHeaderDto.builder() return ListHeaderDto.builder()
.prjctIdx(entity.getPrjctIdx()) .prjctIdx(entity.getPrjctIdx())
@@ -68,6 +95,7 @@ public class ListHeaderDto {
.listHderGrad(ListHeaderGrade.fromCode(entity.getListHderGrad())) .listHderGrad(ListHeaderGrade.fromCode(entity.getListHderGrad()))
.listHderNm(entity.getListHderNm()) .listHderNm(entity.getListHderNm())
.listHderTy(ListHeaderType.fromCode(entity.getListHderTy())) .listHderTy(ListHeaderType.fromCode(entity.getListHderTy()))
.listHderColor(entity.getListHderColor())
.useFilter(entity.getUseFilter()) .useFilter(entity.getUseFilter())
.useColView(entity.getUseColView()) .useColView(entity.getUseColView())
.useIntrvwerView(entity.getUseIntrvwerView()) .useIntrvwerView(entity.getUseIntrvwerView())
@@ -83,6 +111,7 @@ public class ListHeaderDto {
.listHderGrad(src.getListHderGrad()) .listHderGrad(src.getListHderGrad())
.listHderNm(src.getListHderNm()) .listHderNm(src.getListHderNm())
.listHderTy(src.getListHderTy()) .listHderTy(src.getListHderTy())
.listHderColor(src.getListHderColor())
.useFilter(src.getUseFilter()) .useFilter(src.getUseFilter())
.useColView(src.getUseColView()) .useColView(src.getUseColView())
.useIntrvwerView(src.getUseIntrvwerView()) .useIntrvwerView(src.getUseIntrvwerView())
@@ -96,7 +125,7 @@ public class ListHeaderDto {
.listHderId(headerId) .listHderId(headerId)
.listHderOrder((short) headerId) .listHderOrder((short) headerId)
.listHderGrad(ListHeaderGrade.COMMON) .listHderGrad(ListHeaderGrade.COMMON)
.listHderNm(headerName) .listHderNm(headerName == null ? null : headerName.trim())
.listHderTy(type) .listHderTy(type)
.useFilter(true) .useFilter(true)
.useColView(true) .useColView(true)
@@ -109,13 +138,13 @@ public class ListHeaderDto {
return Objects.equals(listHderId, dto.listHderId) && return Objects.equals(listHderId, dto.listHderId) &&
Objects.equals(listHderOrder, dto.listHderOrder) && Objects.equals(listHderOrder, dto.listHderOrder) &&
Objects.equals(listHderGrad, dto.listHderGrad) && Objects.equals(listHderGrad, dto.listHderGrad) &&
Objects.equals(listHderNm, dto.listHderNm) && Objects.equals(getListHderNm(), dto.getListHderNm()) &&
Objects.equals(listHderTy, dto.listHderTy); Objects.equals(listHderTy, dto.listHderTy);
} }
public boolean isEqualSimple(ListHeaderDto dto) { public boolean isEqualSimple(ListHeaderDto dto) {
return Objects.equals(listHderId, dto.listHderId) && return Objects.equals(listHderId, dto.listHderId) &&
Objects.equals(listHderGrad, dto.listHderGrad) && Objects.equals(listHderGrad, dto.listHderGrad) &&
Objects.equals(listHderNm, dto.listHderNm); Objects.equals(getListHderNm(), dto.getListHderNm());
} }
} }

View File

@@ -32,6 +32,7 @@ public class ListHeaderWithFilterContentDto extends ListHeaderDto {
.listHderGrad(ListHeaderGrade.fromCode(entity.getListHderGrad())) .listHderGrad(ListHeaderGrade.fromCode(entity.getListHderGrad()))
.listHderNm(entity.getListHderNm()) .listHderNm(entity.getListHderNm())
.listHderTy(ListHeaderType.fromCode(entity.getListHderTy())) .listHderTy(ListHeaderType.fromCode(entity.getListHderTy()))
.listHderColor(entity.getListHderColor())
.useFilter(entity.getUseFilter()) .useFilter(entity.getUseFilter())
.useColView(entity.getUseColView()) .useColView(entity.getUseColView())
.useIntrvwerView(entity.getUseIntrvwerView()) .useIntrvwerView(entity.getUseIntrvwerView())

View File

@@ -4,6 +4,7 @@ import com.kri.contact.server.common.enums.ListResetMode;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import java.util.List;
import lombok.Getter; import lombok.Getter;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.Setter; import lombok.Setter;
@@ -14,10 +15,21 @@ import lombok.Setter;
@Schema(description = "리스트 초기화 요청 DTO") @Schema(description = "리스트 초기화 요청 DTO")
public class ListResetRequestDto { public class ListResetRequestDto {
@NotNull @Schema(description = "기존 초기화 모드(0: 전체, 1: 전체 이력). 신규 선택 필드와 함께 사용할 수 없습니다.", deprecated = true)
@Schema(description = "초기화 범위")
private ListResetMode resetMode; private ListResetMode resetMode;
@Schema(description = "리스트 초기화 여부. true이면 모든 이력과 연동 설문을 선택해야 합니다.")
private Boolean resetList;
@Schema(description = "컨택이력 초기화 여부")
private Boolean resetContactHistory;
@Schema(description = "면접이력 초기화 여부")
private Boolean resetInterviewHistory;
@Schema(description = "상태이력을 초기화할 프로젝트 설문 고유번호 목록. 미선택은 빈 배열")
private List<Long> resetSurveyIds;
@Valid @Valid
@NotNull @NotNull
@Schema(description = "리스트 필터") @Schema(description = "리스트 필터")

View File

@@ -0,0 +1,16 @@
package com.kri.contact.server.dto.list;
import com.kri.contact.server.common.enums.ListResetMode;
import java.util.Set;
public record ListResetScopeDto(
ListResetMode mode,
boolean selective,
boolean contactHistory,
boolean interviewHistory,
Set<Long> surveyIds
) {
public ListResetScopeDto {
surveyIds = Set.copyOf(surveyIds);
}
}

View File

@@ -2,25 +2,19 @@ package com.kri.contact.server.dto.list;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Map; import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@Builder @Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "외부에서 리스트 조회") @Schema(description = "외부에서 리스트 조회")
public class ListSearchExternalDto { public record ListSearchExternalDto(
@Schema(description = "프로젝트 코드") @Schema(description = "프로젝트 코드")
private String prjctCd; String prjctCd,
@Schema(description = "SID") @Schema(description = "SID")
private String sid; String sid,
@Schema(description = "리스트 값 정보(헤더 네임 기반)") @Schema(description = "리스트 값 정보(헤더 네임 기반)")
private Map<String, String> itemList; Map<String, String> itemList
) {
} }

View File

@@ -4,28 +4,21 @@ import com.kri.common.feature.web.page.PageRequestDto;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid; import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@Builder @Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "리스트 검색 조건") @Schema(description = "리스트 검색 조건")
public class ListSearchRequestDto { public record ListSearchRequestDto(
@Valid @Valid
@NotNull @NotNull
@Schema(description = "리스트 필터") @Schema(description = "리스트 필터")
private ListFilterDto listFilter; ListFilterDto listFilter,
@NotNull @NotNull
@Schema(description = "페이지네이션 정보") @Schema(description = "페이지네이션 정보")
private PageRequestDto pageRequest; PageRequestDto pageRequest
) {
public static ListSearchRequestDto of(ListFilterDto listFilter, PageRequestDto pageRequest){ public static ListSearchRequestDto of(ListFilterDto listFilter, PageRequestDto pageRequest){
return ListSearchRequestDto.builder() return ListSearchRequestDto.builder()

View File

@@ -28,11 +28,11 @@ public class ListSendResultDto extends ListResultBaseDto {
} }
return ListSendResultDto.builder() return ListSendResultDto.builder()
.lastResultCd(dto.getLastResultCode() == null ? null : dto.getLastResultCode().shortValue()) .lastResultCd(dto.lastResultCode() == null ? null : dto.lastResultCode().shortValue())
.lastResultDt(dto.getLastSendDt()) .lastResultDt(dto.lastSendDt())
.attemptCount(dto.getTotalSendCount()) .attemptCount(dto.totalSendCount())
.lastResultLabel(dto.getLastResultLabel()) .lastResultLabel(dto.lastResultLabel())
.lastResultViewLabel(dto.getLastResultViewLabel()) .lastResultViewLabel(dto.lastResultViewLabel())
.build(); .build();
} }
} }

View File

@@ -4,21 +4,16 @@ import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty; import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import java.util.Set; import java.util.Set;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "설문별 결과 필터 조건") @Schema(description = "설문별 결과 필터 조건")
public class ListSurveyResultFilterConditionDto { public record ListSurveyResultFilterConditionDto(
@NotNull @NotNull
@Schema(description = "프로젝트 설문 고유번호") @Schema(description = "프로젝트 설문 고유번호")
private Long prjctSurveyIdx; Long prjctSurveyIdx,
@NotEmpty @NotEmpty
@Schema(description = "설문 결과 코드 목록") @Schema(description = "설문 결과 코드 목록")
private Set<Integer> resultCodes; Set<Integer> resultCodes
) {
} }

View File

@@ -2,21 +2,16 @@ package com.kri.contact.server.dto.list;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "설문 결과 수정 내용") @Schema(description = "설문 결과 수정 내용")
public class ListSurveyResultUpdateDto { public record ListSurveyResultUpdateDto(
@NotNull @NotNull
@Schema(description = "프로젝트 설문 고유번호") @Schema(description = "프로젝트 설문 고유번호")
private Long prjctSurveyIdx; Long prjctSurveyIdx,
@NotNull @NotNull
@Schema(description = "설문 결과 코드") @Schema(description = "설문 결과 코드")
private Integer resultCd; Integer resultCd
) {
} }

View File

@@ -5,29 +5,35 @@ import io.swagger.v3.oas.annotations.media.Schema;
import com.kri.contact.server.persistence.entity.TListUpdateHistEntity; import com.kri.contact.server.persistence.entity.TListUpdateHistEntity;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "ListUpdateHistoryDto") @Schema(description = "ListUpdateHistoryDto")
public class ListUpdateHistoryDto { public record ListUpdateHistoryDto(
@Schema(description = "listUpdateHistIdx") @Schema(description = "listUpdateHistIdx")
private Long listUpdateHistIdx; Long listUpdateHistIdx,
@Schema(description = "prjctIdx") @Schema(description = "prjctIdx")
private Long prjctIdx; Long prjctIdx,
@Schema(description = "sid") @Schema(description = "sid")
private String sid; String sid,
@Schema(description = "listHderId") @Schema(description = "listHderId")
private Integer listHderId; Integer listHderId,
@Schema(description = "beforeVal") @Schema(description = "beforeVal")
private String beforeVal; String beforeVal,
@Schema(description = "afterVal") @Schema(description = "afterVal")
private String afterVal; String afterVal,
@Schema(description = "regUser") @Schema(description = "regUser")
private String regUser; String regUser,
@Schema(description = "regDt") @Schema(description = "regDt")
private LocalDateTime regDt; LocalDateTime regDt
) {
public static ListUpdateHistoryDto from(TListUpdateHistEntity entity) { public static ListUpdateHistoryDto from(TListUpdateHistEntity entity) {
return ListUpdateHistoryDto.builder() return ListUpdateHistoryDto.builder()

View File

@@ -2,16 +2,15 @@ package com.kri.contact.server.dto.list;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "리스트 업로드 파일 정보") @Schema(description = "리스트 업로드 파일 정보")
public class ListUploadFileInfoDto { public record ListUploadFileInfoDto(
@Schema(description = "파일명") @Schema(description = "파일명")
private String fileName; String fileName,
@Schema(description = "파일 바이트") @Schema(description = "파일 바이트")
private byte[] bytes; byte[] bytes
) {
} }

View File

@@ -5,36 +5,35 @@ import com.kri.contact.server.persistence.entity.TListUploadLogEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "리스트 업로드 이력") @Schema(description = "리스트 업로드 이력")
public class ListUploadHistoryDto { public record ListUploadHistoryDto(
@Schema(description = "리스트 업로드 로그 ID") @Schema(description = "리스트 업로드 로그 ID")
private String listUploadLogId; String listUploadLogId,
@Schema(description = "업로드 차수") @Schema(description = "업로드 차수")
private Integer wave; Integer wave,
@Schema(description = "업로드 파일명") @Schema(description = "업로드 파일명")
private String fileName; String fileName,
@Schema(description = "업로드 리스트 수") @Schema(description = "업로드 리스트 수")
private Integer listCount; Integer listCount,
@Schema(description = "업로드 모드") @Schema(description = "업로드 모드")
private ListUploadMode uploadMode; ListUploadMode uploadMode,
@Schema(description = "등록 사용자") @Schema(description = "등록 사용자")
private String regUser; String regUser,
@Schema(description = "등록 일시") @Schema(description = "등록 일시")
private LocalDateTime regDt; LocalDateTime regDt,
@Schema(description = "업로드 파일 자동삭제 일시") @Schema(description = "업로드 파일 자동삭제 일시")
private LocalDateTime schedulingDelDt; LocalDateTime schedulingDelDt
) {
public static ListUploadHistoryDto fromEntity(TListUploadLogEntity entity) { public static ListUploadHistoryDto fromEntity(TListUploadLogEntity entity) {
return ListUploadHistoryDto.builder() return ListUploadHistoryDto.builder()

View File

@@ -5,26 +5,21 @@ import com.kri.contact.server.common.enums.ListUploadMode;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import java.util.Map; import java.util.Map;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "리스트 업로드 요청 DTO") @Schema(description = "리스트 업로드 요청 DTO")
public class ListUploadRequestDto { public record ListUploadRequestDto(
@NotNull @NotNull
@Schema(description = "업로드 모드") @Schema(description = "업로드 모드")
private ListUploadMode uploadMode; ListUploadMode uploadMode,
@Schema(description = "이메일 중복 체크") @Schema(description = "이메일 중복 체크")
private boolean checkDuplicateEmail; boolean checkDuplicateEmail,
@Schema(description = "전화번호 중복 체크") @Schema(description = "전화번호 중복 체크")
private boolean checkDuplicatePhone; boolean checkDuplicatePhone,
@Schema(description = "특수 헤더 정보") @Schema(description = "특수 헤더 정보")
private Map<String, ListHeaderTypeSpecific> specificHeader; Map<String, ListHeaderTypeSpecific> specificHeader
) {
} }

View File

@@ -7,7 +7,8 @@ import java.time.LocalDateTime;
import java.util.List; import java.util.List;
public record ListAsyncAvailabilityDto(ListAsyncJobType requestedJobType, boolean allowed, public record ListAsyncAvailabilityDto(ListAsyncJobType requestedJobType, boolean allowed,
String reasonCode, int blockerCount, List<Blocker> blockers) { String reasonCode, int blockerCount, List<Blocker> blockers,
ListAsyncMutationCompletionDto mutationCompletion) {
public record Blocker(ListAsyncJobType jobType, ListAsyncJobStatus jobStatus, public record Blocker(ListAsyncJobType jobType, ListAsyncJobStatus jobStatus,
String blockingPhase, String requestUserId, String requestUserName, String blockingPhase, String requestUserId, String requestUserName,
boolean mine, String jobKey, LocalDateTime regDt, ListAsyncAssignOperation operation) {} boolean mine, String jobKey, LocalDateTime regDt, ListAsyncAssignOperation operation) {}

View File

@@ -0,0 +1,6 @@
package com.kri.contact.server.dto.list.async;
import java.time.LocalDateTime;
/** Existing job history summary; no separate data version is stored. */
public record ListAsyncMutationCompletionDto(long finishedCount, LocalDateTime lastFinishedAt) {}

View File

@@ -1,23 +0,0 @@
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;
}

View File

@@ -1,6 +1,8 @@
package com.kri.contact.server.dto.message; package com.kri.contact.server.dto.message;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.kri.contact.server.dto.list.ListFilterDto; import com.kri.contact.server.dto.list.ListFilterDto;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.Valid; import jakarta.validation.Valid;
@@ -8,39 +10,35 @@ import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "Message bulk send request") @Schema(description = "Message bulk send request")
public class MessageSendBulkRequestDto { public record MessageSendBulkRequestDto(
@NotNull @NotNull
@Schema(description = "템플릿 고유 번호", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "템플릿 고유 번호", requiredMode = Schema.RequiredMode.REQUIRED)
private Long tmplatIdx; Long tmplatIdx,
@NotNull @NotNull
@Schema(description = "예약 발송 여부", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "예약 발송 여부", requiredMode = Schema.RequiredMode.REQUIRED)
private Boolean resve; Boolean resve,
@Schema(description = "예약 발송 일시") @Schema(description = "예약 발송 일시")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime sendDt; LocalDateTime sendDt,
@Valid @Valid
@Schema(description = "리스트 필터") @Schema(description = "리스트 필터")
private ListFilterDto listFilter; ListFilterDto listFilter,
@NotEmpty @NotEmpty
@Schema(description = "수신처로 사용할 리스트 헤더 ID 목록", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "수신처로 사용할 리스트 헤더 ID 목록", requiredMode = Schema.RequiredMode.REQUIRED)
private List<Integer> destHeaderIds; List<Integer> destHeaderIds,
@Schema(description = "수신자 이름으로 사용할 리스트 헤더 ID") @Schema(description = "수신자 이름으로 사용할 리스트 헤더 ID")
private Integer destNameHeaderId; Integer destNameHeaderId,
@Schema(description = "수신처 중복 제거 여부", defaultValue = "false") @Schema(description = "수신처 중복 제거 여부", defaultValue = "false")
private Boolean dedupe = false; @JsonSetter(nulls = Nulls.AS_EMPTY)
boolean dedupe
) {
} }

View File

@@ -1,28 +0,0 @@
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 MessageSendBulkResponseDto {
@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<>();
}

View File

@@ -0,0 +1,12 @@
package com.kri.contact.server.dto.message;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
@Schema(description = "Bulk scheduled message cancellation request")
public record MessageSendCancelBulkRequestDto(
@NotBlank @Size(max = 32)
@Schema(description = "NotiHub bulk send key", requiredMode = Schema.RequiredMode.REQUIRED)
String bulkSendKey
) {}

View File

@@ -0,0 +1,11 @@
package com.kri.contact.server.dto.message;
import io.swagger.v3.oas.annotations.media.Schema;
@Schema(description = "NotiHub cancellation counts; non-cancelable items may be included in a successful response")
public record MessageSendCancelResponseDto(
long targetCount,
long canceledCount,
long alreadyCanceledCount,
long notCancelableCount
) {}

View File

@@ -0,0 +1,12 @@
package com.kri.contact.server.dto.message;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
@Schema(description = "Single scheduled message cancellation request")
public record MessageSendCancelSingleRequestDto(
@NotNull @Positive
@Schema(description = "NotiHub send identifier", requiredMode = Schema.RequiredMode.REQUIRED)
Long sendIdx
) {}

View File

@@ -6,36 +6,31 @@ import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "Message single send request") @Schema(description = "Message single send request")
public class MessageSendSingleRequestDto { public record MessageSendSingleRequestDto(
@NotNull @NotNull
@Schema(description = "tmplatIdx") @Schema(description = "tmplatIdx")
private Long tmplatIdx; Long tmplatIdx,
@NotNull @NotNull
@Schema(description = "resve") @Schema(description = "resve")
private Boolean resve; Boolean resve,
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Schema(description = "sendDt") @Schema(description = "sendDt")
private LocalDateTime sendDt; LocalDateTime sendDt,
@NotNull @NotNull
@Schema(description = "sid") @Schema(description = "sid")
private String sid; String sid,
@NotEmpty @NotEmpty
@Schema(description = "destHeaderIds") @Schema(description = "destHeaderIds")
private List<Integer> destHeaderIds; List<Integer> destHeaderIds,
@Schema(description = "destNameHeaderId") @Schema(description = "destNameHeaderId")
private Integer destNameHeaderId; Integer destNameHeaderId
) {
} }

View File

@@ -4,23 +4,26 @@ import com.kri.contact.server.common.external.notihub.dto.NotiHubSendSingleRespo
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.util.Map; import java.util.Map;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "Message single send response") @Schema(description = "Message single send response")
public class MessageSendSingleResponseDto { public record MessageSendSingleResponseDto(
@Schema(description = "NotiHub send identifier for single cancellation")
Long sendIdx,
@Schema(description = "cmid") @Schema(description = "cmid")
private String cmid; String cmid,
@Schema(description = "data") @Schema(description = "data")
private Map<String, Object> data; Map<String, Object> data
) {
public static MessageSendSingleResponseDto from(NotiHubSendSingleResponseDto response) { public static MessageSendSingleResponseDto from(NotiHubSendSingleResponseDto response) {
return MessageSendSingleResponseDto.builder() return MessageSendSingleResponseDto.builder()
.cmid(response.getCmid()) .sendIdx(response.sendIdx())
.data(response.getData()) .cmid(response.cmid())
.data(response.data())
.build(); .build();
} }
} }

View File

@@ -1,23 +1,20 @@
package com.kri.contact.server.dto.progress; package com.kri.contact.server.dto.progress;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Schema(description = "진행 현황 조회 요청") @Schema(description = "진행 현황 조회 요청")
public class ProgressSearchRequestDto { public record ProgressSearchRequestDto(
@Schema(description = "사용자 ID") @Schema(description = "사용자 ID")
private String userId; String userId,
@Schema(description = "회사 ID") @Schema(description = "회사 ID")
private String cmpnId; String cmpnId,
@Schema(description = "시작일시") @Schema(description = "시작일시")
private String startDt; String startDt,
@Schema(description = "종료일시") @Schema(description = "종료일시")
private String endDt; String endDt
) {
} }

View File

@@ -3,35 +3,28 @@ package com.kri.contact.server.dto.project;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size; import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "프로젝트 생성 요청") @Schema(description = "프로젝트 생성 요청")
public class ProjectCreateRequestDto { public record ProjectCreateRequestDto(
@Size(max = 128) @Size(max = 128)
@NotBlank @NotBlank
@Schema(description = "프로젝트 명") @Schema(description = "프로젝트 명")
private String prjctName; String prjctName,
@Size(max = 32) @Size(max = 32)
@NotBlank @NotBlank
@Schema(description = "인트라넷 프로젝트 코드") @Schema(description = "인트라넷 프로젝트 코드")
private String itrntPrjctCd; String itrntPrjctCd,
@Size(max = 32) @Size(max = 32)
@NotBlank @NotBlank
@Schema(description = "담당 그룹") @Schema(description = "담당 그룹")
private String ownerDept; String ownerDept,
@Size(max = 32) @Size(max = 32)
@NotBlank @NotBlank
@Schema(description = "담당 실사") @Schema(description = "담당 실사")
private String ownerFw; String ownerFw
) {
} }

View File

@@ -3,27 +3,19 @@ package com.kri.contact.server.dto.project;
import com.kri.contact.server.common.enums.ChannelType; import com.kri.contact.server.common.enums.ChannelType;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "프로젝트 생성 요청") @Schema(description = "프로젝트 생성 요청")
public class ProjectMainTemplateUpdateRequestDto { public record ProjectMainTemplateUpdateRequestDto(
@NotNull @NotNull
@Schema(description = "프로젝트 명") @Schema(description = "프로젝트 명")
private Long prjctIdx; Long prjctIdx,
@NotNull @NotNull
@Schema(description = "템플릿 채널 타입") @Schema(description = "템플릿 채널 타입")
private ChannelType chnnlTy; ChannelType chnnlTy,
@Schema(description = "템플릿 ID") @Schema(description = "템플릿 ID")
private Long tmplatIdx; Long tmplatIdx
) {
} }

View File

@@ -2,20 +2,14 @@ package com.kri.contact.server.dto.project;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List; import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "프로젝트 담당들 정보") @Schema(description = "프로젝트 담당들 정보")
public class ProjectOwnerResponseDto { public record ProjectOwnerResponseDto(
@Schema(description = "담당 연구 부서") @Schema(description = "담당 연구 부서")
List<String> ownerDeptList; List<String> ownerDeptList,
@Schema(description = "담당 실사 인원") @Schema(description = "담당 실사 인원")
List<String> ownerFwList; List<String> ownerFwList
) {
} }

View File

@@ -3,26 +3,23 @@ package com.kri.contact.server.dto.project;
import com.kri.common.feature.web.page.PageRequestDto; import com.kri.common.feature.web.page.PageRequestDto;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List; import java.util.List;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Schema(description = "프로젝트 검색 조건") @Schema(description = "프로젝트 검색 조건")
public class ProjectSearchRequestDto { public record ProjectSearchRequestDto(
@Schema(description = "검색 텍스트") @Schema(description = "검색 텍스트")
private String prjctText; // like 대상 String prjctText, // like 대상
@Schema(description = "프로젝트 상태 리스트") @Schema(description = "프로젝트 상태 리스트")
private List<Short> prjctStatusList; // in (0,1,10) List<Short> prjctStatusList, // in (0,1,10)
@Schema(description = "담당 부서 리스트") @Schema(description = "담당 부서 리스트")
private List<String> ownerDeptList; // in ('S101','P101') List<String> ownerDeptList, // in ('S101','P101')
@Schema(description = "담당 실사 리스트") @Schema(description = "담당 실사 리스트")
private List<String> ownerFwList; // in ('jspark','jhchae') List<String> ownerFwList, // in ('jspark','jhchae')
@Schema(description = "페이지네이션 정보") @Schema(description = "페이지네이션 정보")
private PageRequestDto pageRequest; PageRequestDto pageRequest
) {
} }

View File

@@ -3,21 +3,18 @@ package com.kri.contact.server.dto.project;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import java.util.List; import java.util.List;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Schema(description = "프로젝트 수정 요청") @Schema(description = "프로젝트 수정 요청")
public class ProjectUpdateRequestDto { public record ProjectUpdateRequestDto(
@NotNull @NotNull
@Schema(description = "프로젝트 정보") @Schema(description = "프로젝트 정보")
private ProjectInfoDto projectInfo; ProjectInfoDto projectInfo,
@Schema(description = "프로젝트 수정 대상 결과 코드") @Schema(description = "프로젝트 수정 대상 결과 코드")
private List<ResultCodeDto> resultCodeList; List<ResultCodeDto> resultCodeList,
@Schema(description = "프로젝트 배정 회사 목록") @Schema(description = "프로젝트 배정 회사 목록")
private List<String> assignCmpnIdList; List<String> assignCmpnIdList
) {
} }

View File

@@ -5,32 +5,29 @@ import com.kri.contact.server.common.enums.ResultCodeType;
import com.kri.contact.server.persistence.entity.TResultCodeEntity; import com.kri.contact.server.persistence.entity.TResultCodeEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Builder @Builder
@Schema(description = "결과 코드") @Schema(description = "결과 코드")
public class ResultCodeDto { public record ResultCodeDto(
@Schema(description = "결과 코드 고유 키") @Schema(description = "결과 코드 고유 키")
private String resultCdUUID; String resultCdUUID,
@Schema(description = "프로젝트 인덱스") @Schema(description = "프로젝트 인덱스")
private Long prjctIdx; Long prjctIdx,
@Schema(description = "결과 코드 타입") @Schema(description = "결과 코드 타입")
private ResultCodeType resultCdTy; ResultCodeType resultCdTy,
@Schema(description = "결과 코드") @Schema(description = "결과 코드")
private Short resultCd; Short resultCd,
@Schema(description = "결과 코드 라벨") @Schema(description = "결과 코드 라벨")
private String resultCdLbl; String resultCdLbl,
@Schema(description = "isDefault") @Schema(description = "isDefault")
private Boolean isDefault; Boolean isDefault
) {
public static ResultCodeDto from(TResultCodeEntity entity) { public static ResultCodeDto from(TResultCodeEntity entity) {
return ResultCodeDto.builder() return ResultCodeDto.builder()

View File

@@ -5,33 +5,41 @@ import io.swagger.v3.oas.annotations.media.Schema;
import com.kri.contact.server.persistence.entity.TListResveEntity; import com.kri.contact.server.persistence.entity.TListResveEntity;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
@Getter
@Builder @Builder
@Schema(description = "ListReserveDto") @Schema(description = "ListReserveDto")
public class ListReserveDto { public record ListReserveDto(
@Schema(description = "listResveIdx") @Schema(description = "listResveIdx")
private Long listResveIdx; Long listResveIdx,
@Schema(description = "prjctIdx") @Schema(description = "prjctIdx")
private Long prjctIdx; Long prjctIdx,
@Schema(description = "프로젝트명") @Schema(description = "프로젝트명")
private String prjctName; String prjctName,
@Schema(description = "sid") @Schema(description = "sid")
private String sid; String sid,
@Schema(description = "memo") @Schema(description = "memo")
private String memo; String memo,
@Schema(description = "cnfirm") @Schema(description = "cnfirm")
private Boolean cnfirm; Boolean cnfirm,
@Schema(description = "resveDt") @Schema(description = "resveDt")
private LocalDateTime resveDt; LocalDateTime resveDt,
@Schema(description = "resveUser") @Schema(description = "resveUser")
private String resveUser; String resveUser,
@Schema(description = "regUser") @Schema(description = "regUser")
private String regUser; String regUser,
@Schema(description = "regDt") @Schema(description = "regDt")
private LocalDateTime regDt; LocalDateTime regDt
) {
public static ListReserveDto from(TListResveEntity entity) { public static ListReserveDto from(TListResveEntity entity) {
return from(entity, null); return from(entity, null);

View File

@@ -5,29 +5,24 @@ import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@Schema(description = "ListReserveRequestDto") @Schema(description = "ListReserveRequestDto")
public class ListReserveRequestDto { public record ListReserveRequestDto(
@NotNull @NotNull
@Schema(description = "prjctIdx") @Schema(description = "prjctIdx")
private Long prjctIdx; Long prjctIdx,
@NotNull @NotNull
@Schema(description = "sid") @Schema(description = "sid")
private String sid; String sid,
@NotBlank @NotBlank
@Schema(description = "userId") @Schema(description = "userId")
private String userId; String userId,
@NotNull @NotNull
@Schema(description = "resveDt") @Schema(description = "resveDt")
private LocalDateTime resveDt; LocalDateTime resveDt
) {
} }

View File

@@ -2,23 +2,19 @@ package com.kri.contact.server.dto.systemlog;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@Getter
@Setter
@Builder @Builder
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "UploadContentDto") @Schema(description = "UploadContentDto")
public class UploadContentDto { public record UploadContentDto(
String fileName;
String fileType; String fileName,
Long fileSize;
String fileType,
Long fileSize
) {
public static UploadContentDto from(MultipartFile file){ public static UploadContentDto from(MultipartFile file){
return UploadContentDto.builder() return UploadContentDto.builder()
@@ -28,4 +24,3 @@ public class UploadContentDto {
.build(); .build();
} }
} }

View File

@@ -5,40 +5,36 @@ import com.kri.contact.server.persistence.entity.TRoleEntity;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.Builder; import lombok.Builder;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@Builder @Builder
@Schema(description = "권한 정보") @Schema(description = "권한 정보")
public class RoleInfoDto { public record RoleInfoDto(
@Schema(description = "권한 코드") @Schema(description = "권한 코드")
private Integer roleCd; Integer roleCd,
@Schema(description = "권한 명") @Schema(description = "권한 명")
private String roleNm; String roleNm,
@Schema(description = "메모") @Schema(description = "메모")
private String memo; String memo,
@Schema(description = "등록자", accessMode = Schema.AccessMode.READ_ONLY) @Schema(description = "등록자", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY) @JsonProperty(access = JsonProperty.Access.READ_ONLY)
private String regUser; String regUser,
@Schema(description = "등록일시", accessMode = Schema.AccessMode.READ_ONLY) @Schema(description = "등록일시", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY) @JsonProperty(access = JsonProperty.Access.READ_ONLY)
private LocalDateTime regDt; LocalDateTime regDt,
@Schema(description = "수정자", accessMode = Schema.AccessMode.READ_ONLY) @Schema(description = "수정자", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY) @JsonProperty(access = JsonProperty.Access.READ_ONLY)
private String modUser; String modUser,
@Schema(description = "수정일시", accessMode = Schema.AccessMode.READ_ONLY) @Schema(description = "수정일시", accessMode = Schema.AccessMode.READ_ONLY)
@JsonProperty(access = JsonProperty.Access.READ_ONLY) @JsonProperty(access = JsonProperty.Access.READ_ONLY)
private LocalDateTime modDt; LocalDateTime modDt
) {
public static RoleInfoDto from(TRoleEntity roleEntity) { public static RoleInfoDto from(TRoleEntity roleEntity) {
return RoleInfoDto.builder() return RoleInfoDto.builder()

View File

@@ -71,21 +71,21 @@ public class TCmpnEntity {
public static TCmpnEntity fromDto(CmpnInfoDto dto, String regUser, LocalDateTime regDt) { public static TCmpnEntity fromDto(CmpnInfoDto dto, String regUser, LocalDateTime regDt) {
return TCmpnEntity.builder() return TCmpnEntity.builder()
.cmpnId(dto.getCmpnId()) .cmpnId(dto.cmpnId())
.cmpnAlias(dto.getCmpnAlias()) .cmpnAlias(dto.cmpnAlias())
.cmpnTel(dto.getCmpnTel()) .cmpnTel(dto.cmpnTel())
.ownCmpn(Boolean.TRUE.equals(dto.getOwnCmpn())) .ownCmpn(Boolean.TRUE.equals(dto.ownCmpn()))
.memo(dto.getMemo()) .memo(dto.memo())
.regUser(regUser) .regUser(regUser)
.regDt(regDt) .regDt(regDt)
.build(); .build();
} }
public void updateFromDto(CmpnInfoDto dto, String modUser, LocalDateTime modDt) { public void updateFromDto(CmpnInfoDto dto, String modUser, LocalDateTime modDt) {
this.cmpnAlias = dto.getCmpnAlias(); this.cmpnAlias = dto.cmpnAlias();
this.cmpnTel = dto.getCmpnTel(); this.cmpnTel = dto.cmpnTel();
this.ownCmpn = Boolean.TRUE.equals(dto.getOwnCmpn()); this.ownCmpn = Boolean.TRUE.equals(dto.ownCmpn());
this.memo = dto.getMemo(); this.memo = dto.memo();
this.modUser = modUser; this.modUser = modUser;
this.modDt = modDt; this.modDt = modDt;
} }

View File

@@ -13,7 +13,6 @@ import jakarta.persistence.Table;
import jakarta.persistence.UniqueConstraint; import jakarta.persistence.UniqueConstraint;
import jakarta.validation.constraints.NotNull; import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size; import jakarta.validation.constraints.Size;
import java.time.Duration;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
@@ -155,19 +154,6 @@ public class TListCallHistEntity {
} }
public boolean markUserHangup(LocalDateTime endDt) {
if (this.callStatus == CallStatus.CALL_CLOSE) {
return false;
}
LocalDateTime resolvedEndDt = this.endDt == null ? endDt : this.endDt;
int durationSeconds = durationSeconds(this.startDt, resolvedEndDt);
this.endDt = resolvedEndDt;
this.totalTime = durationSeconds;
this.talkTime = durationSeconds;
this.callStatus = CallStatus.USER_HANGUP;
return true;
}
private static LocalDateTime resolveEndDt(ListCallCloseRequestDto request, LocalDateTime now) { private static LocalDateTime resolveEndDt(ListCallCloseRequestDto request, LocalDateTime now) {
return isCompletedRequest(request) ? now : null; return isCompletedRequest(request) ? now : null;
} }
@@ -181,14 +167,6 @@ public class TListCallHistEntity {
|| isPositive(request.getTalkTime()); || isPositive(request.getTalkTime());
} }
private static int durationSeconds(LocalDateTime startDt, LocalDateTime endDt) {
if (startDt == null || endDt == null || endDt.isBefore(startDt)) {
return 0;
}
long seconds = Duration.between(startDt, endDt).getSeconds();
return seconds > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) seconds;
}
private static boolean isPositive(Integer value) { private static boolean isPositive(Integer value) {
return value != null && value > 0; return value != null && value > 0;
} }

View File

@@ -85,11 +85,11 @@ public class TListEventHistEntity {
return TListEventHistEntity.builder() return TListEventHistEntity.builder()
.eventTy(ResultCodeType.SURVEY.getCode()) .eventTy(ResultCodeType.SURVEY.getCode())
.prjctIdx(prjctIdx) .prjctIdx(prjctIdx)
.prjctSurveyIdx(request.getPrjctSurveyIdx()) .prjctSurveyIdx(request.prjctSurveyIdx())
.sid(request.getSid()) .sid(request.sid())
.resultCd(request.getAction().getCode().intValue()) .resultCd(request.action().getCode().intValue())
.metaData(metaData) .metaData(metaData)
.memo(request.getAction().name()) .memo(request.action().name())
.regUser(regUser) .regUser(regUser)
.regDt(regDt) .regDt(regDt)
.build(); .build();
@@ -102,13 +102,13 @@ public class TListEventHistEntity {
LocalDateTime regDt LocalDateTime regDt
) { ) {
return TListEventHistEntity.builder() return TListEventHistEntity.builder()
.eventTy(request.getResultCodeType().getCode()) .eventTy(request.resultCodeType().getCode())
.prjctIdx(request.getPrjctIdx()) .prjctIdx(request.prjctIdx())
.sid(request.getSid()) .sid(request.sid())
.resultCd(request.getResultCd()) .resultCd(request.resultCd())
.listCallHistIdx(request.getListCallHistIdx()) .listCallHistIdx(request.listCallHistIdx())
.metaData(metaData) .metaData(metaData)
.memo(request.getMemo()) .memo(request.memo())
.regUser(regUser) .regUser(regUser)
.regDt(regDt) .regDt(regDt)
.build(); .build();

View File

@@ -46,6 +46,10 @@ public class TListHeaderEntity {
@Column(name = "list_hder_ty", nullable = false) @Column(name = "list_hder_ty", nullable = false)
private Short listHderTy; private Short listHderTy;
@Size(max = 16)
@Column(name = "list_hder_color", length = 16)
private String listHderColor;
@NotNull @NotNull
@ColumnDefault("0") @ColumnDefault("0")
@Column(name = "use_filter", nullable = false) @Column(name = "use_filter", nullable = false)
@@ -101,8 +105,9 @@ public class TListHeaderEntity {
.id(TListHeaderEntityId.create(prjctIdx, src.getListHderId())) .id(TListHeaderEntityId.create(prjctIdx, src.getListHderId()))
.listHderOrder(src.getListHderOrder()) .listHderOrder(src.getListHderOrder())
.listHderGrad(src.getListHderGrad()) .listHderGrad(src.getListHderGrad())
.listHderNm(src.getListHderNm()) .listHderNm(src.getListHderNm() == null ? null : src.getListHderNm().trim())
.listHderTy(src.getListHderTy()) .listHderTy(src.getListHderTy())
.listHderColor(src.getListHderColor())
.useFilter(src.getUseFilter()) .useFilter(src.getUseFilter())
.useColView(src.getUseColView()) .useColView(src.getUseColView())
.useIntrvwerView(src.getUseIntrvwerView()) .useIntrvwerView(src.getUseIntrvwerView())
@@ -119,6 +124,7 @@ public class TListHeaderEntity {
.listHderGrad(dto.getListHderGrad().getCode()) .listHderGrad(dto.getListHderGrad().getCode())
.listHderNm(dto.getListHderNm()) .listHderNm(dto.getListHderNm())
.listHderTy(dto.getListHderTy().getCode()) .listHderTy(dto.getListHderTy().getCode())
.listHderColor(dto.getListHderColor())
.useFilter(dto.getUseFilter()) .useFilter(dto.getUseFilter())
.useColView(dto.getUseColView()) .useColView(dto.getUseColView())
.useIntrvwerView(dto.getUseIntrvwerView()) .useIntrvwerView(dto.getUseIntrvwerView())

View File

@@ -120,10 +120,10 @@ public class TPrjctEntity {
return TPrjctEntity.builder() return TPrjctEntity.builder()
.prjctCd(prjctCd) .prjctCd(prjctCd)
.prjctStatus(ProjectStatus.STANDBY.getCode()) .prjctStatus(ProjectStatus.STANDBY.getCode())
.prjctNm(req.getPrjctName()) .prjctNm(req.prjctName())
.itrntPrjctCd(req.getItrntPrjctCd()) .itrntPrjctCd(req.itrntPrjctCd())
.ownerDept(req.getOwnerDept()) .ownerDept(req.ownerDept())
.ownerFw(req.getOwnerFw()) .ownerFw(req.ownerFw())
.callerTelNum(DEFAULT_CALLER_TELNUM) .callerTelNum(DEFAULT_CALLER_TELNUM)
.ff(false) .ff(false)
.useContactSenario(false) .useContactSenario(false)

View File

@@ -46,8 +46,8 @@ public class TPrjctMainTmplatEntity {
public static TPrjctMainTmplatEntity create(ProjectMainTemplateUpdateRequestDto req, public static TPrjctMainTmplatEntity create(ProjectMainTemplateUpdateRequestDto req,
String regUser, LocalDateTime regDt) { String regUser, LocalDateTime regDt) {
return TPrjctMainTmplatEntity.builder() return TPrjctMainTmplatEntity.builder()
.id(TPrjctMainTmplatEntityId.create(req.getPrjctIdx(), req.getChnnlTy().getCode())) .id(TPrjctMainTmplatEntityId.create(req.prjctIdx(), req.chnnlTy().getCode()))
.tmplatIdx(req.getTmplatIdx()) .tmplatIdx(req.tmplatIdx())
.regUser(regUser) .regUser(regUser)
.regDt(regDt) .regDt(regDt)
.build(); .build();

View File

@@ -69,8 +69,8 @@ public class TResultCodeEntity {
public static TResultCodeEntity fromDto(Long prjctIdx, ResultCodeType resultCdTy, public static TResultCodeEntity fromDto(Long prjctIdx, ResultCodeType resultCdTy,
ResultCodeDto req, String regUser, LocalDateTime regDt) { ResultCodeDto req, String regUser, LocalDateTime regDt) {
return TResultCodeEntity.builder() return TResultCodeEntity.builder()
.id(TResultCodeEntityId.create(prjctIdx, resultCdTy, req.getResultCd())) .id(TResultCodeEntityId.create(prjctIdx, resultCdTy, req.resultCd()))
.resultCdLbl(req.getResultCdLbl()) .resultCdLbl(req.resultCdLbl())
.defaultCode(false) .defaultCode(false)
.regUser(regUser) .regUser(regUser)
.regDt(regDt) .regDt(regDt)

View File

@@ -1,5 +1,6 @@
package com.kri.contact.server.persistence.jdbc; package com.kri.contact.server.persistence.jdbc;
import com.kri.common.feature.web.BusinessException;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.SQLException; import java.sql.SQLException;
import java.sql.Timestamp; import java.sql.Timestamp;
@@ -150,7 +151,7 @@ public class ListAssignJdbcSupport {
return List.of(); return List.of();
} }
if (chunkSize <= 0) { if (chunkSize <= 0) {
throw new IllegalArgumentException("chunkSize must be greater than 0"); throw BusinessException.internalError("INVALID_LIST_CHUNK_SIZE", "chunkSize must be greater than 0");
} }
List<String> sidList = sids instanceof List<String> list ? list : new ArrayList<>(sids); List<String> sidList = sids instanceof List<String> list ? list : new ArrayList<>(sids);

View File

@@ -1,5 +1,8 @@
package com.kri.contact.server.persistence.jdbc; package com.kri.contact.server.persistence.jdbc;
import com.kri.common.feature.web.BusinessException;
import com.kri.contact.server.common.enums.ResultCodeType;
import com.kri.contact.server.dto.list.ListResetScopeDto;
import jakarta.persistence.EntityManager; import jakarta.persistence.EntityManager;
import jakarta.persistence.Query; import jakarta.persistence.Query;
import java.util.ArrayList; import java.util.ArrayList;
@@ -17,6 +20,44 @@ public class ListResetJdbcSupport {
private final EntityManager entityManager; private final EntityManager entityManager;
public DeleteCounts deleteSelectedHistories(Long prjctIdx, Collection<String> sids,
ListResetScopeDto scope, int chunkSize) {
if (sids == null || sids.isEmpty()) {
return DeleteCounts.empty();
}
try {
prepareTempSids(sids, chunkSize);
int historyCount = deleteSelectedEvents("t_list_event_hist", prjctIdx, scope);
int latestCount = deleteSelectedEvents("t_list_event_latest", prjctIdx, scope);
return DeleteCounts.histories(historyCount, latestCount, 0, 0);
} finally {
dropTempSids();
}
}
private int deleteSelectedEvents(String tableName, Long prjctIdx, ListResetScopeDto scope) {
List<Short> eventTypes = new ArrayList<>();
if (scope.contactHistory()) eventTypes.add(ResultCodeType.CONTACT.getCode());
if (scope.interviewHistory()) eventTypes.add(ResultCodeType.INTERVIEW.getCode());
List<String> conditions = new ArrayList<>();
if (!eventTypes.isEmpty()) conditions.add("target.event_ty in (:eventTypes)");
if (!scope.surveyIds().isEmpty()) {
conditions.add("(target.event_ty = :surveyType and target.prjct_survey_idx in (:surveyIds))");
}
if (conditions.isEmpty()) return 0;
Query query = entityManager.createNativeQuery(
"delete target from " + tableName + " target "
+ "join " + TEMP_SID_TABLE + " reset_sid on reset_sid.sid = target.sid "
+ "where target.prjct_idx = :prjctIdx and (" + String.join(" or ", conditions) + ")");
query.setParameter("prjctIdx", prjctIdx);
if (!eventTypes.isEmpty()) query.setParameter("eventTypes", eventTypes);
if (!scope.surveyIds().isEmpty()) {
query.setParameter("surveyType", ResultCodeType.SURVEY.getCode());
query.setParameter("surveyIds", scope.surveyIds());
}
return query.executeUpdate();
}
public DeleteCounts deleteHistories(Long prjctIdx, Collection<String> sids, int chunkSize) { public DeleteCounts deleteHistories(Long prjctIdx, Collection<String> sids, int chunkSize) {
if (sids == null || sids.isEmpty()) { if (sids == null || sids.isEmpty()) {
return DeleteCounts.empty(); return DeleteCounts.empty();
@@ -123,7 +164,7 @@ public class ListResetJdbcSupport {
return List.of(); return List.of();
} }
if (chunkSize <= 0) { if (chunkSize <= 0) {
throw new IllegalArgumentException("chunkSize must be greater than 0"); throw BusinessException.internalError("INVALID_LIST_CHUNK_SIZE", "chunkSize must be greater than 0");
} }
List<String> sidList = new ArrayList<>(sids); List<String> sidList = new ArrayList<>(sids);
@@ -179,20 +220,5 @@ public class ListResetJdbcSupport {
); );
} }
public DeleteCounts plus(DeleteCounts other) {
return new DeleteCounts(
fileCount + other.fileCount,
callHistCount + other.callHistCount,
eventHistCount + other.eventHistCount,
eventLatestCount + other.eventLatestCount,
updateHistCount + other.updateHistCount,
itemCount + other.itemCount,
listCount + other.listCount,
assignUserCount + other.assignUserCount,
assignCmpnCount + other.assignCmpnCount,
resveCount + other.resveCount
);
}
} }
} }

View File

@@ -3,6 +3,7 @@ package com.kri.contact.server.persistence.repository;
import com.kri.contact.server.common.enums.ListAsyncJobStatus; import com.kri.contact.server.common.enums.ListAsyncJobStatus;
import com.kri.contact.server.common.enums.ListAsyncJobType; import com.kri.contact.server.common.enums.ListAsyncJobType;
import com.kri.contact.server.dto.list.async.ListAsyncJobActivity; import com.kri.contact.server.dto.list.async.ListAsyncJobActivity;
import com.kri.contact.server.dto.list.async.ListAsyncMutationCompletionDto;
import com.kri.contact.server.persistence.entity.TListAsyncJobEntity; import com.kri.contact.server.persistence.entity.TListAsyncJobEntity;
import jakarta.persistence.LockModeType; import jakarta.persistence.LockModeType;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@@ -27,6 +28,18 @@ public interface ListAsyncJobRepository extends JpaRepository<TListAsyncJobEntit
@Param("projectId") Long projectId, @Param("statuses") Collection<ListAsyncJobStatus> statuses, @Param("projectId") Long projectId, @Param("statuses") Collection<ListAsyncJobStatus> statuses,
@Param("heldKeys") Collection<String> heldKeys); @Param("heldKeys") Collection<String> heldKeys);
@Query("""
select new com.kri.contact.server.dto.list.async.ListAsyncMutationCompletionDto(
count(j), max(j.finishedDt))
from TListAsyncJobEntity j
where j.prjctIdx = :projectId and j.jobType in :types and j.jobStatus in :statuses
and j.finishedDt is not null and j.jobKey not in :heldKeys
""")
ListAsyncMutationCompletionDto summarizeFinishedMutations(
@Param("projectId") Long projectId, @Param("types") Collection<ListAsyncJobType> types,
@Param("statuses") Collection<ListAsyncJobStatus> statuses,
@Param("heldKeys") Collection<String> heldKeys);
Optional<TListAsyncJobEntity> findFirstByPrjctIdxAndJobTypeInAndJobStatusInOrderByRegDtDescJobKeyDesc( Optional<TListAsyncJobEntity> findFirstByPrjctIdxAndJobTypeInAndJobStatusInOrderByRegDtDescJobKeyDesc(
Long projectId, Collection<ListAsyncJobType> types, Collection<ListAsyncJobStatus> statuses); Long projectId, Collection<ListAsyncJobType> types, Collection<ListAsyncJobStatus> statuses);

View File

@@ -601,12 +601,12 @@ public class ListQueryRepositoryImpl implements ListQueryRepository {
for (int index = 0; index < conditions.size(); index++) { for (int index = 0; index < conditions.size(); index++) {
LastEventDateRangeDto condition = conditions.get(index); LastEventDateRangeDto condition = conditions.get(index);
if (condition == null || condition.getResultCodeType() == null) { if (condition == null || condition.resultCodeType() == null) {
continue; continue;
} }
LocalDateTime startDate = condition.getStartDate(); LocalDateTime startDate = condition.startDate();
LocalDateTime endDate = condition.getEndDate(); LocalDateTime endDate = condition.endDate();
if (startDate == null && endDate == null) { if (startDate == null && endDate == null) {
continue; continue;
} }
@@ -616,7 +616,7 @@ public class ListQueryRepositoryImpl implements ListQueryRepository {
endDate = swapped; endDate = swapped;
} }
ResultCodeType resultCodeType = condition.getResultCodeType(); ResultCodeType resultCodeType = condition.resultCodeType();
QTListEventLatestEntity latest = new QTListEventLatestEntity("latest_event_date_" + index); QTListEventLatestEntity latest = new QTListEventLatestEntity("latest_event_date_" + index);
BooleanBuilder latestPredicate = new BooleanBuilder() BooleanBuilder latestPredicate = new BooleanBuilder()
.and(latest.prjctIdx.eq(prjctIdx)) .and(latest.prjctIdx.eq(prjctIdx))
@@ -624,7 +624,7 @@ public class ListQueryRepositoryImpl implements ListQueryRepository {
.and(latest.eventTy.eq(resultCodeType.getCode())); .and(latest.eventTy.eq(resultCodeType.getCode()));
if (resultCodeType == ResultCodeType.SURVEY) { if (resultCodeType == ResultCodeType.SURVEY) {
latestPredicate.and(latest.prjctSurveyIdx.eq(condition.getPrjctSurveyIdx())); latestPredicate.and(latest.prjctSurveyIdx.eq(condition.prjctSurveyIdx()));
} else { } else {
latestPredicate.and(latest.prjctSurveyIdx.isNull()); latestPredicate.and(latest.prjctSurveyIdx.isNull());
} }
@@ -654,16 +654,16 @@ public class ListQueryRepositoryImpl implements ListQueryRepository {
for (ListSurveyResultFilterConditionDto condition : surveyResultConditions) { for (ListSurveyResultFilterConditionDto condition : surveyResultConditions) {
if (condition == null if (condition == null
|| condition.getPrjctSurveyIdx() == null || condition.prjctSurveyIdx() == null
|| condition.getResultCodes() == null || condition.resultCodes() == null
|| condition.getResultCodes().isEmpty()) { || condition.resultCodes().isEmpty()) {
continue; continue;
} }
boolean includeNoHistory = condition.getResultCodes().stream() boolean includeNoHistory = condition.resultCodes().stream()
.filter(Objects::nonNull) .filter(Objects::nonNull)
.anyMatch(resultCode -> resultCode == NO_RESULT_HISTORY_CODE); .anyMatch(resultCode -> resultCode == NO_RESULT_HISTORY_CODE);
List<Integer> existingHistoryResultCodes = condition.getResultCodes().stream() List<Integer> existingHistoryResultCodes = condition.resultCodes().stream()
.filter(Objects::nonNull) .filter(Objects::nonNull)
.filter(resultCode -> resultCode != NO_RESULT_HISTORY_CODE) .filter(resultCode -> resultCode != NO_RESULT_HISTORY_CODE)
.distinct() .distinct()
@@ -674,7 +674,7 @@ public class ListQueryRepositoryImpl implements ListQueryRepository {
BooleanBuilder surveyPredicate = new BooleanBuilder(); BooleanBuilder surveyPredicate = new BooleanBuilder();
QTListEventLatestEntity latest = new QTListEventLatestEntity( QTListEventLatestEntity latest = new QTListEventLatestEntity(
"latest_survey_result_" + condition.getPrjctSurveyIdx() "latest_survey_result_" + condition.prjctSurveyIdx()
); );
if (!existingHistoryResultCodes.isEmpty()) { if (!existingHistoryResultCodes.isEmpty()) {
@@ -684,7 +684,7 @@ public class ListQueryRepositoryImpl implements ListQueryRepository {
latest.prjctIdx.eq(prjctIdx), latest.prjctIdx.eq(prjctIdx),
latest.sid.eq(list.id.sid), latest.sid.eq(list.id.sid),
latest.eventTy.eq(ResultCodeType.SURVEY.getCode()), latest.eventTy.eq(ResultCodeType.SURVEY.getCode()),
latest.prjctSurveyIdx.eq(condition.getPrjctSurveyIdx()), latest.prjctSurveyIdx.eq(condition.prjctSurveyIdx()),
latest.resultCd.in(existingHistoryResultCodes) latest.resultCd.in(existingHistoryResultCodes)
) )
.exists()); .exists());
@@ -692,7 +692,7 @@ public class ListQueryRepositoryImpl implements ListQueryRepository {
if (includeNoHistory) { if (includeNoHistory) {
QTListEventLatestEntity noHistoryLatest = new QTListEventLatestEntity( QTListEventLatestEntity noHistoryLatest = new QTListEventLatestEntity(
"no_history_survey_result_" + condition.getPrjctSurveyIdx() "no_history_survey_result_" + condition.prjctSurveyIdx()
); );
surveyPredicate.or(JPAExpressions.selectOne() surveyPredicate.or(JPAExpressions.selectOne()
.from(noHistoryLatest) .from(noHistoryLatest)
@@ -700,7 +700,7 @@ public class ListQueryRepositoryImpl implements ListQueryRepository {
noHistoryLatest.prjctIdx.eq(prjctIdx), noHistoryLatest.prjctIdx.eq(prjctIdx),
noHistoryLatest.sid.eq(list.id.sid), noHistoryLatest.sid.eq(list.id.sid),
noHistoryLatest.eventTy.eq(ResultCodeType.SURVEY.getCode()), noHistoryLatest.eventTy.eq(ResultCodeType.SURVEY.getCode()),
noHistoryLatest.prjctSurveyIdx.eq(condition.getPrjctSurveyIdx()) noHistoryLatest.prjctSurveyIdx.eq(condition.prjctSurveyIdx())
) )
.notExists()); .notExists());
} }

View File

@@ -4,10 +4,14 @@ import com.kri.contact.server.persistence.entity.TPrjctMainTmplatEntity;
import com.kri.contact.server.persistence.entity.id.TPrjctMainTmplatEntityId; import com.kri.contact.server.persistence.entity.id.TPrjctMainTmplatEntityId;
import java.util.Optional; import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.transaction.annotation.Transactional;
public interface ProjectMainTemplateRepository extends JpaRepository<TPrjctMainTmplatEntity, TPrjctMainTmplatEntityId> { public interface ProjectMainTemplateRepository extends JpaRepository<TPrjctMainTmplatEntity, TPrjctMainTmplatEntityId> {
Optional<TPrjctMainTmplatEntity> findByIdPrjctIdxAndIdChnnlTy(Long prjctIdx, Short chnnlTy); Optional<TPrjctMainTmplatEntity> findByIdPrjctIdxAndIdChnnlTy(Long prjctIdx, Short chnnlTy);
long deleteByIdPrjctIdxAndIdChnnlTy(Long prjctIdx, Short chnnlTy); long deleteByIdPrjctIdxAndIdChnnlTy(Long prjctIdx, Short chnnlTy);
@Transactional
long deleteByTmplatIdx(Long tmplatIdx);
} }

View File

@@ -2,6 +2,7 @@ package com.kri.contact.server.persistence.support;
import com.kri.common.feature.web.BusinessException; import com.kri.common.feature.web.BusinessException;
import com.kri.contact.server.common.enums.ListResetMode; import com.kri.contact.server.common.enums.ListResetMode;
import com.kri.contact.server.dto.list.ListResetScopeDto;
import com.kri.contact.server.persistence.entity.TListResetLogEntity; import com.kri.contact.server.persistence.entity.TListResetLogEntity;
import com.kri.contact.server.persistence.jdbc.ListResetJdbcSupport; import com.kri.contact.server.persistence.jdbc.ListResetJdbcSupport;
import com.kri.contact.server.persistence.jdbc.ListResetJdbcSupport.DeleteCounts; import com.kri.contact.server.persistence.jdbc.ListResetJdbcSupport.DeleteCounts;
@@ -20,17 +21,6 @@ public class ListResetPersistenceSupport {
private final ListDeleteSessionContext deleteSessionContext; private final ListDeleteSessionContext deleteSessionContext;
private final EntityManager entityManager; private final EntityManager entityManager;
public int resetWithAuditContext(
Long prjctIdx,
Collection<String> sids,
ListResetMode mode,
String listResetLogId,
String delUser,
int chunkSize
) {
return resetWithAuditContext(prjctIdx, sids, mode, listResetLogId, delUser, chunkSize, false);
}
public int resetChunkWithAuditContext(Long projectId, Collection<String> sids, ListResetMode mode, public int resetChunkWithAuditContext(Long projectId, Collection<String> sids, ListResetMode mode,
String logId, String user, int chunkSize) { String logId, String user, int chunkSize) {
return resetWithAuditContext(projectId, sids, mode, logId, user, chunkSize, true); return resetWithAuditContext(projectId, sids, mode, logId, user, chunkSize, true);
@@ -38,6 +28,16 @@ public class ListResetPersistenceSupport {
private int resetWithAuditContext(Long prjctIdx, Collection<String> sids, ListResetMode mode, private int resetWithAuditContext(Long prjctIdx, Collection<String> sids, ListResetMode mode,
String listResetLogId, String delUser, int chunkSize, boolean accumulate) { String listResetLogId, String delUser, int chunkSize, boolean accumulate) {
return resetWithAuditContext(prjctIdx, sids, mode, listResetLogId, delUser, chunkSize, accumulate, null);
}
public int resetChunkWithAuditContext(Long projectId, Collection<String> sids, ListResetScopeDto scope,
String logId, String user, int chunkSize) {
return resetWithAuditContext(projectId, sids, scope.mode(), logId, user, chunkSize, true, scope);
}
private int resetWithAuditContext(Long prjctIdx, Collection<String> sids, ListResetMode mode,
String listResetLogId, String delUser, int chunkSize, boolean accumulate, ListResetScopeDto scope) {
int resetCount = mode == ListResetMode.HIST ? sids.size() : 0; int resetCount = mode == ListResetMode.HIST ? sids.size() : 0;
try (var ignored = deleteSessionContext.openReset(listResetLogId, delUser)) { try (var ignored = deleteSessionContext.openReset(listResetLogId, delUser)) {
@@ -45,7 +45,13 @@ public class ListResetPersistenceSupport {
entityManager.clear(); entityManager.clear();
switch (mode) { switch (mode) {
case HIST -> listResetJdbcSupport.deleteHistories(prjctIdx, sids, chunkSize); case HIST -> {
if (scope != null && scope.selective()) {
listResetJdbcSupport.deleteSelectedHistories(prjctIdx, sids, scope, chunkSize);
} else {
listResetJdbcSupport.deleteHistories(prjctIdx, sids, chunkSize);
}
}
case ALL -> { case ALL -> {
listResetJdbcSupport.deleteHistories(prjctIdx, sids, chunkSize); listResetJdbcSupport.deleteHistories(prjctIdx, sids, chunkSize);
DeleteCounts counts = listResetJdbcSupport.deleteListData(prjctIdx, sids, true, true, chunkSize); DeleteCounts counts = listResetJdbcSupport.deleteListData(prjctIdx, sids, true, true, chunkSize);
@@ -62,7 +68,7 @@ public class ListResetPersistenceSupport {
TListResetLogEntity log = listResetLogRepository.findById(listResetLogId) TListResetLogEntity log = listResetLogRepository.findById(listResetLogId)
.orElseThrow(() -> BusinessException.internalError("List reset log not found.")); .orElseThrow(() -> BusinessException.internalError("List reset log not found."));
if (!java.util.Objects.equals(log.getPrjctIdx(), prjctIdx) || !java.util.Objects.equals(log.getMode(), mode.getCode())) { if (!java.util.Objects.equals(log.getPrjctIdx(), prjctIdx) || !java.util.Objects.equals(log.getMode(), mode.getCode())) {
throw new IllegalArgumentException("Reset log does not match project and mode"); throw BusinessException.internalError("RESET_LOG_PROJECT_OR_MODE_MISMATCH", "Reset log does not match project and mode");
} }
log.setListCnt(accumulate ? Math.addExact(log.getListCnt(), resetCount) : resetCount); log.setListCnt(accumulate ? Math.addExact(log.getListCnt(), resetCount) : resetCount);
listResetLogRepository.saveAndFlush(log); listResetLogRepository.saveAndFlush(log);

View File

@@ -81,7 +81,7 @@ public class AssignService {
.toList(); .toList();
long assignedCount = assignees.stream() long assignedCount = assignees.stream()
.mapToLong(CompanyAssignSummaryItemDto::getAssignedCount) .mapToLong(CompanyAssignSummaryItemDto::assignedCount)
.sum(); .sum();
validateSummaryCount(totalCount, assignedCount); validateSummaryCount(totalCount, assignedCount);

View File

@@ -28,14 +28,14 @@ public class AuthService {
JwtUserClaimsDto claims; JwtUserClaimsDto claims;
if (loginInfoResponse != null) { if (loginInfoResponse != null) {
claims = JwtUserClaimsDto.builder() claims = JwtUserClaimsDto.builder()
.userId(loginInfoResponse.getUserId()) .userId(loginInfoResponse.userId())
.userCmpn(DEFAULT_COMPANY_NAME) .userCmpn(DEFAULT_COMPANY_NAME)
.userName(loginInfoResponse.getUserNm()) .userName(loginInfoResponse.userNm())
.userTeam(loginInfoResponse.getUserTeam()) .userTeam(loginInfoResponse.userTeam())
.userRole(loginInfoResponse.getUserRole()) .userRole(loginInfoResponse.userRole())
.build(); .build();
} else { } else {
TUserEntity user = userService.getUser(request.getUserId(), request.getUserPw()); TUserEntity user = userService.getUser(request.userId(), request.userPw());
claims = JwtUserClaimsDto.builder() claims = JwtUserClaimsDto.builder()
.userId(user.getUserId()) .userId(user.getUserId())
.userCmpn(user.getUserCmpn()) .userCmpn(user.getUserCmpn())

View File

@@ -33,9 +33,9 @@ public class CmpnService {
@Transactional @Transactional
public void createCmpn(CmpnInfoDto dto, String regUser, LocalDateTime regDt) { public void createCmpn(CmpnInfoDto dto, String regUser, LocalDateTime regDt) {
DataVerificationDto verification = verifyCmpnId(dto.getCmpnId()); DataVerificationDto verification = verifyCmpnId(dto.cmpnId());
if (!verification.isSuccess()) { if (!verification.success()) {
throw BusinessException.badRequest("WRONG_CMPN_DATA", verification.getErrMessage()); throw BusinessException.badRequest("WRONG_CMPN_DATA", verification.errMessage());
} }
validateCmpnDto(dto); validateCmpnDto(dto);
@@ -45,7 +45,7 @@ public class CmpnService {
@Transactional @Transactional
public void updateCmpn(CmpnInfoDto dto, String modUser, LocalDateTime modDt) { public void updateCmpn(CmpnInfoDto dto, String modUser, LocalDateTime modDt) {
validateCmpnDto(dto); validateCmpnDto(dto);
TCmpnEntity entity = findCmpn(dto.getCmpnId()); TCmpnEntity entity = findCmpn(dto.cmpnId());
entity.updateFromDto(dto, modUser, modDt); entity.updateFromDto(dto, modUser, modDt);
} }
@@ -74,7 +74,7 @@ public class CmpnService {
} }
private void validateCmpnDto(CmpnInfoDto dto) { private void validateCmpnDto(CmpnInfoDto dto) {
if (dto.getCmpnAlias() == null || dto.getCmpnAlias().isBlank()) { if (dto.cmpnAlias() == null || dto.cmpnAlias().isBlank()) {
throw BusinessException.badRequest("WRONG_CMPN_DATA", "회사 별칭이 비어 있습니다."); throw BusinessException.badRequest("WRONG_CMPN_DATA", "회사 별칭이 비어 있습니다.");
} }
} }

Some files were not shown because too many files have changed in this diff Show More