260212_01_DOC: 프로젝트 전체에 구글 java 스타일 적용
This commit is contained in:
@@ -4,145 +4,143 @@ import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "`BIZ_LOG`")
|
||||
public class BizLogEntity {
|
||||
@Id
|
||||
@Size(max = 32)
|
||||
@Column(name = "`CMID`", length = 32)
|
||||
private String cmid;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "`UMID`", length = 32)
|
||||
private String umid;
|
||||
@Id
|
||||
@Size(max = 32)
|
||||
@Column(name = "`CMID`", length = 32)
|
||||
private String cmid;
|
||||
|
||||
@Column(name = "`MSG_TYPE`")
|
||||
private Integer msgType;
|
||||
@Size(max = 32)
|
||||
@Column(name = "`UMID`", length = 32)
|
||||
private String umid;
|
||||
|
||||
@Column(name = "`STATUS`")
|
||||
private Integer status;
|
||||
@Column(name = "`MSG_TYPE`")
|
||||
private Integer msgType;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "`CALL_STATUS`", length = 32)
|
||||
private String callStatus;
|
||||
@Column(name = "`STATUS`")
|
||||
private Integer status;
|
||||
|
||||
@Column(name = "`REQUEST_TIME`")
|
||||
private LocalDateTime requestTime;
|
||||
@Size(max = 32)
|
||||
@Column(name = "`CALL_STATUS`", length = 32)
|
||||
private String callStatus;
|
||||
|
||||
@Column(name = "`SEND_TIME`")
|
||||
private LocalDateTime sendTime;
|
||||
@Column(name = "`REQUEST_TIME`")
|
||||
private LocalDateTime requestTime;
|
||||
|
||||
@Column(name = "`REPORT_TIME`")
|
||||
private LocalDateTime reportTime;
|
||||
@Column(name = "`SEND_TIME`")
|
||||
private LocalDateTime sendTime;
|
||||
|
||||
@Size(max = 16)
|
||||
@Column(name = "`DEST_PHONE`", length = 16)
|
||||
private String destPhone;
|
||||
@Column(name = "`REPORT_TIME`")
|
||||
private LocalDateTime reportTime;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "`DEST_NAME`", length = 32)
|
||||
private String destName;
|
||||
@Size(max = 16)
|
||||
@Column(name = "`DEST_PHONE`", length = 16)
|
||||
private String destPhone;
|
||||
|
||||
@Size(max = 16)
|
||||
@Column(name = "`SEND_PHONE`", length = 16)
|
||||
private String sendPhone;
|
||||
@Size(max = 32)
|
||||
@Column(name = "`DEST_NAME`", length = 32)
|
||||
private String destName;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "`SEND_NAME`", length = 32)
|
||||
private String sendName;
|
||||
@Size(max = 16)
|
||||
@Column(name = "`SEND_PHONE`", length = 16)
|
||||
private String sendPhone;
|
||||
|
||||
@Size(max = 64)
|
||||
@Column(name = "`SUBJECT`", length = 64)
|
||||
private String subject;
|
||||
@Size(max = 32)
|
||||
@Column(name = "`SEND_NAME`", length = 32)
|
||||
private String sendName;
|
||||
|
||||
@Size(max = 2000)
|
||||
@Column(name = "`MSG_BODY`", length = 2000)
|
||||
private String msgBody;
|
||||
@Size(max = 64)
|
||||
@Column(name = "`SUBJECT`", length = 64)
|
||||
private String subject;
|
||||
|
||||
@Size(max = 5)
|
||||
@Column(name = "`NATION_CODE`", length = 5)
|
||||
private String nationCode;
|
||||
@Size(max = 2000)
|
||||
@Column(name = "`MSG_BODY`", length = 2000)
|
||||
private String msgBody;
|
||||
|
||||
@Size(max = 40)
|
||||
@Column(name = "`SENDER_KEY`", length = 40)
|
||||
private String senderKey;
|
||||
@Size(max = 5)
|
||||
@Column(name = "`NATION_CODE`", length = 5)
|
||||
private String nationCode;
|
||||
|
||||
@Size(max = 64)
|
||||
@Column(name = "`TEMPLATE_CODE`", length = 64)
|
||||
private String templateCode;
|
||||
@Size(max = 40)
|
||||
@Column(name = "`SENDER_KEY`", length = 40)
|
||||
private String senderKey;
|
||||
|
||||
@Size(max = 8)
|
||||
@Column(name = "`RESPONSE_METHOD`", length = 8)
|
||||
private String responseMethod;
|
||||
@Size(max = 64)
|
||||
@Column(name = "`TEMPLATE_CODE`", length = 64)
|
||||
private String templateCode;
|
||||
|
||||
@Size(max = 4)
|
||||
@Column(name = "`TIMEOUT`", length = 4)
|
||||
private String timeout;
|
||||
@Size(max = 8)
|
||||
@Column(name = "`RESPONSE_METHOD`", length = 8)
|
||||
private String responseMethod;
|
||||
|
||||
@Size(max = 3)
|
||||
@Column(name = "`RE_TYPE`", length = 3)
|
||||
private String reType;
|
||||
@Size(max = 4)
|
||||
@Column(name = "`TIMEOUT`", length = 4)
|
||||
private String timeout;
|
||||
|
||||
@Size(max = 2000)
|
||||
@Column(name = "`RE_BODY`", length = 2000)
|
||||
private String reBody;
|
||||
@Size(max = 3)
|
||||
@Column(name = "`RE_TYPE`", length = 3)
|
||||
private String reType;
|
||||
|
||||
@Size(max = 1)
|
||||
@Column(name = "`RE_PART`", length = 1)
|
||||
private String rePart;
|
||||
@Size(max = 2000)
|
||||
@Column(name = "`RE_BODY`", length = 2000)
|
||||
private String reBody;
|
||||
|
||||
@Column(name = "`COVER_FLAG`")
|
||||
private Integer coverFlag;
|
||||
@Size(max = 1)
|
||||
@Column(name = "`RE_PART`", length = 1)
|
||||
private String rePart;
|
||||
|
||||
@Column(name = "`SMS_FLAG`")
|
||||
private Integer smsFlag;
|
||||
@Column(name = "`COVER_FLAG`")
|
||||
private Integer coverFlag;
|
||||
|
||||
@Column(name = "`REPLY_FLAG`")
|
||||
private Integer replyFlag;
|
||||
@Column(name = "`SMS_FLAG`")
|
||||
private Integer smsFlag;
|
||||
|
||||
@Column(name = "`RETRY_CNT`")
|
||||
private Integer retryCnt;
|
||||
@Column(name = "`REPLY_FLAG`")
|
||||
private Integer replyFlag;
|
||||
|
||||
@Size(max = 1000)
|
||||
@Column(name = "`ATTACHED_FILE`", length = 1000)
|
||||
private String attachedFile;
|
||||
@Column(name = "`RETRY_CNT`")
|
||||
private Integer retryCnt;
|
||||
|
||||
@Size(max = 64)
|
||||
@Column(name = "`VXML_FILE`", length = 64)
|
||||
private String vxmlFile;
|
||||
@Size(max = 1000)
|
||||
@Column(name = "`ATTACHED_FILE`", length = 1000)
|
||||
private String attachedFile;
|
||||
|
||||
@Column(name = "`USE_PAGE`")
|
||||
private Integer usePage;
|
||||
@Size(max = 64)
|
||||
@Column(name = "`VXML_FILE`", length = 64)
|
||||
private String vxmlFile;
|
||||
|
||||
@Column(name = "`USE_TIME`")
|
||||
private Integer useTime;
|
||||
@Column(name = "`USE_PAGE`")
|
||||
private Integer usePage;
|
||||
|
||||
@Column(name = "`SN_RESULT`")
|
||||
private Integer snResult;
|
||||
@Column(name = "`USE_TIME`")
|
||||
private Integer useTime;
|
||||
|
||||
@Size(max = 10)
|
||||
@Column(name = "`TEL_INFO`", length = 10)
|
||||
private String telInfo;
|
||||
@Column(name = "`SN_RESULT`")
|
||||
private Integer snResult;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "`CINFO`", length = 32)
|
||||
private String cinfo;
|
||||
@Size(max = 10)
|
||||
@Column(name = "`TEL_INFO`", length = 10)
|
||||
private String telInfo;
|
||||
|
||||
@Size(max = 30)
|
||||
@Column(name = "`USER_KEY`", length = 30)
|
||||
private String userKey;
|
||||
@Size(max = 32)
|
||||
@Column(name = "`CINFO`", length = 32)
|
||||
private String cinfo;
|
||||
|
||||
@Size(max = 1)
|
||||
@Column(name = "`AD_FLAG`", length = 1)
|
||||
private String adFalg;
|
||||
@Size(max = 30)
|
||||
@Column(name = "`USER_KEY`", length = 30)
|
||||
private String userKey;
|
||||
|
||||
@Size(max = 1)
|
||||
@Column(name = "`AD_FLAG`", length = 1)
|
||||
private String adFalg;
|
||||
}
|
||||
@@ -7,10 +7,13 @@ import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@@ -20,151 +23,152 @@ import java.time.LocalDateTime;
|
||||
@AllArgsConstructor
|
||||
@Table(name = "`BIZ_MSG`")
|
||||
public class BizMsgEntity {
|
||||
@Id
|
||||
@Size(max = 32)
|
||||
@Column(name = "`CMID`", nullable = false, length = 32)
|
||||
private String cmid;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "`UMID`", length = 32)
|
||||
private String umid;
|
||||
@Id
|
||||
@Size(max = 32)
|
||||
@Column(name = "`CMID`", nullable = false, length = 32)
|
||||
private String cmid;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "`MSG_TYPE`", nullable = false)
|
||||
private Integer msgType;
|
||||
@Size(max = 32)
|
||||
@Column(name = "`UMID`", length = 32)
|
||||
private String umid;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "`STATUS`", nullable = false)
|
||||
private Integer status;
|
||||
@NotNull
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "`MSG_TYPE`", nullable = false)
|
||||
private Integer msgType;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "`CALL_STATUS`", length = 32)
|
||||
private String callStatus;
|
||||
@NotNull
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "`STATUS`", nullable = false)
|
||||
private Integer status;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "`REQUEST_TIME`", nullable = false)
|
||||
private LocalDateTime requestTime;
|
||||
@Size(max = 32)
|
||||
@Column(name = "`CALL_STATUS`", length = 32)
|
||||
private String callStatus;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "`SEND_TIME`", nullable = false)
|
||||
private LocalDateTime sendTime;
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "`REQUEST_TIME`", nullable = false)
|
||||
private LocalDateTime requestTime;
|
||||
|
||||
@Column(name = "`REPORT_TIME`")
|
||||
private LocalDateTime reportTime;
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "`SEND_TIME`", nullable = false)
|
||||
private LocalDateTime sendTime;
|
||||
|
||||
@Size(max = 16)
|
||||
@NotNull
|
||||
@Column(name = "`DEST_PHONE`", nullable = false, length = 16)
|
||||
private String destPhone;
|
||||
@Column(name = "`REPORT_TIME`")
|
||||
private LocalDateTime reportTime;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "`DEST_NAME`", length = 32)
|
||||
private String destName;
|
||||
@Size(max = 16)
|
||||
@NotNull
|
||||
@Column(name = "`DEST_PHONE`", nullable = false, length = 16)
|
||||
private String destPhone;
|
||||
|
||||
@Size(max = 16)
|
||||
@NotNull
|
||||
@Column(name = "`SEND_PHONE`", nullable = false, length = 16)
|
||||
private String sendPhone;
|
||||
@Size(max = 32)
|
||||
@Column(name = "`DEST_NAME`", length = 32)
|
||||
private String destName;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "`SEND_NAME`", length = 32)
|
||||
private String sendName;
|
||||
@Size(max = 16)
|
||||
@NotNull
|
||||
@Column(name = "`SEND_PHONE`", nullable = false, length = 16)
|
||||
private String sendPhone;
|
||||
|
||||
@Size(max = 64)
|
||||
@Column(name = "`SUBJECT`", length = 64)
|
||||
private String subject;
|
||||
@Size(max = 32)
|
||||
@Column(name = "`SEND_NAME`", length = 32)
|
||||
private String sendName;
|
||||
|
||||
@Size(max = 2000)
|
||||
@NotNull
|
||||
@Column(name = "`MSG_BODY`", nullable = false, length = 2000)
|
||||
private String msgBody;
|
||||
@Size(max = 64)
|
||||
@Column(name = "`SUBJECT`", length = 64)
|
||||
private String subject;
|
||||
|
||||
@Size(max = 5)
|
||||
@Column(name = "`NATION_CODE`", length = 5)
|
||||
private String nationCode;
|
||||
@Size(max = 2000)
|
||||
@NotNull
|
||||
@Column(name = "`MSG_BODY`", nullable = false, length = 2000)
|
||||
private String msgBody;
|
||||
|
||||
@Size(max = 40)
|
||||
@Column(name = "`SENDER_KEY`", length = 40)
|
||||
private String senderKey;
|
||||
@Size(max = 5)
|
||||
@Column(name = "`NATION_CODE`", length = 5)
|
||||
private String nationCode;
|
||||
|
||||
@Size(max = 64)
|
||||
@Column(name = "`TEMPLATE_CODE`", length = 64)
|
||||
private String templateCode;
|
||||
@Size(max = 40)
|
||||
@Column(name = "`SENDER_KEY`", length = 40)
|
||||
private String senderKey;
|
||||
|
||||
@Size(max = 8)
|
||||
@Column(name = "`RESPONSE_METHOD`", length = 8)
|
||||
private String responseMethod;
|
||||
@Size(max = 64)
|
||||
@Column(name = "`TEMPLATE_CODE`", length = 64)
|
||||
private String templateCode;
|
||||
|
||||
@Size(max = 4)
|
||||
@Column(name = "`TIMEOUT`", length = 4)
|
||||
private String timeout;
|
||||
@Size(max = 8)
|
||||
@Column(name = "`RESPONSE_METHOD`", length = 8)
|
||||
private String responseMethod;
|
||||
|
||||
@Size(max = 3)
|
||||
@Column(name = "`RE_TYPE`", length = 3)
|
||||
private String reType;
|
||||
@Size(max = 4)
|
||||
@Column(name = "`TIMEOUT`", length = 4)
|
||||
private String timeout;
|
||||
|
||||
@Size(max = 2000)
|
||||
@Column(name = "`RE_BODY`", length = 2000)
|
||||
private String reBody;
|
||||
@Size(max = 3)
|
||||
@Column(name = "`RE_TYPE`", length = 3)
|
||||
private String reType;
|
||||
|
||||
@Size(max = 1)
|
||||
@Column(name = "`RE_PART`", length = 1)
|
||||
private String rePart;
|
||||
@Size(max = 2000)
|
||||
@Column(name = "`RE_BODY`", length = 2000)
|
||||
private String reBody;
|
||||
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "`COVER_FLAG`")
|
||||
private Integer coverFlag;
|
||||
@Size(max = 1)
|
||||
@Column(name = "`RE_PART`", length = 1)
|
||||
private String rePart;
|
||||
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "`SMS_FLAG`")
|
||||
private Integer smsFlag;
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "`COVER_FLAG`")
|
||||
private Integer coverFlag;
|
||||
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "`REPLY_FLAG`")
|
||||
private Integer replyFlag;
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "`SMS_FLAG`")
|
||||
private Integer smsFlag;
|
||||
|
||||
@Column(name = "`RETRY_CNT`")
|
||||
private Integer retryCnt;
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "`REPLY_FLAG`")
|
||||
private Integer replyFlag;
|
||||
|
||||
@Size(max = 1000)
|
||||
@Column(name = "`ATTACHED_FILE`", length = 1000)
|
||||
private String attachedFile;
|
||||
@Column(name = "`RETRY_CNT`")
|
||||
private Integer retryCnt;
|
||||
|
||||
@Size(max = 64)
|
||||
@Column(name = "`VXML_FILE`", length = 64)
|
||||
private String vxmlFile;
|
||||
@Size(max = 1000)
|
||||
@Column(name = "`ATTACHED_FILE`", length = 1000)
|
||||
private String attachedFile;
|
||||
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "`USE_PAGE`")
|
||||
private Integer usePage;
|
||||
@Size(max = 64)
|
||||
@Column(name = "`VXML_FILE`", length = 64)
|
||||
private String vxmlFile;
|
||||
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "`USE_TIME`")
|
||||
private Integer useTime;
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "`USE_PAGE`")
|
||||
private Integer usePage;
|
||||
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "`SN_RESULT`")
|
||||
private Integer snResult;
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "`USE_TIME`")
|
||||
private Integer useTime;
|
||||
|
||||
@Size(max = 10)
|
||||
@Column(name = "`TEL_INFO`", length = 10)
|
||||
private String telInfo;
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "`SN_RESULT`")
|
||||
private Integer snResult;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "`CINFO`", length = 32)
|
||||
private String cinfo;
|
||||
@Size(max = 10)
|
||||
@Column(name = "`TEL_INFO`", length = 10)
|
||||
private String telInfo;
|
||||
|
||||
@Size(max = 30)
|
||||
@Column(name = "`USER_KEY`", length = 30)
|
||||
private String userKey;
|
||||
@Size(max = 32)
|
||||
@Column(name = "`CINFO`", length = 32)
|
||||
private String cinfo;
|
||||
|
||||
@Size(max = 1)
|
||||
@Column(name = "`AD_FLAG`", length = 1)
|
||||
private String adFalg;
|
||||
@Size(max = 30)
|
||||
@Column(name = "`USER_KEY`", length = 30)
|
||||
private String userKey;
|
||||
|
||||
@Size(max = 1)
|
||||
@Column(name = "`AD_FLAG`", length = 1)
|
||||
private String adFalg;
|
||||
|
||||
/*
|
||||
@Size(max = 32)
|
||||
@@ -172,24 +176,24 @@ public class BizMsgEntity {
|
||||
private String rcsRefkey;
|
||||
*/
|
||||
|
||||
public static BizMsgEntity fromSend(TSendEntity s){
|
||||
int msgType = s.getSendTy().equals(SendType.SMS.getCode()) ? 0 : 5;
|
||||
String subject = s.getSendTy().equals(SendType.SMS.getCode()) ? null : s.getMsgTitle();
|
||||
public static BizMsgEntity fromSend(TSendEntity s) {
|
||||
int msgType = s.getSendTy().equals(SendType.SMS.getCode()) ? 0 : 5;
|
||||
String subject = s.getSendTy().equals(SendType.SMS.getCode()) ? null : s.getMsgTitle();
|
||||
|
||||
return BizMsgEntity.builder()
|
||||
.cmid(s.getCmid())
|
||||
.msgType(msgType)
|
||||
.status(0)
|
||||
.requestTime(s.getRegDt())
|
||||
.sendTime(s.getSendDt())
|
||||
.destPhone(s.getDestTel().replace("-", ""))
|
||||
.destName(s.getDestNm())
|
||||
.sendPhone(s.getSendTel().replace("-", ""))
|
||||
.sendName(s.getSendNm())
|
||||
.subject(subject)
|
||||
.msgBody(s.getMsgBody())
|
||||
.cinfo(s.getReqstSvc())
|
||||
.build();
|
||||
}
|
||||
return BizMsgEntity.builder()
|
||||
.cmid(s.getCmid())
|
||||
.msgType(msgType)
|
||||
.status(0)
|
||||
.requestTime(s.getRegDt())
|
||||
.sendTime(s.getSendDt())
|
||||
.destPhone(s.getDestTel().replace("-", ""))
|
||||
.destName(s.getDestNm())
|
||||
.sendPhone(s.getSendTel().replace("-", ""))
|
||||
.sendName(s.getSendNm())
|
||||
.subject(subject)
|
||||
.msgBody(s.getMsgBody())
|
||||
.cinfo(s.getReqstSvc())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,13 +2,19 @@ package com.kri.notihub.server.persistence.entity;
|
||||
|
||||
import com.kri.common.jpa.BaseUuidEntity;
|
||||
import com.kri.notihub.server.dto.send.BulkSendCreateRequestDto;
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@@ -18,97 +24,98 @@ import java.time.LocalDateTime;
|
||||
@AllArgsConstructor
|
||||
@Table(name = "t_bulk_send")
|
||||
public class TBulkSendEntity extends BaseUuidEntity {
|
||||
@Id
|
||||
@Size(max = 32)
|
||||
@Column(name = "bulk_send_key", nullable = false, length = 32)
|
||||
private String bulkSendKey;
|
||||
|
||||
@Size(max = 16)
|
||||
@NotNull
|
||||
@Column(name = "reqst_svc", nullable = false, length = 16)
|
||||
private String reqstSvc;
|
||||
@Id
|
||||
@Size(max = 32)
|
||||
@Column(name = "bulk_send_key", nullable = false, length = 32)
|
||||
private String bulkSendKey;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "prjct_cd", nullable = false, length = 32)
|
||||
private String prjctCd;
|
||||
@Size(max = 16)
|
||||
@NotNull
|
||||
@Column(name = "reqst_svc", nullable = false, length = 16)
|
||||
private String reqstSvc;
|
||||
|
||||
@Column(name = "tmplat_idx", columnDefinition = "int UNSIGNED")
|
||||
private Long tmplatIdx;
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "prjct_cd", nullable = false, length = 32)
|
||||
private String prjctCd;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "is_resve", nullable = false)
|
||||
private Boolean resve = false;
|
||||
@Column(name = "tmplat_idx", columnDefinition = "int UNSIGNED")
|
||||
private Long tmplatIdx;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "send_dt", nullable = false)
|
||||
private LocalDateTime sendDt;
|
||||
@NotNull
|
||||
@Column(name = "is_resve", nullable = false)
|
||||
private Boolean resve = false;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "trgt_cnt", nullable = false)
|
||||
private Integer trgtCnt;
|
||||
@NotNull
|
||||
@Column(name = "send_dt", nullable = false)
|
||||
private LocalDateTime sendDt;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "send_cnt", nullable = false)
|
||||
private Integer sendCnt;
|
||||
@NotNull
|
||||
@Column(name = "trgt_cnt", nullable = false)
|
||||
private Integer trgtCnt;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "succes_cnt", nullable = false)
|
||||
private Integer succesCnt;
|
||||
@NotNull
|
||||
@Column(name = "send_cnt", nullable = false)
|
||||
private Integer sendCnt;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "fail_cnt", nullable = false)
|
||||
private Integer failCnt;
|
||||
@NotNull
|
||||
@Column(name = "succes_cnt", nullable = false)
|
||||
private Integer succesCnt;
|
||||
|
||||
@Column(name = "complete_dt")
|
||||
private LocalDateTime completeDt;
|
||||
@NotNull
|
||||
@Column(name = "fail_cnt", nullable = false)
|
||||
private Integer failCnt;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_cmpn", nullable = false, length = 32)
|
||||
private String regCmpn;
|
||||
@Column(name = "complete_dt")
|
||||
private LocalDateTime completeDt;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32)
|
||||
private String regUser;
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_cmpn", nullable = false, length = 32)
|
||||
private String regCmpn;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private LocalDateTime regDt;
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32)
|
||||
private String regUser;
|
||||
|
||||
public static TBulkSendEntity from(BulkSendCreateRequestDto req, LocalDateTime now) {
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private LocalDateTime regDt;
|
||||
|
||||
return TBulkSendEntity.builder()
|
||||
.reqstSvc(req.getReqstSvc())
|
||||
.prjctCd(req.getPrjctCd())
|
||||
.tmplatIdx(req.getTmplatIdx())
|
||||
.resve(req.getResve())
|
||||
.sendDt(req.getSendDt() != null ? req.getSendDt() : now)
|
||||
.trgtCnt(req.getTrgtCnt())
|
||||
.sendCnt(0)
|
||||
.succesCnt(0)
|
||||
.failCnt(0)
|
||||
.completeDt(null)
|
||||
.regCmpn(req.getReqstCmpn())
|
||||
.regUser(req.getReqstUser())
|
||||
.regDt(now)
|
||||
.build();
|
||||
}
|
||||
public static TBulkSendEntity from(BulkSendCreateRequestDto req, LocalDateTime now) {
|
||||
|
||||
@Override
|
||||
protected String getId() {
|
||||
return this.bulkSendKey;
|
||||
}
|
||||
return TBulkSendEntity.builder()
|
||||
.reqstSvc(req.getReqstSvc())
|
||||
.prjctCd(req.getPrjctCd())
|
||||
.tmplatIdx(req.getTmplatIdx())
|
||||
.resve(req.getResve())
|
||||
.sendDt(req.getSendDt() != null ? req.getSendDt() : now)
|
||||
.trgtCnt(req.getTrgtCnt())
|
||||
.sendCnt(0)
|
||||
.succesCnt(0)
|
||||
.failCnt(0)
|
||||
.completeDt(null)
|
||||
.regCmpn(req.getReqstCmpn())
|
||||
.regUser(req.getReqstUser())
|
||||
.regDt(now)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setId(String id) {
|
||||
this.bulkSendKey = id;
|
||||
}
|
||||
@Override
|
||||
protected String getId() {
|
||||
return this.bulkSendKey;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int idLength() {
|
||||
return 32; // cmid가 32면 생략해도 되지만 명시해두면 안전
|
||||
}
|
||||
@Override
|
||||
protected void setId(String id) {
|
||||
this.bulkSendKey = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int idLength() {
|
||||
return 32; // cmid가 32면 생략해도 되지만 명시해두면 안전
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,22 @@
|
||||
package com.kri.notihub.server.persistence.entity;
|
||||
|
||||
import io.hypersistence.utils.hibernate.type.json.JsonType;
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
import org.hibernate.annotations.Type;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
import org.hibernate.annotations.Type;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@@ -19,58 +27,58 @@ import java.util.Map;
|
||||
@Table(name = "t_resve_send")
|
||||
public class TResveSendEntity {
|
||||
|
||||
@Id
|
||||
@NotNull
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "resve_idx", nullable = false)
|
||||
private Long resveIdx;
|
||||
@Id
|
||||
@NotNull
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "resve_idx", nullable = false)
|
||||
private Long resveIdx;
|
||||
|
||||
@Column(name = "bulk_send_key", length = 32)
|
||||
private String bulkSendKey;
|
||||
@Column(name = "bulk_send_key", length = 32)
|
||||
private String bulkSendKey;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "send_ty", nullable = false)
|
||||
private Short sendTy;
|
||||
@NotNull
|
||||
@Column(name = "send_ty", nullable = false)
|
||||
private Short sendTy;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "reqst_svc", nullable = false, length = 16)
|
||||
private String reqstSvc;
|
||||
@NotNull
|
||||
@Column(name = "reqst_svc", nullable = false, length = 16)
|
||||
private String reqstSvc;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "prjct_cd", nullable = false, length = 32)
|
||||
private String prjctCd;
|
||||
@NotNull
|
||||
@Column(name = "prjct_cd", nullable = false, length = 32)
|
||||
private String prjctCd;
|
||||
|
||||
@Column(name = "tmplat_idx")
|
||||
private Long tmplatIdx;
|
||||
@Column(name = "tmplat_idx")
|
||||
private Long tmplatIdx;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "resve_dt", nullable = false)
|
||||
private LocalDateTime resveDt;
|
||||
@NotNull
|
||||
@Column(name = "resve_dt", nullable = false)
|
||||
private LocalDateTime resveDt;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "sid", nullable = false)
|
||||
private Integer sid;
|
||||
@NotNull
|
||||
@Column(name = "sid", nullable = false)
|
||||
private Integer sid;
|
||||
|
||||
@NotNull
|
||||
@Type(JsonType.class)
|
||||
@Column(name = "msg_param", nullable = false, columnDefinition = "json")
|
||||
private Map<String, Object> msgParam;
|
||||
@NotNull
|
||||
@Type(JsonType.class)
|
||||
@Column(name = "msg_param", nullable = false, columnDefinition = "json")
|
||||
private Map<String, Object> msgParam;
|
||||
|
||||
@Column(name = "dest_eml", length = 64)
|
||||
private String destEml;
|
||||
@Column(name = "dest_eml", length = 64)
|
||||
private String destEml;
|
||||
|
||||
@Column(name = "dest_tel", length = 16)
|
||||
private String destTel;
|
||||
@Column(name = "dest_tel", length = 16)
|
||||
private String destTel;
|
||||
|
||||
@Column(name = "dest_nm", length = 32)
|
||||
private String destNm;
|
||||
@Column(name = "dest_nm", length = 32)
|
||||
private String destNm;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32)
|
||||
private String regUser;
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32)
|
||||
private String regUser;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private LocalDateTime regDt;
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private LocalDateTime regDt;
|
||||
}
|
||||
|
||||
@@ -7,15 +7,24 @@ import com.kri.notihub.server.dto.send.SendInternalResultDto;
|
||||
import com.kri.notihub.server.dto.send.SendRequestBasicDto;
|
||||
import com.kri.notihub.server.dto.send.SendRequestSingleDto;
|
||||
import io.hypersistence.utils.hibernate.type.json.JsonType;
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Lob;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
import org.hibernate.annotations.Type;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Map;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
import org.hibernate.annotations.Type;
|
||||
|
||||
@Builder
|
||||
@Getter
|
||||
@@ -26,207 +35,214 @@ import java.util.Map;
|
||||
@Table(name = "t_send")
|
||||
public class TSendEntity {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "send_idx", nullable = false)
|
||||
private Long sendIdx;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "send_idx", nullable = false)
|
||||
private Long sendIdx;
|
||||
|
||||
@NotNull
|
||||
@Size(max = 32)
|
||||
@Column(name = "cmid", nullable = false, length = 32)
|
||||
private String cmid;
|
||||
@NotNull
|
||||
@Size(max = 32)
|
||||
@Column(name = "cmid", nullable = false, length = 32)
|
||||
private String cmid;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "bulk_send_key", length = 32)
|
||||
private String bulkSendKey;
|
||||
@Size(max = 32)
|
||||
@Column(name = "bulk_send_key", length = 32)
|
||||
private String bulkSendKey;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "send_ty", nullable = false)
|
||||
private Short sendTy;
|
||||
@NotNull
|
||||
@Column(name = "send_ty", nullable = false)
|
||||
private Short sendTy;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "is_resve", nullable = false)
|
||||
private boolean resve = false;
|
||||
@NotNull
|
||||
@Column(name = "is_resve", nullable = false)
|
||||
private boolean resve = false;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "send_corp", nullable = false)
|
||||
private Short sendCorp;
|
||||
@NotNull
|
||||
@Column(name = "send_corp", nullable = false)
|
||||
private Short sendCorp;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "send_status", nullable = false)
|
||||
private Short sendStatus;
|
||||
@NotNull
|
||||
@Column(name = "send_status", nullable = false)
|
||||
private Short sendStatus;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "result_code", nullable = false)
|
||||
private Short resultCode;
|
||||
@NotNull
|
||||
@Column(name = "result_code", nullable = false)
|
||||
private Short resultCode;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "itrnt_prjct_cd", nullable = false, length = 32)
|
||||
private String itrntPrjctCd;
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "itrnt_prjct_cd", nullable = false, length = 32)
|
||||
private String itrntPrjctCd;
|
||||
|
||||
@Size(max = 16)
|
||||
@NotNull
|
||||
@Column(name = "reqst_svc", nullable = false, length = 16)
|
||||
private String reqstSvc;
|
||||
@Size(max = 16)
|
||||
@NotNull
|
||||
@Column(name = "reqst_svc", nullable = false, length = 16)
|
||||
private String reqstSvc;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "prjct_cd", nullable = false, length = 32)
|
||||
private String prjctCd;
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "prjct_cd", nullable = false, length = 32)
|
||||
private String prjctCd;
|
||||
|
||||
@Column(name = "tmplat_idx", columnDefinition = "int UNSIGNED")
|
||||
private Long tmplatIdx;
|
||||
@Column(name = "tmplat_idx", columnDefinition = "int UNSIGNED")
|
||||
private Long tmplatIdx;
|
||||
|
||||
@Size(max = 64)
|
||||
@Column(name = "send_eml", length = 64)
|
||||
private String sendEml;
|
||||
@Size(max = 64)
|
||||
@Column(name = "send_eml", length = 64)
|
||||
private String sendEml;
|
||||
|
||||
@Size(max = 16)
|
||||
@Column(name = "send_tel", length = 16)
|
||||
private String sendTel;
|
||||
@Size(max = 16)
|
||||
@Column(name = "send_tel", length = 16)
|
||||
private String sendTel;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "send_nm", length = 32)
|
||||
private String sendNm;
|
||||
@Size(max = 32)
|
||||
@Column(name = "send_nm", length = 32)
|
||||
private String sendNm;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "send_dt", nullable = false)
|
||||
private LocalDateTime sendDt;
|
||||
@NotNull
|
||||
@Column(name = "send_dt", nullable = false)
|
||||
private LocalDateTime sendDt;
|
||||
|
||||
@NotNull
|
||||
@Size(max = 128)
|
||||
@Column(name = "sid", nullable = false, length = 128)
|
||||
private String sid;
|
||||
@NotNull
|
||||
@Size(max = 128)
|
||||
@Column(name = "sid", nullable = false, length = 128)
|
||||
private String sid;
|
||||
|
||||
@Size(max = 128)
|
||||
@Column(name = "msg_title", length = 128)
|
||||
private String msgTitle;
|
||||
@Size(max = 128)
|
||||
@Column(name = "msg_title", length = 128)
|
||||
private String msgTitle;
|
||||
|
||||
@NotNull
|
||||
@Lob
|
||||
@Column(name = "msg_body", nullable = false)
|
||||
private String msgBody;
|
||||
@NotNull
|
||||
@Lob
|
||||
@Column(name = "msg_body", nullable = false)
|
||||
private String msgBody;
|
||||
|
||||
@NotNull
|
||||
@Type(JsonType.class)
|
||||
@Column(name = "msg_param", nullable = false)
|
||||
private Map<String, String> msgParam;
|
||||
@NotNull
|
||||
@Type(JsonType.class)
|
||||
@Column(name = "msg_param", nullable = false)
|
||||
private Map<String, String> msgParam;
|
||||
|
||||
@Size(max = 64)
|
||||
@Column(name = "dest_eml", length = 64)
|
||||
private String destEml;
|
||||
@Size(max = 64)
|
||||
@Column(name = "dest_eml", length = 64)
|
||||
private String destEml;
|
||||
|
||||
@Size(max = 16)
|
||||
@Column(name = "dest_tel", length = 16)
|
||||
private String destTel;
|
||||
@Size(max = 16)
|
||||
@Column(name = "dest_tel", length = 16)
|
||||
private String destTel;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "dest_nm", length = 32)
|
||||
private String destNm;
|
||||
@Size(max = 32)
|
||||
@Column(name = "dest_nm", length = 32)
|
||||
private String destNm;
|
||||
|
||||
@Column(name = "report_dt")
|
||||
private LocalDateTime reportDt;
|
||||
@Column(name = "report_dt")
|
||||
private LocalDateTime reportDt;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_cmpn", nullable = false, length = 32)
|
||||
private String regCmpn;
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_cmpn", nullable = false, length = 32)
|
||||
private String regCmpn;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32)
|
||||
private String regUser;
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32)
|
||||
private String regUser;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private LocalDateTime regDt;
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private LocalDateTime regDt;
|
||||
|
||||
public static TSendEntity from(
|
||||
SendRequestSingleDto req,
|
||||
SendType sendTy,
|
||||
SendInternalResultDto sendResult,
|
||||
String itrntPrjctCd,
|
||||
String msgTitle,
|
||||
String msgBody,
|
||||
String regCmpn,
|
||||
String regUser,
|
||||
Boolean resve,
|
||||
LocalDateTime sendDt,
|
||||
LocalDateTime regDt
|
||||
){
|
||||
if (req == null) return null;
|
||||
return from(
|
||||
req,
|
||||
req.getDestInfo(),
|
||||
sendTy,
|
||||
sendResult,
|
||||
itrntPrjctCd,
|
||||
req.getReqstSvc(),
|
||||
req.getPrjctCd(),
|
||||
req.getTmplatIdx(),
|
||||
msgTitle,
|
||||
msgBody,
|
||||
regCmpn,
|
||||
regUser,
|
||||
resve,
|
||||
sendDt,
|
||||
null,
|
||||
regDt
|
||||
);
|
||||
public static TSendEntity from(
|
||||
SendRequestSingleDto req,
|
||||
SendType sendTy,
|
||||
SendInternalResultDto sendResult,
|
||||
String itrntPrjctCd,
|
||||
String msgTitle,
|
||||
String msgBody,
|
||||
String regCmpn,
|
||||
String regUser,
|
||||
Boolean resve,
|
||||
LocalDateTime sendDt,
|
||||
LocalDateTime regDt
|
||||
) {
|
||||
if (req == null) {
|
||||
return null;
|
||||
}
|
||||
return from(
|
||||
req,
|
||||
req.getDestInfo(),
|
||||
sendTy,
|
||||
sendResult,
|
||||
itrntPrjctCd,
|
||||
req.getReqstSvc(),
|
||||
req.getPrjctCd(),
|
||||
req.getTmplatIdx(),
|
||||
msgTitle,
|
||||
msgBody,
|
||||
regCmpn,
|
||||
regUser,
|
||||
resve,
|
||||
sendDt,
|
||||
null,
|
||||
regDt
|
||||
);
|
||||
}
|
||||
|
||||
public static TSendEntity from(
|
||||
SendRequestBasicDto basic,
|
||||
DestInfoDto dest,
|
||||
SendType sendTy,
|
||||
SendInternalResultDto sendResult,
|
||||
String itrntPrjctCd,
|
||||
String reqstSvc,
|
||||
String prjctCd,
|
||||
Long tmplatIdx,
|
||||
String msgTitle,
|
||||
String msgBody,
|
||||
String regCmpn,
|
||||
String regUser,
|
||||
Boolean resve,
|
||||
LocalDateTime sendDt,
|
||||
String bulkSendKey,
|
||||
LocalDateTime regDt
|
||||
) {
|
||||
if (basic == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static TSendEntity from(
|
||||
SendRequestBasicDto basic,
|
||||
DestInfoDto dest,
|
||||
SendType sendTy,
|
||||
SendInternalResultDto sendResult,
|
||||
String itrntPrjctCd,
|
||||
String reqstSvc,
|
||||
String prjctCd,
|
||||
Long tmplatIdx,
|
||||
String msgTitle,
|
||||
String msgBody,
|
||||
String regCmpn,
|
||||
String regUser,
|
||||
Boolean resve,
|
||||
LocalDateTime sendDt,
|
||||
String bulkSendKey,
|
||||
LocalDateTime regDt
|
||||
){
|
||||
if (basic == null) return null;
|
||||
|
||||
if (dest == null) return null;
|
||||
|
||||
Short sendCorp = sendTy == SendType.EMAIL ? SendCorpType.PRINGO.getCode() : SendCorpType.BIZ_PPURIO.getCode();
|
||||
|
||||
return TSendEntity.builder()
|
||||
.cmid(sendResult.getCmid())
|
||||
.bulkSendKey(bulkSendKey)
|
||||
.sendTy(sendTy.getCode())
|
||||
.resve(resve)
|
||||
.sendCorp(sendCorp)
|
||||
.sendStatus(sendResult.getStatus().getCode())
|
||||
.resultCode(sendResult.getResultCode())
|
||||
.itrntPrjctCd(itrntPrjctCd)
|
||||
.reqstSvc(reqstSvc)
|
||||
.prjctCd(prjctCd)
|
||||
.tmplatIdx(tmplatIdx)
|
||||
.sendEml(basic.getSendEml())
|
||||
.sendTel(basic.getSendTel())
|
||||
.sendNm(basic.getSendNm())
|
||||
.sendDt(sendDt)
|
||||
.sid(dest.getSid())
|
||||
.msgTitle(msgTitle)
|
||||
.msgBody(msgBody)
|
||||
.msgParam(dest.getMsgParam() != null? dest.getMsgParam() : Map.of())
|
||||
.destEml(dest.getDestEml())
|
||||
.destTel(dest.getDestTel())
|
||||
.destNm(dest.getDestNm())
|
||||
.regCmpn(regCmpn)
|
||||
.regUser(regUser)
|
||||
.regDt(regDt)
|
||||
.build();
|
||||
if (dest == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Short sendCorp = sendTy == SendType.EMAIL ? SendCorpType.PRINGO.getCode()
|
||||
: SendCorpType.BIZ_PPURIO.getCode();
|
||||
|
||||
return TSendEntity.builder()
|
||||
.cmid(sendResult.getCmid())
|
||||
.bulkSendKey(bulkSendKey)
|
||||
.sendTy(sendTy.getCode())
|
||||
.resve(resve)
|
||||
.sendCorp(sendCorp)
|
||||
.sendStatus(sendResult.getStatus().getCode())
|
||||
.resultCode(sendResult.getResultCode())
|
||||
.itrntPrjctCd(itrntPrjctCd)
|
||||
.reqstSvc(reqstSvc)
|
||||
.prjctCd(prjctCd)
|
||||
.tmplatIdx(tmplatIdx)
|
||||
.sendEml(basic.getSendEml())
|
||||
.sendTel(basic.getSendTel())
|
||||
.sendNm(basic.getSendNm())
|
||||
.sendDt(sendDt)
|
||||
.sid(dest.getSid())
|
||||
.msgTitle(msgTitle)
|
||||
.msgBody(msgBody)
|
||||
.msgParam(dest.getMsgParam() != null ? dest.getMsgParam() : Map.of())
|
||||
.destEml(dest.getDestEml())
|
||||
.destTel(dest.getDestTel())
|
||||
.destNm(dest.getDestNm())
|
||||
.regCmpn(regCmpn)
|
||||
.regUser(regUser)
|
||||
.regDt(regDt)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -14,28 +14,33 @@ import lombok.Setter;
|
||||
@Entity
|
||||
@Table(name = "t_send_result_code")
|
||||
public class TSendResultCodeEntity {
|
||||
@EmbeddedId
|
||||
private TSendResultCodeEntityId id;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "result_ty", nullable = false)
|
||||
private Short resultTy;
|
||||
@EmbeddedId
|
||||
private TSendResultCodeEntityId id;
|
||||
|
||||
@Size(max = 128)
|
||||
@NotNull
|
||||
@Column(name = "result_label", nullable = false, length = 128)
|
||||
private String resultLabel;
|
||||
@NotNull
|
||||
@Column(name = "result_ty", nullable = false)
|
||||
private Short resultTy;
|
||||
|
||||
@Size(max = 128)
|
||||
@NotNull
|
||||
@Column(name = "result_view_label", nullable = false, length = 128)
|
||||
private String resultViewLabel;
|
||||
@Size(max = 128)
|
||||
@NotNull
|
||||
@Column(name = "result_label", nullable = false, length = 128)
|
||||
private String resultLabel;
|
||||
|
||||
@Size(max = 128)
|
||||
@Column(name = "memo", length = 128)
|
||||
private String memo;
|
||||
@Size(max = 128)
|
||||
@NotNull
|
||||
@Column(name = "result_view_label", nullable = false, length = 128)
|
||||
private String resultViewLabel;
|
||||
|
||||
public short getSendCorp() { return id.getSendCorp(); }
|
||||
@Size(max = 128)
|
||||
@Column(name = "memo", length = 128)
|
||||
private String memo;
|
||||
|
||||
public short getResultCode() { return id.getResultCode(); }
|
||||
public short getSendCorp() {
|
||||
return id.getSendCorp();
|
||||
}
|
||||
|
||||
public short getResultCode() {
|
||||
return id.getResultCode();
|
||||
}
|
||||
}
|
||||
@@ -3,38 +3,42 @@ package com.kri.notihub.server.persistence.entity;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Embeddable;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.Hibernate;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Embeddable
|
||||
public class TSendResultCodeEntityId implements Serializable {
|
||||
private static final long serialVersionUID = -53054354660031517L;
|
||||
@NotNull
|
||||
@Column(name = "send_corp", nullable = false)
|
||||
private Short sendCorp;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "result_code", nullable = false)
|
||||
private Short resultCode;
|
||||
private static final long serialVersionUID = -53054354660031517L;
|
||||
@NotNull
|
||||
@Column(name = "send_corp", nullable = false)
|
||||
private Short sendCorp;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
|
||||
TSendResultCodeEntityId entity = (TSendResultCodeEntityId) o;
|
||||
return Objects.equals(this.sendCorp, entity.sendCorp) &&
|
||||
Objects.equals(this.resultCode, entity.resultCode);
|
||||
@NotNull
|
||||
@Column(name = "result_code", nullable = false)
|
||||
private Short resultCode;
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(sendCorp, resultCode);
|
||||
if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) {
|
||||
return false;
|
||||
}
|
||||
TSendResultCodeEntityId entity = (TSendResultCodeEntityId) o;
|
||||
return Objects.equals(this.sendCorp, entity.sendCorp) &&
|
||||
Objects.equals(this.resultCode, entity.resultCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(sendCorp, resultCode);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,13 +1,22 @@
|
||||
package com.kri.notihub.server.persistence.entity;
|
||||
|
||||
import com.kri.notihub.server.dto.template.TemplateBasicDto;
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Lob;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
@Builder
|
||||
@Getter
|
||||
@@ -17,108 +26,110 @@ import java.time.LocalDateTime;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TTmplatEntity {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "tmplat_idx", columnDefinition = "int UNSIGNED not null")
|
||||
private Long tmplatIdx;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "itrnt_prjct_cd", nullable = false, length = 32)
|
||||
private String itrntPrjctCd;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "tmplat_idx", columnDefinition = "int UNSIGNED not null")
|
||||
private Long tmplatIdx;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "tmplat_ty", nullable = false)
|
||||
private Short tmplatTy;
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "itrnt_prjct_cd", nullable = false, length = 32)
|
||||
private String itrntPrjctCd;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "tmplat_nm", nullable = false, length = 32)
|
||||
private String tmplatNm;
|
||||
@NotNull
|
||||
@Column(name = "tmplat_ty", nullable = false)
|
||||
private Short tmplatTy;
|
||||
|
||||
@Size(max = 128)
|
||||
@Column(name = "tmplat_title", length = 128)
|
||||
private String tmplatTitle;
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "tmplat_nm", nullable = false, length = 32)
|
||||
private String tmplatNm;
|
||||
|
||||
@NotNull
|
||||
@Lob
|
||||
@Column(name = "tmplat_body", nullable = false)
|
||||
private String tmplatBody;
|
||||
@Size(max = 128)
|
||||
@Column(name = "tmplat_title", length = 128)
|
||||
private String tmplatTitle;
|
||||
|
||||
@Column(name = "delay_time")
|
||||
private Short delayTime;
|
||||
@NotNull
|
||||
@Lob
|
||||
@Column(name = "tmplat_body", nullable = false)
|
||||
private String tmplatBody;
|
||||
|
||||
@Size(max = 16)
|
||||
@Column(name = "send_tel", length = 16)
|
||||
private String sendTel;
|
||||
@Column(name = "delay_time")
|
||||
private Short delayTime;
|
||||
|
||||
@Size(max = 64)
|
||||
@Column(name = "send_eml", length = 64)
|
||||
private String sendEml;
|
||||
@Size(max = 16)
|
||||
@Column(name = "send_tel", length = 16)
|
||||
private String sendTel;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "send_nm", length = 32)
|
||||
private String sendNm;
|
||||
@Size(max = 64)
|
||||
@Column(name = "send_eml", length = 64)
|
||||
private String sendEml;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32, updatable = false)
|
||||
private String regUser;
|
||||
@Size(max = 32)
|
||||
@Column(name = "send_nm", length = 32)
|
||||
private String sendNm;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false, updatable = false)
|
||||
private LocalDateTime regDt;
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32, updatable = false)
|
||||
private String regUser;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "mod_user", length = 32, insertable = false)
|
||||
private String modUser;
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false, updatable = false)
|
||||
private LocalDateTime regDt;
|
||||
|
||||
@Column(name = "mod_dt", insertable = false)
|
||||
private LocalDateTime modDt;
|
||||
@Size(max = 32)
|
||||
@Column(name = "mod_user", length = 32, insertable = false)
|
||||
private String modUser;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "is_del", nullable = false)
|
||||
private Boolean del = false;
|
||||
@Column(name = "mod_dt", insertable = false)
|
||||
private LocalDateTime modDt;
|
||||
|
||||
@Size(max = 32)
|
||||
@Column(name = "del_user", length = 32)
|
||||
private String delUser;
|
||||
@NotNull
|
||||
@ColumnDefault("0")
|
||||
@Column(name = "is_del", nullable = false)
|
||||
private Boolean del = false;
|
||||
|
||||
@Column(name = "del_dt")
|
||||
private LocalDateTime delDt;
|
||||
@Size(max = 32)
|
||||
@Column(name = "del_user", length = 32)
|
||||
private String delUser;
|
||||
|
||||
public static TTmplatEntity create(String itrntPrjctCd, TemplateBasicDto template, String regUser, LocalDateTime regDt) {
|
||||
return TTmplatEntity.builder()
|
||||
.itrntPrjctCd(itrntPrjctCd)
|
||||
.tmplatTy(template.tmplatTy.getCode())
|
||||
.tmplatNm(template.tmplatNm)
|
||||
.tmplatTitle(template.tmplatTitle)
|
||||
.tmplatBody(template.tmplatBody)
|
||||
.delayTime(template.delayTime)
|
||||
.sendTel(template.sendTel)
|
||||
.sendEml(template.sendEml)
|
||||
.sendNm(template.sendNm)
|
||||
.regUser(regUser)
|
||||
.regDt(regDt)
|
||||
.del(false)
|
||||
.build();
|
||||
}
|
||||
@Column(name = "del_dt")
|
||||
private LocalDateTime delDt;
|
||||
|
||||
public void updateFrom(TemplateBasicDto template, String modUser, LocalDateTime modDt) {
|
||||
// 기본 정보 갱신
|
||||
this.tmplatTy = template.tmplatTy.getCode();
|
||||
this.tmplatNm = template.tmplatNm;
|
||||
this.tmplatTitle = template.tmplatTitle;
|
||||
this.tmplatBody = template.tmplatBody;
|
||||
this.delayTime = template.delayTime;
|
||||
this.sendTel = template.sendTel;
|
||||
this.sendEml = template.sendEml;
|
||||
this.sendNm = template.sendNm;
|
||||
public static TTmplatEntity create(String itrntPrjctCd, TemplateBasicDto template, String regUser,
|
||||
LocalDateTime regDt) {
|
||||
return TTmplatEntity.builder()
|
||||
.itrntPrjctCd(itrntPrjctCd)
|
||||
.tmplatTy(template.tmplatTy.getCode())
|
||||
.tmplatNm(template.tmplatNm)
|
||||
.tmplatTitle(template.tmplatTitle)
|
||||
.tmplatBody(template.tmplatBody)
|
||||
.delayTime(template.delayTime)
|
||||
.sendTel(template.sendTel)
|
||||
.sendEml(template.sendEml)
|
||||
.sendNm(template.sendNm)
|
||||
.regUser(regUser)
|
||||
.regDt(regDt)
|
||||
.del(false)
|
||||
.build();
|
||||
}
|
||||
|
||||
// 수정 메타 갱신
|
||||
this.modUser = modUser;
|
||||
this.modDt = modDt;
|
||||
}
|
||||
public void updateFrom(TemplateBasicDto template, String modUser, LocalDateTime modDt) {
|
||||
// 기본 정보 갱신
|
||||
this.tmplatTy = template.tmplatTy.getCode();
|
||||
this.tmplatNm = template.tmplatNm;
|
||||
this.tmplatTitle = template.tmplatTitle;
|
||||
this.tmplatBody = template.tmplatBody;
|
||||
this.delayTime = template.delayTime;
|
||||
this.sendTel = template.sendTel;
|
||||
this.sendEml = template.sendEml;
|
||||
this.sendNm = template.sendNm;
|
||||
|
||||
// 수정 메타 갱신
|
||||
this.modUser = modUser;
|
||||
this.modDt = modDt;
|
||||
}
|
||||
}
|
||||
@@ -3,15 +3,23 @@ package com.kri.notihub.server.persistence.entity;
|
||||
import com.kri.notihub.server.common.enums.TemplateEventType;
|
||||
import com.kri.notihub.server.dto.template.TemplateBasicDto;
|
||||
import io.hypersistence.utils.hibernate.type.json.JsonType;
|
||||
import jakarta.persistence.*;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
import jakarta.persistence.Table;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.*;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
import org.hibernate.annotations.Type;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Builder
|
||||
@Getter
|
||||
@Setter
|
||||
@@ -20,52 +28,53 @@ import java.time.LocalDateTime;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TTmplatEventLogEntity {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "tmplat_event_idx", columnDefinition = "int UNSIGNED not null")
|
||||
private Long tmplatEventIdx;
|
||||
|
||||
@Column(name = "tmplat_idx", columnDefinition = "int UNSIGNED not null")
|
||||
private Long tmplatIdx;
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "tmplat_event_idx", columnDefinition = "int UNSIGNED not null")
|
||||
private Long tmplatEventIdx;
|
||||
|
||||
@NotNull
|
||||
@Column(name = "event_ty", nullable = false)
|
||||
private Short eventTy;
|
||||
@Column(name = "tmplat_idx", columnDefinition = "int UNSIGNED not null")
|
||||
private Long tmplatIdx;
|
||||
|
||||
@Type(JsonType.class)
|
||||
@Column(name = "before_tmplat")
|
||||
private TemplateBasicDto beforeTmplat;
|
||||
@NotNull
|
||||
@Column(name = "event_ty", nullable = false)
|
||||
private Short eventTy;
|
||||
|
||||
@NotNull
|
||||
@Type(JsonType.class)
|
||||
@Column(name = "after_tmplat", nullable = false)
|
||||
private TemplateBasicDto afterTmplat;
|
||||
@Type(JsonType.class)
|
||||
@Column(name = "before_tmplat")
|
||||
private TemplateBasicDto beforeTmplat;
|
||||
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32)
|
||||
private String regUser;
|
||||
@NotNull
|
||||
@Type(JsonType.class)
|
||||
@Column(name = "after_tmplat", nullable = false)
|
||||
private TemplateBasicDto afterTmplat;
|
||||
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private LocalDateTime regDt;
|
||||
@Size(max = 32)
|
||||
@NotNull
|
||||
@Column(name = "reg_user", nullable = false, length = 32)
|
||||
private String regUser;
|
||||
|
||||
public static TTmplatEventLogEntity of(
|
||||
Long tmplatIdx,
|
||||
TemplateEventType eventTy,
|
||||
TemplateBasicDto beforeTmplat,
|
||||
TemplateBasicDto afterTmplat,
|
||||
String regUser,
|
||||
LocalDateTime regDt
|
||||
) {
|
||||
return TTmplatEventLogEntity.builder()
|
||||
.tmplatIdx(tmplatIdx)
|
||||
.eventTy(eventTy.getCode())
|
||||
.beforeTmplat(beforeTmplat)
|
||||
.afterTmplat(afterTmplat)
|
||||
.regUser(regUser)
|
||||
.regDt(regDt)
|
||||
.build();
|
||||
}
|
||||
@NotNull
|
||||
@ColumnDefault("CURRENT_TIMESTAMP")
|
||||
@Column(name = "reg_dt", nullable = false)
|
||||
private LocalDateTime regDt;
|
||||
|
||||
public static TTmplatEventLogEntity of(
|
||||
Long tmplatIdx,
|
||||
TemplateEventType eventTy,
|
||||
TemplateBasicDto beforeTmplat,
|
||||
TemplateBasicDto afterTmplat,
|
||||
String regUser,
|
||||
LocalDateTime regDt
|
||||
) {
|
||||
return TTmplatEventLogEntity.builder()
|
||||
.tmplatIdx(tmplatIdx)
|
||||
.eventTy(eventTy.getCode())
|
||||
.beforeTmplat(beforeTmplat)
|
||||
.afterTmplat(afterTmplat)
|
||||
.regUser(regUser)
|
||||
.regDt(regDt)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,15 @@
|
||||
package com.kri.notihub.server.persistence.repository;
|
||||
|
||||
import com.kri.notihub.server.persistence.entity.BizLogEntity;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface BizLogRepository extends JpaRepository<BizLogEntity, String> {
|
||||
|
||||
Optional<BizLogEntity> findTopByCmidOrderByReportTimeDesc(String cmid);
|
||||
Optional<BizLogEntity> findTopByCmidOrderByReportTimeDesc(String cmid);
|
||||
|
||||
// 또는 대량처리용(필요시)
|
||||
List<BizLogEntity> findByCmidIn(Collection<String> cmids);
|
||||
// 또는 대량처리용(필요시)
|
||||
List<BizLogEntity> findByCmidIn(Collection<String> cmids);
|
||||
}
|
||||
|
||||
@@ -4,4 +4,5 @@ import com.kri.notihub.server.persistence.entity.BizMsgEntity;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface BizMsgRepository extends JpaRepository<BizMsgEntity, String> {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,47 +1,46 @@
|
||||
package com.kri.notihub.server.persistence.repository;
|
||||
|
||||
import com.kri.notihub.server.persistence.entity.TBulkSendEntity;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface BulkSendRepository extends JpaRepository<TBulkSendEntity, String> {
|
||||
|
||||
List<TBulkSendEntity> findByBulkSendKeyIn(List<String> bulkSendKeyList);
|
||||
List<TBulkSendEntity> findByBulkSendKeyIn(List<String> bulkSendKeyList);
|
||||
|
||||
@Query("""
|
||||
select b
|
||||
from TBulkSendEntity b
|
||||
join TTmplatEntity t on t.tmplatIdx = b.tmplatIdx
|
||||
where t.tmplatTy in :sendTyList
|
||||
and b.reqstSvc = :reqstSvc
|
||||
and b.prjctCd = :prjctCd
|
||||
order by b.regDt desc
|
||||
""")
|
||||
List<TBulkSendEntity> findBySendTyInAndReqstSvcAndPrjctCd(
|
||||
List<Short> sendTyList,
|
||||
String reqstSvc,
|
||||
String prjctCd
|
||||
);
|
||||
@Query("""
|
||||
select b
|
||||
from TBulkSendEntity b
|
||||
join TTmplatEntity t on t.tmplatIdx = b.tmplatIdx
|
||||
where t.tmplatTy in :sendTyList
|
||||
and b.reqstSvc = :reqstSvc
|
||||
and b.prjctCd = :prjctCd
|
||||
order by b.regDt desc
|
||||
""")
|
||||
List<TBulkSendEntity> findBySendTyInAndReqstSvcAndPrjctCd(
|
||||
List<Short> sendTyList,
|
||||
String reqstSvc,
|
||||
String prjctCd
|
||||
);
|
||||
|
||||
@Query("""
|
||||
select b
|
||||
from TBulkSendEntity b
|
||||
join TTmplatEntity t on t.tmplatIdx = b.tmplatIdx
|
||||
where t.tmplatTy in :sendTyList
|
||||
and b.reqstSvc = :reqstSvc
|
||||
and b.prjctCd = :prjctCd
|
||||
and b.regCmpn = :regCmpn
|
||||
order by b.regDt desc
|
||||
""")
|
||||
List<TBulkSendEntity> findBySendTyInAndReqstSvcAndPrjctCdAndRegCmpn(
|
||||
List<Short> sendTyList,
|
||||
String reqstSvc,
|
||||
String prjctCd,
|
||||
String regCmpn
|
||||
);
|
||||
@Query("""
|
||||
select b
|
||||
from TBulkSendEntity b
|
||||
join TTmplatEntity t on t.tmplatIdx = b.tmplatIdx
|
||||
where t.tmplatTy in :sendTyList
|
||||
and b.reqstSvc = :reqstSvc
|
||||
and b.prjctCd = :prjctCd
|
||||
and b.regCmpn = :regCmpn
|
||||
order by b.regDt desc
|
||||
""")
|
||||
List<TBulkSendEntity> findBySendTyInAndReqstSvcAndPrjctCdAndRegCmpn(
|
||||
List<Short> sendTyList,
|
||||
String reqstSvc,
|
||||
String prjctCd,
|
||||
String regCmpn
|
||||
);
|
||||
|
||||
Optional<TBulkSendEntity> findByBulkSendKey(String bulkSendKey);
|
||||
Optional<TBulkSendEntity> findByBulkSendKey(String bulkSendKey);
|
||||
}
|
||||
|
||||
@@ -1,68 +1,67 @@
|
||||
package com.kri.notihub.server.persistence.repository;
|
||||
|
||||
import com.kri.notihub.server.persistence.entity.TSendEntity;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
public interface SendRepository extends JpaRepository<TSendEntity, Long> {
|
||||
|
||||
Optional<TSendEntity> findByCmid(String cmid);
|
||||
Optional<TSendEntity> findByCmid(String cmid);
|
||||
|
||||
@Query("""
|
||||
select coalesce(min(s.sendIdx), 0)
|
||||
from TSendEntity s
|
||||
where s.sendTy = :sendTy and s.sendStatus = 0
|
||||
""")
|
||||
long findMinSendIdxBySendTy(short sendTy);
|
||||
@Query("""
|
||||
select coalesce(min(s.sendIdx), 0)
|
||||
from TSendEntity s
|
||||
where s.sendTy = :sendTy and s.sendStatus = 0
|
||||
""")
|
||||
long findMinSendIdxBySendTy(short sendTy);
|
||||
|
||||
|
||||
@Query("""
|
||||
select s
|
||||
from TSendEntity s
|
||||
where s.sendStatus = :sendStatus
|
||||
and s.sendTy in :sendTyList
|
||||
and s.sendDt between :fromDt and :toDt
|
||||
order by s.sendIdx asc
|
||||
""")
|
||||
List<TSendEntity> findSendListToRefreshWithinHours(
|
||||
List<Short> sendTyList,
|
||||
short sendStatus,
|
||||
LocalDateTime fromDt,
|
||||
LocalDateTime toDt,
|
||||
Pageable pageable
|
||||
);
|
||||
@Query("""
|
||||
select s
|
||||
from TSendEntity s
|
||||
where s.sendStatus = :sendStatus
|
||||
and s.sendTy in :sendTyList
|
||||
and s.sendDt between :fromDt and :toDt
|
||||
order by s.sendIdx asc
|
||||
""")
|
||||
List<TSendEntity> findSendListToRefreshWithinHours(
|
||||
List<Short> sendTyList,
|
||||
short sendStatus,
|
||||
LocalDateTime fromDt,
|
||||
LocalDateTime toDt,
|
||||
Pageable pageable
|
||||
);
|
||||
|
||||
@Query("""
|
||||
select s
|
||||
from TSendEntity s
|
||||
where s.sendTy = :sendTy
|
||||
and s.resultCode = :resultCode
|
||||
and s.resve = true
|
||||
and s.sendDt <= :now
|
||||
order by s.sendIdx asc
|
||||
""")
|
||||
List<TSendEntity> findReservedSendEmail(
|
||||
short sendTy,
|
||||
short resultCode,
|
||||
LocalDateTime now,
|
||||
Pageable pageable
|
||||
);
|
||||
@Query("""
|
||||
select s
|
||||
from TSendEntity s
|
||||
where s.sendTy = :sendTy
|
||||
and s.resultCode = :resultCode
|
||||
and s.resve = true
|
||||
and s.sendDt <= :now
|
||||
order by s.sendIdx asc
|
||||
""")
|
||||
List<TSendEntity> findReservedSendEmail(
|
||||
short sendTy,
|
||||
short resultCode,
|
||||
LocalDateTime now,
|
||||
Pageable pageable
|
||||
);
|
||||
|
||||
/**
|
||||
* Poller 복구용: STANDBY_EMAIL 상태로 남아있는 최근 발송건을 다시 enqueue 하기 위해 사용
|
||||
*/
|
||||
Page<TSendEntity> findBySendTyAndResultCodeAndSendDtAfterOrderBySendDtAsc(
|
||||
short sendTy,
|
||||
short resultCode,
|
||||
LocalDateTime sendDtAfter,
|
||||
Pageable pageable
|
||||
);
|
||||
/**
|
||||
* Poller 복구용: STANDBY_EMAIL 상태로 남아있는 최근 발송건을 다시 enqueue 하기 위해 사용
|
||||
*/
|
||||
Page<TSendEntity> findBySendTyAndResultCodeAndSendDtAfterOrderBySendDtAsc(
|
||||
short sendTy,
|
||||
short resultCode,
|
||||
LocalDateTime sendDtAfter,
|
||||
Pageable pageable
|
||||
);
|
||||
|
||||
Page<TSendEntity> findByBulkSendKey(String bulkSendKey, Pageable pageable);
|
||||
Page<TSendEntity> findByBulkSendKey(String bulkSendKey, Pageable pageable);
|
||||
}
|
||||
@@ -4,6 +4,8 @@ import com.kri.notihub.server.persistence.entity.TSendResultCodeEntity;
|
||||
import com.kri.notihub.server.persistence.entity.TSendResultCodeEntityId;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
public interface SendResultCodeRepository extends JpaRepository<TSendResultCodeEntity, TSendResultCodeEntityId> {
|
||||
public interface SendResultCodeRepository extends
|
||||
JpaRepository<TSendResultCodeEntity, TSendResultCodeEntityId> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.kri.notihub.server.persistence.entity.TTmplatEventLogEntity;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
public interface TemplateEventLogRepository extends JpaRepository<TTmplatEventLogEntity, Long>, JpaSpecificationExecutor<TTmplatEventLogEntity> {
|
||||
public interface TemplateEventLogRepository extends JpaRepository<TTmplatEventLogEntity, Long>,
|
||||
JpaSpecificationExecutor<TTmplatEventLogEntity> {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,29 +1,30 @@
|
||||
package com.kri.notihub.server.persistence.repository;
|
||||
|
||||
import com.kri.notihub.server.persistence.entity.TTmplatEntity;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Modifying;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
public interface TemplateRepository extends JpaRepository<TTmplatEntity, Long>,
|
||||
JpaSpecificationExecutor<TTmplatEntity> {
|
||||
|
||||
public interface TemplateRepository extends JpaRepository<TTmplatEntity, Long>, JpaSpecificationExecutor<TTmplatEntity> {
|
||||
@Modifying(clearAutomatically = true, flushAutomatically = true)
|
||||
@Query("""
|
||||
update TTmplatEntity t
|
||||
set t.del = true,
|
||||
t.delUser = :delUser,
|
||||
t.delDt = :delDt
|
||||
where t.tmplatIdx = :idx
|
||||
and t.del = false
|
||||
""")
|
||||
int softDeleteByTmplatIdx(long idx, String delUser, LocalDateTime delDt);
|
||||
|
||||
@Modifying(clearAutomatically = true, flushAutomatically = true)
|
||||
@Query("""
|
||||
update TTmplatEntity t
|
||||
set t.del = true,
|
||||
t.delUser = :delUser,
|
||||
t.delDt = :delDt
|
||||
where t.tmplatIdx = :idx
|
||||
and t.del = false
|
||||
""")
|
||||
int softDeleteByTmplatIdx(long idx, String delUser, LocalDateTime delDt);
|
||||
List<TTmplatEntity> findAllByTmplatTyInAndItrntPrjctCdAndDelFalse(List<Short> tmplatTyList,
|
||||
String itrntPrjctCd);
|
||||
|
||||
List<TTmplatEntity> findAllByTmplatTyInAndItrntPrjctCdAndDelFalse(List<Short> tmplatTyList, String itrntPrjctCd);
|
||||
|
||||
Optional<TTmplatEntity> findByTmplatIdxAndDelFalse(long tmplatIdx);
|
||||
Optional<TTmplatEntity> findByTmplatIdxAndDelFalse(long tmplatIdx);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user