260115_02_ENH : 이전 커밋 누락

This commit is contained in:
2026-01-15 11:31:27 +09:00
parent c137aa1063
commit 23d2a70ec2

View File

@@ -1,7 +1,10 @@
package com.kri.notihub.server.dto.report; package com.kri.notihub.server.dto.report;
import com.kri.common.excel.ExcelColumn;
import com.kri.notihub.server.common.enums.SendStatusType;
import com.kri.notihub.server.common.enums.SendType; import com.kri.notihub.server.common.enums.SendType;
import com.kri.notihub.server.persistence.entity.TSendEntity; import com.kri.notihub.server.persistence.entity.TSendEntity;
import com.kri.notihub.server.persistence.entity.TSendResultCodeEntity;
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.NotNull; import jakarta.validation.constraints.NotNull;
@@ -9,6 +12,7 @@ import jakarta.validation.constraints.Size;
import lombok.*; import lombok.*;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;
@Getter @Getter
@Setter @Setter
@@ -29,20 +33,34 @@ public class SendInfoDto {
@NotNull @NotNull
@Schema(description = "발송 타입 코드") @Schema(description = "발송 타입 코드")
private Short sendTy; private Short sendTyCode;
@NotNull
@Schema(description = "발송 타입 라벨")
private String sendTyLabel;
@NotNull @NotNull
@Schema(description = "예약 여부") @Schema(description = "예약 여부")
private Boolean resve; private Boolean resve;
@NotNull @NotNull
@Schema(description = "발송 상태 코드") @Schema(description = "발송 상태")
private Short sendStatus; private Short sendStatusCode;
@NotNull
@ExcelColumn(header = "발송 상태", order = 0)
@Schema(description = "발송 상태 라벨")
private String sendStatusLabel;
@NotNull @NotNull
@Schema(description = "결과 코드") @Schema(description = "결과 코드")
private Short resultCode; private Short resultCode;
@NotNull
@ExcelColumn(header = "발송 결과", order = 1)
@Schema(description = "결과 라벨")
private String resultLabel;
@Size(max = 16) @Size(max = 16)
@NotBlank @NotBlank
@Schema(description = "요청 서비스") @Schema(description = "요청 서비스")
@@ -57,30 +75,37 @@ public class SendInfoDto {
private Long tmplatIdx; private Long tmplatIdx;
@Size(max = 64) @Size(max = 64)
@ExcelColumn(header = "발신지", order = 2)
@Schema(description = "발신지(EMAIL이면 sendEml, 아니면 sendTel)") @Schema(description = "발신지(EMAIL이면 sendEml, 아니면 sendTel)")
private String sendFrom; private String sendFrom;
@Size(max = 32) @Size(max = 32)
@ExcelColumn(header = "발신자명", order = 3)
@Schema(description = "발신자명") @Schema(description = "발신자명")
private String sendNm; private String sendNm;
@NotNull @NotNull
@ExcelColumn(header = "발송 일시", order = 4)
@Schema(description = "발송 일시") @Schema(description = "발송 일시")
private LocalDateTime sendDt; private LocalDateTime sendDt;
@Size(max = 128) @Size(max = 128)
@NotBlank @NotBlank
@ExcelColumn(header = "SID", order = 5)
@Schema(description = "SID") @Schema(description = "SID")
private String sid; private String sid;
@Size(max = 64) @Size(max = 64)
@ExcelColumn(header = "수신지", order = 6)
@Schema(description = "수신지(EMAIL이면 destEml, 아니면 destTel)") @Schema(description = "수신지(EMAIL이면 destEml, 아니면 destTel)")
private String destTo; private String destTo;
@Size(max = 32) @Size(max = 32)
@ExcelColumn(header = "수신자명", order = 7)
@Schema(description = "수신자명") @Schema(description = "수신자명")
private String destNm; private String destNm;
@ExcelColumn(header = "발송 결과 확인 일시", order = 8)
@Schema(description = "리포트 일시") @Schema(description = "리포트 일시")
private LocalDateTime reportDt; private LocalDateTime reportDt;
@@ -91,14 +116,16 @@ public class SendInfoDto {
@Size(max = 32) @Size(max = 32)
@NotBlank @NotBlank
@ExcelColumn(header = "발송 요청자", order = 9)
@Schema(description = "등록자") @Schema(description = "등록자")
private String regUser; private String regUser;
@NotNull @NotNull
@ExcelColumn(header = "발송 요청 일시", order = 10)
@Schema(description = "등록일시") @Schema(description = "등록일시")
private LocalDateTime regDt; private LocalDateTime regDt;
public static SendInfoDto from(TSendEntity entity) { public static SendInfoDto from(TSendEntity entity, List<TSendResultCodeEntity> resultCodeEntity) {
if (entity == null) return null; if (entity == null) return null;
boolean isEmail = entity.getSendTy() != null boolean isEmail = entity.getSendTy() != null
@@ -107,13 +134,22 @@ public class SendInfoDto {
String sendFrom = isEmail ? entity.getSendEml() : entity.getSendTel(); String sendFrom = isEmail ? entity.getSendEml() : entity.getSendTel();
String destTo = isEmail ? entity.getDestEml() : entity.getDestTel(); String destTo = isEmail ? entity.getDestEml() : entity.getDestTel();
String resultViewLabel = resultCodeEntity.stream()
.filter(e -> e.getId() != null && e.getId().getResultCode().equals(entity.getResultCode()))
.map(TSendResultCodeEntity::getResultViewLabel)
.findFirst()
.orElse(null); // 없으면 null
return SendInfoDto.builder() return SendInfoDto.builder()
.cmid(entity.getCmid()) .cmid(entity.getCmid())
.bulkSendKey(entity.getBulkSendKey()) .bulkSendKey(entity.getBulkSendKey())
.sendTy(entity.getSendTy()) .sendTyCode(entity.getSendTy())
.sendTyLabel(SendType.fromCode(entity.getSendTy()).name())
.resve(entity.isResve()) .resve(entity.isResve())
.sendStatus(entity.getSendStatus()) .sendStatusCode(entity.getSendStatus())
.sendStatusLabel(SendStatusType.fromCode(entity.getSendStatus()).name())
.resultCode(entity.getResultCode()) .resultCode(entity.getResultCode())
.resultLabel(resultViewLabel)
.reqstSvc(entity.getReqstSvc()) .reqstSvc(entity.getReqstSvc())
.prjctCd(entity.getPrjctCd()) .prjctCd(entity.getPrjctCd())
.tmplatIdx(entity.getTmplatIdx()) .tmplatIdx(entity.getTmplatIdx())