feat: 카카오톡 make 반영

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

@ -1,41 +1,29 @@
package cokr.xit.ens.modules.kkotalk.service;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import cokr.xit.ens.core.aop.EnsResponseVO;
import cokr.xit.ens.core.exception.EnsException;
import cokr.xit.ens.core.exception.code.EnsErrCd;
import cokr.xit.ens.core.utils.CmmnUtil;
import cokr.xit.ens.modules.common.code.PostSeCd;
import cokr.xit.ens.modules.common.code.StatCd;
import cokr.xit.ens.modules.common.ctgy.sys.mng.domain.OrgMng;
import cokr.xit.ens.modules.common.ctgy.sys.mng.service.OrgMngService;
import cokr.xit.ens.modules.common.domain.SendMast;
import cokr.xit.ens.modules.common.domain.repository.SendMastRepository;
import cokr.xit.ens.modules.common.domain.support.FieldError;
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;
import java.time.*;
import java.util.*;
import java.util.stream.*;
import org.apache.commons.lang.*;
import org.springframework.stereotype.*;
import org.springframework.transaction.annotation.*;
import cokr.xit.ens.core.aop.*;
import cokr.xit.ens.core.exception.*;
import cokr.xit.ens.core.exception.code.*;
import cokr.xit.ens.core.utils.*;
import cokr.xit.ens.modules.common.code.*;
import cokr.xit.ens.modules.common.ctgy.sys.mng.domain.*;
import cokr.xit.ens.modules.common.ctgy.sys.mng.service.*;
import cokr.xit.ens.modules.common.domain.*;
import cokr.xit.ens.modules.common.domain.repository.*;
import cokr.xit.ens.modules.common.domain.support.*;
import cokr.xit.ens.modules.kkomydoc.domain.*;
import cokr.xit.ens.modules.kkomydoc.domain.repository.*;
import cokr.xit.ens.modules.kkotalk.model.*;
import cokr.xit.ens.modules.kkotalk.service.support.*;
import lombok.*;
import lombok.extern.slf4j.*;
// FIXME: 카카오톡 신규 추가
@Slf4j
@ -93,7 +81,7 @@ public class KkoTalkService {
try {
SendMast sendMast = sendMastRepository.findById(sendMastId)
.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()));
if (!(StatCd.accept.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()))
.build();
sendMastRepository.save(sendMast);
sendMastRepository.flush();
Gson gson = new GsonBuilder().disableHtmlEscaping().create();
List<KkotalkDTO.SendDetailKkoTalkDTO> sendDetails = new ArrayList<>();
@ -218,8 +216,10 @@ public class KkoTalkAcceptor implements EnsPhaseProcSupport<EnsResponseVO<?>, Kk
.filter(row -> CmmnUtil.isEmpty(row.getBillId()))
.collect(Collectors.toList())
);
billRepository.flush();
// FIXME: 발송상세 저장을 위해 추가
sendMastRepository.flush();
billRepository.flush();
// kkotalk 발송상세 저장
sendDetails.forEach(d -> {
d.setSendDetailId(keySequenceService.getKeySequence("SendDetailKkoTalk_id"));

@ -15,7 +15,11 @@ logging:
file: utf-8
level:
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.transaction]': debug
# '[org.springframework.transaction.interceptor]': trace

@ -51,7 +51,7 @@
)
</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 */
SELECT send_detail_id,
title,

Loading…
Cancel
Save