|
|
@ -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())))
|
|
|
|