260219_01_ENH: 공용라이브러리 버전업, 알림톡 발송 구현 완료

This commit is contained in:
2026-02-19 15:18:29 +09:00
parent 774188088b
commit 674e8f20f0
31 changed files with 672 additions and 332 deletions

View File

@@ -89,15 +89,15 @@ public class BizMsgEntity {
@Size(max = 5)
@Column(name = "`NATION_CODE`", length = 5)
private String nationCode;
private String nationCode; //알림톡에서만 사용
@Size(max = 40)
@Column(name = "`SENDER_KEY`", length = 40)
private String senderKey;
private String senderKey; //알림톡에서만 사용(발송 프로필 키)
@Size(max = 64)
@Column(name = "`TEMPLATE_CODE`", length = 64)
private String templateCode;
private String templateCode; //알림톡에서만 사용
@Size(max = 8)
@Column(name = "`RESPONSE_METHOD`", length = 8)
@@ -136,7 +136,7 @@ public class BizMsgEntity {
@Size(max = 1000)
@Column(name = "`ATTACHED_FILE`", length = 1000)
private String attachedFile;
private String attachedFile;//알림톡에서 버튼 구현등을 위해 사용
@Size(max = 64)
@Column(name = "`VXML_FILE`", length = 64)
@@ -176,9 +176,7 @@ 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, String subject) {
return BizMsgEntity.builder()
.cmid(s.getCmid())
@@ -192,7 +190,11 @@ public class BizMsgEntity {
.sendName(s.getSendNm())
.subject(subject)
.msgBody(s.getMsgBody())
.attachedFile(s.getAtchFl())//varchar(1000)
.cinfo(s.getReqstSvc())
.nationCode(s.getNationCd())//varchar(5)
.senderKey(s.getSenderKey())
.templateCode(s.getKkoTmplatCd())
.build();
}

View File

@@ -6,6 +6,7 @@ import com.kri.notihub.server.dto.send.DestInfoDto;
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 com.kri.notihub.server.dto.template.TemplateDto;
import io.hypersistence.utils.hibernate.type.json.JsonType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
@@ -87,6 +88,22 @@ public class TSendEntity {
@Column(name = "tmplat_idx", columnDefinition = "int UNSIGNED")
private Long tmplatIdx;
@Size(max = 40)
@Column(name = "sender_key", length = 40)
private String senderKey;
@Size(max = 64)
@Column(name = "kko_tmplat_cd", length = 64)
private String kkoTmplatCd;
@Size(max = 5)
@Column(name = "nation_cd", length = 5)
private String nationCd;
@Size(max = 1000)
@Column(name = "atch_fl", length = 1000)
private String atchFl;
@Size(max = 64)
@Column(name = "send_eml", length = 64)
private String sendEml;
@@ -154,9 +171,8 @@ public class TSendEntity {
public static TSendEntity from(
SendRequestSingleDto req,
SendType sendTy,
TemplateDto tmplat,
SendInternalResultDto sendResult,
String itrntPrjctCd,
String msgTitle,
String msgBody,
String regCmpn,
@@ -171,12 +187,10 @@ public class TSendEntity {
return from(
req,
req.getDestInfo(),
sendTy,
tmplat,
sendResult,
itrntPrjctCd,
req.getReqstSvc(),
req.getPrjctCd(),
req.getTmplatIdx(),
msgTitle,
msgBody,
regCmpn,
@@ -191,12 +205,10 @@ public class TSendEntity {
public static TSendEntity from(
SendRequestBasicDto basic,
DestInfoDto dest,
SendType sendTy,
TemplateDto tmplat,
SendInternalResultDto sendResult,
String itrntPrjctCd,
String reqstSvc,
String prjctCd,
Long tmplatIdx,
String msgTitle,
String msgBody,
String regCmpn,
@@ -214,21 +226,25 @@ public class TSendEntity {
return null;
}
Short sendCorp = sendTy == SendType.EMAIL ? SendCorpType.PRINGO.getCode()
Short sendCorp = tmplat.getTmplatTy() == SendType.EMAIL ? SendCorpType.PRINGO.getCode()
: SendCorpType.BIZ_PPURIO.getCode();
return TSendEntity.builder()
.cmid(sendResult.getCmid())
.bulkSendKey(bulkSendKey)
.sendTy(sendTy.getCode())
.sendTy(tmplat.getTmplatTy().getCode())
.resve(resve)
.sendCorp(sendCorp)
.sendStatus(sendResult.getStatus().getCode())
.resultCode(sendResult.getResultCode())
.itrntPrjctCd(itrntPrjctCd)
.itrntPrjctCd(tmplat.getItrntPrjctCd())
.reqstSvc(reqstSvc)
.prjctCd(prjctCd)
.tmplatIdx(tmplatIdx)
.tmplatIdx(tmplat.getTmplatIdx())
.senderKey(tmplat.getSenderKey())
.kkoTmplatCd(tmplat.getKkoTmplatCd())
.nationCd(tmplat.getNationCd())
.atchFl(tmplat.getAtchFl())
.sendEml(basic.getSendEml())
.sendTel(basic.getSendTel())
.sendNm(basic.getSendNm())

View File

@@ -52,9 +52,25 @@ public class TTmplatEntity {
@NotNull
@Lob
@Column(name = "tmplat_body", nullable = false)
@Column(name = "tmplat_body", nullable = false, columnDefinition = "TEXT")
private String tmplatBody;
@Size(max = 40)
@Column(name = "sender_key", length = 40)
private String senderKey;
@Size(max = 64)
@Column(name = "kko_tmplat_cd", length = 64)
private String kkoTmplatCd;
@Size(max = 5)
@Column(name = "nation_cd", length = 5)
private String nationCd;
@Size(max = 1000)
@Column(name = "atch_fl", length = 1000)
private String atchFl;
@Column(name = "delay_time")
private Short delayTime;
@@ -103,14 +119,18 @@ public class TTmplatEntity {
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)
.tmplatTy(template.getTmplatTy().getCode())
.tmplatNm(template.getTmplatNm())
.tmplatTitle(template.getTmplatTitle())
.tmplatBody(template.getTmplatBody())
.senderKey(template.getSenderKey())
.kkoTmplatCd(template.getKkoTmplatCd())
.nationCd(template.getNationCd())
.atchFl(template.getAtchFl())
.delayTime(template.getDelayTime())
.sendTel(template.getSendTel())
.sendEml(template.getSendEml())
.sendNm(template.getSendNm())
.regUser(regUser)
.regDt(regDt)
.del(false)
@@ -119,14 +139,18 @@ public class TTmplatEntity {
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.tmplatTy = template.getTmplatTy().getCode();
this.tmplatNm = template.getTmplatNm();
this.tmplatTitle = template.getTmplatTitle();
this.tmplatBody = template.getTmplatBody();
this.senderKey = template.getSenderKey();
this.kkoTmplatCd = template.getKkoTmplatCd();
this.nationCd = template.getNationCd();
this.atchFl = template.getAtchFl();
this.delayTime = template.getDelayTime();
this.sendTel = template.getSendTel();
this.sendEml = template.getSendEml();
this.sendNm = template.getSendNm();
// 수정 메타 갱신
this.modUser = modUser;

View File

@@ -16,9 +16,9 @@ public interface SendRepository extends JpaRepository<TSendEntity, Long> {
@Query("""
select coalesce(min(s.sendIdx), 0)
from TSendEntity s
where s.sendTy = :sendTy and s.sendStatus = 0
where s.sendTy in :sendTyList and s.sendStatus = 0
""")
long findMinSendIdxBySendTy(short sendTy);
long findMinSendIdxBySendTyList(List<Short> sendTyList);
@Query("""