feat: 카카오톡 make 반영

main
Jonguk. Lim 2 months ago
parent 644dece18b
commit 72a972cc6d

@ -1,41 +1,29 @@
package cokr.xit.ens.modules.kkotalk.service; package cokr.xit.ens.modules.kkotalk.service;
import java.time.LocalDateTime; import java.time.*;
import java.util.Arrays; import java.util.*;
import java.util.Collections; import java.util.stream.*;
import java.util.List;
import java.util.Map; import org.apache.commons.lang.*;
import java.util.Optional; import org.springframework.stereotype.*;
import java.util.stream.Collectors; import org.springframework.transaction.annotation.*;
import org.apache.commons.lang.StringUtils; import cokr.xit.ens.core.aop.*;
import org.springframework.stereotype.Service; import cokr.xit.ens.core.exception.*;
import org.springframework.transaction.annotation.Propagation; import cokr.xit.ens.core.exception.code.*;
import org.springframework.transaction.annotation.Transactional; import cokr.xit.ens.core.utils.*;
import cokr.xit.ens.modules.common.code.*;
import cokr.xit.ens.core.aop.EnsResponseVO; import cokr.xit.ens.modules.common.ctgy.sys.mng.domain.*;
import cokr.xit.ens.core.exception.EnsException; import cokr.xit.ens.modules.common.ctgy.sys.mng.service.*;
import cokr.xit.ens.core.exception.code.EnsErrCd; import cokr.xit.ens.modules.common.domain.*;
import cokr.xit.ens.core.utils.CmmnUtil; import cokr.xit.ens.modules.common.domain.repository.*;
import cokr.xit.ens.modules.common.code.PostSeCd; import cokr.xit.ens.modules.common.domain.support.*;
import cokr.xit.ens.modules.common.code.StatCd; import cokr.xit.ens.modules.kkomydoc.domain.*;
import cokr.xit.ens.modules.common.ctgy.sys.mng.domain.OrgMng; import cokr.xit.ens.modules.kkomydoc.domain.repository.*;
import cokr.xit.ens.modules.common.ctgy.sys.mng.service.OrgMngService; import cokr.xit.ens.modules.kkotalk.model.*;
import cokr.xit.ens.modules.common.domain.SendMast; import cokr.xit.ens.modules.kkotalk.service.support.*;
import cokr.xit.ens.modules.common.domain.repository.SendMastRepository; import lombok.*;
import cokr.xit.ens.modules.common.domain.support.FieldError; import lombok.extern.slf4j.*;
import cokr.xit.ens.modules.kkomydoc.domain.SendDetailKkoMydocTokenHist;
import cokr.xit.ens.modules.kkomydoc.domain.repository.SendDetailKkoMydocTokenHistRepository;
import cokr.xit.ens.modules.kkotalk.model.KkotalkApiDTO;
import cokr.xit.ens.modules.kkotalk.model.KkotalkDTO;
import cokr.xit.ens.modules.kkotalk.service.support.KkoTalkAcceptor;
import cokr.xit.ens.modules.kkotalk.service.support.KkoTalkApiService;
import cokr.xit.ens.modules.kkotalk.service.support.KkoTalkMaker;
import cokr.xit.ens.modules.kkotalk.service.support.KkoTalkRsltFetcher;
import cokr.xit.ens.modules.kkotalk.service.support.KkoTalkRsltProvider;
import cokr.xit.ens.modules.kkotalk.service.support.KkoTalkSender;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
// FIXME: 카카오톡 신규 추가 // FIXME: 카카오톡 신규 추가
@Slf4j @Slf4j
@ -93,7 +81,7 @@ public class KkoTalkService {
try { try {
SendMast sendMast = sendMastRepository.findById(sendMastId) SendMast sendMast = sendMastRepository.findById(sendMastId)
.orElseThrow(() -> new EnsException(EnsErrCd.SEND404, "일치하는 자료가 없습니다.")); .orElseThrow(() -> new EnsException(EnsErrCd.SEND404, "일치하는 자료가 없습니다."));
if (!PostSeCd.kkoMydoc.equals(sendMast.getPostSe())) if (!PostSeCd.kkoTalk.equals(sendMast.getPostSe()))
throw new EnsException(EnsErrCd.SEND404, String.format("%s 자료가 아닙니다.", PostSeCd.kkoMydoc.getCodeNm())); throw new EnsException(EnsErrCd.SEND404, String.format("%s 자료가 아닙니다.", PostSeCd.kkoMydoc.getCodeNm()));
if (!(StatCd.accept.equals(sendMast.getStatCd()) if (!(StatCd.accept.equals(sendMast.getStatCd())
|| StatCd.makefail.equals(sendMast.getStatCd()))) || StatCd.makefail.equals(sendMast.getStatCd())))

@ -136,8 +136,6 @@ public class KkoTalkAcceptor implements EnsPhaseProcSupport<EnsResponseVO<?>, Kk
.closeDt(DateUtil.toLocalDateTime(reqDTO.getClose_dt())) .closeDt(DateUtil.toLocalDateTime(reqDTO.getClose_dt()))
.build(); .build();
sendMastRepository.save(sendMast); sendMastRepository.save(sendMast);
sendMastRepository.flush();
Gson gson = new GsonBuilder().disableHtmlEscaping().create(); Gson gson = new GsonBuilder().disableHtmlEscaping().create();
List<KkotalkDTO.SendDetailKkoTalkDTO> sendDetails = new ArrayList<>(); List<KkotalkDTO.SendDetailKkoTalkDTO> sendDetails = new ArrayList<>();
@ -218,8 +216,10 @@ public class KkoTalkAcceptor implements EnsPhaseProcSupport<EnsResponseVO<?>, Kk
.filter(row -> CmmnUtil.isEmpty(row.getBillId())) .filter(row -> CmmnUtil.isEmpty(row.getBillId()))
.collect(Collectors.toList()) .collect(Collectors.toList())
); );
billRepository.flush();
// FIXME: 발송상세 저장을 위해 추가
sendMastRepository.flush();
billRepository.flush();
// kkotalk 발송상세 저장 // kkotalk 발송상세 저장
sendDetails.forEach(d -> { sendDetails.forEach(d -> {
d.setSendDetailId(keySequenceService.getKeySequence("SendDetailKkoTalk_id")); d.setSendDetailId(keySequenceService.getKeySequence("SendDetailKkoTalk_id"));

@ -15,7 +15,11 @@ logging:
file: utf-8 file: utf-8
level: level:
root: info root: info
'[org.hibernate.type.descriptor.sql]': off #jpa "?" 부분(binding 파라미터) 출력 # org.hibernate.SQL.logStatement 로그 제거
'[org.hibernate.SQL]': INFO
# org.hibernate.type.descriptor.sql.BasicBinder.bind 로그 제거
'[org.hibernate.type.descriptor.sql.BasicBinder]': INFO
#'[org.hibernate.type.descriptor.sql]': off #jpa "?" 부분(binding 파라미터) 출력
# '[org.springframework.orm.jpa]': debug # '[org.springframework.orm.jpa]': debug
# '[org.springframework.transaction]': debug # '[org.springframework.transaction]': debug
# '[org.springframework.transaction.interceptor]': trace # '[org.springframework.transaction.interceptor]': trace

@ -51,7 +51,7 @@
) )
</insert> </insert>
<select id="findAllBySendMastId" parameterType="string" resultType="cokr.xit.ens.modules.kkotalk.model.KkotalkDTO$SendDetailKkoTalkDTO"> <select id="findAllBySendMastId" parameterType="long" resultType="cokr.xit.ens.modules.kkotalk.model.KkotalkDTO$SendDetailKkoTalkDTO">
/** iup-kkotalk-mapper|findAllBySendMastId-카카오톡발송대상 조회|julim */ /** iup-kkotalk-mapper|findAllBySendMastId-카카오톡발송대상 조회|julim */
SELECT send_detail_id, SELECT send_detail_id,
title, title,

Loading…
Cancel
Save