+ */
+ private static ApiConstants.SndngSeCode getSndngSeCodFromTrySeq(final EnsDTO.SndngValidation dto) {
+ String[] tryVal = {
+ Checks.checkVal(dto.getTry1(), ""),
+ Checks.checkVal(dto.getTry2(), ""),
+ Checks.checkVal(dto.getTry3(), "")
+ };
+ String seCode = tryVal[dto.getTrySeq() - 1];
+
+ return ApiConstants.SndngSeCode.getSndngSeCode(seCode);
+ }
//-----------------------------------------------------------------------------------------------------------------
}
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 9f6c1da..e4397ff 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
@@ -129,8 +129,6 @@ public class EnsBatchExtractService extends AbstractService implements
// 모바일 페이지 컨텐트 생성
if (Checks.isNotEmpty(t.getEnvelopeId())) {
mapper.insertKkotalkMobilePageManage(t.getExternalId());
- // FIXME: 코드값 확인후 지정
- code = ApiConstants.KkotalkDocStatus.READ.getCode();
}else{
code = t.getErrorCode();
}
diff --git a/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchMakeService.java b/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchMakeService.java
index 33fc577..3c53240 100644
--- a/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchMakeService.java
+++ b/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchMakeService.java
@@ -13,12 +13,12 @@ import org.springframework.transaction.annotation.Transactional;
import kr.xit.biz.common.ApiConstants;
import kr.xit.biz.common.ApiConstants.SignguCode;
import kr.xit.biz.common.ApiConstants.SndngSeCode;
+import kr.xit.biz.ens.cmm.CmmEnsBizUtils;
import kr.xit.biz.ens.mapper.IEnsBatchMapper;
import kr.xit.biz.ens.model.EnsDTO;
import kr.xit.biz.ens.model.cmm.SndngMssageParam;
import kr.xit.core.exception.BizRuntimeException;
import kr.xit.core.service.AbstractService;
-import kr.xit.core.support.utils.Checks;
import lombok.RequiredArgsConstructor;
/**
@@ -103,9 +103,15 @@ public class EnsBatchMakeService extends AbstractService implements IEnsBatchMak
MDC.put(SNDNG_PROCESS_STTUS, "make-fail2");
dto.setProfile(ApiConstants.PROFILE);
- //try2 발송 대상이 있는지 확인
- final int sendCnt = mapper.selectSendOkTgts(dto);
+ final SndngSeCode sndngSeCode = CmmEnsBizUtils.getSndngSeCodFromTrySeq(dto);
+ //try2 발송 대상이 있는지 확인
+ int sendCnt = 0;
+ if(SndngSeCode.KAKAO.equals(sndngSeCode)) {
+ sendCnt = mapper.selectKkopaySendOkTgts(dto);
+ } else {
+ sendCnt = mapper.selectKkotalkSendOkTgts(dto);
+ }
//없으면 연계 발송 마스터, 통합 발송 마스터 send-ok
if (sendCnt == 0) {
if(IS_CCN) dto.setNewSndngProcessSttus(ApiConstants.MappingSndngProcessStatus.fromEns(dto.getNewSndngProcessSttus()));
@@ -179,12 +185,11 @@ public class EnsBatchMakeService extends AbstractService implements IEnsBatchMak
//-----------------------------------------------------------------------------------------------------------------
// make
//-----------------------------------------------------------------------------------------------------------------
-
/**
*
* make 상세 데이타 생성 : 문서 중개자별 상세 데이타 생셩
* - 최초(전송 없슴), 1차 전송, 2차 전송 데이타 대상
- * KAKAO - {@link IEnsBatchMapper#insertKakaoMyDocs(Object) insertKakaoMyDocs}
+ * KAKAO - {@link IEnsBatchMapper#insertKakaopay(Object) insertKakaopay}
* - tb_ens_kakao_my_doc
* KT_BC - {@link IEnsBatchMapper#insertKtBcMastr(Object) insertKtBcMastr}
* - tb_ens_kt_bc_mastr FIXME::운영 전환 시 처리 필요
@@ -195,29 +200,25 @@ public class EnsBatchMakeService extends AbstractService implements IEnsBatchMak
*
*/
private int makeEnsDetailByTry(final SndngMssageParam dto) {
- String[] tryVal = {
- Checks.checkVal(dto.getTry1(), ""),
- Checks.checkVal(dto.getTry2(), ""),
- Checks.checkVal(dto.getTry3(), "")
- };
- final String seCode = tryVal[dto.getTrySeq() - 1];
-
- return switch (SndngSeCode.compare(seCode)) {
- case KAKAO -> mapper.insertKakaoMyDocs(dto);
- case KAKAO_NEW -> mapper.insertKakaoD10(dto);
- case KT_BC -> {
- // FIXME: KT callback url 확인 적용
- if(SignguCode.CHUNCHEON.getCode().equals(dto.getSignguCode())){
- dto.setUrl(CHUNCHEON_CALLBACK_URL);
- }
- // FIXME: KT callback url 확인 적용
- if(SignguCode.FUNERAL.getCode().equals(dto.getSignguCode())){
- dto.setUrl(ME_CALLBACK_URL);
+ final SndngSeCode sndngSeCode = CmmEnsBizUtils.getSndngSeCodFromTrySeq(dto);
+
+ return
+ switch (sndngSeCode) {
+ case KAKAO -> mapper.insertKakaopay(dto);
+ case KAKAO_NEW -> mapper.insertKakaotalk(dto);
+ case KT_BC -> {
+ // FIXME: KT callback url 확인 적용
+ if(SignguCode.CHUNCHEON.getCode().equals(dto.getSignguCode())){
+ dto.setUrl(CHUNCHEON_CALLBACK_URL);
+ }
+ // FIXME: KT callback url 확인 적용
+ if(SignguCode.FUNERAL.getCode().equals(dto.getSignguCode())){
+ dto.setUrl(ME_CALLBACK_URL);
+ }
+ mapper.insertKtBcMastr(dto);
+ yield mapper.insertKtBcDetail(dto);
}
- mapper.insertKtBcMastr(dto);
- yield mapper.insertKtBcDetail(dto);
- }
- default -> throw BizRuntimeException.create(String.format("정의 되지 않은 문서 중개자[%s] 입니다", seCode));
+ //default -> throw BizRuntimeException.create(String.format("정의 되지 않은 문서 중개자[%s] 입니다", sndngSeCode.getCode()));
};
}
//-----------------------------------------------------------------------------------------------------------------
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 6b06737..08603b9 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
@@ -138,18 +138,13 @@ public class EnsBatchSendService extends AbstractService implements IEnsBatchSen
MDC.put("sndngMastrId", dto.getSndngMastrId());
MDC.put(SNDNG_PROCESS_STTUS, "send-fail" + dto.getTrySeq());
- final String[] tryVal = {
- Checks.checkVal(dto.getTry1(), ""),
- Checks.checkVal(dto.getTry2(), ""),
- Checks.checkVal(dto.getTry3(), "")
- };
+ final SndngSeCode sndngSeCode = CmmEnsBizUtils.getSndngSeCodFromTrySeq(dto);
// 마스터 상태 변경값을 파라메터에서 받은 상태값으로 set
dto.setNewSndngProcessSttus(dto.getSndngProcessSttus());
- final String seCode = tryVal[dto.getTrySeq() - 1];
// 업무 문서 구분에 따른 분기
- switch (SndngSeCode.compare(seCode)) {
+ switch (sndngSeCode) {
/*
* 카카오페이 연계 결과 반영 : tb_ens_kakao_my_doc
* 모바일 페이지 생성 : tb_ens_mobile_page_manage
@@ -158,7 +153,7 @@ public class EnsBatchSendService extends AbstractService implements IEnsBatchSen
case KAKAO -> sendBulkKakaopay(dto);
case KAKAO_NEW -> sendBulkKakaotalk(dto);
case KT_BC -> sendBulkKtBc(dto);
- default -> throw BizRuntimeException.create(String.format("정의 되지 않은 문서 중개자[%s] 입니다", seCode));
+ default -> throw BizRuntimeException.create(String.format("정의 되지 않은 문서 중개자[%s] 입니다", sndngSeCode.getCode()));
}
}
@@ -170,7 +165,7 @@ public class EnsBatchSendService extends AbstractService implements IEnsBatchSen
*
* 카카오 문서 send
* 1. 카카오페이 문서요청 대상 조회
- * - {@link IEnsBatchMapper#selectKakaoSendTgts(Object) selectKakaoSendTgts}
+ * - {@link IEnsBatchMapper#selectKakaopaySendTgts(Object) selectKakaopaySendTgts}
* 2. 요청 대상 파라메터 set, validtion check
* - {@link #setKkopaySendBulks}
* - {@link #validatedKkopaySendBulks}
@@ -242,16 +237,16 @@ public class EnsBatchSendService extends AbstractService implements IEnsBatchSen
*
* 카카오톡 전자고지 send
* 1. 카카오톡 전자고지 요청 대상 조회
- * - {@link IEnsBatchMapper#selectKakaoSendTgts(Object) selectKakaoSendTgts}
+ * - {@link IEnsBatchMapper#selectKakaotalkSendTgts(Object) selectKakaotalkSendTgts}
* 2. 요청 대상 파라메터 set, validtion check
- * - {@link #setKkoNewSendBulks}
- * - {@link #validatedKkoNewSendBulks}
+ * - {@link #setKkotalkSendBulks}
+ * - {@link #validatedKkotalkSendBulks}
* 3. 카카오페이 문서요청 API 호출
* -> 결과 목록 획득
* 4. 카카오페이 문서요청 결과 반영
* - bulk 전송 기준 모든건이 실패인 경우만 실패 처리
* -
- * -> {@link EnsBatchExtractService#saveKkopaySendResult(String, String, List) saveKkoNewSendResult}
+ * -> {@link EnsBatchExtractService#saveKkotalkSendResult(String, String, List) saveKkoNewSendResult}
* - 카카오페이 연계 결과 반영 : tb_ens_kakao_my_doc
* - 모바일 페이지 생성 : tb_ens_mobile_page_manage
* - 연계발송결과 생성 : tb_cntc_sndng_result
@@ -307,7 +302,7 @@ public class EnsBatchSendService extends AbstractService implements IEnsBatchSen
if(!isSuccess){
extractService.updateSndngMstFailStatus(mstId, SndngSeCode.KAKAO_NEW, "", errMsg, errMsg);
}
- extractService.saveKkoNewSendResult(mstId, dto.getUnitySndngMastrId(), resList);
+ extractService.saveKkotalkSendResult(mstId, dto.getUnitySndngMastrId(), resList);
}
/**
diff --git a/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchStatusService.java b/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchStatusService.java
index 3c1bc10..41284c2 100644
--- a/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchStatusService.java
+++ b/mens-batch/src/main/java/kr/xit/biz/ens/service/EnsBatchStatusService.java
@@ -85,31 +85,27 @@ public class EnsBatchStatusService extends AbstractService implements IEnsBatchS
MDC.put("sndngMastrId", dto.getSndngMastrId());
//MDC.put(SNDNG_PROCESS_STTUS, "send-fail" + dto.getTrySeq());
- final String[] tryVal = {
- Checks.checkVal(dto.getTry1(), ""),
- Checks.checkVal(dto.getTry2(), ""),
- Checks.checkVal(dto.getTry3(), "")
- };
+ final SndngSeCode sndngSeCode = CmmEnsBizUtils.getSndngSeCodFromTrySeq(dto);
// 마스터 상태 변경값을 파라메터에서 받은 상태값으로 set
//dto.setNewSndngProcessSttus(reqDTO.getSndngProcessSttus());
- final String seCode = tryVal[dto.getTrySeq() - 1];
// 업무 문서 구분에 따른 분기
- switch (SndngSeCode.compare(seCode)) {
+ switch (sndngSeCode) {
/*
* 카카오페이 연계 결과 반영 : tb_ens_kakao_my_doc
* 모바일 페이지 생성 : tb_ens_mobile_page_manage
* 연계발송결과 생성 : tb_cntc_sndng_result
*/
- case KAKAO:
- statusKakao(dto);
- break;
- case KT_BC:
- break;
-
- default:
- throw BizRuntimeException.create(String.format("정의 되지 않은 문서 중개자[%s] 입니다", seCode));
+ case KAKAO -> statusKakao(dto);
+
+ case KAKAO_NEW
+ -> statusKakao(dto);
+ //break;
+ case KT_BC -> {}
+
+ default ->
+ throw BizRuntimeException.create(String.format("정의 되지 않은 문서 중개자[%s] 입니다", sndngSeCode.getCode()));
}
}
diff --git a/mens-batch/src/main/resources/config/application-local-ccn.yml b/mens-batch/src/main/resources/config/application-local-ccn.yml
index 0868dcc..2b8afc6 100644
--- a/mens-batch/src/main/resources/config/application-local-ccn.yml
+++ b/mens-batch/src/main/resources/config/application-local-ccn.yml
@@ -111,5 +111,5 @@ app:
kt:
api:
# 모바일페이지 : 본문자수신등록 callback url - 토큰인증확인 조회, 열람확인결과 전송
- dp-callback-url: http://${app.api-ip}:8080/api/web/mbl/v1/kt/dpMblPage.do
+ chuncheon-callback-url: http://${app.api-ip}:8080/api/web/mbl/v1/kt/dpMblPage.do
me-callback-url: http://${app.api-ip}:8080/api/web/mbl/v1/kt/meMblPage.do
diff --git a/mens-batch/src/main/resources/egovframework/mapper/biz/ens-mysql-mapper.xml b/mens-batch/src/main/resources/egovframework/mapper/biz/ens-mysql-mapper.xml
index 173ccd6..aa0fb02 100644
--- a/mens-batch/src/main/resources/egovframework/mapper/biz/ens-mysql-mapper.xml
+++ b/mens-batch/src/main/resources/egovframework/mapper/biz/ens-mysql-mapper.xml
@@ -77,8 +77,7 @@
/** ens-mysql-mapper|insertUnitySndngDtls-통합발송상세 생성|julim */
- INSERT
- INTO tb_ens_unity_sndng_detail (
+ INSERT INTO tb_ens_unity_sndng_detail (
unity_sndng_detail_id, /* 통합발송상세 ID*/
unity_sndng_mastr_id, /* 통합발송마스터 ID */
signgu_code, /* 시군구 코드 */
@@ -193,18 +192,30 @@
-
-
+
/** ens-mysql-mapper|selectAcceptVali-Validate용|seojh */
SELECT term.ffnlg_code
, term.signgu_code
diff --git a/mens-core/src/main/java/kr/xit/biz/common/ApiConstants.java b/mens-core/src/main/java/kr/xit/biz/common/ApiConstants.java
index 19c9193..1a88958 100644
--- a/mens-core/src/main/java/kr/xit/biz/common/ApiConstants.java
+++ b/mens-core/src/main/java/kr/xit/biz/common/ApiConstants.java
@@ -197,7 +197,7 @@ public class ApiConstants {
this.desc = desc;
}
- public static SndngSeCode compare(final String code){
+ public static SndngSeCode getSndngSeCode(final String code){
return Arrays.stream(SndngSeCode.values())
.filter(ssc -> ssc.getCode().equals(code))
.findFirst()