diff --git a/mens-api/README.md b/mens-api/README.md index ddd31fa..fdad075 100644 --- a/mens-api/README.md +++ b/mens-api/README.md @@ -166,6 +166,9 @@ $ c:\tools\java\azul-17.0.1\java -jar -Dspring.profiles.active=local .\mens-api. $ mvnw clean package -pl mens-api -am -P local # -amd : 의존성 있는 타 프로젝트 빌드 - C가 A를 디펜던시로 가지고 있는 경우 A를 빌드 하면 A -> C 순으로 빌드 $ mvnw clean package -pl mens-core -amd -P local + +mvn clean package -pl mens-batch -am -P prod + ``` ### 스프링 배치 DB schema [mysql DDL 스크립트](./document/batch-schema-mysql.sql) 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 00bb180..e3c05dd 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 @@ -1,6 +1,7 @@ package kr.xit.biz.mbl.service; import kr.xit.biz.ens.model.kakao.KkopayDocDTO; +import kr.xit.biz.ens.model.kt.KtCommonDTO; import kr.xit.biz.ens.model.kt.KtTokenDTO; import kr.xit.biz.mbl.mapper.IMobilePageMapper; import kr.xit.biz.mbl.model.MobilePageDTO.MobilePageManage; @@ -13,6 +14,7 @@ import kr.xit.core.support.utils.Checks; import kr.xit.ens.kakao.service.IKkopayEltrcDocService; import kr.xit.ens.kt.service.IKtMmsService; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; import org.springframework.stereotype.Service; @@ -31,6 +33,7 @@ import org.springframework.stereotype.Service; * * */ +@Slf4j @RequiredArgsConstructor @Service public class MobilePageService extends EgovAbstractServiceImpl implements IMobilePageService { @@ -89,23 +92,22 @@ public class MobilePageService extends EgovAbstractServiceImpl implements IMobil * */ @Override - @TraceLogging + //@TraceLogging public MobilePageManage findKtMblPage(final KtTokenDTO.KtTokenConfirmRequest reqDTO) { //TODO::테스트 - return mapper.selectKtMobilePage("srcKey"); + //return mapper.selectKtMobilePage("srcKey"); //TODO::실운영시 코멘트 제거 - /* if (Checks.isEmpty(reqDTO.getAccessToken())) throw BizRuntimeException.create(String.valueOf(ErrorCode.BAD_REQUEST.getHttpStatus().value()), "정상적인 요청이 아닙니다. 재인증 후 시도하시기 바랍니다."); final String signguCode = reqDTO.getSignguCode(); final String ffnlgCode = reqDTO.getFfnlgCode(); - final KtTokenConfirmResponse cfmRes = ktMmsService.cfmToken(reqDTO); + final KtTokenDTO.KtTokenConfirmResponse cfmRes = ktMmsService.cfmToken(reqDTO); if(cfmRes.getResultCd().equals("00")){ - KtCommonResponse readRes = ktMmsService.readToken( - KtTokenReadRequest.builder() + KtCommonDTO.KtCommonResponse readRes = ktMmsService.readToken( + KtTokenDTO.KtTokenReadRequest.builder() .signguCode(signguCode) .ffnlgCode(ffnlgCode) .accessToken(reqDTO.getAccessToken()) @@ -114,12 +116,16 @@ public class MobilePageService extends EgovAbstractServiceImpl implements IMobil if(readRes.getResultCd().equals("00")){ String srcKey = cfmRes.getSrcKey(); + log.error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", readRes.getResultCd()); return mapper.selectKtMobilePage(srcKey); } + log.error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ read token result - {} @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", readRes.getResultCd()); + log.error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ read token result error - {} @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", readRes.toStringErrorMsg()); throw BizRuntimeException.create(readRes.getResultCd(), readRes.toStringErrorMsg()); } + log.error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ token confirm result - {} @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", cfmRes.getResultCd()); + log.error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ token confirm result error - {} @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", cfmRes.toStringErrorMsg()); throw BizRuntimeException.create(cfmRes.getResultCd(), cfmRes.toStringErrorMsg()); - */ } } diff --git a/mens-api/src/main/java/kr/xit/ens/kt/cmm/CmmKtMmsUtils.java b/mens-api/src/main/java/kr/xit/ens/kt/cmm/CmmKtMmsUtils.java index da62c96..e59f25c 100644 --- a/mens-api/src/main/java/kr/xit/ens/kt/cmm/CmmKtMmsUtils.java +++ b/mens-api/src/main/java/kr/xit/ens/kt/cmm/CmmKtMmsUtils.java @@ -55,9 +55,11 @@ public class CmmKtMmsUtils { if(ObjectUtils.isEmpty(dto)) throw BizRuntimeException.create(messageSource.getMessage("fail.api.rlaybsnm.info")); // 토큰 유효기간 체크 - if(DateUtils.getTodayAndNowTime(ApiConstants.FMT_DT_STD).compareTo( - Objects.requireNonNull(dto.getKtTokenExpiresIn(), () -> messageSource.getMessage("fail.api.kt.token.invalid.expired"))) < 0) return dto; + //if(DateUtils.getTodayAndNowTime(ApiConstants.FMT_DT_STD).compareTo( + // Objects.requireNonNull(dto.getKtTokenExpiresIn(), () -> messageSource.getMessage("fail.api.kt.token.invalid.expired"))) < 0) return dto; + return dto; + /* ktMmsService.requestToken( KtMnsRequest.builder() .signguCode(signguCode) @@ -66,6 +68,8 @@ public class CmmKtMmsUtils { .build() ); return cacheService.getRlaybsnmInfoCache(ensDTO); + + */ } diff --git a/mens-api/src/main/resources/config/application-ens.yml b/mens-api/src/main/resources/config/application-ens.yml index 6239ed9..f074f09 100644 --- a/mens-api/src/main/resources/config/application-ens.yml +++ b/mens-api/src/main/resources/config/application-ens.yml @@ -38,9 +38,9 @@ contract: ci: /digital/niceid/cert/v1.0/ipin/addinfo/ci kt: # vpn 사용 - #host: http://172.16.0.13:10210/ONLWeb + host: http://172.16.0.13:10210/ONLWeb # 운영 - host: http://172.16.1.182:10210/ONLWeb + #host: http://172.16.11.182:10210/ONLWeb api: # 토큰발행 generate-token: /oauth/token diff --git a/mens-api/src/main/resources/config/application-local.yml b/mens-api/src/main/resources/config/application-local.yml index 13bbb93..6682beb 100644 --- a/mens-api/src/main/resources/config/application-local.yml +++ b/mens-api/src/main/resources/config/application-local.yml @@ -66,7 +66,7 @@ app: data: root: #path: /Users/minuk/data - path: d:/data + path: c:/data #--------------------------------------------------------------- # log 설정 diff --git a/mens-api/src/main/resources/config/application-prod.yml b/mens-api/src/main/resources/config/application-prod.yml index 01bd9ac..33f2a50 100644 --- a/mens-api/src/main/resources/config/application-prod.yml +++ b/mens-api/src/main/resources/config/application-prod.yml @@ -19,9 +19,9 @@ spring: springdoc: api-docs: - enabled: false + enabled: true swagger-ui: - enabled: false + enabled: true logging: level: @@ -41,7 +41,7 @@ logging: # Spring Security cors 설정 :: CorsConfiguration 설정 값 cors: - allowed-origins: http://localhost:8080, http://${app.api-ip}:8080, http://localhost:8082, http://${app.api-ip}:8082 + allowed-origins: http://localhost, http://${app.api-ip}, http://localhost:8082, http://${app.api-ip}:8082, https://ens.sisul.or.kr # ================================================================================================================== # SQL logging lib setting @@ -52,9 +52,9 @@ decorator: enable-logging: true app: - api-ip: 127.0.0.1 + api-ip: 103.145.215.46 # swagger url - url: 'http://localhost:${server.port}${server.servlet.context-path:}/' + url: 'http://103.145.215.46:${server.port}${server.servlet.context-path:}/' data: root: path: /data @@ -70,10 +70,10 @@ app: log: request: common-enabled: true - response-enabled: false + response-enabled: true # MDC logging trace 활성 mdc: - enabled: true + enabled: false # slack slack-webhook: diff --git a/mens-batch/src/main/java/kr/xit/biz/ens/mapper/IEnsBatchMapper.java b/mens-batch/src/main/java/kr/xit/biz/ens/mapper/IEnsBatchMapper.java index b19c6e9..6f5350f 100644 --- a/mens-batch/src/main/java/kr/xit/biz/ens/mapper/IEnsBatchMapper.java +++ b/mens-batch/src/main/java/kr/xit/biz/ens/mapper/IEnsBatchMapper.java @@ -143,6 +143,16 @@ public interface IEnsBatchMapper { */ int insertMobilePageManage(final T t); + /** + *
+     * Kt 모바일페이지 관리 생성
+     * - tb_ens_mobile_page_manage
+     * @param t T
+     * @return int
+     * 
+ */ + int insertKtMobilePageManage(final T t); + /** *
      * 문자발송 데이터 생성
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 a05166f..4f2c603 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
@@ -351,6 +351,10 @@ public class EnsBatchSendService extends EgovAbstractServiceImpl implements IEns
             throw e;
         }
 
+        sendReqs.forEach(d -> mapper.insertKtMobilePageManage(d.getSrcKey()));
+
+
+
         final List> partitions = ListUtils.partition(sendReqs, bulkKtMaxCnt);
         List apiResults = partitions.stream()
             .map(bulkSendList -> {
@@ -362,6 +366,7 @@ public class EnsBatchSendService extends EgovAbstractServiceImpl implements IEns
                         ApiResponseDTO.class,
                         CmmEnsBizUtils.getHeadeMap());
                 }
+
             )
             .toList();
 
@@ -378,6 +383,7 @@ public class EnsBatchSendService extends EgovAbstractServiceImpl implements IEns
                     isSuccess = true;
                     dto.setErrorMssage("정상");
                 }else{
+                    //TODO:: 모바일 콘텐츠 삭제
                     errList.addAll(resDTO.getErrors());
                 }
 
diff --git a/mens-batch/src/main/resources/config/application-prod.yml b/mens-batch/src/main/resources/config/application-prod.yml
index 3121d29..fd94d77 100644
--- a/mens-batch/src/main/resources/config/application-prod.yml
+++ b/mens-batch/src/main/resources/config/application-prod.yml
@@ -21,9 +21,9 @@ spring:
 
 springdoc:
   api-docs:
-    enabled: false
+    enabled: true
   swagger-ui:
-    enabled: false
+    enabled: true
 
 logging:
   level:
@@ -40,7 +40,7 @@ logging:
 
 # Spring Security cors 설정 :: CorsConfiguration 설정 값
 cors:
-  allowed-origins: http://localhost
+  allowed-origins: http://localhost, https://ens.sisul.or.kr, http://103.145.215.46
 
 # ==================================================================================================================
 # SQL logging lib setting
@@ -51,9 +51,9 @@ decorator:
       enable-logging: true
 
 app:
-  api-ip: 127.0.0.1
+  api-ip: 103.145.215.46
   # swagger url
-  url: 'http://localhost:${server.port}${server.servlet.context-path:}/'
+  url: 'http://103.145.215.46:${server.port}${server.servlet.context-path:}/'
   data:
     root:
       path: /data
@@ -70,7 +70,7 @@ app:
   log:
     request:
       custom-enabled: true
-    response-enabled: false
+    response-enabled: true
     # MDC logging trace 활성
     mdc:
       enabled: true
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 069e65a..e9f7fd5 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
@@ -853,6 +853,27 @@
 			 AND signgu_code = #{signguCode}
 			 AND ffnlg_code = #{ffnlgCode}
 	
+
+	
+		/** ens-mysql-mapper|insertKtMobilePageManage-모바일페이지관리 데이타 생성|julim  */
+		INSERT
+		INTO tb_ens_mobile_page_manage (
+			sndng_detail_id, /* 발송상세 ID*/
+			sndng_se_code, /* 발송 구분 코드 */
+			mobile_page_cn, /* 모바일 페이지 내용 */
+			regist_dt,
+			register
+		)
+		SELECT tekbd.sndng_detail_id
+			 , 'KT-BC'
+			 , teusd.mobile_page_cn
+			 , date_format(now(), '%Y%m%d%H%i%s')
+			 , 'batch'
+		FROM tb_ens_kt_bc_detail tekbd
+		JOIN tb_ens_unity_sndng_detail teusd
+		  ON tekbd.unity_sndng_detail_id = teusd.unity_sndng_detail_id
+	   WHERE teusd.unity_sndng_detail_id = #{unitySndngDetailId}
+	
 	
 	
 	
diff --git a/mens-batch/src/main/resources/static/fmcExcelUpload.html b/mens-batch/src/main/resources/static/fmcExcelUpload.html
index 800cad3..3855955 100644
--- a/mens-batch/src/main/resources/static/fmcExcelUpload.html
+++ b/mens-batch/src/main/resources/static/fmcExcelUpload.html
@@ -8,19 +8,19 @@
   
선택 - - + +
- + function handleSubmit() { const form = document.querySelector("form"); - let sndngDt = document.querySelector("#sndngDt").value.replaceAll("-", "") + // let sndngDt = document.querySelector("#sndngDt").value.replaceAll("-", "") let file = document.querySelector("#files").files[0]; - if(!sndngDt){ + /*if(!sndngDt){ alert('전송일을 선택하세요'); return false; - } - if(!file){ + }*/ + /*if(!file){ alert('업로드할 파일을 선택하세요'); return false; - } + }*/ const fd = new FormData(); - fd.append('sysSeCode', document.querySelector("#sysSeCode").value); - fd.append('sndngSeCode', document.querySelector("#sndngSeCode").value); - fd.append('sndngDt', document.querySelector("#sndngDt").value.replaceAll("-", "")); + fd.append('signguCode', document.querySelector("#signguCode").value); + // fd.append('sndngSeCode', document.querySelector("#sndngSeCode").value); + fd.append('register', 'admin'); fd.append('files', document.querySelector("#files").files[0]); + $.ajax({ - url: 'http://localhost:8081/api/biz/sisul/v1/fmcExcelUpload', + url: 'http://103.145.215.46:8081/api/biz/sisul/v1/fmcExcelUpload', data: fd, cache: false, contentType: false, diff --git a/mens-core/src/main/java/kr/xit/core/spring/config/WebMvcConfig.java b/mens-core/src/main/java/kr/xit/core/spring/config/WebMvcConfig.java index 4d692ae..73f2881 100644 --- a/mens-core/src/main/java/kr/xit/core/spring/config/WebMvcConfig.java +++ b/mens-core/src/main/java/kr/xit/core/spring/config/WebMvcConfig.java @@ -135,7 +135,7 @@ public class WebMvcConfig implements WebMvcConfigurer { * Post 요청시 request(stream) logging 처리를 위한 필터 * @return */ - @Bean + //@Bean public FilterRegistrationBean readableRequestWrapperFilter() { ReadableRequestWrapperFilter readableRequestWrapperFilter = new ReadableRequestWrapperFilter(); diff --git a/mens-core/src/main/resources/config/application-common.yml b/mens-core/src/main/resources/config/application-common.yml index fd60f38..9fd9350 100644 --- a/mens-core/src/main/resources/config/application-common.yml +++ b/mens-core/src/main/resources/config/application-common.yml @@ -130,7 +130,7 @@ cors: # 리소스 접근을 허용하는 HTTP 메서드를 지정 allowed-methods: GET, POST, PUT, DELETE # 요청을 허용하는 해더 - allowed-headers: Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers, X-Csrftoken, Authorization + allowed-headers: Origin, Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers, X-Csrftoken, Authorization, Content-Security-Policy # 클라이언트에서 preflight 의 요청 결과를 저장할 기간을 지정 # 60초 동안 preflight 요청을 캐시하는 설정으로, 첫 요청 이후 60초 동안은 OPTIONS 메소드를 사용하는 예비 요청을 보내지 않는다. max-Age: 60