From a50be223041f6736285bf685ea41e05bf228b3e3 Mon Sep 17 00:00:00 2001 From: limju Date: Fri, 27 Oct 2023 17:16:56 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=B9=B4=EC=B9=B4=EC=98=A4,=20KT-BC=20s?= =?UTF-8?q?end,=20status=20=EC=8B=9C=EA=B5=B0=EA=B5=AC=EC=BD=94=EB=93=9C?= =?UTF-8?q?=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kr/xit/biz/mbl/model/MobilePageDTO.java | 16 +++++++--- .../biz/mbl/service/MobilePageService.java | 2 ++ .../service/AsyncKkopayEltrcDocService.java | 2 +- .../kakao/service/KkopayEltrcDocService.java | 29 ++++++------------- .../mapper/biz/ens-mbl-mysql-mapper.xml | 2 ++ 5 files changed, 26 insertions(+), 25 deletions(-) diff --git a/mens-api/src/main/java/kr/xit/biz/mbl/model/MobilePageDTO.java b/mens-api/src/main/java/kr/xit/biz/mbl/model/MobilePageDTO.java index 3b4637b..8b883c4 100644 --- a/mens-api/src/main/java/kr/xit/biz/mbl/model/MobilePageDTO.java +++ b/mens-api/src/main/java/kr/xit/biz/mbl/model/MobilePageDTO.java @@ -3,12 +3,13 @@ package kr.xit.biz.mbl.model; import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer; -import java.io.Serializable; import java.time.LocalDateTime; +import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO; import lombok.AllArgsConstructor; -import lombok.Builder; import lombok.Data; +import lombok.EqualsAndHashCode; import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; /** *
@@ -30,8 +31,9 @@ public class MobilePageDTO {
     @Data
     @NoArgsConstructor
     @AllArgsConstructor
-    @Builder
-    public static class MobilePageManage implements Serializable {
+    @SuperBuilder
+    @EqualsAndHashCode(callSuper = false)
+    public static class MobilePageManage extends CmmEnsRequestDTO {
 
         /**
          * 발송 상세 id
@@ -45,6 +47,12 @@ public class MobilePageDTO {
          * 모바일 페이지 내용
          */
         private String mobilePageCn;
+
+        private String signguCode;
+
+        private String ffnlgCode;
+        private String profile;
+
         /**
          * 등록 일시
          */
diff --git a/mens-api/src/main/java/kr/xit/biz/mbl/service/MobilePageService.java b/mens-api/src/main/java/kr/xit/biz/mbl/service/MobilePageService.java
index 1ea3b15..ec031ed 100644
--- a/mens-api/src/main/java/kr/xit/biz/mbl/service/MobilePageService.java
+++ b/mens-api/src/main/java/kr/xit/biz/mbl/service/MobilePageService.java
@@ -63,6 +63,8 @@ public class MobilePageService extends EgovAbstractServiceImpl implements IMobil
         final MobilePageManage mobilePageManage = mapper.selectKkoMobilePage(reqDTO);
         if(mobilePageManage == null)    throw BizRuntimeException.create("데이타 오류[내문서함 문서가 없습니다]");
 
+        reqDTO.setSignguCode(mobilePageManage.getSignguCode());
+        reqDTO.setFfnlgCode(mobilePageManage.getFfnlgCode());
         final ApiResponseDTO res = kkoService.findMyDocReadyAndMblPage(reqDTO);
         if(!res.isSuccess()){
             return res;
diff --git a/mens-api/src/main/java/kr/xit/ens/kakao/service/AsyncKkopayEltrcDocService.java b/mens-api/src/main/java/kr/xit/ens/kakao/service/AsyncKkopayEltrcDocService.java
index fe7568c..8d76341 100644
--- a/mens-api/src/main/java/kr/xit/ens/kakao/service/AsyncKkopayEltrcDocService.java
+++ b/mens-api/src/main/java/kr/xit/ens/kakao/service/AsyncKkopayEltrcDocService.java
@@ -292,7 +292,7 @@ public class AsyncKkopayEltrcDocService extends EgovAbstractServiceImpl implemen
                 CmmEnsRequestDTO.builder()
                 .signguCode(signguCode)
                 .ffnlgCode(ffnlgCode)
-                .profile("prod")
+                .profile("")
                 .build());
     }
 }
diff --git a/mens-api/src/main/java/kr/xit/ens/kakao/service/KkopayEltrcDocService.java b/mens-api/src/main/java/kr/xit/ens/kakao/service/KkopayEltrcDocService.java
index aad7d73..79406b4 100644
--- a/mens-api/src/main/java/kr/xit/ens/kakao/service/KkopayEltrcDocService.java
+++ b/mens-api/src/main/java/kr/xit/ens/kakao/service/KkopayEltrcDocService.java
@@ -9,8 +9,6 @@ import javax.validation.Validation;
 import javax.validation.Validator;
 import kr.xit.biz.common.ApiConstants;
 import kr.xit.biz.common.ApiConstants.SignguCode;
-import kr.xit.biz.ens.model.cmm.CmmEnsRequestDTO;
-import kr.xit.biz.ens.model.cmm.CmmEnsRlaybsnmDTO;
 import kr.xit.biz.ens.model.kakao.KkopayDocAttrDTO.DocumentBinderUuid;
 import kr.xit.biz.ens.model.kakao.KkopayDocAttrDTO.Receiver;
 import kr.xit.biz.ens.model.kakao.KkopayDocBulkDTO.BulkSendReq;
@@ -32,7 +30,7 @@ import kr.xit.core.spring.annotation.TraceLogging;
 import kr.xit.core.spring.util.ApiWebClientUtil;
 import kr.xit.core.support.utils.Checks;
 import kr.xit.core.support.utils.JsonUtils;
-import kr.xit.ens.kakao.cmm.CmmKakaoUtils;
+import kr.xit.ens.kt.cmm.CmmKtMmsUtils;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -110,7 +108,7 @@ public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements
             if(Checks.isEmpty(receiver.getBirthday()))      Objects.requireNonNull(errors).add("receiver.birthday=받는이 생년월일은 필수입니다.");
         }
         if(!Objects.requireNonNull(errors).isEmpty()) throw BizRuntimeException.create(errors.toString());
-        return webClient.exchangeKko(HOST + API_SEND[0], HttpMethod.valueOf(API_SEND[1]), JsonUtils.toJson(reqDTO), SendResponse.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
+        return webClient.exchangeKko(HOST + API_SEND[0], HttpMethod.valueOf(API_SEND[1]), JsonUtils.toJson(reqDTO), SendResponse.class, CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
     }
 
     /**
@@ -128,7 +126,7 @@ public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements
         final String url = HOST
             + API_VALID_TOKEN[0].replace(DOCUMENT_BINDER_UUID, reqDTO.getDocument_binder_uuid())
                                 .replace("{tokens}", reqDTO.getToken());
-        return webClient.exchangeKko(url, HttpMethod.valueOf(API_VALID_TOKEN[1]), null, ValidTokenResponse.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
+        return webClient.exchangeKko(url, HttpMethod.valueOf(API_VALID_TOKEN[1]), null, ValidTokenResponse.class, CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
     }
 
     /**
@@ -149,7 +147,7 @@ public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements
         final String body = "{\"document\": {\"is_detail_read\": true} }";
         final String url = HOST + API_MODIFY_STATUS[0].replace(DOCUMENT_BINDER_UUID, reqDTO.getDocument_binder_uuid());
 
-        webClient.exchangeKko(url, HttpMethod.valueOf(API_MODIFY_STATUS[1]), body, Void.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
+        webClient.exchangeKko(url, HttpMethod.valueOf(API_MODIFY_STATUS[1]), body, Void.class, CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
     }
 
     /**
@@ -170,7 +168,7 @@ public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements
         validate(reqDTO, null);
 
         final String url = HOST + API_STATUS[0].replace(DOCUMENT_BINDER_UUID, reqDTO.getDocument_binder_uuid());
-        return webClient.exchangeKko(url, HttpMethod.valueOf(API_STATUS[1]), null, DocStatusResponse.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
+        return webClient.exchangeKko(url, HttpMethod.valueOf(API_STATUS[1]), null, DocStatusResponse.class, CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
     }
 
     /**
@@ -227,7 +225,7 @@ public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements
             throw BizRuntimeException.create(errors.toString());
         }
 
-        return webClient.exchangeKko(HOST + API_BULKSEND[0], HttpMethod.valueOf(API_BULKSEND[1]), JsonUtils.toJson(reqDTO), BulkSendResponses.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
+        return webClient.exchangeKko(HOST + API_BULKSEND[0], HttpMethod.valueOf(API_BULKSEND[1]), JsonUtils.toJson(reqDTO), BulkSendResponses.class, CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
     }
 
     /**
@@ -257,7 +255,7 @@ public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements
         if(!errors.isEmpty()) {
             throw BizRuntimeException.create(errors.toString());
         }
-        return webClient.exchangeKko(HOST + API_BULKSTATUS[0], HttpMethod.valueOf(API_BULKSTATUS[1]), JsonUtils.toJson(reqDTO), BulkStatusResponses.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
+        return webClient.exchangeKko(HOST + API_BULKSTATUS[0], HttpMethod.valueOf(API_BULKSTATUS[1]), JsonUtils.toJson(reqDTO), BulkStatusResponses.class, CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
     }
 
     @Override
@@ -269,7 +267,7 @@ public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements
 
         // 유효성 검증
         final ValidTokenResponse validTokenRes = webClient.exchangeKko(url, HttpMethod.valueOf(API_VALID_TOKEN[1]), null,
-                ValidTokenResponse.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
+                ValidTokenResponse.class, CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
 
         if(!"USED".equals(validTokenRes.getToken_status())){
             return ApiResponseDTO.error(validTokenRes.getError_code(), validTokenRes.getError_message());
@@ -281,7 +279,7 @@ public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements
 
         // 정상 : HttpStatus.NO_CONTENT(204) return
         // error : body에 error_code, error_message return
-        final KkopayErrorDTO errorDTO = webClient.exchangeKko(url2, HttpMethod.valueOf(API_MODIFY_STATUS[1]), body, KkopayErrorDTO.class, getEnsRlaybsnmDTO(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
+        final KkopayErrorDTO errorDTO = webClient.exchangeKko(url2, HttpMethod.valueOf(API_MODIFY_STATUS[1]), body, KkopayErrorDTO.class, CmmKtMmsUtils.getRlaybsnmInfo(reqDTO.getSignguCode(), reqDTO.getFfnlgCode()));
         if(errorDTO != null){
             return ApiResponseDTO.error(errorDTO.getErrorCode(), errorDTO.getErrorMessage());
         }
@@ -308,13 +306,4 @@ public class KkopayEltrcDocService extends EgovAbstractServiceImpl implements
         }
         return errList;
     }
-
-    private CmmEnsRlaybsnmDTO getEnsRlaybsnmDTO(final String signguCode, final String ffnlgCode){
-        return CmmKakaoUtils.getRlaybsnmInfo(
-                CmmEnsRequestDTO.builder()
-                        .signguCode(signguCode)
-                        .ffnlgCode(ffnlgCode)
-                        .profile("prod")
-                        .build());
-    }
 }
diff --git a/mens-api/src/main/resources/egovframework/mapper/biz/ens-mbl-mysql-mapper.xml b/mens-api/src/main/resources/egovframework/mapper/biz/ens-mbl-mysql-mapper.xml
index 2ba2a85..c4dcb33 100644
--- a/mens-api/src/main/resources/egovframework/mapper/biz/ens-mbl-mysql-mapper.xml
+++ b/mens-api/src/main/resources/egovframework/mapper/biz/ens-mbl-mysql-mapper.xml
@@ -8,6 +8,8 @@
     SELECT tempm.sndng_detail_id
          , tempm.sndng_se_code
          , tempm.mobile_page_cn
+         , tekmd.signgu_code
+         , tekmd.ffnlg_code
       FROM tb_ens_kakao_my_doc tekmd
       JOIN tb_ens_mobile_page_manage tempm
         ON tekmd.sndng_detail_id = tempm.sndng_detail_id