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