feat: 카카오톡 추가 반영 - accept

main
Jonguk. Lim 2 months ago
parent 650b49b81c
commit bae3ec5083

@ -1,31 +1,29 @@
package cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.repository; package cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.repository;
import cokr.xit.ens.core.utils.CmmnUtil; import static cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.QIntgrnSendDetail.*;
import cokr.xit.ens.modules.common.code.IntgrnDtlStatCd; import static cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.QIntgrnSendMast.*;
import cokr.xit.ens.modules.common.code.PostSeCd; import static cokr.xit.ens.modules.common.domain.QSendMast.*;
import cokr.xit.ens.modules.common.code.StatCd; import static cokr.xit.ens.modules.kkoalimtalk.domain.QSendDetailKkoAlimtalk.*;
import cokr.xit.ens.modules.common.ctgy.intgrnnoti.code.TryStatCd; import static cokr.xit.ens.modules.kkomydoc.domain.QSendDetailKkoMydoc.*;
import cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.IntgrnSendDetail; import static cokr.xit.ens.modules.kkotalk.domain.QSendDetailKkoTalk.*;
import cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.IntgrnSendMast; import static cokr.xit.ens.modules.ktsigntalk.direct.domain.QSendDetailKtSigntalk.*;
import cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.QIntgrnSendMast; import static cokr.xit.ens.modules.ktsigntalk.gibis.domain.QSendDetailKtGibis.*;
import cokr.xit.ens.modules.common.ctgy.intgrnnoti.model.IntgrnDetailStatVO; import static cokr.xit.ens.modules.nvsigntalk.domain.QSendDetailNvSigntalk.*;
import cokr.xit.ens.modules.common.domain.SendMast;
import com.querydsl.core.BooleanBuilder; import java.time.*;
import com.querydsl.core.types.Projections;
import com.querydsl.jpa.impl.JPAQueryFactory;
import lombok.RequiredArgsConstructor;
import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import static cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.QIntgrnSendDetail.intgrnSendDetail; import com.querydsl.core.*;
import static cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.QIntgrnSendMast.intgrnSendMast; import com.querydsl.core.types.*;
import static cokr.xit.ens.modules.common.domain.QSendMast.sendMast; import com.querydsl.jpa.impl.*;
import static cokr.xit.ens.modules.kkoalimtalk.domain.QSendDetailKkoAlimtalk.sendDetailKkoAlimtalk;
import static cokr.xit.ens.modules.kkomydoc.domain.QSendDetailKkoMydoc.sendDetailKkoMydoc; import cokr.xit.ens.core.utils.*;
import static cokr.xit.ens.modules.ktsigntalk.direct.domain.QSendDetailKtSigntalk.sendDetailKtSigntalk; import cokr.xit.ens.modules.common.code.*;
import static cokr.xit.ens.modules.ktsigntalk.gibis.domain.QSendDetailKtGibis.sendDetailKtGibis; import cokr.xit.ens.modules.common.ctgy.intgrnnoti.code.*;
import static cokr.xit.ens.modules.nvsigntalk.domain.QSendDetailNvSigntalk.sendDetailNvSigntalk; import cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.*;
import cokr.xit.ens.modules.common.ctgy.intgrnnoti.model.*;
import cokr.xit.ens.modules.common.domain.*;
import lombok.*;
@RequiredArgsConstructor @RequiredArgsConstructor
public class IntgrnSendDetailRepositoryImpl implements IntgrnSendDetailRepositoryCustom { public class IntgrnSendDetailRepositoryImpl implements IntgrnSendDetailRepositoryCustom {
@ -49,10 +47,15 @@ public class IntgrnSendDetailRepositoryImpl implements IntgrnSendDetailRepositor
@Override @Override
public void modifyDetailStatCdByIntgrnDetailStatVO(List<IntgrnDetailStatVO> list) { public void modifyDetailStatCdByIntgrnDetailStatVO(List<IntgrnDetailStatVO> list) {
list.forEach(data -> list.forEach(data -> {
// FIXME: 카카오톡 추가 : null 처리
query.update(intgrnSendDetail) IntgrnDtlStatCd intgrnDtlStatCd = CmmnUtil.isEmpty(data.getCurStatCd()) ?
.set(intgrnSendDetail.curStatCd, IntgrnDtlStatCd.ACPT_CMPLT.equals(data.getCurStatCd().getIntgrnDtlStatCd()) ? (CmmnUtil.isEmpty(data.getMastErrorCode()) ? data.getCurStatCd().getIntgrnDtlStatCd() : IntgrnDtlStatCd.FAIL) : data.getCurStatCd().getIntgrnDtlStatCd()) IntgrnDtlStatCd.UNKNOWN :
(IntgrnDtlStatCd.ACPT_CMPLT.equals(data.getCurStatCd().getIntgrnDtlStatCd()) ?
(CmmnUtil.isEmpty(data.getMastErrorCode()) ? data.getCurStatCd().getIntgrnDtlStatCd() : IntgrnDtlStatCd.FAIL)
: data.getCurStatCd().getIntgrnDtlStatCd());
query.update(intgrnSendDetail)
.set(intgrnSendDetail.curStatCd, intgrnDtlStatCd)
.set(intgrnSendDetail.docSentDt, data.getDocSentDt()) .set(intgrnSendDetail.docSentDt, data.getDocSentDt())
.set(intgrnSendDetail.docReceivedDt, data.getDocReceivedDt()) .set(intgrnSendDetail.docReceivedDt, data.getDocReceivedDt())
.set(intgrnSendDetail.docAuthFrstDt, data.getDocAuthFrstDt()) .set(intgrnSendDetail.docAuthFrstDt, data.getDocAuthFrstDt())
@ -62,7 +65,8 @@ public class IntgrnSendDetailRepositoryImpl implements IntgrnSendDetailRepositor
.set(intgrnSendDetail.error.errorCode, data.getMastErrorCode() == null && data.getErrorCode() == null ? null : String.format("[M]%s. [D]%s", data.getMastErrorCode(), data.getErrorCode())) .set(intgrnSendDetail.error.errorCode, data.getMastErrorCode() == null && data.getErrorCode() == null ? null : String.format("[M]%s. [D]%s", data.getMastErrorCode(), data.getErrorCode()))
.set(intgrnSendDetail.error.errorMessage, data.getMastErrorCode() == null && data.getErrorCode() == null ? null : String.format("[M]%s. [D]%s", data.getMastErrorMessage(), data.getErrorMessage())) .set(intgrnSendDetail.error.errorMessage, data.getMastErrorCode() == null && data.getErrorCode() == null ? null : String.format("[M]%s. [D]%s", data.getMastErrorMessage(), data.getErrorMessage()))
.where(intgrnSendDetail.intSendDetailId.eq(data.getIntSendDetailId())) .where(intgrnSendDetail.intSendDetailId.eq(data.getIntSendDetailId()))
.execute() .execute();
}
); );
} }
@ -121,6 +125,32 @@ public class IntgrnSendDetailRepositoryImpl implements IntgrnSendDetailRepositor
) )
.fetch()); .fetch());
// FIXME: 카카오톡 추가
list.addAll(query.select(Projections.fields(IntgrnDetailStatVO.class
, intgrnSendDetail.intSendDetailId
, intgrnSendDetail.linkedUuid
, intgrnSendDetail.curPostSe
, sendDetailKkoTalk.status.as("status")
, sendDetailKkoTalk.sentAt.as("sentAt")
, sendDetailKkoTalk.receivedAt.as("receivedAt")
, sendDetailKkoTalk.authenticatedAt.as("authenticatedAt")
, sendDetailKkoTalk.ottVerifiedAt.as("ottVerifiedAt")
, sendDetailKkoTalk.readAt.as("readAt")
, sendDetailKkoTalk.userNotifiedAt.as("userNotifiedAt")
, sendDetailKkoTalk.error.errorCode
, sendDetailKkoTalk.error.errorMessage
, sendMast.error.errorCode.as("mastErrorCode")
, sendMast.error.errorMessage.as("mastErrorMessage")
))
.from(intgrnSendDetail)
.innerJoin(sendDetailKkoTalk).on(sendDetailKkoTalk.sendDetailId.eq(intgrnSendDetail.sendDetailIdKkoTalk))
.innerJoin(sendDetailKkoTalk.sendMast, sendMast)
.where(
intgrnSendDetail.curPostSe.eq(PostSeCd.kkoTalk)
.and(intgrnSendDetail.intgrnSendMast.intSendMastId.eq(intSendMastId))
)
.fetch());
list.addAll(query.select(Projections.fields(IntgrnDetailStatVO.class list.addAll(query.select(Projections.fields(IntgrnDetailStatVO.class
, intgrnSendDetail.intSendDetailId , intgrnSendDetail.intSendDetailId
, intgrnSendDetail.linkedUuid , intgrnSendDetail.linkedUuid
@ -236,6 +266,8 @@ public class IntgrnSendDetailRepositoryImpl implements IntgrnSendDetailRepositor
public Optional<IntgrnSendDetail> findByDocUuidAndLinkedUuid(String docUuid, String linkedUuid) { public Optional<IntgrnSendDetail> findByDocUuidAndLinkedUuid(String docUuid, String linkedUuid) {
List<Long> intSendDetailIds = new ArrayList<>(); List<Long> intSendDetailIds = new ArrayList<>();
intSendDetailIds.addAll(findIntSendDetailIdsByKkoMydoc(docUuid, linkedUuid)); intSendDetailIds.addAll(findIntSendDetailIdsByKkoMydoc(docUuid, linkedUuid));
// FIXME: 카카오톡 추가
intSendDetailIds.addAll(findIntSendDetailIdsByKkoTalk(docUuid, linkedUuid));
intSendDetailIds.addAll(findIntSendDetailIdsByNvSigntalk(docUuid, linkedUuid)); intSendDetailIds.addAll(findIntSendDetailIdsByNvSigntalk(docUuid, linkedUuid));
intSendDetailIds.addAll(findIntSendDetailIdsByKtSigntalk(docUuid, linkedUuid)); intSendDetailIds.addAll(findIntSendDetailIdsByKtSigntalk(docUuid, linkedUuid));
intSendDetailIds.addAll(findIntSendDetailIdsByKtGibis(docUuid, linkedUuid)); intSendDetailIds.addAll(findIntSendDetailIdsByKtGibis(docUuid, linkedUuid));
@ -247,6 +279,8 @@ public class IntgrnSendDetailRepositoryImpl implements IntgrnSendDetailRepositor
@Override @Override
public PostSeCd findPostSeByDocUuidAndLinkedUuid(String docUuid, String linkedUuid) { public PostSeCd findPostSeByDocUuidAndLinkedUuid(String docUuid, String linkedUuid) {
if (findIntSendDetailIdsByKkoMydoc(docUuid, linkedUuid).size() > 0) return PostSeCd.kkoMydoc; if (findIntSendDetailIdsByKkoMydoc(docUuid, linkedUuid).size() > 0) return PostSeCd.kkoMydoc;
// FIXME: 카카오톡 추가
if (findIntSendDetailIdsByKkoTalk(docUuid, linkedUuid).size() > 0) return PostSeCd.kkoTalk;
if (findIntSendDetailIdsByNvSigntalk(docUuid, linkedUuid).size() > 0) return PostSeCd.nvSigntalk; if (findIntSendDetailIdsByNvSigntalk(docUuid, linkedUuid).size() > 0) return PostSeCd.nvSigntalk;
if (findIntSendDetailIdsByKtSigntalk(docUuid, linkedUuid).size() > 0) return PostSeCd.ktSigntalk; if (findIntSendDetailIdsByKtSigntalk(docUuid, linkedUuid).size() > 0) return PostSeCd.ktSigntalk;
if (findIntSendDetailIdsByKtGibis(docUuid, linkedUuid).size() > 0) return PostSeCd.ktGibis; if (findIntSendDetailIdsByKtGibis(docUuid, linkedUuid).size() > 0) return PostSeCd.ktGibis;
@ -267,6 +301,15 @@ public class IntgrnSendDetailRepositoryImpl implements IntgrnSendDetailRepositor
.groupBy(intgrnSendDetail.intgrnSendMast.intSendMastId) .groupBy(intgrnSendDetail.intgrnSendMast.intSendMastId)
.fetchOne()); .fetchOne());
// FIXME: 카카오톡 추가
if (PostSeCd.kkoTalk.equals(sendMastObj.getPostSe()))
return Optional.ofNullable(query.select(intgrnSendDetail.intgrnSendMast.intSendMastId)
.from(intgrnSendDetail)
.innerJoin(sendDetailKkoTalk).on(intgrnSendDetail.sendDetailIdKkoTalk.eq(sendDetailKkoTalk.sendDetailId))
.where(sendDetailKkoTalk.sendMast.sendMastId.eq(sendMastId))
.groupBy(intgrnSendDetail.intgrnSendMast.intSendMastId)
.fetchOne());
if (PostSeCd.kkoAlimtalk.equals(sendMastObj.getPostSe())) if (PostSeCd.kkoAlimtalk.equals(sendMastObj.getPostSe()))
return Optional.ofNullable(query.select(intgrnSendDetail.intgrnSendMast.intSendMastId) return Optional.ofNullable(query.select(intgrnSendDetail.intgrnSendMast.intSendMastId)
.from(intgrnSendDetail) .from(intgrnSendDetail)
@ -315,6 +358,20 @@ public class IntgrnSendDetailRepositoryImpl implements IntgrnSendDetailRepositor
.fetch(); .fetch();
} }
// FIXME: 카카오톡 추가
private List<Long> findIntSendDetailIdsByKkoTalk(String docUuid, String linkedUuid) {
BooleanBuilder isMatched = new BooleanBuilder();
isMatched.and(sendDetailKkoTalk.envelopeId.eq(docUuid));
if (linkedUuid != null)
isMatched.and(intgrnSendDetail.linkedUuid.eq(linkedUuid));
return query.select(intgrnSendDetail.intSendDetailId)
.from(intgrnSendDetail)
.innerJoin(sendDetailKkoTalk).on(intgrnSendDetail.sendDetailIdKkoTalk.eq(sendDetailKkoTalk.sendDetailId))
.where(isMatched)
.fetch();
}
private List<Long> findIntSendDetailIdsByNvSigntalk(String docUuid, String linkedUuid) { private List<Long> findIntSendDetailIdsByNvSigntalk(String docUuid, String linkedUuid) {
BooleanBuilder isMatched = new BooleanBuilder(); BooleanBuilder isMatched = new BooleanBuilder();
isMatched.and(sendDetailNvSigntalk.docId.eq(docUuid)); isMatched.and(sendDetailNvSigntalk.docId.eq(docUuid));

@ -1,31 +1,32 @@
package cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.repository; package cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.repository;
import cokr.xit.ens.core.utils.CmmnUtil; import static cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.QTmpltMngIntgrn.*;
import cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.TmpltMngIntgrn; import static cokr.xit.ens.modules.common.ctgy.sys.mng.domain.QOrgMng.*;
import cokr.xit.ens.modules.common.ctgy.intgrnnoti.model.TmpltMngIntgrnDTO; import static cokr.xit.ens.modules.kkoalimtalk.domain.QTmpltMngKkoAlimtalk.*;
import cokr.xit.ens.modules.common.ctgy.sys.mng.model.TmpltMngSearchDTO; import static cokr.xit.ens.modules.kkomydoc.domain.QTmpltMngKkoMydoc.*;
import cokr.xit.ens.modules.kkoalimtalk.model.TmpltMngKkoAlimtalkDTO; import static cokr.xit.ens.modules.kkotalk.domain.QTmpltMngKkoTalk.*;
import cokr.xit.ens.modules.kkomydoc.model.TmpltMngKkoMydocDTO; import static cokr.xit.ens.modules.ktsigntalk.direct.domain.QTmpltMngKtSigntalk.*;
import cokr.xit.ens.modules.ktsigntalk.direct.model.TmpltMngKtSigntalkDTO; import static cokr.xit.ens.modules.ktsigntalk.gibis.domain.QTmpltMngKtGibis.*;
import cokr.xit.ens.modules.ktsigntalk.gibis.model.TmpltMngKtGibisDTO; import static cokr.xit.ens.modules.nvsigntalk.domain.QTmpltMngNvSigntalk.*;
import cokr.xit.ens.modules.nvsigntalk.model.TmpltMngNvSigntalkDTO;
import com.google.gson.Gson; import java.util.*;
import com.querydsl.core.BooleanBuilder;
import com.querydsl.core.types.Projections; import com.google.gson.*;
import com.querydsl.core.types.QBean; import com.querydsl.core.*;
import com.querydsl.jpa.impl.JPAQueryFactory; import com.querydsl.core.types.*;
import lombok.RequiredArgsConstructor; import com.querydsl.jpa.impl.*;
import java.util.List; import cokr.xit.ens.core.utils.*;
import java.util.Optional; import cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.*;
import cokr.xit.ens.modules.common.ctgy.intgrnnoti.model.*;
import static cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.QTmpltMngIntgrn.tmpltMngIntgrn; import cokr.xit.ens.modules.common.ctgy.sys.mng.model.*;
import static cokr.xit.ens.modules.common.ctgy.sys.mng.domain.QOrgMng.orgMng; import cokr.xit.ens.modules.kkoalimtalk.model.*;
import static cokr.xit.ens.modules.kkoalimtalk.domain.QTmpltMngKkoAlimtalk.tmpltMngKkoAlimtalk; import cokr.xit.ens.modules.kkomydoc.model.*;
import static cokr.xit.ens.modules.kkomydoc.domain.QTmpltMngKkoMydoc.tmpltMngKkoMydoc; import cokr.xit.ens.modules.kkotalk.model.*;
import static cokr.xit.ens.modules.ktsigntalk.direct.domain.QTmpltMngKtSigntalk.tmpltMngKtSigntalk; import cokr.xit.ens.modules.ktsigntalk.direct.model.*;
import static cokr.xit.ens.modules.ktsigntalk.gibis.domain.QTmpltMngKtGibis.tmpltMngKtGibis; import cokr.xit.ens.modules.ktsigntalk.gibis.model.*;
import static cokr.xit.ens.modules.nvsigntalk.domain.QTmpltMngNvSigntalk.tmpltMngNvSigntalk; import cokr.xit.ens.modules.nvsigntalk.model.*;
import lombok.*;
@RequiredArgsConstructor @RequiredArgsConstructor
public class TmpltMngIntgrnRepositoryImpl implements TmpltMngIntgrnRepositoryCustom { public class TmpltMngIntgrnRepositoryImpl implements TmpltMngIntgrnRepositoryCustom {
@ -55,6 +56,8 @@ public class TmpltMngIntgrnRepositoryImpl implements TmpltMngIntgrnRepositoryCus
.from(tmpltMngIntgrn) .from(tmpltMngIntgrn)
.leftJoin(tmpltMngKkoAlimtalk).on(tmpltMngIntgrn.orgMng.orgCd.eq(tmpltMngKkoAlimtalk.orgMng.orgCd).and(tmpltMngIntgrn.tmpltCd.eq(tmpltMngKkoAlimtalk.tmpltCd))) .leftJoin(tmpltMngKkoAlimtalk).on(tmpltMngIntgrn.orgMng.orgCd.eq(tmpltMngKkoAlimtalk.orgMng.orgCd).and(tmpltMngIntgrn.tmpltCd.eq(tmpltMngKkoAlimtalk.tmpltCd)))
.leftJoin(tmpltMngKkoMydoc).on(tmpltMngIntgrn.orgMng.orgCd.eq(tmpltMngKkoMydoc.orgMng.orgCd).and(tmpltMngIntgrn.tmpltCd.eq(tmpltMngKkoMydoc.tmpltCd))) .leftJoin(tmpltMngKkoMydoc).on(tmpltMngIntgrn.orgMng.orgCd.eq(tmpltMngKkoMydoc.orgMng.orgCd).and(tmpltMngIntgrn.tmpltCd.eq(tmpltMngKkoMydoc.tmpltCd)))
// FIXME: 카카오톡 추가
.leftJoin(tmpltMngKkoTalk).on(tmpltMngIntgrn.orgMng.orgCd.eq(tmpltMngKkoTalk.orgMng.orgCd).and(tmpltMngIntgrn.tmpltCd.eq(tmpltMngKkoTalk.tmpltCd)))
.leftJoin(tmpltMngNvSigntalk).on(tmpltMngIntgrn.orgMng.orgCd.eq(tmpltMngNvSigntalk.orgMng.orgCd).and(tmpltMngIntgrn.tmpltCd.eq(tmpltMngNvSigntalk.tmpltCd))) .leftJoin(tmpltMngNvSigntalk).on(tmpltMngIntgrn.orgMng.orgCd.eq(tmpltMngNvSigntalk.orgMng.orgCd).and(tmpltMngIntgrn.tmpltCd.eq(tmpltMngNvSigntalk.tmpltCd)))
.leftJoin(tmpltMngKtSigntalk).on(tmpltMngIntgrn.orgMng.orgCd.eq(tmpltMngKtSigntalk.orgMng.orgCd).and(tmpltMngIntgrn.tmpltCd.eq(tmpltMngKtSigntalk.tmpltCd))) .leftJoin(tmpltMngKtSigntalk).on(tmpltMngIntgrn.orgMng.orgCd.eq(tmpltMngKtSigntalk.orgMng.orgCd).and(tmpltMngIntgrn.tmpltCd.eq(tmpltMngKtSigntalk.tmpltCd)))
.leftJoin(tmpltMngKtGibis).on(tmpltMngIntgrn.orgMng.orgCd.eq(tmpltMngKtGibis.orgMng.orgCd).and(tmpltMngIntgrn.tmpltCd.eq(tmpltMngKtGibis.tmpltCd))) .leftJoin(tmpltMngKtGibis).on(tmpltMngIntgrn.orgMng.orgCd.eq(tmpltMngKtGibis.orgMng.orgCd).and(tmpltMngIntgrn.tmpltCd.eq(tmpltMngKtGibis.tmpltCd)))
@ -69,6 +72,8 @@ public class TmpltMngIntgrnRepositoryImpl implements TmpltMngIntgrnRepositoryCus
.from(tmpltMngIntgrn) .from(tmpltMngIntgrn)
.leftJoin(tmpltMngKkoAlimtalk).on(tmpltMngIntgrn.orgMng.orgCd.eq(tmpltMngKkoAlimtalk.orgMng.orgCd).and(tmpltMngIntgrn.tmpltCd.eq(tmpltMngKkoAlimtalk.tmpltCd))) .leftJoin(tmpltMngKkoAlimtalk).on(tmpltMngIntgrn.orgMng.orgCd.eq(tmpltMngKkoAlimtalk.orgMng.orgCd).and(tmpltMngIntgrn.tmpltCd.eq(tmpltMngKkoAlimtalk.tmpltCd)))
.leftJoin(tmpltMngKkoMydoc).on(tmpltMngIntgrn.orgMng.orgCd.eq(tmpltMngKkoMydoc.orgMng.orgCd).and(tmpltMngIntgrn.tmpltCd.eq(tmpltMngKkoMydoc.tmpltCd))) .leftJoin(tmpltMngKkoMydoc).on(tmpltMngIntgrn.orgMng.orgCd.eq(tmpltMngKkoMydoc.orgMng.orgCd).and(tmpltMngIntgrn.tmpltCd.eq(tmpltMngKkoMydoc.tmpltCd)))
// FIXME: 카카오톡 추가
.leftJoin(tmpltMngKkoTalk).on(tmpltMngIntgrn.orgMng.orgCd.eq(tmpltMngKkoTalk.orgMng.orgCd).and(tmpltMngIntgrn.tmpltCd.eq(tmpltMngKkoTalk.tmpltCd)))
.leftJoin(tmpltMngNvSigntalk).on(tmpltMngIntgrn.orgMng.orgCd.eq(tmpltMngNvSigntalk.orgMng.orgCd).and(tmpltMngIntgrn.tmpltCd.eq(tmpltMngNvSigntalk.tmpltCd))) .leftJoin(tmpltMngNvSigntalk).on(tmpltMngIntgrn.orgMng.orgCd.eq(tmpltMngNvSigntalk.orgMng.orgCd).and(tmpltMngIntgrn.tmpltCd.eq(tmpltMngNvSigntalk.tmpltCd)))
.leftJoin(tmpltMngKtSigntalk).on(tmpltMngIntgrn.orgMng.orgCd.eq(tmpltMngKtSigntalk.orgMng.orgCd).and(tmpltMngIntgrn.tmpltCd.eq(tmpltMngKtSigntalk.tmpltCd))) .leftJoin(tmpltMngKtSigntalk).on(tmpltMngIntgrn.orgMng.orgCd.eq(tmpltMngKtSigntalk.orgMng.orgCd).and(tmpltMngIntgrn.tmpltCd.eq(tmpltMngKtSigntalk.tmpltCd)))
.leftJoin(tmpltMngKtGibis).on(tmpltMngIntgrn.orgMng.orgCd.eq(tmpltMngKtGibis.orgMng.orgCd).and(tmpltMngIntgrn.tmpltCd.eq(tmpltMngKtGibis.tmpltCd))) .leftJoin(tmpltMngKtGibis).on(tmpltMngIntgrn.orgMng.orgCd.eq(tmpltMngKtGibis.orgMng.orgCd).and(tmpltMngIntgrn.tmpltCd.eq(tmpltMngKtGibis.tmpltCd)))
@ -102,6 +107,15 @@ public class TmpltMngIntgrnRepositoryImpl implements TmpltMngIntgrnRepositoryCus
, tmpltMngKkoMydoc.tmpltCsInfoUseYn , tmpltMngKkoMydoc.tmpltCsInfoUseYn
, tmpltMngKkoMydoc.pryMessage , tmpltMngKkoMydoc.pryMessage
).as("kkoMydoc") ).as("kkoMydoc")
// FIXME: 카카오톡 추가
, Projections.fields(TmpltMngKkoTalkDTO.class
, tmpltMngKkoTalk.csNumber
, tmpltMngKkoTalk.csName
, tmpltMngKkoTalk.ciTransUseYn
, tmpltMngKkoTalk.tmpltMsgUseYn
, tmpltMngKkoTalk.tmpltCsInfoUseYn
, tmpltMngKkoTalk.pryMessage
).as("kkoTalk")
, Projections.fields(TmpltMngNvSigntalkDTO.class , Projections.fields(TmpltMngNvSigntalkDTO.class
, tmpltMngNvSigntalk.callCenterNo , tmpltMngNvSigntalk.callCenterNo
, tmpltMngNvSigntalk.ciTransUseYn , tmpltMngNvSigntalk.ciTransUseYn

@ -1,29 +1,23 @@
package cokr.xit.ens.modules.common.ctgy.intgrnnoti.service.support; package cokr.xit.ens.modules.common.ctgy.intgrnnoti.service.support;
import cokr.xit.ens.core.aop.EnsResponseVO; import java.util.*;
import cokr.xit.ens.core.exception.EnsException;
import cokr.xit.ens.core.exception.code.EnsErrCd; import org.springframework.stereotype.*;
import cokr.xit.ens.core.utils.CmmnUtil; import org.springframework.transaction.annotation.*;
import cokr.xit.ens.modules.common.biztmplt.ResultProcTemplate;
import cokr.xit.ens.modules.common.code.IntgrnDtlStatCd; import cokr.xit.ens.core.aop.*;
import cokr.xit.ens.modules.common.code.PostSeCd; import cokr.xit.ens.core.exception.*;
import cokr.xit.ens.modules.common.code.StatCd; import cokr.xit.ens.core.exception.code.*;
import cokr.xit.ens.modules.common.ctgy.intgrnnoti.code.TryStatCd; import cokr.xit.ens.core.utils.*;
import cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.IntgrnSendDetail; import cokr.xit.ens.modules.common.biztmplt.*;
import cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.IntgrnSendMast; import cokr.xit.ens.modules.common.code.*;
import cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.repository.IntgrnSendDetailRepository; import cokr.xit.ens.modules.common.ctgy.intgrnnoti.code.*;
import cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.repository.IntgrnSendMastRepository; import cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.*;
import cokr.xit.ens.modules.common.ctgy.intgrnnoti.model.IntgrnDetailStatVO; import cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.repository.*;
import cokr.xit.ens.modules.common.domain.support.FieldError; import cokr.xit.ens.modules.common.ctgy.intgrnnoti.model.*;
import lombok.RequiredArgsConstructor; import cokr.xit.ens.modules.common.domain.support.*;
import lombok.extern.slf4j.Slf4j; import lombok.*;
import org.springframework.stereotype.Component; import lombok.extern.slf4j.*;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Slf4j @Slf4j
@Component @Component
@ -55,7 +49,7 @@ public class IntgrnNotiRsltFetcher extends ResultProcTemplate {
intgrnSendDetailRepository.modifyDetailStatCdByIntgrnDetailStatVO(list); intgrnSendDetailRepository.modifyDetailStatCdByIntgrnDetailStatVO(list);
sendDetails = intgrnSendDetailRepository.findAllByIntgrnSendMast(intgrnSendMast); sendDetails = intgrnSendDetailRepository.findAllByIntgrnSendMast(intgrnSendMast);
// FIXME: sendDetails가 null이 되는 경우 발생
respVO = EnsResponseVO.okBuilder().resultInfo(resultInfo).build(); respVO = EnsResponseVO.okBuilder().resultInfo(resultInfo).build();

@ -14,9 +14,9 @@ import cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.*;
import cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.repository.*; import cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.repository.*;
import cokr.xit.ens.modules.common.ctgy.intgrnnoti.service.support.*; import cokr.xit.ens.modules.common.ctgy.intgrnnoti.service.support.*;
import cokr.xit.ens.modules.common.monitor.*; import cokr.xit.ens.modules.common.monitor.*;
import cokr.xit.ens.modules.kkomydoc.service.event.*;
import cokr.xit.ens.modules.kkotalk.model.*; import cokr.xit.ens.modules.kkotalk.model.*;
import cokr.xit.ens.modules.kkotalk.service.*; import cokr.xit.ens.modules.kkotalk.service.*;
import cokr.xit.ens.modules.kkotalk.service.event.*;
import lombok.*; import lombok.*;
import lombok.extern.slf4j.*; import lombok.extern.slf4j.*;
@ -55,13 +55,13 @@ public class AcceptByKkoTalkEventListener implements AcceptDataEventListener<Acc
if (ev.IsReserveSend()) { if (ev.IsReserveSend()) {
KkoMydocSendReserveEvent event = KkoMydocSendReserveEvent.builder() KkoTalkSendReserveEvent event = KkoTalkSendReserveEvent.builder()
.sendMastIds(Arrays.asList(sendMastId)) .sendMastIds(Arrays.asList(sendMastId))
.build(); .build();
applicationEventPublisher.publishEvent(event); applicationEventPublisher.publishEvent(event);
} else { } else {
KkoMydocSendRealtimeEvent event = KkoMydocSendRealtimeEvent.builder() KkoTalkSendRealtimeEvent event = KkoTalkSendRealtimeEvent.builder()
.sendMastIds(Arrays.asList(sendMastId)) .sendMastIds(Arrays.asList(sendMastId))
// .callback(() -> this.fetch(sendMastId, ev.getSendDetails())) // .callback(() -> this.fetch(sendMastId, ev.getSendDetails()))
.build(); .build();

@ -1,28 +1,12 @@
package cokr.xit.ens.modules.kkotalk.domain; package cokr.xit.ens.modules.kkotalk.domain;
import javax.persistence.Column; import javax.persistence.*;
import javax.persistence.Embedded;
import javax.persistence.Entity; import cokr.xit.ens.modules.common.ctgy.intgrnbill.support.entity.*;
import javax.persistence.FetchType; import cokr.xit.ens.modules.common.domain.*;
import javax.persistence.GeneratedValue; import cokr.xit.ens.modules.common.domain.support.*;
import javax.persistence.GenerationType; import lombok.*;
import javax.persistence.Id; import lombok.experimental.*;
import javax.persistence.Index;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
import cokr.xit.ens.modules.common.ctgy.intgrnbill.support.entity.Bill;
import cokr.xit.ens.modules.common.domain.BaseEntity;
import cokr.xit.ens.modules.common.domain.SendMast;
import cokr.xit.ens.modules.common.domain.support.FieldError;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.SuperBuilder;
// FIXME: 카카오톡 신규 추가 // FIXME: 카카오톡 신규 추가
@Entity @Entity
@ -83,7 +67,7 @@ public class SendDetailKkoTalk extends BaseEntity {
* default: false * default: false
* </pre> * </pre>
*/ */
@Column(name = "is_notification_unavailable", nullable = true) @Column(name = "use_non_personalized_noti", nullable = true)
private Boolean useNonPersonalizedNotification = false; private Boolean useNonPersonalizedNotification = false;
/** /**
@ -130,6 +114,32 @@ public class SendDetailKkoTalk extends BaseEntity {
@Column(name = "envelope_id", nullable = true) @Column(name = "envelope_id", nullable = true)
private String envelopeId; private String envelopeId;
@Column(name = "status", nullable = true)
private String status;
@Column(name = "sent_at", nullable = true)
private String sentAt;
@Column(name = "received_at", nullable = true)
private String receivedAt;
@Column(name = "read_at", nullable = true)
private String readAt;
@Column(name = "authenticated_at", nullable = true)
private String authenticatedAt;
@Column(name = "ott_verified_at", nullable = true)
private String ottVerifiedAt;
@Column(name = "is_notification_unavailable", nullable = true)
private String isNotificationUnavailable;
@Column(name = "user_notified_at", nullable = true)
private String userNotifiedAt;
@Column(name = "distribution_received_at", nullable = true)
private String distributionReceivedAt;
@Embedded @Embedded
@Setter @Setter

@ -1,19 +1,16 @@
package cokr.xit.ens.modules.kkotalk.model; package cokr.xit.ens.modules.kkotalk.model;
import java.time.LocalDateTime; import java.time.*;
import java.util.List; import java.util.*;
import javax.validation.Valid; import javax.validation.*;
import javax.validation.constraints.Size; import javax.validation.constraints.*;
import cokr.xit.ens.core.model.EnsAcceptReqDTO; import cokr.xit.ens.core.model.*;
import cokr.xit.ens.modules.kkotalk.model.config.Document; import cokr.xit.ens.modules.kkotalk.model.config.*;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.*;
import lombok.AllArgsConstructor; import lombok.*;
import lombok.Data; import lombok.experimental.*;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
/** /**
* <pre> * <pre>
@ -134,6 +131,15 @@ public class KkotalkDTO extends KkotalkApiDTO {
private String envelopeId; private String envelopeId;
private String link; private String link;
private String status; private String status;
private String sentAt;
private String receivedAt;
private String readAt;
private String authenticatedAt;
private String ottVerifiedAt;
private String isNotificationUnavailable;
private String userNotifiedAt;
private String distributionReceivedAt;
private Long sendDetailId; private Long sendDetailId;
private Long sendMastId; private Long sendMastId;
private String errorCode; private String errorCode;

@ -176,7 +176,7 @@ public class KkoTalkAcceptor implements EnsPhaseProcSupport<EnsResponseVO<?>, Kk
KkotalkDTO.SendDetailKkoTalkDTO sendDetail = KkotalkDTO.SendDetailKkoTalkDTO.builder() KkotalkDTO.SendDetailKkoTalkDTO sendDetail = KkotalkDTO.SendDetailKkoTalkDTO.builder()
.sendMastId(sendMast.getSendMastId()) .sendMastId(sendMast.getSendMastId())
.title(document.getTitle()) .title(document.getTitle())
.link(document.getContent().getLink()) .link(document.getContent() != null? document.getContent().getLink(): null)
.hash(document.getHash()) .hash(document.getHash())
.guide(document.getGuide()) .guide(document.getGuide())
.payload(document.getPayload()) .payload(document.getPayload())

@ -76,4 +76,31 @@
WHERE send_mast_id = #{sendMastId} WHERE send_mast_id = #{sendMastId}
</select> </select>
<select id="findAllBySendMastAndEnvlopeIdIsNotNull" parameterType="cokr.xit.ens.modules.common.domain.SendMast" resultType="cokr.xit.ens.modules.kkotalk.model.KkotalkDTO$SendDetailKkoTalkDTO">
/** iup-kkotalk-mapper|findAllBySendMastAndEnvlopeIdIsNotNull-카카오톡 발송 결과 대상?? 조회|julim */
SELECT send_detail_id,
title,
link,
hash,
guide,
payload,
read_expires_at,
review_expires_at,
use_non_personalized_noti AS useNonPersonalizedNotification,
ci,
phone_number,
name,
birthday,
external_id,
error_code,
error_message,
bill_uid,
send_mast_id,
regist_dt
FROM ens_snd_dtl_kko_talk
WHERE send_mast_id = #{sendMastId}
AND envelope_id IS NOT NULL
</select>
</mapper> </mapper>

Loading…
Cancel
Save