260716_01_ENH: 본 서버에서 기동 후 중간 테스트를 위한 커밋
This commit is contained in:
@@ -1,19 +1,30 @@
|
|||||||
package com.kri.contact.server.common.external.notihub;
|
package com.kri.contact.server.common.external.notihub;
|
||||||
|
|
||||||
|
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.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Builder
|
@Builder
|
||||||
|
@Schema(description = "NotiHubBulkSendCreateRequestDto")
|
||||||
public class NotiHubBulkSendCreateRequestDto {
|
public class NotiHubBulkSendCreateRequestDto {
|
||||||
|
|
||||||
|
@Schema(description = "reqstCmpn")
|
||||||
private String reqstCmpn;
|
private String reqstCmpn;
|
||||||
|
@Schema(description = "reqstUser")
|
||||||
private String reqstUser;
|
private String reqstUser;
|
||||||
|
@Schema(description = "reqstSvc")
|
||||||
private String reqstSvc;
|
private String reqstSvc;
|
||||||
|
@Schema(description = "prjctCd")
|
||||||
private String prjctCd;
|
private String prjctCd;
|
||||||
|
@Schema(description = "tmplatIdx")
|
||||||
private Long tmplatIdx;
|
private Long tmplatIdx;
|
||||||
|
@Schema(description = "resve")
|
||||||
private Boolean resve;
|
private Boolean resve;
|
||||||
|
@Schema(description = "sendDt")
|
||||||
private LocalDateTime sendDt;
|
private LocalDateTime sendDt;
|
||||||
|
@Schema(description = "trgtCnt")
|
||||||
private Integer trgtCnt;
|
private Integer trgtCnt;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.kri.contact.server.common.external.notihub;
|
package com.kri.contact.server.common.external.notihub;
|
||||||
|
|
||||||
|
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.Getter;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
@@ -9,10 +11,15 @@ import lombok.Setter;
|
|||||||
@Setter
|
@Setter
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
@Schema(description = "NotiHubBulkSendResponseDto")
|
||||||
public class NotiHubBulkSendResponseDto {
|
public class NotiHubBulkSendResponseDto {
|
||||||
|
|
||||||
|
@Schema(description = "bulkSendKey")
|
||||||
private String bulkSendKey;
|
private String bulkSendKey;
|
||||||
|
@Schema(description = "requestCount")
|
||||||
private Integer requestCount;
|
private Integer requestCount;
|
||||||
|
@Schema(description = "acceptCount")
|
||||||
private Integer acceptCount;
|
private Integer acceptCount;
|
||||||
|
@Schema(description = "failCount")
|
||||||
private Integer failCount;
|
private Integer failCount;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,24 @@
|
|||||||
package com.kri.contact.server.common.external.notihub;
|
package com.kri.contact.server.common.external.notihub;
|
||||||
|
|
||||||
|
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;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Builder
|
@Builder
|
||||||
|
@Schema(description = "NotiHubDestInfoDto")
|
||||||
public class NotiHubDestInfoDto {
|
public class NotiHubDestInfoDto {
|
||||||
|
|
||||||
|
@Schema(description = "sid")
|
||||||
private String sid;
|
private String sid;
|
||||||
|
@Schema(description = "destEml")
|
||||||
private String destEml;
|
private String destEml;
|
||||||
|
@Schema(description = "destTel")
|
||||||
private String destTel;
|
private String destTel;
|
||||||
|
@Schema(description = "destNm")
|
||||||
private String destNm;
|
private String destNm;
|
||||||
|
@Schema(description = "msgParam")
|
||||||
private Map<String, String> msgParam;
|
private Map<String, String> msgParam;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,24 @@
|
|||||||
package com.kri.contact.server.common.external.notihub;
|
package com.kri.contact.server.common.external.notihub;
|
||||||
|
|
||||||
|
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;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Builder
|
@Builder
|
||||||
|
@Schema(description = "NotiHubSendRequestBulkDto")
|
||||||
public class NotiHubSendRequestBulkDto {
|
public class NotiHubSendRequestBulkDto {
|
||||||
|
|
||||||
|
@Schema(description = "sendEml")
|
||||||
private String sendEml;
|
private String sendEml;
|
||||||
|
@Schema(description = "sendTel")
|
||||||
private String sendTel;
|
private String sendTel;
|
||||||
|
@Schema(description = "sendNm")
|
||||||
private String sendNm;
|
private String sendNm;
|
||||||
|
@Schema(description = "bulkSendKey")
|
||||||
private String bulkSendKey;
|
private String bulkSendKey;
|
||||||
|
@Schema(description = "destInfoList")
|
||||||
private List<NotiHubDestInfoDto> destInfoList;
|
private List<NotiHubDestInfoDto> destInfoList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,32 @@
|
|||||||
package com.kri.contact.server.common.external.notihub;
|
package com.kri.contact.server.common.external.notihub;
|
||||||
|
|
||||||
|
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.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Builder
|
@Builder
|
||||||
|
@Schema(description = "NotiHubSendRequestSingleDto")
|
||||||
public class NotiHubSendRequestSingleDto {
|
public class NotiHubSendRequestSingleDto {
|
||||||
|
|
||||||
|
@Schema(description = "sendEml")
|
||||||
private String sendEml;
|
private String sendEml;
|
||||||
|
@Schema(description = "sendTel")
|
||||||
private String sendTel;
|
private String sendTel;
|
||||||
|
@Schema(description = "sendNm")
|
||||||
private String sendNm;
|
private String sendNm;
|
||||||
|
@Schema(description = "destInfo")
|
||||||
private NotiHubDestInfoDto destInfo;
|
private NotiHubDestInfoDto destInfo;
|
||||||
|
@Schema(description = "tmplatIdx")
|
||||||
private Long tmplatIdx;
|
private Long tmplatIdx;
|
||||||
|
@Schema(description = "reqstSvc")
|
||||||
private String reqstSvc;
|
private String reqstSvc;
|
||||||
|
@Schema(description = "prjctCd")
|
||||||
private String prjctCd;
|
private String prjctCd;
|
||||||
|
@Schema(description = "resve")
|
||||||
private Boolean resve;
|
private Boolean resve;
|
||||||
|
@Schema(description = "sendDt")
|
||||||
private LocalDateTime sendDt;
|
private LocalDateTime sendDt;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.kri.contact.server.common.external.notihub;
|
package com.kri.contact.server.common.external.notihub;
|
||||||
|
|
||||||
|
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.Getter;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
@@ -9,11 +11,17 @@ import lombok.Setter;
|
|||||||
@Setter
|
@Setter
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
@Schema(description = "NotiHubTemplateDto")
|
||||||
public class NotiHubTemplateDto {
|
public class NotiHubTemplateDto {
|
||||||
|
|
||||||
|
@Schema(description = "tmplatIdx")
|
||||||
private Long tmplatIdx;
|
private Long tmplatIdx;
|
||||||
|
@Schema(description = "tmplatBody")
|
||||||
private String tmplatBody;
|
private String tmplatBody;
|
||||||
|
@Schema(description = "sendTel")
|
||||||
private String sendTel;
|
private String sendTel;
|
||||||
|
@Schema(description = "sendEml")
|
||||||
private String sendEml;
|
private String sendEml;
|
||||||
|
@Schema(description = "sendNm")
|
||||||
private String sendNm;
|
private String sendNm;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ import static com.kri.contact.server.common.util.ExcelResponseBuilder.buildExcel
|
|||||||
import com.kri.common.feature.datetime.DateTimeUtil;
|
import com.kri.common.feature.datetime.DateTimeUtil;
|
||||||
import com.kri.common.feature.web.BusinessException;
|
import com.kri.common.feature.web.BusinessException;
|
||||||
import com.kri.common.feature.web.RequestUserContext;
|
import com.kri.common.feature.web.RequestUserContext;
|
||||||
import com.kri.contact.server.common.enums.ResultCodeType;
|
|
||||||
import com.kri.contact.server.dto.list.ListEventHistDownloadRequestDto;
|
import com.kri.contact.server.dto.list.ListEventHistDownloadRequestDto;
|
||||||
import com.kri.contact.server.dto.list.ListEventHistFromSurveyDto;
|
import com.kri.contact.server.dto.list.ListEventHistFromSurveyDto;
|
||||||
import com.kri.contact.server.dto.list.ListEventHistInsertRequestDto;
|
import com.kri.contact.server.dto.list.ListEventHistInsertRequestDto;
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.kri.contact.server.dto.excel;
|
package com.kri.contact.server.dto.excel;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
||||||
import com.kri.common.feature.excel.ExcelColumn;
|
import com.kri.common.feature.excel.ExcelColumn;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
@@ -8,15 +10,19 @@ import lombok.experimental.SuperBuilder;
|
|||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
@Schema(description = "ExcelErrorDto")
|
||||||
public class ExcelErrorDto {
|
public class ExcelErrorDto {
|
||||||
|
|
||||||
@ExcelColumn(header = "행 번호", order = 0)
|
@ExcelColumn(header = "행 번호", order = 0)
|
||||||
|
@Schema(description = "rowNumber")
|
||||||
private int rowNumber;
|
private int rowNumber;
|
||||||
|
|
||||||
@ExcelColumn(header = "필드명", order = 1)
|
@ExcelColumn(header = "필드명", order = 1)
|
||||||
|
@Schema(description = "fieldName")
|
||||||
private String fieldName;
|
private String fieldName;
|
||||||
|
|
||||||
@ExcelColumn(header = "에러 메시지", order = 2)
|
@ExcelColumn(header = "에러 메시지", order = 2)
|
||||||
|
@Schema(description = "errorMessage")
|
||||||
private String errorMessage;
|
private String errorMessage;
|
||||||
|
|
||||||
public static ExcelErrorDto of(int rowNumber, String fieldName, String errorMessage) {
|
public static ExcelErrorDto of(int rowNumber, String fieldName, String errorMessage) {
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import lombok.Setter;
|
|||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@Builder
|
@Builder
|
||||||
|
@Schema(description = "ExcelUploadResultDto")
|
||||||
public class ExcelUploadResultDto {
|
public class ExcelUploadResultDto {
|
||||||
|
|
||||||
@Schema(description = "전체 읽은 행 수 (헤더 제외)")
|
@Schema(description = "전체 읽은 행 수 (헤더 제외)")
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.kri.contact.server.dto.excel;
|
package com.kri.contact.server.dto.excel;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
@@ -7,6 +9,7 @@ import lombok.experimental.SuperBuilder;
|
|||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
@Schema(description = "ListUploadErrorDto")
|
||||||
public class ListUploadErrorDto extends ExcelErrorDto {
|
public class ListUploadErrorDto extends ExcelErrorDto {
|
||||||
public static ListUploadErrorDto of(int rowNumber, String fieldName, String errorMessage) {
|
public static ListUploadErrorDto of(int rowNumber, String fieldName, String errorMessage) {
|
||||||
return ListUploadErrorDto.builder()
|
return ListUploadErrorDto.builder()
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import lombok.Setter;
|
|||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@Schema(description = "UserUploadDto")
|
||||||
public class UserUploadDto {
|
public class UserUploadDto {
|
||||||
|
|
||||||
@ExcelColumn(header = "사용자 ID", order = 0, width = 11)
|
@ExcelColumn(header = "사용자 ID", order = 0, width = 11)
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.kri.contact.server.dto.excel;
|
package com.kri.contact.server.dto.excel;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
@@ -7,6 +9,7 @@ import lombok.experimental.SuperBuilder;
|
|||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
@Schema(description = "UserUploadErrorDto")
|
||||||
public class UserUploadErrorDto extends ExcelErrorDto {
|
public class UserUploadErrorDto extends ExcelErrorDto {
|
||||||
|
|
||||||
public static UserUploadErrorDto of(int rowNumber, String fieldName, String errorMessage) {
|
public static UserUploadErrorDto of(int rowNumber, String fieldName, String errorMessage) {
|
||||||
|
|||||||
@@ -1,32 +1,54 @@
|
|||||||
package com.kri.contact.server.dto.list;
|
package com.kri.contact.server.dto.list;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
||||||
import com.kri.contact.server.persistence.entity.TListCallHistEntity;
|
import com.kri.contact.server.persistence.entity.TListCallHistEntity;
|
||||||
import java.time.Instant;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Builder
|
@Builder
|
||||||
|
@Schema(description = "ListCallHistDto")
|
||||||
public class ListCallHistDto {
|
public class ListCallHistDto {
|
||||||
|
|
||||||
|
@Schema(description = "listCallHistIdx")
|
||||||
private Long listCallHistIdx;
|
private Long listCallHistIdx;
|
||||||
|
@Schema(description = "prjctIdx")
|
||||||
private Long prjctIdx;
|
private Long prjctIdx;
|
||||||
|
@Schema(description = "sid")
|
||||||
private Integer sid;
|
private Integer sid;
|
||||||
|
@Schema(description = "listHderId")
|
||||||
private Integer listHderId;
|
private Integer listHderId;
|
||||||
|
@Schema(description = "destNum")
|
||||||
private String destNum;
|
private String destNum;
|
||||||
|
@Schema(description = "agentNum")
|
||||||
private String agentNum;
|
private String agentNum;
|
||||||
|
@Schema(description = "aniNum")
|
||||||
private String aniNum;
|
private String aniNum;
|
||||||
|
@Schema(description = "agentSessionId")
|
||||||
private String agentSessionId;
|
private String agentSessionId;
|
||||||
|
@Schema(description = "destSessionId")
|
||||||
private String destSessionId;
|
private String destSessionId;
|
||||||
|
@Schema(description = "callTy")
|
||||||
private String callTy;
|
private String callTy;
|
||||||
|
@Schema(description = "startDt")
|
||||||
private LocalDateTime startDt;
|
private LocalDateTime startDt;
|
||||||
|
@Schema(description = "endDt")
|
||||||
|
private LocalDateTime endDt;
|
||||||
|
@Schema(description = "totalTime")
|
||||||
private Integer totalTime;
|
private Integer totalTime;
|
||||||
|
@Schema(description = "talkTime")
|
||||||
private Integer talkTime;
|
private Integer talkTime;
|
||||||
|
@Schema(description = "mediaServerId")
|
||||||
private Integer mediaServerId;
|
private Integer mediaServerId;
|
||||||
|
@Schema(description = "mediaServerName")
|
||||||
private String mediaServerName;
|
private String mediaServerName;
|
||||||
|
@Schema(description = "recordFileName")
|
||||||
private String recordFileName;
|
private String recordFileName;
|
||||||
|
@Schema(description = "regUser")
|
||||||
private String regUser;
|
private String regUser;
|
||||||
|
@Schema(description = "regDt")
|
||||||
private LocalDateTime regDt;
|
private LocalDateTime regDt;
|
||||||
|
|
||||||
public static ListCallHistDto from(TListCallHistEntity entity) {
|
public static ListCallHistDto from(TListCallHistEntity entity) {
|
||||||
@@ -42,6 +64,7 @@ public class ListCallHistDto {
|
|||||||
.destSessionId(entity.getDestSessionId())
|
.destSessionId(entity.getDestSessionId())
|
||||||
.callTy(entity.getCallTy())
|
.callTy(entity.getCallTy())
|
||||||
.startDt(entity.getStartDt())
|
.startDt(entity.getStartDt())
|
||||||
|
.endDt(entity.getEndDt())
|
||||||
.totalTime(entity.getTotalTime())
|
.totalTime(entity.getTotalTime())
|
||||||
.talkTime(entity.getTalkTime())
|
.talkTime(entity.getTalkTime())
|
||||||
.mediaServerId(entity.getMediaServerId())
|
.mediaServerId(entity.getMediaServerId())
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.kri.contact.server.dto.list;
|
package com.kri.contact.server.dto.list;
|
||||||
|
|
||||||
|
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 jakarta.validation.constraints.Size;
|
import jakarta.validation.constraints.Size;
|
||||||
@@ -12,52 +14,65 @@ import lombok.Setter;
|
|||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@Schema(description = "ListCallHistRequestDto")
|
||||||
public class ListCallHistRequestDto {
|
public class ListCallHistRequestDto {
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
@Schema(description = "listHderId")
|
||||||
private Integer listHderId;
|
private Integer listHderId;
|
||||||
|
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@Size(max = 64)
|
@Size(max = 64)
|
||||||
|
@Schema(description = "destNum")
|
||||||
private String destNum;
|
private String destNum;
|
||||||
|
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@Size(max = 64)
|
@Size(max = 64)
|
||||||
|
@Schema(description = "agentNum")
|
||||||
private String agentNum;
|
private String agentNum;
|
||||||
|
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@Size(max = 64)
|
@Size(max = 64)
|
||||||
|
@Schema(description = "aniNum")
|
||||||
private String aniNum;
|
private String aniNum;
|
||||||
|
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@Size(max = 64)
|
@Size(max = 64)
|
||||||
|
@Schema(description = "agentSessionId")
|
||||||
private String agentSessionId;
|
private String agentSessionId;
|
||||||
|
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@Size(max = 64)
|
@Size(max = 64)
|
||||||
|
@Schema(description = "destSessionId")
|
||||||
private String destSessionId;
|
private String destSessionId;
|
||||||
|
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@Size(max = 64)
|
@Size(max = 64)
|
||||||
|
@Schema(description = "callTy")
|
||||||
private String callTy;
|
private String callTy;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
@Schema(description = "startDt")
|
||||||
private LocalDateTime startDt;
|
private LocalDateTime startDt;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
@Schema(description = "totalTime")
|
||||||
private Integer totalTime;
|
private Integer totalTime;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
@Schema(description = "talkTime")
|
||||||
private Integer talkTime;
|
private Integer talkTime;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
@Schema(description = "mediaServerId")
|
||||||
private Integer mediaServerId;
|
private Integer mediaServerId;
|
||||||
|
|
||||||
@NotBlank
|
@NotBlank
|
||||||
@Size(max = 64)
|
@Size(max = 64)
|
||||||
|
@Schema(description = "mediaServerName")
|
||||||
private String mediaServerName;
|
private String mediaServerName;
|
||||||
|
|
||||||
@NotBlank
|
|
||||||
@Size(max = 256)
|
@Size(max = 256)
|
||||||
|
@Schema(description = "recordFileName")
|
||||||
private String recordFileName;
|
private String recordFileName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,9 @@ public class ListEventHistInsertRequestDto {
|
|||||||
@Schema(description = "결과 코드")
|
@Schema(description = "결과 코드")
|
||||||
private Integer resultCd;
|
private Integer resultCd;
|
||||||
|
|
||||||
|
@Schema(description = "전화 이력 id")
|
||||||
|
private Long listCallHistIdx;
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
@Schema(description = "메타 데이터")
|
@Schema(description = "메타 데이터")
|
||||||
private ListEventHistInternalMetaDto meta;
|
private ListEventHistInternalMetaDto meta;
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import lombok.Setter;
|
|||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@Schema(description = "ListEventHistInternalMetaDto")
|
||||||
public class ListEventHistInternalMetaDto {
|
public class ListEventHistInternalMetaDto {
|
||||||
|
|
||||||
@Schema(description = "GPS 위도")
|
@Schema(description = "GPS 위도")
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import lombok.Setter;
|
|||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@Schema(description = "ListEventHistSurveyMetaDto")
|
||||||
public class ListEventHistSurveyMetaDto {
|
public class ListEventHistSurveyMetaDto {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Schema(description = "진입 유형")
|
@Schema(description = "진입 유형")
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.kri.contact.server.dto.list;
|
package com.kri.contact.server.dto.list;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
||||||
import com.kri.contact.server.persistence.entity.TListEventHistEntity;
|
import com.kri.contact.server.persistence.entity.TListEventHistEntity;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
@@ -7,17 +9,28 @@ import lombok.Getter;
|
|||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Builder
|
@Builder
|
||||||
|
@Schema(description = "ListEventHistoryDto")
|
||||||
public class ListEventHistoryDto {
|
public class ListEventHistoryDto {
|
||||||
|
|
||||||
|
@Schema(description = "listEventHistIdx")
|
||||||
private Long listEventHistIdx;
|
private Long listEventHistIdx;
|
||||||
|
@Schema(description = "eventTy")
|
||||||
private Short eventTy;
|
private Short eventTy;
|
||||||
|
@Schema(description = "prjctIdx")
|
||||||
private Long prjctIdx;
|
private Long prjctIdx;
|
||||||
|
@Schema(description = "sid")
|
||||||
private Integer sid;
|
private Integer sid;
|
||||||
|
@Schema(description = "resultCd")
|
||||||
private Integer resultCd;
|
private Integer resultCd;
|
||||||
|
@Schema(description = "metaData")
|
||||||
private String metaData;
|
private String metaData;
|
||||||
|
@Schema(description = "listCallHistIdx")
|
||||||
private Long listCallHistIdx;
|
private Long listCallHistIdx;
|
||||||
|
@Schema(description = "memo")
|
||||||
private String memo;
|
private String memo;
|
||||||
|
@Schema(description = "regUser")
|
||||||
private String regUser;
|
private String regUser;
|
||||||
|
@Schema(description = "regDt")
|
||||||
private LocalDateTime regDt;
|
private LocalDateTime regDt;
|
||||||
|
|
||||||
public static ListEventHistoryDto from(TListEventHistEntity entity) {
|
public static ListEventHistoryDto from(TListEventHistEntity entity) {
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import lombok.experimental.SuperBuilder;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@Schema(description = "리스트 헤더 (필터 목록 포함)")
|
@Schema(description = "리스트 헤더 (필터 목록 포함)")
|
||||||
public class ListHeaderWithFilterContentDto extends ListHeaderDto {
|
public class ListHeaderWithFilterContentDto extends ListHeaderDto {
|
||||||
|
@Schema(description = "filterContents")
|
||||||
private List<String> filterContents;
|
private List<String> filterContents;
|
||||||
|
|
||||||
public static ListHeaderWithFilterContentDto fromEntity(
|
public static ListHeaderWithFilterContentDto fromEntity(
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.kri.contact.server.dto.list;
|
package com.kri.contact.server.dto.list;
|
||||||
|
|
||||||
|
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;
|
||||||
@@ -7,15 +9,24 @@ import lombok.Getter;
|
|||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Builder
|
@Builder
|
||||||
|
@Schema(description = "ListUpdateHistoryDto")
|
||||||
public class ListUpdateHistoryDto {
|
public class ListUpdateHistoryDto {
|
||||||
|
|
||||||
|
@Schema(description = "listUpdateHistIdx")
|
||||||
private Long listUpdateHistIdx;
|
private Long listUpdateHistIdx;
|
||||||
|
@Schema(description = "prjctIdx")
|
||||||
private Long prjctIdx;
|
private Long prjctIdx;
|
||||||
|
@Schema(description = "sid")
|
||||||
private Integer sid;
|
private Integer sid;
|
||||||
|
@Schema(description = "listHderId")
|
||||||
private Integer listHderId;
|
private Integer listHderId;
|
||||||
|
@Schema(description = "beforeVal")
|
||||||
private String beforeVal;
|
private String beforeVal;
|
||||||
|
@Schema(description = "afterVal")
|
||||||
private String afterVal;
|
private String afterVal;
|
||||||
|
@Schema(description = "regUser")
|
||||||
private String regUser;
|
private String regUser;
|
||||||
|
@Schema(description = "regDt")
|
||||||
private LocalDateTime regDt;
|
private LocalDateTime regDt;
|
||||||
|
|
||||||
public static ListUpdateHistoryDto from(TListUpdateHistEntity entity) {
|
public static ListUpdateHistoryDto from(TListUpdateHistEntity entity) {
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.kri.contact.server.dto.message;
|
package com.kri.contact.server.dto.message;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
@@ -7,13 +9,20 @@ import lombok.Getter;
|
|||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Builder
|
@Builder
|
||||||
|
@Schema(description = "MessageBulkSendResponseDto")
|
||||||
public class MessageBulkSendResponseDto {
|
public class MessageBulkSendResponseDto {
|
||||||
|
|
||||||
|
@Schema(description = "bulkSendKey")
|
||||||
private String bulkSendKey;
|
private String bulkSendKey;
|
||||||
|
@Schema(description = "targetCount")
|
||||||
private int targetCount;
|
private int targetCount;
|
||||||
|
@Schema(description = "requestCount")
|
||||||
private int requestCount;
|
private int requestCount;
|
||||||
|
@Schema(description = "acceptCount")
|
||||||
private int acceptCount;
|
private int acceptCount;
|
||||||
|
@Schema(description = "failCount")
|
||||||
private int failCount;
|
private int failCount;
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
|
@Schema(description = "failedChunks")
|
||||||
private List<MessageFailedChunkDto> failedChunks = new ArrayList<>();
|
private List<MessageFailedChunkDto> failedChunks = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,23 @@
|
|||||||
package com.kri.contact.server.dto.message;
|
package com.kri.contact.server.dto.message;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Builder
|
@Builder
|
||||||
|
@Schema(description = "MessageFailedChunkDto")
|
||||||
public class MessageFailedChunkDto {
|
public class MessageFailedChunkDto {
|
||||||
|
|
||||||
|
@Schema(description = "chunkIndex")
|
||||||
private int chunkIndex;
|
private int chunkIndex;
|
||||||
|
@Schema(description = "from")
|
||||||
private int from;
|
private int from;
|
||||||
|
@Schema(description = "to")
|
||||||
private int to;
|
private int to;
|
||||||
|
@Schema(description = "targetCount")
|
||||||
private int targetCount;
|
private int targetCount;
|
||||||
|
@Schema(description = "errorMessage")
|
||||||
private String errorMessage;
|
private String errorMessage;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,18 +18,27 @@ import lombok.Setter;
|
|||||||
public class MessageSendBulkRequestDto {
|
public class MessageSendBulkRequestDto {
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
@Schema(description = "템플릿 고유 번호", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
private Long tmplatIdx;
|
private Long tmplatIdx;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
@Schema(description = "예약 발송 여부", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
private Boolean resve;
|
private Boolean resve;
|
||||||
|
|
||||||
|
@Schema(description = "예약 발송 일시")
|
||||||
private LocalDateTime sendDt;
|
private LocalDateTime sendDt;
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
@Schema(description = "리스트 필터")
|
||||||
private ListFilterDto listFilter;
|
private ListFilterDto listFilter;
|
||||||
|
|
||||||
@NotEmpty
|
@NotEmpty
|
||||||
|
@Schema(description = "수신처로 사용할 리스트 헤더 ID 목록", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
private List<Integer> destHeaderIds;
|
private List<Integer> destHeaderIds;
|
||||||
|
|
||||||
|
@Schema(description = "수신자 이름으로 사용할 리스트 헤더 ID")
|
||||||
private Integer destNameHeaderId;
|
private Integer destNameHeaderId;
|
||||||
|
|
||||||
|
@Schema(description = "수신처 중복 제거 여부", defaultValue = "false")
|
||||||
|
private Boolean dedupe = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,18 +16,24 @@ import lombok.Setter;
|
|||||||
public class MessageSendSingleRequestDto {
|
public class MessageSendSingleRequestDto {
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
@Schema(description = "tmplatIdx")
|
||||||
private Long tmplatIdx;
|
private Long tmplatIdx;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
@Schema(description = "resve")
|
||||||
private Boolean resve;
|
private Boolean resve;
|
||||||
|
|
||||||
|
@Schema(description = "sendDt")
|
||||||
private LocalDateTime sendDt;
|
private LocalDateTime sendDt;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
@Schema(description = "sid")
|
||||||
private Integer sid;
|
private Integer sid;
|
||||||
|
|
||||||
@NotEmpty
|
@NotEmpty
|
||||||
|
@Schema(description = "destHeaderIds")
|
||||||
private List<Integer> destHeaderIds;
|
private List<Integer> destHeaderIds;
|
||||||
|
|
||||||
|
@Schema(description = "destNameHeaderId")
|
||||||
private Integer destNameHeaderId;
|
private Integer destNameHeaderId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,14 +11,19 @@ import lombok.Getter;
|
|||||||
@Schema(description = "날짜별 진행 현황")
|
@Schema(description = "날짜별 진행 현황")
|
||||||
public class ProgressDateResponseDto {
|
public class ProgressDateResponseDto {
|
||||||
|
|
||||||
|
@Schema(description = "contactDate")
|
||||||
private String contactDate;
|
private String contactDate;
|
||||||
|
|
||||||
|
@Schema(description = "startTime")
|
||||||
private String startTime;
|
private String startTime;
|
||||||
|
|
||||||
|
@Schema(description = "endTime")
|
||||||
private String endTime;
|
private String endTime;
|
||||||
|
|
||||||
|
@Schema(description = "totalCount")
|
||||||
private long totalCount;
|
private long totalCount;
|
||||||
|
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
|
@Schema(description = "resultCodeCountMap")
|
||||||
private Map<Integer, Long> resultCodeCountMap = new LinkedHashMap<>();
|
private Map<Integer, Long> resultCodeCountMap = new LinkedHashMap<>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,10 +11,13 @@ import lombok.Getter;
|
|||||||
@Schema(description = "사용자별 진행 현황")
|
@Schema(description = "사용자별 진행 현황")
|
||||||
public class ProgressUserResponseDto {
|
public class ProgressUserResponseDto {
|
||||||
|
|
||||||
|
@Schema(description = "userId")
|
||||||
private String userId;
|
private String userId;
|
||||||
|
|
||||||
|
@Schema(description = "totalCount")
|
||||||
private long totalCount;
|
private long totalCount;
|
||||||
|
|
||||||
@Builder.Default
|
@Builder.Default
|
||||||
|
@Schema(description = "resultCodeCountMap")
|
||||||
private Map<Integer, Long> resultCodeCountMap = new LinkedHashMap<>();
|
private Map<Integer, Long> resultCodeCountMap = new LinkedHashMap<>();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ public class ResultCodeDto {
|
|||||||
@Schema(description = "결과 코드 라벨")
|
@Schema(description = "결과 코드 라벨")
|
||||||
private String resultCdLbl;
|
private String resultCdLbl;
|
||||||
|
|
||||||
|
@Schema(description = "isDefault")
|
||||||
private Boolean isDefault;
|
private Boolean isDefault;
|
||||||
|
|
||||||
public static ResultCodeDto from(TResultCodeEntity entity) {
|
public static ResultCodeDto from(TResultCodeEntity entity) {
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.kri.contact.server.dto.reserve;
|
package com.kri.contact.server.dto.reserve;
|
||||||
|
|
||||||
|
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;
|
||||||
@@ -7,16 +9,26 @@ import lombok.Getter;
|
|||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Builder
|
@Builder
|
||||||
|
@Schema(description = "ListReserveDto")
|
||||||
public class ListReserveDto {
|
public class ListReserveDto {
|
||||||
|
|
||||||
|
@Schema(description = "listResveIdx")
|
||||||
private Long listResveIdx;
|
private Long listResveIdx;
|
||||||
|
@Schema(description = "prjctIdx")
|
||||||
private Long prjctIdx;
|
private Long prjctIdx;
|
||||||
|
@Schema(description = "sid")
|
||||||
private Integer sid;
|
private Integer sid;
|
||||||
|
@Schema(description = "memo")
|
||||||
private String memo;
|
private String memo;
|
||||||
|
@Schema(description = "cnfirm")
|
||||||
private Boolean cnfirm;
|
private Boolean cnfirm;
|
||||||
|
@Schema(description = "resveDt")
|
||||||
private LocalDateTime resveDt;
|
private LocalDateTime resveDt;
|
||||||
|
@Schema(description = "resveUser")
|
||||||
private String resveUser;
|
private String resveUser;
|
||||||
|
@Schema(description = "regUser")
|
||||||
private String regUser;
|
private String regUser;
|
||||||
|
@Schema(description = "regDt")
|
||||||
private LocalDateTime regDt;
|
private LocalDateTime regDt;
|
||||||
|
|
||||||
public static ListReserveDto from(TListResveEntity entity) {
|
public static ListReserveDto from(TListResveEntity entity) {
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.kri.contact.server.dto.reserve;
|
package com.kri.contact.server.dto.reserve;
|
||||||
|
|
||||||
|
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;
|
||||||
@@ -10,17 +12,22 @@ import lombok.Setter;
|
|||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@Schema(description = "ListReserveRequestDto")
|
||||||
public class ListReserveRequestDto {
|
public class ListReserveRequestDto {
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
@Schema(description = "prjctIdx")
|
||||||
private Long prjctIdx;
|
private Long prjctIdx;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
@Schema(description = "sid")
|
||||||
private Integer sid;
|
private Integer sid;
|
||||||
|
|
||||||
@NotBlank
|
@NotBlank
|
||||||
|
@Schema(description = "userId")
|
||||||
private String userId;
|
private String userId;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
@Schema(description = "resveDt")
|
||||||
private LocalDateTime resveDt;
|
private LocalDateTime resveDt;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.kri.contact.server.dto.systemlog;
|
package com.kri.contact.server.dto.systemlog;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@@ -12,6 +14,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
@Schema(description = "UploadContentDto")
|
||||||
public class UploadContentDto {
|
public class UploadContentDto {
|
||||||
String fileName;
|
String fileName;
|
||||||
String fileType;
|
String fileType;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.kri.contact.server.persistence.entity;
|
package com.kri.contact.server.persistence.entity;
|
||||||
|
|
||||||
|
import com.kri.contact.server.dto.list.ListCallHistRequestDto;
|
||||||
import jakarta.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
import jakarta.persistence.Entity;
|
import jakarta.persistence.Entity;
|
||||||
import jakarta.persistence.GeneratedValue;
|
import jakarta.persistence.GeneratedValue;
|
||||||
@@ -8,21 +9,26 @@ import jakarta.persistence.Id;
|
|||||||
import jakarta.persistence.Table;
|
import jakarta.persistence.Table;
|
||||||
import jakarta.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
import jakarta.validation.constraints.Size;
|
import jakarta.validation.constraints.Size;
|
||||||
import java.time.Instant;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import org.hibernate.annotations.ColumnDefault;
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
|
|
||||||
|
@Builder
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@Entity
|
@Entity
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
@Table(name = "t_list_call_hist")
|
@Table(name = "t_list_call_hist")
|
||||||
public class TListCallHistEntity {
|
public class TListCallHistEntity {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
@Column(name = "list_call_hist_idx", nullable = false, insertable = false)
|
@Column(name = "list_call_hist_idx", nullable = false, insertable = false, updatable = false)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED not null")
|
@Column(name = "prjct_idx", columnDefinition = "int UNSIGNED not null")
|
||||||
@@ -53,12 +59,12 @@ public class TListCallHistEntity {
|
|||||||
|
|
||||||
@Size(max = 64)
|
@Size(max = 64)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Column(name = "agent_session_id", nullable = false, length = 64)
|
@Column(name = "agent_session_id", nullable = false, length = 64, updatable = false)
|
||||||
private String agentSessionId;
|
private String agentSessionId;
|
||||||
|
|
||||||
@Size(max = 64)
|
@Size(max = 64)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Column(name = "dest_session_id", nullable = false, length = 64)
|
@Column(name = "dest_session_id", nullable = false, length = 64, updatable = false)
|
||||||
private String destSessionId;
|
private String destSessionId;
|
||||||
|
|
||||||
@Size(max = 64)
|
@Size(max = 64)
|
||||||
@@ -70,6 +76,9 @@ public class TListCallHistEntity {
|
|||||||
@Column(name = "start_dt", nullable = false)
|
@Column(name = "start_dt", nullable = false)
|
||||||
private LocalDateTime startDt;
|
private LocalDateTime startDt;
|
||||||
|
|
||||||
|
@Column(name = "end_dt")
|
||||||
|
private LocalDateTime endDt;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Column(name = "total_time", nullable = false)
|
@Column(name = "total_time", nullable = false)
|
||||||
private Integer totalTime;
|
private Integer totalTime;
|
||||||
@@ -88,19 +97,55 @@ public class TListCallHistEntity {
|
|||||||
private String mediaServerName;
|
private String mediaServerName;
|
||||||
|
|
||||||
@Size(max = 256)
|
@Size(max = 256)
|
||||||
@NotNull
|
@Column(name = "record_file_name", length = 256)
|
||||||
@Column(name = "record_file_name", nullable = false, length = 256)
|
|
||||||
private String recordFileName;
|
private String recordFileName;
|
||||||
|
|
||||||
@Size(max = 32)
|
@Size(max = 32)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Column(name = "reg_user", nullable = false, length = 32)
|
@Column(name = "reg_user", nullable = false, length = 32, updatable = false)
|
||||||
private String regUser;
|
private String regUser;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||||
@Column(name = "reg_dt", nullable = false)
|
@Column(name = "reg_dt", nullable = false, updatable = false)
|
||||||
private LocalDateTime regDt;
|
private LocalDateTime regDt;
|
||||||
|
|
||||||
|
public static TListCallHistEntity from(
|
||||||
|
Long prjctIdx,
|
||||||
|
Integer sid,
|
||||||
|
ListCallHistRequestDto request,
|
||||||
|
String regUser,
|
||||||
|
LocalDateTime regDt
|
||||||
|
) {
|
||||||
|
return TListCallHistEntity.builder()
|
||||||
|
.prjctIdx(prjctIdx)
|
||||||
|
.sid(sid)
|
||||||
|
.listHderId(request.getListHderId())
|
||||||
|
.destNum(request.getDestNum())
|
||||||
|
.agentNum(request.getAgentNum())
|
||||||
|
.aniNum(request.getAniNum())
|
||||||
|
.agentSessionId(request.getAgentSessionId())
|
||||||
|
.destSessionId(request.getDestSessionId())
|
||||||
|
.callTy(request.getCallTy())
|
||||||
|
.startDt(request.getStartDt())
|
||||||
|
.endDt(regDt)
|
||||||
|
.totalTime(request.getTotalTime())
|
||||||
|
.talkTime(request.getTalkTime())
|
||||||
|
.mediaServerId(request.getMediaServerId())
|
||||||
|
.mediaServerName(request.getMediaServerName())
|
||||||
|
.recordFileName(request.getRecordFileName())
|
||||||
|
.regUser(regUser)
|
||||||
|
.regDt(regDt)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateCallResult(ListCallHistRequestDto request, LocalDateTime endDt) {
|
||||||
|
this.endDt = endDt;
|
||||||
|
this.totalTime = request.getTotalTime();
|
||||||
|
this.talkTime = request.getTalkTime();
|
||||||
|
this.mediaServerId = request.getMediaServerId();
|
||||||
|
this.mediaServerName = request.getMediaServerName();
|
||||||
|
this.recordFileName = request.getRecordFileName();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -101,6 +101,7 @@ public class TListEventHistEntity {
|
|||||||
.prjctIdx(request.getPrjctIdx())
|
.prjctIdx(request.getPrjctIdx())
|
||||||
.sid(request.getSid())
|
.sid(request.getSid())
|
||||||
.resultCd(request.getResultCd())
|
.resultCd(request.getResultCd())
|
||||||
|
.listCallHistIdx(request.getListCallHistIdx())
|
||||||
.metaData(metaData)
|
.metaData(metaData)
|
||||||
.memo(request.getMemo())
|
.memo(request.getMemo())
|
||||||
.regUser(regUser)
|
.regUser(regUser)
|
||||||
|
|||||||
@@ -13,23 +13,30 @@ import org.springframework.stereotype.Component;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class ListResetJdbcSupport {
|
public class ListResetJdbcSupport {
|
||||||
|
|
||||||
|
private static final String TEMP_SID_TABLE = "tmp_list_reset_sid";
|
||||||
|
|
||||||
private final EntityManager entityManager;
|
private final EntityManager entityManager;
|
||||||
|
|
||||||
public DeleteCounts deleteHistories(Long prjctIdx, Collection<Integer> sids, int chunkSize) {
|
public DeleteCounts deleteHistories(Long prjctIdx, Collection<Integer> sids, int chunkSize) {
|
||||||
DeleteCounts total = DeleteCounts.empty();
|
if (sids == null || sids.isEmpty()) {
|
||||||
for (List<Integer> sub : chunkSids(sids, chunkSize)) {
|
return DeleteCounts.empty();
|
||||||
int eventHistCount = deleteBySids("t_list_event_hist", prjctIdx, sub);
|
}
|
||||||
int eventLatestCount = deleteBySids("t_list_event_latest", prjctIdx, sub);
|
|
||||||
int updateHistCount = deleteBySids("t_list_update_hist", prjctIdx, sub);
|
prepareTempSids(sids, chunkSize);
|
||||||
int callHistCount = deleteBySids("t_list_call_hist", prjctIdx, sub);
|
try {
|
||||||
total = total.plus(DeleteCounts.histories(
|
int eventHistCount = deleteByTempSids("t_list_event_hist", prjctIdx);
|
||||||
|
int eventLatestCount = deleteByTempSids("t_list_event_latest", prjctIdx);
|
||||||
|
int updateHistCount = deleteByTempSids("t_list_update_hist", prjctIdx);
|
||||||
|
int callHistCount = deleteByTempSids("t_list_call_hist", prjctIdx);
|
||||||
|
return DeleteCounts.histories(
|
||||||
eventHistCount,
|
eventHistCount,
|
||||||
eventLatestCount,
|
eventLatestCount,
|
||||||
updateHistCount,
|
updateHistCount,
|
||||||
callHistCount
|
callHistCount
|
||||||
));
|
);
|
||||||
|
} finally {
|
||||||
|
dropTempSids();
|
||||||
}
|
}
|
||||||
return total;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public DeleteCounts deleteListData(
|
public DeleteCounts deleteListData(
|
||||||
@@ -39,16 +46,20 @@ public class ListResetJdbcSupport {
|
|||||||
boolean includeResve,
|
boolean includeResve,
|
||||||
int chunkSize
|
int chunkSize
|
||||||
) {
|
) {
|
||||||
DeleteCounts total = DeleteCounts.empty();
|
if (sids == null || sids.isEmpty()) {
|
||||||
for (List<Integer> sub : chunkSids(sids, chunkSize)) {
|
return DeleteCounts.empty();
|
||||||
int fileCount = includeFile ? deleteBySids("t_list_item_file", prjctIdx, sub) : 0;
|
}
|
||||||
int itemCount = deleteBySids("t_list_item", prjctIdx, sub);
|
|
||||||
int assignUserCount = deleteBySids("t_list_assign_user", prjctIdx, sub);
|
|
||||||
int assignCmpnCount = deleteBySids("t_list_assign_cmpn", prjctIdx, sub);
|
|
||||||
int resveCount = includeResve ? deleteBySids("t_list_resve", prjctIdx, sub) : 0;
|
|
||||||
int listCount = deleteBySids("t_list", prjctIdx, sub);
|
|
||||||
|
|
||||||
total = total.plus(new DeleteCounts(
|
prepareTempSids(sids, chunkSize);
|
||||||
|
try {
|
||||||
|
int fileCount = includeFile ? deleteByTempSids("t_list_item_file", prjctIdx) : 0;
|
||||||
|
int itemCount = deleteByTempSids("t_list_item", prjctIdx);
|
||||||
|
int assignUserCount = deleteByTempSids("t_list_assign_user", prjctIdx);
|
||||||
|
int assignCmpnCount = deleteByTempSids("t_list_assign_cmpn", prjctIdx);
|
||||||
|
int resveCount = includeResve ? deleteByTempSids("t_list_resve", prjctIdx) : 0;
|
||||||
|
int listCount = deleteByTempSids("t_list", prjctIdx);
|
||||||
|
|
||||||
|
return new DeleteCounts(
|
||||||
fileCount,
|
fileCount,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
@@ -59,26 +70,52 @@ public class ListResetJdbcSupport {
|
|||||||
assignUserCount,
|
assignUserCount,
|
||||||
assignCmpnCount,
|
assignCmpnCount,
|
||||||
resveCount
|
resveCount
|
||||||
));
|
);
|
||||||
|
} finally {
|
||||||
|
dropTempSids();
|
||||||
}
|
}
|
||||||
return total;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int deleteBySids(String tableName, Long prjctIdx, List<Integer> sids) {
|
private void prepareTempSids(Collection<Integer> sids, int chunkSize) {
|
||||||
|
dropTempSids();
|
||||||
|
entityManager.createNativeQuery(
|
||||||
|
"create temporary table " + TEMP_SID_TABLE + " (sid int not null primary key) engine=memory"
|
||||||
|
).executeUpdate();
|
||||||
|
|
||||||
|
List<Integer> sidList = new ArrayList<>(sids);
|
||||||
|
for (List<Integer> sub : chunkSids(sidList, chunkSize)) {
|
||||||
|
insertTempSids(sub);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void insertTempSids(List<Integer> sids) {
|
||||||
if (sids.isEmpty()) {
|
if (sids.isEmpty()) {
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Query query = entityManager.createNativeQuery(
|
Query query = entityManager.createNativeQuery(
|
||||||
"delete from " + tableName + " where prjct_idx = :prjctIdx and sid in (" + createInSql(sids) + ")"
|
"insert into " + TEMP_SID_TABLE + " (sid) values " + createValuesSql(sids)
|
||||||
);
|
);
|
||||||
query.setParameter("prjctIdx", prjctIdx);
|
|
||||||
for (int i = 0; i < sids.size(); i++) {
|
for (int i = 0; i < sids.size(); i++) {
|
||||||
query.setParameter("sid" + i, sids.get(i));
|
query.setParameter("sid" + i, sids.get(i));
|
||||||
}
|
}
|
||||||
|
query.executeUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
private int deleteByTempSids(String tableName, Long prjctIdx) {
|
||||||
|
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"
|
||||||
|
);
|
||||||
|
query.setParameter("prjctIdx", prjctIdx);
|
||||||
return query.executeUpdate();
|
return query.executeUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void dropTempSids() {
|
||||||
|
entityManager.createNativeQuery("drop temporary table if exists " + TEMP_SID_TABLE).executeUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
private List<List<Integer>> chunkSids(Collection<Integer> sids, int chunkSize) {
|
private List<List<Integer>> chunkSids(Collection<Integer> sids, int chunkSize) {
|
||||||
if (sids == null || sids.isEmpty()) {
|
if (sids == null || sids.isEmpty()) {
|
||||||
return List.of();
|
return List.of();
|
||||||
@@ -95,10 +132,10 @@ public class ListResetJdbcSupport {
|
|||||||
return chunks;
|
return chunks;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String createInSql(List<Integer> sids) {
|
private String createValuesSql(List<Integer> sids) {
|
||||||
StringJoiner joiner = new StringJoiner(",");
|
StringJoiner joiner = new StringJoiner(",");
|
||||||
for (int i = 0; i < sids.size(); i++) {
|
for (int i = 0; i < sids.size(); i++) {
|
||||||
joiner.add(":sid" + i);
|
joiner.add("(:sid" + i + ")");
|
||||||
}
|
}
|
||||||
return joiner.toString();
|
return joiner.toString();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
package com.kri.contact.server.persistence.repository;
|
package com.kri.contact.server.persistence.repository;
|
||||||
|
|
||||||
import com.kri.contact.server.persistence.entity.TListCallHistEntity;
|
import com.kri.contact.server.persistence.entity.TListCallHistEntity;
|
||||||
|
import java.util.Optional;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
public interface ListCallHistRepository extends JpaRepository<TListCallHistEntity, Long> {
|
public interface ListCallHistRepository extends JpaRepository<TListCallHistEntity, Long> {
|
||||||
|
|
||||||
|
Optional<TListCallHistEntity> findFirstByAgentSessionId(String agentSessionId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,24 +39,13 @@ public class ListCallHistService {
|
|||||||
.with("listHderId", request.getListHderId());
|
.with("listHderId", request.getListHderId());
|
||||||
}
|
}
|
||||||
|
|
||||||
TListCallHistEntity entity = new TListCallHistEntity();
|
TListCallHistEntity entity = listCallHistRepository.findFirstByAgentSessionId(request.getAgentSessionId())
|
||||||
entity.setPrjctIdx(prjctIdx);
|
.map(existing -> {
|
||||||
entity.setSid(sid);
|
existing.updateCallResult(request, regDt);
|
||||||
entity.setListHderId(request.getListHderId());
|
return existing;
|
||||||
entity.setDestNum(request.getDestNum());
|
})
|
||||||
entity.setAgentNum(request.getAgentNum());
|
.orElseGet(() -> TListCallHistEntity.from(prjctIdx, sid, request, regUser, regDt));
|
||||||
entity.setAniNum(request.getAniNum());
|
|
||||||
entity.setAgentSessionId(request.getAgentSessionId());
|
|
||||||
entity.setDestSessionId(request.getDestSessionId());
|
|
||||||
entity.setCallTy(request.getCallTy());
|
|
||||||
entity.setStartDt(request.getStartDt());
|
|
||||||
entity.setTotalTime(request.getTotalTime());
|
|
||||||
entity.setTalkTime(request.getTalkTime());
|
|
||||||
entity.setMediaServerId(request.getMediaServerId());
|
|
||||||
entity.setMediaServerName(request.getMediaServerName());
|
|
||||||
entity.setRecordFileName(request.getRecordFileName());
|
|
||||||
entity.setRegUser(regUser);
|
|
||||||
entity.setRegDt(regDt);
|
|
||||||
return ListCallHistDto.from(listCallHistRepository.save(entity));
|
return ListCallHistDto.from(listCallHistRepository.save(entity));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,9 @@ import com.kri.contact.server.dto.common.DateRangeDto;
|
|||||||
import com.kri.contact.server.dto.list.ListFilterDto;
|
import com.kri.contact.server.dto.list.ListFilterDto;
|
||||||
import com.kri.contact.server.dto.list.ListHeaderDto;
|
import com.kri.contact.server.dto.list.ListHeaderDto;
|
||||||
import com.kri.contact.server.persistence.entity.TListItemFileEntity;
|
import com.kri.contact.server.persistence.entity.TListItemFileEntity;
|
||||||
|
import com.kri.contact.server.persistence.entity.TResultCodeEntity;
|
||||||
import com.kri.contact.server.persistence.repository.ListItemFileRepository;
|
import com.kri.contact.server.persistence.repository.ListItemFileRepository;
|
||||||
|
import com.kri.contact.server.persistence.repository.ResultCodeRepository;
|
||||||
import com.kri.contact.server.service.file.ListItemFileService;
|
import com.kri.contact.server.service.file.ListItemFileService;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@@ -40,6 +42,7 @@ public class ListDownloadService {
|
|||||||
private static final String HEADER_MEMO = "메모";
|
private static final String HEADER_MEMO = "메모";
|
||||||
private static final String HEADER_BEFORE = "변경전";
|
private static final String HEADER_BEFORE = "변경전";
|
||||||
private static final String HEADER_AFTER = "변경후";
|
private static final String HEADER_AFTER = "변경후";
|
||||||
|
private static final String ZERO_WIDTH_SPACE = String.valueOf(Character.toChars(0x200B));
|
||||||
|
|
||||||
private static final List<String> EVENT_HISTORY_HEADERS = List.of(
|
private static final List<String> EVENT_HISTORY_HEADERS = List.of(
|
||||||
HEADER_TYPE,
|
HEADER_TYPE,
|
||||||
@@ -59,6 +62,7 @@ public class ListDownloadService {
|
|||||||
private final ListSearchService listSearchService;
|
private final ListSearchService listSearchService;
|
||||||
private final ListItemFileRepository listItemFileRepository;
|
private final ListItemFileRepository listItemFileRepository;
|
||||||
private final ListItemFileService listItemFileService;
|
private final ListItemFileService listItemFileService;
|
||||||
|
private final ResultCodeRepository resultCodeRepository;
|
||||||
|
|
||||||
public byte[] downloadList(Long prjctIdx, ListFilterDto listFilter) {
|
public byte[] downloadList(Long prjctIdx, ListFilterDto listFilter) {
|
||||||
List<ListHeaderDto> headers = getSortedHeaders(prjctIdx);
|
List<ListHeaderDto> headers = getSortedHeaders(prjctIdx);
|
||||||
@@ -102,6 +106,7 @@ public class ListDownloadService {
|
|||||||
|
|
||||||
validateDateRange(dateRange);
|
validateDateRange(dateRange);
|
||||||
List<ListHeaderDto> headers = getSortedHeaders(prjctIdx);
|
List<ListHeaderDto> headers = getSortedHeaders(prjctIdx);
|
||||||
|
Map<EventResultKey, String> resultLabelMap = createResultLabelMap(prjctIdx);
|
||||||
int maxHistoryCount = findMaxEventHistoryCount(prjctIdx, listFilter, resultCodeTypes, searchBase, dateRange);
|
int maxHistoryCount = findMaxEventHistoryCount(prjctIdx, listFilter, resultCodeTypes, searchBase, dateRange);
|
||||||
List<String> excelHeaders = new ArrayList<>(toBaseHeaderNames(headers));
|
List<String> excelHeaders = new ArrayList<>(toBaseHeaderNames(headers));
|
||||||
appendRepeatedHeaders(excelHeaders, EVENT_HISTORY_HEADERS, maxHistoryCount);
|
appendRepeatedHeaders(excelHeaders, EVENT_HISTORY_HEADERS, maxHistoryCount);
|
||||||
@@ -131,6 +136,7 @@ public class ListDownloadService {
|
|||||||
headers,
|
headers,
|
||||||
row,
|
row,
|
||||||
historyMap.getOrDefault(row.sid(), List.of()),
|
historyMap.getOrDefault(row.sid(), List.of()),
|
||||||
|
resultLabelMap,
|
||||||
maxHistoryCount
|
maxHistoryCount
|
||||||
));
|
));
|
||||||
lastSid = row.sid();
|
lastSid = row.sid();
|
||||||
@@ -167,12 +173,16 @@ public class ListDownloadService {
|
|||||||
listSearchService.findUpdateHistoryGroupsForDownload(prjctIdx, sids);
|
listSearchService.findUpdateHistoryGroupsForDownload(prjctIdx, sids);
|
||||||
|
|
||||||
for (Integer sid : sids) {
|
for (Integer sid : sids) {
|
||||||
|
lastSid = sid;
|
||||||
|
List<ListSearchService.UpdateHistoryGroupRow> histories = historyMap.getOrDefault(sid, List.of());
|
||||||
|
if (histories.isEmpty()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
writer.append(createUpdateHistoryRow(
|
writer.append(createUpdateHistoryRow(
|
||||||
sid,
|
sid,
|
||||||
historyMap.getOrDefault(sid, List.of()),
|
histories,
|
||||||
maxHistoryGroupCount
|
maxHistoryGroupCount
|
||||||
));
|
));
|
||||||
lastSid = sid;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -319,15 +329,16 @@ public class ListDownloadService {
|
|||||||
List<ListHeaderDto> headers,
|
List<ListHeaderDto> headers,
|
||||||
ListSearchService.DownloadListRow row,
|
ListSearchService.DownloadListRow row,
|
||||||
List<ListSearchService.EventHistoryRow> histories,
|
List<ListSearchService.EventHistoryRow> histories,
|
||||||
|
Map<EventResultKey, String> resultLabelMap,
|
||||||
int maxHistoryCount
|
int maxHistoryCount
|
||||||
) {
|
) {
|
||||||
Map<String, Object> excelRow = createBaseRow(headers, row);
|
Map<String, Object> excelRow = createBaseRow(headers, row);
|
||||||
for (int index = 0; index < maxHistoryCount; index++) {
|
for (int index = 0; index < maxHistoryCount; index++) {
|
||||||
ListSearchService.EventHistoryRow history = index < histories.size() ? histories.get(index) : null;
|
ListSearchService.EventHistoryRow history = index < histories.size() ? histories.get(index) : null;
|
||||||
excelRow.put(createRepeatedHeaderName(HEADER_TYPE, index), history == null ? "" : defaultString(history.eventTy()));
|
excelRow.put(createRepeatedHeaderName(HEADER_TYPE, index), history == null ? "" : resolveEventTypeLabel(history.eventTy()));
|
||||||
excelRow.put(createRepeatedHeaderName(HEADER_DATE, index), history == null ? "" : formatDateTime(history.regDt()));
|
excelRow.put(createRepeatedHeaderName(HEADER_DATE, index), history == null ? "" : formatDateTime(history.regDt()));
|
||||||
excelRow.put(createRepeatedHeaderName(HEADER_USER, index), history == null ? "" : defaultString(history.regUser()));
|
excelRow.put(createRepeatedHeaderName(HEADER_USER, index), history == null ? "" : defaultString(history.regUser()));
|
||||||
excelRow.put(createRepeatedHeaderName(HEADER_RESULT, index), history == null ? "" : defaultString(history.resultCd()));
|
excelRow.put(createRepeatedHeaderName(HEADER_RESULT, index), history == null ? "" : resolveResultLabel(history, resultLabelMap));
|
||||||
excelRow.put(createRepeatedHeaderName(HEADER_MEMO, index), history == null ? "" : defaultString(history.memo()));
|
excelRow.put(createRepeatedHeaderName(HEADER_MEMO, index), history == null ? "" : defaultString(history.memo()));
|
||||||
}
|
}
|
||||||
return excelRow;
|
return excelRow;
|
||||||
@@ -381,7 +392,7 @@ public class ListDownloadService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String createRepeatedHeaderName(String headerName, int index) {
|
private String createRepeatedHeaderName(String headerName, int index) {
|
||||||
return index == 0 ? headerName : headerName + "\u200B".repeat(index);
|
return index == 0 ? headerName : headerName + ZERO_WIDTH_SPACE.repeat(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void validateDateRange(DateRangeDto dateRange) {
|
private void validateDateRange(DateRangeDto dateRange) {
|
||||||
@@ -413,6 +424,39 @@ public class ListDownloadService {
|
|||||||
return defaultString(isUse);
|
return defaultString(isUse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Map<EventResultKey, String> createResultLabelMap(Long prjctIdx) {
|
||||||
|
return resultCodeRepository.findByIdPrjctIdx(prjctIdx)
|
||||||
|
.stream()
|
||||||
|
.filter(entity -> entity.getResultCdTy() != null && entity.getResultCd() != null)
|
||||||
|
.collect(Collectors.toMap(
|
||||||
|
entity -> new EventResultKey(entity.getResultCdTy().getCode(), entity.getResultCd().intValue()),
|
||||||
|
TResultCodeEntity::getResultCdLbl,
|
||||||
|
(left, right) -> left,
|
||||||
|
LinkedHashMap::new
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
private String resolveEventTypeLabel(Short eventTy) {
|
||||||
|
if (Objects.equals(eventTy, ResultCodeType.CONTACT.getCode())) {
|
||||||
|
return "컨택";
|
||||||
|
}
|
||||||
|
if (Objects.equals(eventTy, ResultCodeType.INTERVIEW.getCode())) {
|
||||||
|
return "면접";
|
||||||
|
}
|
||||||
|
if (Objects.equals(eventTy, ResultCodeType.SURVEY.getCode())) {
|
||||||
|
return "설문";
|
||||||
|
}
|
||||||
|
return defaultString(eventTy);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String resolveResultLabel(
|
||||||
|
ListSearchService.EventHistoryRow history,
|
||||||
|
Map<EventResultKey, String> resultLabelMap
|
||||||
|
) {
|
||||||
|
String label = resultLabelMap.get(new EventResultKey(history.eventTy(), history.resultCd()));
|
||||||
|
return label == null ? defaultString(history.resultCd()) : label;
|
||||||
|
}
|
||||||
|
|
||||||
private String defaultString(Object value) {
|
private String defaultString(Object value) {
|
||||||
return value == null ? "" : String.valueOf(value);
|
return value == null ? "" : String.valueOf(value);
|
||||||
}
|
}
|
||||||
@@ -420,4 +464,9 @@ public class ListDownloadService {
|
|||||||
private String sanitizeZipEntryName(String fileName) {
|
private String sanitizeZipEntryName(String fileName) {
|
||||||
return fileName.replace("\\", "_").replace("/", "_");
|
return fileName.replace("\\", "_").replace("/", "_");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private record EventResultKey(
|
||||||
|
Short eventTy,
|
||||||
|
Integer resultCd
|
||||||
|
) {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import com.kri.contact.server.common.consts.ContactConstant;
|
|||||||
import com.kri.contact.server.common.enums.ListResetMode;
|
import com.kri.contact.server.common.enums.ListResetMode;
|
||||||
import com.kri.contact.server.dto.list.ListFilterDto;
|
import com.kri.contact.server.dto.list.ListFilterDto;
|
||||||
import com.kri.contact.server.persistence.entity.TListResetLogEntity;
|
import com.kri.contact.server.persistence.entity.TListResetLogEntity;
|
||||||
import com.kri.contact.server.persistence.jdbc.ListResetJdbcSupport.DeleteCounts;
|
|
||||||
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.repository.ListResetLogRepository;
|
import com.kri.contact.server.persistence.repository.ListResetLogRepository;
|
||||||
import jakarta.persistence.EntityManager;
|
import jakarta.persistence.EntityManager;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@@ -49,7 +49,7 @@ public class ListResetService {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (mode == null) {
|
if (mode == null) {
|
||||||
throw BusinessException.badRequest("EMPTY_MODE","mode는 필수 입니다.");
|
throw BusinessException.badRequest("EMPTY_MODE", "mode는 필수 입니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
String listResetLogId = createResetLog(prjctIdx, mode, 0, regUser, regDt);
|
String listResetLogId = createResetLog(prjctIdx, mode, 0, regUser, regDt);
|
||||||
|
|||||||
@@ -5,7 +5,9 @@ import com.kri.common.feature.web.page.PageRequestDto;
|
|||||||
import com.kri.common.feature.web.page.PageResponseDto;
|
import com.kri.common.feature.web.page.PageResponseDto;
|
||||||
import com.kri.contact.server.common.consts.ContactConstant;
|
import com.kri.contact.server.common.consts.ContactConstant;
|
||||||
import com.kri.contact.server.common.enums.ListEventHistoryBase;
|
import com.kri.contact.server.common.enums.ListEventHistoryBase;
|
||||||
|
import com.kri.contact.server.common.enums.ListHeaderType;
|
||||||
import com.kri.contact.server.common.enums.ListHeaderTypeAssign;
|
import com.kri.contact.server.common.enums.ListHeaderTypeAssign;
|
||||||
|
import com.kri.contact.server.common.enums.ListIsUse;
|
||||||
import com.kri.contact.server.common.enums.ListSearchResponseType;
|
import com.kri.contact.server.common.enums.ListSearchResponseType;
|
||||||
import com.kri.contact.server.common.enums.ResultCodeType;
|
import com.kri.contact.server.common.enums.ResultCodeType;
|
||||||
import com.kri.contact.server.dto.common.DateRangeDto;
|
import com.kri.contact.server.dto.common.DateRangeDto;
|
||||||
@@ -292,9 +294,10 @@ public class ListSearchService {
|
|||||||
List<String> beforeValues = new ArrayList<>(groupHistories.size());
|
List<String> beforeValues = new ArrayList<>(groupHistories.size());
|
||||||
List<String> afterValues = new ArrayList<>(groupHistories.size());
|
List<String> afterValues = new ArrayList<>(groupHistories.size());
|
||||||
for (TListUpdateHistEntity history : groupHistories) {
|
for (TListUpdateHistEntity history : groupHistories) {
|
||||||
|
ListHeaderDto header = headerMap.get(history.getListHderId());
|
||||||
String headerName = resolveHeaderName(headerMap, history.getListHderId());
|
String headerName = resolveHeaderName(headerMap, history.getListHderId());
|
||||||
beforeValues.add(headerName + ": " + defaultString(history.getBeforeVal()));
|
beforeValues.add(headerName + ": " + resolveUpdateHistoryValue(header, history.getBeforeVal()));
|
||||||
afterValues.add(headerName + ": " + defaultString(history.getAfterVal()));
|
afterValues.add(headerName + ": " + resolveUpdateHistoryValue(header, history.getAfterVal()));
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateHistoryGroupKey key = entry.getKey();
|
UpdateHistoryGroupKey key = entry.getKey();
|
||||||
@@ -588,6 +591,27 @@ public class ListSearchService {
|
|||||||
return header == null ? String.valueOf(headerId) : header.getListHderNm();
|
return header == null ? String.valueOf(headerId) : header.getListHderNm();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String resolveUpdateHistoryValue(ListHeaderDto header, String value) {
|
||||||
|
if (header != null && Objects.equals(header.getListHderTy(), ListHeaderType.IS_USE)) {
|
||||||
|
return toUseValue(value);
|
||||||
|
}
|
||||||
|
return defaultString(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String toUseValue(String value) {
|
||||||
|
String trimmedValue = defaultString(value).trim();
|
||||||
|
if (Objects.equals(trimmedValue, String.valueOf(ListIsUse.USABLE.getCode()))) {
|
||||||
|
return "O";
|
||||||
|
}
|
||||||
|
if (Objects.equals(trimmedValue, String.valueOf(ListIsUse.UNUSABLE.getCode()))) {
|
||||||
|
return "X";
|
||||||
|
}
|
||||||
|
if (Objects.equals(trimmedValue, String.valueOf(ListIsUse.TEST.getCode()))) {
|
||||||
|
return "TEST";
|
||||||
|
}
|
||||||
|
return defaultString(value);
|
||||||
|
}
|
||||||
|
|
||||||
private String defaultString(String value) {
|
private String defaultString(String value) {
|
||||||
return value == null ? "" : value;
|
return value == null ? "" : value;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import com.kri.contact.server.dto.list.ListHeaderDto;
|
|||||||
import com.kri.contact.server.dto.list.ListUpdateRequestDto;
|
import com.kri.contact.server.dto.list.ListUpdateRequestDto;
|
||||||
import com.kri.contact.server.persistence.entity.TListEventHistEntity;
|
import com.kri.contact.server.persistence.entity.TListEventHistEntity;
|
||||||
import com.kri.contact.server.persistence.entity.TListHeaderEntity;
|
import com.kri.contact.server.persistence.entity.TListHeaderEntity;
|
||||||
|
import com.kri.contact.server.persistence.entity.TListItemFileEntity;
|
||||||
import com.kri.contact.server.persistence.jdbc.ListUpdateJdbcSupport;
|
import com.kri.contact.server.persistence.jdbc.ListUpdateJdbcSupport;
|
||||||
import com.kri.contact.server.persistence.jdbc.ListUpdateJdbcSupport.ListItemDeleteRow;
|
import com.kri.contact.server.persistence.jdbc.ListUpdateJdbcSupport.ListItemDeleteRow;
|
||||||
import com.kri.contact.server.persistence.jdbc.ListUpdateJdbcSupport.ListItemInsertRow;
|
import com.kri.contact.server.persistence.jdbc.ListUpdateJdbcSupport.ListItemInsertRow;
|
||||||
@@ -27,7 +28,10 @@ import com.kri.contact.server.persistence.jdbc.ListUpdateJdbcSupport.ListUpdateR
|
|||||||
import com.kri.contact.server.persistence.jdbc.ListUpdateJdbcSupport.UpdateHistRow;
|
import com.kri.contact.server.persistence.jdbc.ListUpdateJdbcSupport.UpdateHistRow;
|
||||||
import com.kri.contact.server.persistence.repository.ListEventHistRepository;
|
import com.kri.contact.server.persistence.repository.ListEventHistRepository;
|
||||||
import com.kri.contact.server.persistence.repository.ListHeaderRepository;
|
import com.kri.contact.server.persistence.repository.ListHeaderRepository;
|
||||||
|
import com.kri.contact.server.persistence.repository.ListItemFileRepository;
|
||||||
import com.kri.contact.server.persistence.repository.ListRepository;
|
import com.kri.contact.server.persistence.repository.ListRepository;
|
||||||
|
import com.kri.contact.server.service.file.ListItemFileService;
|
||||||
|
import jakarta.persistence.EntityManager;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
@@ -45,14 +49,19 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class ListUpdateService {
|
public class ListUpdateService {
|
||||||
|
|
||||||
|
private static final String FILE_DELETE = "FILE_DELETE";
|
||||||
|
|
||||||
private final ListHeaderRepository listHeaderRepository;
|
private final ListHeaderRepository listHeaderRepository;
|
||||||
private final ListSearchService listSearchService;
|
private final ListSearchService listSearchService;
|
||||||
private final ListContentItemService listContentItemService;
|
private final ListContentItemService listContentItemService;
|
||||||
private final ListUpdateJdbcSupport listUpdateJdbcSupport;
|
private final ListUpdateJdbcSupport listUpdateJdbcSupport;
|
||||||
private final ListRepository listRepository;
|
private final ListRepository listRepository;
|
||||||
private final ListEventHistRepository listEventHistRepository;
|
private final ListEventHistRepository listEventHistRepository;
|
||||||
|
private final ListItemFileRepository listItemFileRepository;
|
||||||
|
private final ListItemFileService listItemFileService;
|
||||||
private final ResultCodeService resultCodeService;
|
private final ResultCodeService resultCodeService;
|
||||||
private final ObjectMapper objectMapper;
|
private final ObjectMapper objectMapper;
|
||||||
|
private final EntityManager entityManager;
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public int updateList(
|
public int updateList(
|
||||||
@@ -240,6 +249,7 @@ public class ListUpdateService {
|
|||||||
Map<ListItemKey, ListItemUpdateRow> itemUpdates = new LinkedHashMap<>();
|
Map<ListItemKey, ListItemUpdateRow> itemUpdates = new LinkedHashMap<>();
|
||||||
Map<ListItemKey, ListItemInsertRow> itemInserts = new LinkedHashMap<>();
|
Map<ListItemKey, ListItemInsertRow> itemInserts = new LinkedHashMap<>();
|
||||||
Map<ListItemKey, ListItemDeleteRow> itemDeletes = new LinkedHashMap<>();
|
Map<ListItemKey, ListItemDeleteRow> itemDeletes = new LinkedHashMap<>();
|
||||||
|
Set<ListItemKey> fileDeleteKeys = new LinkedHashSet<>();
|
||||||
|
|
||||||
for (ListSearchService.ListUpdateTargetRow targetRow : targetRows) {
|
for (ListSearchService.ListUpdateTargetRow targetRow : targetRows) {
|
||||||
Short currentIsUse = targetRow.isUse();
|
Short currentIsUse = targetRow.isUse();
|
||||||
@@ -250,7 +260,8 @@ public class ListUpdateService {
|
|||||||
Integer headerId = entry.getKey();
|
Integer headerId = entry.getKey();
|
||||||
Integer sid = targetRow.sid();
|
Integer sid = targetRow.sid();
|
||||||
TListHeaderEntity header = headerMap.get(headerId);
|
TListHeaderEntity header = headerMap.get(headerId);
|
||||||
String newValue = normalizeUpdateValue(header, entry.getValue());
|
boolean deleteFile = isFileDeleteCommand(header, entry.getValue());
|
||||||
|
String newValue = deleteFile ? "" : normalizeUpdateValue(header, entry.getValue());
|
||||||
|
|
||||||
if (Objects.equals(header.getListHderTy(), ListHeaderType.IS_USE.getCode())) {
|
if (Objects.equals(header.getListHderTy(), ListHeaderType.IS_USE.getCode())) {
|
||||||
String beforeVal = String.valueOf(currentIsUse);
|
String beforeVal = String.valueOf(currentIsUse);
|
||||||
@@ -293,6 +304,9 @@ public class ListUpdateService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ListItemKey itemKey = new ListItemKey(sid, headerId);
|
ListItemKey itemKey = new ListItemKey(sid, headerId);
|
||||||
|
if (deleteFile) {
|
||||||
|
fileDeleteKeys.add(itemKey);
|
||||||
|
}
|
||||||
if (newValue.isEmpty()) {
|
if (newValue.isEmpty()) {
|
||||||
if (currentValue != null) {
|
if (currentValue != null) {
|
||||||
itemDeletes.put(itemKey, new ListItemDeleteRow(prjctIdx, sid, headerId));
|
itemDeletes.put(itemKey, new ListItemDeleteRow(prjctIdx, sid, headerId));
|
||||||
@@ -330,7 +344,7 @@ public class ListUpdateService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (updateHistRows.isEmpty()) {
|
if (updateHistRows.isEmpty() && fileDeleteKeys.isEmpty()) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,11 +352,65 @@ public class ListUpdateService {
|
|||||||
listUpdateJdbcSupport.batchUpdateList(new ArrayList<>(listUpdates.values()), ContactConstant.INSERT_CHUNK_SIZE);
|
listUpdateJdbcSupport.batchUpdateList(new ArrayList<>(listUpdates.values()), ContactConstant.INSERT_CHUNK_SIZE);
|
||||||
listUpdateJdbcSupport.batchUpdateListItem(new ArrayList<>(itemUpdates.values()), ContactConstant.INSERT_CHUNK_SIZE);
|
listUpdateJdbcSupport.batchUpdateListItem(new ArrayList<>(itemUpdates.values()), ContactConstant.INSERT_CHUNK_SIZE);
|
||||||
listUpdateJdbcSupport.batchInsertListItem(new ArrayList<>(itemInserts.values()), ContactConstant.INSERT_CHUNK_SIZE);
|
listUpdateJdbcSupport.batchInsertListItem(new ArrayList<>(itemInserts.values()), ContactConstant.INSERT_CHUNK_SIZE);
|
||||||
listUpdateJdbcSupport.batchDeleteListItem(new ArrayList<>(itemDeletes.values()), ContactConstant.INSERT_CHUNK_SIZE);
|
deleteItemsWithoutBackup(
|
||||||
|
prjctIdx,
|
||||||
|
new ArrayList<>(itemDeletes.values()),
|
||||||
|
fileDeleteKeys
|
||||||
|
);
|
||||||
|
|
||||||
return updateHistRows.size();
|
return updateHistRows.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void deleteItemsWithoutBackup(
|
||||||
|
Long prjctIdx,
|
||||||
|
List<ListItemDeleteRow> itemDeletes,
|
||||||
|
Set<ListItemKey> fileDeleteKeys
|
||||||
|
) {
|
||||||
|
if (itemDeletes.isEmpty() && fileDeleteKeys.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
setSkipDeleteBackup();
|
||||||
|
try {
|
||||||
|
listUpdateJdbcSupport.batchDeleteListItem(itemDeletes, ContactConstant.INSERT_CHUNK_SIZE);
|
||||||
|
deleteListItemFiles(prjctIdx, fileDeleteKeys);
|
||||||
|
} finally {
|
||||||
|
clearSkipDeleteBackup();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void deleteListItemFiles(Long prjctIdx, Set<ListItemKey> fileDeleteKeys) {
|
||||||
|
if (fileDeleteKeys.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Set<Integer> sids = fileDeleteKeys.stream()
|
||||||
|
.map(ListItemKey::sid)
|
||||||
|
.collect(LinkedHashSet::new, LinkedHashSet::add, LinkedHashSet::addAll);
|
||||||
|
Set<Integer> headerIds = fileDeleteKeys.stream()
|
||||||
|
.map(ListItemKey::listHderId)
|
||||||
|
.collect(LinkedHashSet::new, LinkedHashSet::add, LinkedHashSet::addAll);
|
||||||
|
|
||||||
|
List<TListItemFileEntity> fileEntities = listItemFileRepository
|
||||||
|
.findByIdPrjctIdxAndIdSidInAndIdListHderIdInOrderByIdSidAscIdListHderIdAsc(
|
||||||
|
prjctIdx,
|
||||||
|
sids,
|
||||||
|
headerIds
|
||||||
|
)
|
||||||
|
.stream()
|
||||||
|
.filter(entity -> fileDeleteKeys.contains(new ListItemKey(entity.getSid(), entity.getListHderId())))
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
if (fileEntities.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
listItemFileRepository.deleteAllInBatch(fileEntities);
|
||||||
|
for (TListItemFileEntity fileEntity : fileEntities) {
|
||||||
|
listItemFileService.deleteItemFile(fileEntity.getFilePath(), fileEntity.getFileNm());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private Set<Integer> resolveTargetSids(Long prjctIdx, ListFilterDto listFilter) {
|
private Set<Integer> resolveTargetSids(Long prjctIdx, ListFilterDto listFilter) {
|
||||||
return new LinkedHashSet<>(listSearchService.findTargetSids(prjctIdx, listFilter));
|
return new LinkedHashSet<>(listSearchService.findTargetSids(prjctIdx, listFilter));
|
||||||
}
|
}
|
||||||
@@ -389,6 +457,19 @@ public class ListUpdateService {
|
|||||||
return defaultString(normalizeBlank(value));
|
return defaultString(normalizeBlank(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isFileDeleteCommand(TListHeaderEntity header, String value) {
|
||||||
|
return Objects.equals(header.getListHderTy(), ListHeaderType.FILE.getCode())
|
||||||
|
&& Objects.equals(normalizeBlank(value), FILE_DELETE);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setSkipDeleteBackup() {
|
||||||
|
entityManager.createNativeQuery("SET @skip_delete_backup = 1").executeUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void clearSkipDeleteBackup() {
|
||||||
|
entityManager.createNativeQuery("SET @skip_delete_backup = NULL").executeUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
private short parseIsUseCode(String value) {
|
private short parseIsUseCode(String value) {
|
||||||
String normalized = defaultString(normalizeBlank(value)).toUpperCase();
|
String normalized = defaultString(normalizeBlank(value)).toUpperCase();
|
||||||
return switch (normalized) {
|
return switch (normalized) {
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import java.util.HashSet;
|
|||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.LinkedHashSet;
|
import java.util.LinkedHashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
@@ -90,7 +91,8 @@ public class MessageService {
|
|||||||
request.getDestNameHeaderId(),
|
request.getDestNameHeaderId(),
|
||||||
messageContext,
|
messageContext,
|
||||||
channelType,
|
channelType,
|
||||||
new LinkedHashSet<>()
|
new LinkedHashSet<>(),
|
||||||
|
true
|
||||||
);
|
);
|
||||||
if (destInfos.isEmpty()) {
|
if (destInfos.isEmpty()) {
|
||||||
throw BusinessException.badRequest("NO_DESTINATION", "발송 대상 이메일 또는 전화번호가 없습니다.");
|
throw BusinessException.badRequest("NO_DESTINATION", "발송 대상 이메일 또는 전화번호가 없습니다.");
|
||||||
@@ -127,7 +129,8 @@ public class MessageService {
|
|||||||
prjctIdx,
|
prjctIdx,
|
||||||
request,
|
request,
|
||||||
messageContext,
|
messageContext,
|
||||||
channelType
|
channelType,
|
||||||
|
Boolean.TRUE.equals(request.getDedupe())
|
||||||
);
|
);
|
||||||
if (destInfos.isEmpty()) {
|
if (destInfos.isEmpty()) {
|
||||||
throw BusinessException.badRequest("NO_DESTINATION", "발송 대상 이메일 또는 전화번호가 없습니다.");
|
throw BusinessException.badRequest("NO_DESTINATION", "발송 대상 이메일 또는 전화번호가 없습니다.");
|
||||||
@@ -174,7 +177,8 @@ public class MessageService {
|
|||||||
Long prjctIdx,
|
Long prjctIdx,
|
||||||
MessageSendBulkRequestDto request,
|
MessageSendBulkRequestDto request,
|
||||||
MessageContext messageContext,
|
MessageContext messageContext,
|
||||||
ChannelType channelType
|
ChannelType channelType,
|
||||||
|
boolean dedupe
|
||||||
) {
|
) {
|
||||||
List<NotiHubDestInfoDto> destInfos = new ArrayList<>();
|
List<NotiHubDestInfoDto> destInfos = new ArrayList<>();
|
||||||
Set<String> dedupeKeys = new LinkedHashSet<>();
|
Set<String> dedupeKeys = new LinkedHashSet<>();
|
||||||
@@ -196,7 +200,8 @@ public class MessageService {
|
|||||||
request.getDestNameHeaderId(),
|
request.getDestNameHeaderId(),
|
||||||
messageContext,
|
messageContext,
|
||||||
channelType,
|
channelType,
|
||||||
dedupeKeys
|
dedupeKeys,
|
||||||
|
dedupe
|
||||||
));
|
));
|
||||||
lastSid = rows.get(rows.size() - 1).sid();
|
lastSid = rows.get(rows.size() - 1).sid();
|
||||||
}
|
}
|
||||||
@@ -209,7 +214,8 @@ public class MessageService {
|
|||||||
Integer destNameHeaderId,
|
Integer destNameHeaderId,
|
||||||
MessageContext messageContext,
|
MessageContext messageContext,
|
||||||
ChannelType channelType,
|
ChannelType channelType,
|
||||||
Set<String> dedupeKeys
|
Set<String> dedupeKeys,
|
||||||
|
boolean dedupe
|
||||||
) {
|
) {
|
||||||
List<NotiHubDestInfoDto> result = new ArrayList<>();
|
List<NotiHubDestInfoDto> result = new ArrayList<>();
|
||||||
for (ListSearchService.DownloadListRow row : rows) {
|
for (ListSearchService.DownloadListRow row : rows) {
|
||||||
@@ -219,7 +225,7 @@ public class MessageService {
|
|||||||
for (Integer destHeaderId : destHeaderIds) {
|
for (Integer destHeaderId : destHeaderIds) {
|
||||||
String rawDestination = row.itemMap().get(destHeaderId);
|
String rawDestination = row.itemMap().get(destHeaderId);
|
||||||
String destination = normalizeDestination(rawDestination, channelType);
|
String destination = normalizeDestination(rawDestination, channelType);
|
||||||
if (destination == null || !dedupeKeys.add(destination)) {
|
if (destination == null || isDuplicateDestination(destination, channelType, dedupeKeys, dedupe)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -399,6 +405,25 @@ public class MessageService {
|
|||||||
return normalized;
|
return normalized;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean isDuplicateDestination(
|
||||||
|
String destination,
|
||||||
|
ChannelType channelType,
|
||||||
|
Set<String> dedupeKeys,
|
||||||
|
boolean dedupe
|
||||||
|
) {
|
||||||
|
if (!dedupe) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return !dedupeKeys.add(createDedupeKey(destination, channelType));
|
||||||
|
}
|
||||||
|
|
||||||
|
private String createDedupeKey(String destination, ChannelType channelType) {
|
||||||
|
if (channelType == ChannelType.EMAIL) {
|
||||||
|
return destination.toLowerCase(Locale.ROOT);
|
||||||
|
}
|
||||||
|
return destination;
|
||||||
|
}
|
||||||
|
|
||||||
private String normalizeBlank(String value) {
|
private String normalizeBlank(String value) {
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import java.time.LocalDateTime;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.poi.ss.usermodel.Workbook;
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
import org.apache.poi.ss.usermodel.WorkbookFactory;
|
import org.apache.poi.ss.usermodel.WorkbookFactory;
|
||||||
@@ -37,6 +38,8 @@ public class UserService {
|
|||||||
private final RoleService roleService;
|
private final RoleService roleService;
|
||||||
private final UserRepository userRepository;
|
private final UserRepository userRepository;
|
||||||
|
|
||||||
|
private static final int OUTSOURCE_USER_ROLE_END = ContactConstant.OUTSOURCE_USER_ROLE + 1000;
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void createUser(UserInfoDto userInfo, String regUser, LocalDateTime regDt) {
|
public void createUser(UserInfoDto userInfo, String regUser, LocalDateTime regDt) {
|
||||||
List<RoleInfoDto> roleList = roleService.getRoleList();
|
List<RoleInfoDto> roleList = roleService.getRoleList();
|
||||||
@@ -220,7 +223,9 @@ public class UserService {
|
|||||||
.with("userId", dto.getUserId())
|
.with("userId", dto.getUserId())
|
||||||
);
|
);
|
||||||
|
|
||||||
if(entity.getUserRole() != dto.getUserRole()) {
|
validateUserRoleChange(entity.getUserRole(), dto.getUserRole());
|
||||||
|
|
||||||
|
if(!Objects.equals(entity.getUserRole(), dto.getUserRole())) {
|
||||||
assignService.deleteListAssignWithUser(dto.getUserId());
|
assignService.deleteListAssignWithUser(dto.getUserId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -239,6 +244,29 @@ public class UserService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*******************************private*******************************/
|
/*******************************private*******************************/
|
||||||
|
private void validateUserRoleChange(Integer currentRole, Integer newRole) {
|
||||||
|
if (Objects.equals(currentRole, newRole)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ((isOutsourceRole(currentRole) && isFieldworkRole(newRole))
|
||||||
|
|| (isFieldworkRole(currentRole) && isOutsourceRole(newRole))) {
|
||||||
|
throw BusinessException.badRequest(
|
||||||
|
"USER_ROLE_CHANGE_NOT_ALLOWED",
|
||||||
|
"외주사와 콜센터/컨택원/면접원 간 권한 변경은 할 수 없습니다."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isOutsourceRole(Integer role) {
|
||||||
|
return role != null
|
||||||
|
&& role >= ContactConstant.OUTSOURCE_USER_ROLE
|
||||||
|
&& role < OUTSOURCE_USER_ROLE_END;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isFieldworkRole(Integer role) {
|
||||||
|
return role != null && role >= ContactConstant.FIELDWORK_USER_ROLE;
|
||||||
|
}
|
||||||
|
|
||||||
private DataVerificationDto verifyUserId(String userId, List<String> intranetUserList) {
|
private DataVerificationDto verifyUserId(String userId, List<String> intranetUserList) {
|
||||||
if (userId == null || userId.isBlank()) {
|
if (userId == null || userId.isBlank()) {
|
||||||
return new DataVerificationDto(false, "사용자 ID", "사용자 ID가 비었습니다.");
|
return new DataVerificationDto(false, "사용자 ID", "사용자 ID가 비었습니다.");
|
||||||
|
|||||||
@@ -55,6 +55,23 @@ public class ListItemFileService extends AbstractFileService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void deleteItemFile(String filePath, String fileName) {
|
||||||
|
Path baseDir = getBaseDir();
|
||||||
|
Path dir = baseDir.resolve(filePath == null || filePath.isBlank() ? "" : filePath)
|
||||||
|
.toAbsolutePath()
|
||||||
|
.normalize();
|
||||||
|
|
||||||
|
if (!dir.startsWith(baseDir)) {
|
||||||
|
throw BusinessException.badRequest("WRONG_FILE_PATH", "잘못된 파일 경로입니다.");
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
deleteFile(dir, fileName);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw BusinessException.internalError("FAIL_DELETE_LIST_ITEM_FILE", e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private Path resolveItemFilePath(Path baseDir, String filePath, String fileName) {
|
private Path resolveItemFilePath(Path baseDir, String filePath, String fileName) {
|
||||||
String relativePath = filePath == null || filePath.isBlank() ? "" : filePath;
|
String relativePath = filePath == null || filePath.isBlank() ? "" : filePath;
|
||||||
return baseDir.resolve(relativePath).resolve(fileName).toAbsolutePath().normalize();
|
return baseDir.resolve(relativePath).resolve(fileName).toAbsolutePath().normalize();
|
||||||
|
|||||||
Reference in New Issue
Block a user