|
|
|
@ -1,43 +1,36 @@
|
|
|
|
|
package cokr.xit.ens.modules.kkotalk.service.support;
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.stream.*;
|
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.context.ApplicationEventPublisher;
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import com.google.common.collect.Lists;
|
|
|
|
|
import com.google.gson.Gson;
|
|
|
|
|
import com.google.gson.GsonBuilder;
|
|
|
|
|
|
|
|
|
|
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.core.utils.MapDeserailizer;
|
|
|
|
|
import cokr.xit.ens.modules.common.biztmplt.ResultProcTemplate;
|
|
|
|
|
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.common.event.SendMastStatUpdateEvent;
|
|
|
|
|
import cokr.xit.ens.modules.kkomydoc.code.KkoMydocStatusCd;
|
|
|
|
|
import cokr.xit.ens.modules.kkomydoc.domain.SendDetailKkoMydoc;
|
|
|
|
|
import cokr.xit.ens.modules.kkomydoc.domain.SendDetailKkoMydocStatHist;
|
|
|
|
|
import cokr.xit.ens.modules.kkomydoc.domain.repository.SendDetailKkoMydocRepository;
|
|
|
|
|
import cokr.xit.ens.modules.kkomydoc.domain.repository.SendDetailKkoMydocStatHistRepository;
|
|
|
|
|
import cokr.xit.ens.modules.kkomydoc.model.KkoMydocApiRespVO;
|
|
|
|
|
import cokr.xit.ens.modules.kkotalk.mapper.IKkoTalkMapper;
|
|
|
|
|
import cokr.xit.ens.modules.kkotalk.model.KkotalkDTO;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springframework.context.*;
|
|
|
|
|
import org.springframework.stereotype.*;
|
|
|
|
|
import org.springframework.transaction.annotation.*;
|
|
|
|
|
|
|
|
|
|
import com.google.common.collect.*;
|
|
|
|
|
import com.google.gson.*;
|
|
|
|
|
|
|
|
|
|
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.biztmplt.*;
|
|
|
|
|
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.common.event.*;
|
|
|
|
|
import cokr.xit.ens.modules.kkomydoc.code.*;
|
|
|
|
|
import cokr.xit.ens.modules.kkomydoc.domain.*;
|
|
|
|
|
import cokr.xit.ens.modules.kkomydoc.domain.repository.*;
|
|
|
|
|
import cokr.xit.ens.modules.kkomydoc.model.*;
|
|
|
|
|
import cokr.xit.ens.modules.kkotalk.mapper.*;
|
|
|
|
|
import cokr.xit.ens.modules.kkotalk.model.*;
|
|
|
|
|
import lombok.*;
|
|
|
|
|
import lombok.extern.slf4j.*;
|
|
|
|
|
|
|
|
|
|
// FIXME: 카카오톡 신규 추가
|
|
|
|
|
@Slf4j
|
|
|
|
@ -48,7 +41,6 @@ public class KkoTalkRsltFetcher extends ResultProcTemplate {
|
|
|
|
|
private final ApplicationEventPublisher applicationEventPublisher;
|
|
|
|
|
|
|
|
|
|
private final SendMastRepository sendMastRepository;
|
|
|
|
|
private final SendDetailKkoMydocRepository sendDetailKkoMydocRepository;
|
|
|
|
|
private final IKkoTalkMapper talkMapper;
|
|
|
|
|
private final SendDetailKkoMydocStatHistRepository sendDetailKkoMydocStatHistRepository;
|
|
|
|
|
private final OrgMngService orgMngService;
|
|
|
|
@ -63,7 +55,7 @@ public class KkoTalkRsltFetcher extends ResultProcTemplate {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SendMast sendMast = null;
|
|
|
|
|
List<KkotalkDTO.SendDetailKkoTalkDTO> sendDetails = null;
|
|
|
|
|
List<SendDetailKkoTalkDTO> sendDetails = null;
|
|
|
|
|
EnsResponseVO respVO = null;
|
|
|
|
|
Map<String, Long> resultInfo = new HashMap<>();
|
|
|
|
|
resultInfo.put("sendMastId", sendMastId);
|
|
|
|
@ -73,7 +65,6 @@ public class KkoTalkRsltFetcher extends ResultProcTemplate {
|
|
|
|
|
|
|
|
|
|
sendMast = sendMastRepository.findById(sendMastId).orElseThrow(() -> new EnsException(EnsErrCd.RSLT404, String.format("일치하는 발송마스터 자료가 없습니다. [ sendMastId %s ]", sendMastId)));
|
|
|
|
|
sendDetails = talkMapper.findAllBySendMastAndEnvlopeIdIsNotNull(sendMast);
|
|
|
|
|
//sendDetails = sendDetailKkoMydocRepository.findAllBySendMastAndDocumentBinderUuidIsNotNull(sendMast);
|
|
|
|
|
OrgMng orgMng = orgMngService.find(sendMast.getOrgCd()).getResultInfo();
|
|
|
|
|
|
|
|
|
|
Lists.partition(sendDetails, SEND_BATCH_UNIT).stream()
|
|
|
|
@ -222,10 +213,10 @@ public class KkoTalkRsltFetcher extends ResultProcTemplate {
|
|
|
|
|
* @param list
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private List<String> makeMessage(List<KkotalkDTO.SendDetailKkoTalkDTO> list) {
|
|
|
|
|
private List<String> makeMessage(List<SendDetailKkoTalkDTO> list) {
|
|
|
|
|
|
|
|
|
|
return list.stream()
|
|
|
|
|
.map(KkotalkDTO.SendDetailKkoTalkDTO::getEnvelopeId)
|
|
|
|
|
.map(SendDetailKkoTalkDTO::getEnvelopeId)
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -255,7 +246,7 @@ public class KkoTalkRsltFetcher extends ResultProcTemplate {
|
|
|
|
|
* -. 성공/실패 여부에 따라 상태정보 및 Error 필드 갱신
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
private void modifyStatInfoByDocumentBinderUuid(KkotalkDTO.SendDetailKkoTalkDTO row, List<KkotalkDTO.BulkStatusResponse> resList) {
|
|
|
|
|
private void modifyStatInfoByDocumentBinderUuid(SendDetailKkoTalkDTO row, List<KkotalkDTO.BulkStatusResponse> resList) {
|
|
|
|
|
/*
|
|
|
|
|
List<KkotalkApiDTO.EnvelopeStatusResponse> resList = response.getEnvelopeStatus();
|
|
|
|
|
if (CmmnUtil.isEmpty(envelopeStatus..getError_code())) {
|
|
|
|
|