diff --git a/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchExtractService.java b/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchExtractService.java index d165a9f..afaaf56 100644 --- a/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchExtractService.java +++ b/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchExtractService.java @@ -13,6 +13,7 @@ import kr.xit.biz.ens.model.EnsDTO; import kr.xit.biz.ens.model.cmm.SndngMssageParam; import kr.xit.biz.ens.model.cntc.CntcDTO; import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendResponses; +import kr.xit.biz.ens.model.kt.KtMmsSendDTO.KtMainSendReqData; import kr.xit.biz.sms.service.ISmsMessageService; import kr.xit.core.exception.BizRuntimeException; import kr.xit.core.support.utils.Checks; @@ -69,7 +70,7 @@ public class EnsBatchExtractService extends EgovAbstractServiceImpl implements */ @Override @Transactional(propagation = Propagation.REQUIRES_NEW) - public void saveKkoMyDocResult(final String mstId, String unitySndMstId, final List resList) { + public void saveKkoSendResult(final String mstId, String unitySndMstId, final List resList) { // 결과 반영 resList.forEach(o -> o.getDocuments().forEach( @@ -140,6 +141,15 @@ public class EnsBatchExtractService extends EgovAbstractServiceImpl implements updateMstTable(paramDTO, SndngSeCode.SMS); } + @Override + @Transactional(propagation = Propagation.REQUIRES_NEW) + public void saveKtBcResult(final SndngMssageParam dto, final List sendReqs) { + // 성공처리 + // mobile page create + if(Checks.isNotEmpty(sendReqs)) sendReqs.forEach(d -> mapper.insertKtMobilePageManage(d.getSrcKey())); + mapper.updateKtBcMst(dto); + } + @Override @Transactional(propagation = Propagation.REQUIRES_NEW) public void sendPostPlus(SndngMssageParam dto) { diff --git a/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchSendService.java b/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchSendService.java index 0acc1ed..0ea580f 100644 --- a/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchSendService.java +++ b/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchSendService.java @@ -93,6 +93,7 @@ public class EnsBatchSendService extends EgovAbstractServiceImpl implements IEns /** *
      * 전자고지(문서) send bulks - 문서 중개자별 send
+     * - 문서 중개자별 처리(BIZ DB) -> 트랜잭션이 분리 되어야 한다
      * - 발송마스터의 발송처리 상태 'make-ok' 대상
      * - 처리완료 : 발송상세(문서중개자별 상세 테이블) 전송 결과 반영
      *            연계마스터, 통합발송마스터, 발송마스터의 발송처리 상태 변경 - 'send-ok'
@@ -167,7 +168,7 @@ public class EnsBatchSendService extends EgovAbstractServiceImpl implements IEns
      * 4. 카카오페이 문서요청 결과 반영
      *    - bulk 전송 기준 모든건이 실패인 경우만 실패 처리
      *    -
-     *    -> {@link EnsBatchExtractService#saveKkoMyDocResult(String, String, List) saveKkoMyDocResult}
+     *    -> {@link EnsBatchExtractService#saveKkoSendResult(String, String, List) saveKkoMyDocResult}
      *       - 카카오페이 연계 결과 반영 : tb_ens_kakao_my_doc
      *       - 모바일 페이지 생성 : tb_ens_mobile_page_manage
      *       - 연계발송결과 생성 : tb_cntc_sndng_result
@@ -221,7 +222,7 @@ public class EnsBatchSendService extends EgovAbstractServiceImpl implements IEns
         if(!isSuccess){
             extractService.updateSndngMstFailStatus(mstId, SndngSeCode.KAKAO, "", errMsg, errMsg);
         }
-        extractService.saveKkoMyDocResult(mstId, dto.getUnitySndngMastrId(), resList);
+        extractService.saveKkoSendResult(mstId, dto.getUnitySndngMastrId(), resList);
     }
 
     /**
@@ -234,8 +235,8 @@ public class EnsBatchSendService extends EgovAbstractServiceImpl implements IEns
         final List bulkList = new ArrayList<>();
 
         for (SendKakaoTgt sendTgtDTO : list) {
-            /**
-             * 방어 코드 추가 : CI 인증인 경우 개인정보 삭제
+            /*
+              방어 코드 추가 : CI 인증인 경우 개인정보 삭제
              */
             Receiver receiver = null;
             if(StringUtils.isNotEmpty(sendTgtDTO.getCi())){
@@ -406,17 +407,14 @@ public class EnsBatchSendService extends EgovAbstractServiceImpl implements IEns
                     .map(ErrorMsg::getErrorMsg)
                     .collect(Collectors.joining(","))
             );
-            mapper.updateKtBcMst(dto);
+            extractService.saveKtBcResult(dto, null);
             extractService.updateSndngMstFailStatus(mstId, SndngSeCode.KT_BC, dto.getErrorCode(), dto.getErrorMssage(), "[send] KT-BC 발송(bulks)요청 실패");
             return;
         }
-        // mobile page create
-        sendReqs.forEach(d -> mapper.insertKtMobilePageManage(d.getSrcKey()));
-
         // 성공 건수 존재시 성공 처리
         dto.setResultCd("00");
         dto.setErrorMssage("정상");
-        mapper.updateKtBcMst(dto);
+        extractService.saveKtBcResult(dto, sendReqs);
         extractService.updateSendSndngMstStatus(mstId, unitySndMstId, SndngSeCode.KT_BC, "KT-BC 실패(발송마스터 데이타 오류)");
     }
 
diff --git a/mens-batch/src/main/java/kr/xit/biz/ens/service/IEnsBatchExtractService.java b/mens-batch/src/main/java/kr/xit/biz/ens/service/IEnsBatchExtractService.java
index b44bd58..ba997c8 100644
--- a/mens-batch/src/main/java/kr/xit/biz/ens/service/IEnsBatchExtractService.java
+++ b/mens-batch/src/main/java/kr/xit/biz/ens/service/IEnsBatchExtractService.java
@@ -4,6 +4,7 @@ import java.util.List;
 import kr.xit.biz.common.ApiConstants.SndngSeCode;
 import kr.xit.biz.ens.model.cmm.SndngMssageParam;
 import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendResponses;
+import kr.xit.biz.ens.model.kt.KtMmsSendDTO.KtMainSendReqData;
 
 /**
  * 
@@ -27,9 +28,12 @@ public interface IEnsBatchExtractService {
     //-----------------------------------------------------------------------------------------------------------------
     // REQUIRES_NEW service method
     //-----------------------------------------------------------------------------------------------------------------
-    void saveKkoMyDocResult(final String mstId, String unitySndMstId, final List resList);
+    void saveKkoSendResult(final String mstId, String unitySndMstId, final List resList);
     void sendEgreen(final SndngMssageParam dto);
     void sendSms(final SndngMssageParam dto);
+
+    void saveKtBcResult(final SndngMssageParam dto, final List sendReqs);
+
     void sendPostPlus(final SndngMssageParam dto);