From ad66abf3dfb3c6e451e4d32231f3099c0c02c91c Mon Sep 17 00:00:00 2001 From: "Jonguk. Lim" Date: Fri, 30 Aug 2024 10:20:57 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20iup=20=EB=AA=A8=EB=93=88=EC=99=B8?= =?UTF-8?q?=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 +- pom.xml | 60 +--- .../cokr/xit/ens/ModulePostApplication.java | 2 +- .../xit/ens/biz/iup/init/IupJpaRunner.java | 20 +- .../cheonan/code/SndngProcessSttusCd.java | 40 --- .../cheonan/code/SndngResultSttusCd.java | 66 ---- .../biz/traffic/cheonan/code/SndngSeCd.java | 49 --- .../cheonan/init/TrafficCaJpaRunner.java | 130 -------- .../signtalk/domain/TcaElctrnNticSndng.java | 70 ----- .../domain/TcaElctrnNticSndngDetail.java | 82 ----- .../domain/TcaElctrnNticSndngResult.java | 65 ---- .../signtalk/domain/TcaNhtTmplatManage.java | 69 ---- .../signtalk/domain/TcaRlaybsnmManage.java | 70 ----- .../signtalk/domain/embeded/FieldCreate.java | 37 --- .../signtalk/domain/embeded/FieldUpdate.java | 34 -- .../TcaElctrnNticSndngDetailRepository.java | 13 - ...ElctrnNticSndngDetailRepositoryCustom.java | 20 -- ...caElctrnNticSndngDetailRepositoryImpl.java | 86 ----- .../TcaElctrnNticSndngRepository.java | 16 - .../TcaElctrnNticSndngResultRepository.java | 8 - ...ElctrnNticSndngResultRepositoryCustom.java | 11 - ...caElctrnNticSndngResultRepositoryImpl.java | 35 --- .../TcaNhtTmplatManageRepository.java | 8 - .../TcaRlaybsnmManageRepository.java | 8 - .../model/TrafficCaSigntalkReqDTO.java | 12 - .../TrafficCaSigntalkController.java | 53 ---- .../sched/TrafficCaSigntalkScheduler.java | 46 --- .../service/TrafficCaSigntalkService.java | 169 ---------- .../support/TrafficCaSigntalkAcceptor.java | 247 --------------- .../support/TrafficCaSigntalkFetcher.java | 179 ----------- .../support/TrafficCaSigntalkMaker.java | 64 ---- .../support/TrafficCaSigntalkSender.java | 64 ---- .../service/support/accept/Accept.java | 5 - .../service/support/accept/AcptDocKkoMd.java | 40 --- .../service/support/accept/AcptDocKtGbs.java | 26 -- .../chuncheon/init/TrafficCcJpaRunner.java | 125 -------- .../mydoc/domain/ElctrnNticSndng.java | 73 ----- .../mydoc/domain/ElctrnNticSndngDetail.java | 68 ---- .../mydoc/domain/ElctrnNticSndngResult.java | 52 --- .../mydoc/domain/NhtTmplatManage.java | 68 ---- .../mydoc/domain/embeded/FieldCreate.java | 35 --- .../mydoc/domain/embeded/FieldUpdate.java | 34 -- .../ElctrnNticSndngDetailRepository.java | 12 - ...ElctrnNticSndngDetailRepositoryCustom.java | 20 -- .../ElctrnNticSndngDetailRepositoryImpl.java | 83 ----- .../repository/ElctrnNticSndngRepository.java | 15 - .../ElctrnNticSndngResultRepository.java | 8 - ...ElctrnNticSndngResultRepositoryCustom.java | 13 - .../ElctrnNticSndngResultRepositoryImpl.java | 34 -- .../repository/NhtTmplatManageRepository.java | 9 - .../mydoc/v1/mq/UserElctrnNticProducer.java | 32 -- .../v1/sched/TrafficKkoMydocScheduler.java | 55 ---- .../v1/service/UserElctrnNticService.java | 296 ------------------ .../mydoc/v2/model/TrafficCcMydocReqDTO.java | 12 - .../TrafficCcMydocController.java | 53 ---- .../v2/sched/TrafficCcMydocScheduler.java | 46 --- .../v2/service/TrafficCcMydocService.java | 167 ---------- .../support/TrafficCcMydocAcceptor.java | 245 --------------- .../support/TrafficCcMydocFetcher.java | 213 ------------- .../service/support/TrafficCcMydocMaker.java | 65 ---- .../service/support/TrafficCcMydocSender.java | 65 ---- .../xit/ens/core/config/SpringDocConfig.java | 55 ++-- ...ion-dev-oracle.yml => application-dev.yml} | 16 +- ...al-oracle.yml => application-local-h2.yml} | 46 +-- .../resources/application-local-maria.yml | 46 --- src/main/resources/application-local.yml | 42 +-- .../application-prod-traffic-cheonan.yml | 98 ------ .../resources/application-prod-traffic.yml | 69 ---- ...tion-prod-iup.yml => application-prod.yml} | 54 ++-- src/test/java/cokr/xit/TempTest.java | 146 --------- .../service/IupAlimtalkEnsAcceptorTest.java | 183 ----------- .../v2/service/TrafficCcMydocServiceTest.java | 39 --- .../KakaoSignTalkSendInfoRepositoryTest.java | 53 ---- .../xit/problems/FindDuplicateNumber.java | 43 --- .../java/cokr/xit/problems/Permutation.java | 68 ---- src/test/java/cokr/xit/problems/Solution.java | 64 ---- .../java/cokr/xit/problems/Solution1.java | 104 ------ .../java/cokr/xit/problems/Solution2.java | 58 ---- src/test/java/cokr/xit/problems/Sort.java | 66 ---- 79 files changed, 120 insertions(+), 4940 deletions(-) delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/code/SndngProcessSttusCd.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/code/SndngResultSttusCd.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/code/SndngSeCd.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/init/TrafficCaJpaRunner.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/TcaElctrnNticSndng.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/TcaElctrnNticSndngDetail.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/TcaElctrnNticSndngResult.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/TcaNhtTmplatManage.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/TcaRlaybsnmManage.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/embeded/FieldCreate.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/embeded/FieldUpdate.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngDetailRepository.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngDetailRepositoryCustom.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngDetailRepositoryImpl.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngRepository.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngResultRepository.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngResultRepositoryCustom.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngResultRepositoryImpl.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaNhtTmplatManageRepository.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaRlaybsnmManageRepository.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/model/TrafficCaSigntalkReqDTO.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/presentation/TrafficCaSigntalkController.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/sched/TrafficCaSigntalkScheduler.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/TrafficCaSigntalkService.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/TrafficCaSigntalkAcceptor.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/TrafficCaSigntalkFetcher.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/TrafficCaSigntalkMaker.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/TrafficCaSigntalkSender.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/accept/Accept.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/accept/AcptDocKkoMd.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/accept/AcptDocKtGbs.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/init/TrafficCcJpaRunner.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/ElctrnNticSndng.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/ElctrnNticSndngDetail.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/ElctrnNticSndngResult.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/NhtTmplatManage.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/embeded/FieldCreate.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/embeded/FieldUpdate.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngDetailRepository.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngDetailRepositoryCustom.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngDetailRepositoryImpl.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngRepository.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngResultRepository.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngResultRepositoryCustom.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngResultRepositoryImpl.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/NhtTmplatManageRepository.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v1/mq/UserElctrnNticProducer.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v1/sched/TrafficKkoMydocScheduler.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v1/service/UserElctrnNticService.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/model/TrafficCcMydocReqDTO.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/presentation/TrafficCcMydocController.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/sched/TrafficCcMydocScheduler.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/service/TrafficCcMydocService.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/service/support/TrafficCcMydocAcceptor.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/service/support/TrafficCcMydocFetcher.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/service/support/TrafficCcMydocMaker.java delete mode 100644 src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/service/support/TrafficCcMydocSender.java rename src/main/resources/{application-dev-oracle.yml => application-dev.yml} (85%) rename src/main/resources/{application-local-oracle.yml => application-local-h2.yml} (58%) delete mode 100644 src/main/resources/application-local-maria.yml delete mode 100644 src/main/resources/application-prod-traffic-cheonan.yml delete mode 100644 src/main/resources/application-prod-traffic.yml rename src/main/resources/{application-prod-iup.yml => application-prod.yml} (72%) delete mode 100644 src/test/java/cokr/xit/TempTest.java delete mode 100644 src/test/java/cokr/xit/ens/biz/iup/service/IupAlimtalkEnsAcceptorTest.java delete mode 100644 src/test/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/service/TrafficCcMydocServiceTest.java delete mode 100644 src/test/java/cokr/xit/ens/modules/post/domains/sign/domain/KakaoSignTalkSendInfoRepositoryTest.java delete mode 100644 src/test/java/cokr/xit/problems/FindDuplicateNumber.java delete mode 100644 src/test/java/cokr/xit/problems/Permutation.java delete mode 100644 src/test/java/cokr/xit/problems/Solution.java delete mode 100644 src/test/java/cokr/xit/problems/Solution1.java delete mode 100644 src/test/java/cokr/xit/problems/Solution2.java delete mode 100644 src/test/java/cokr/xit/problems/Sort.java diff --git a/README.md b/README.md index 41cda01..b6382ef 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ ### 프로젝트 실행 오류 처리 + ```text import static cokr.xit.ens.modules.common.ctgy.sys.mng.domain.QOrgMng.orgMng; 관련해서 못찾는 경우가 발생 @@ -10,12 +11,14 @@ annotations, java 폴더가 Excluded 상태인데 마우스 우클릭해서 Sour ``` ### 배포 + ```text [민자] -mvn clean package -P prod-iup +mvn clean package -P prod ``` ### 업무 + ```text [전자고지] - 나이스 CI 소켓 @@ -30,6 +33,7 @@ mvn clean package -P prod-iup ``` ### 연계 + ```text [나이스 CI 소켓] - /doc/NICE_CI모듈.zip @@ -51,4 +55,4 @@ mvn clean package -P prod-iup [네이버페이 간편결제] - 개발자센터 : https://developer.pay.naver.com/ -``` \ No newline at end of file +``` diff --git a/pom.xml b/pom.xml index eb87676..a263cad 100644 --- a/pom.xml +++ b/pom.xml @@ -386,16 +386,16 @@ WEB-INF/classes/**/ens/batch/**, WEB-INF/classes/**/ens/modules/**, - WEB-INF/classes/application-local*.yml, + WEB-INF/classes/application-local.yml, - prod-iup + prod - prod-iup + prod ${package.include.base} WEB-INF/classes/**/ens/modules/**, @@ -403,7 +403,7 @@ WEB-INF/classes/**/ens/biz/iup/**, - WEB-INF/classes/application-prod-iup.yml, + WEB-INF/classes/application-prod.yml, WEB-INF/classes/mybatis-mapper/**, @@ -414,57 +414,5 @@ - - prod-traffic-cc - - prod-traffic - - ${package.include.base} - WEB-INF/classes/**/ens/batch/**/EnsKkoMydocScheduler.class, - WEB-INF/classes/**/ens/modules/common/**, - WEB-INF/classes/**/ens/modules/kkomydoc/**, - WEB-INF/classes/**/ens/biz/traffic/chuncheon/**, - WEB-INF/classes/application-prod-traffic.yml, - - - ${package.exclude.base} - WEB-INF/classes/**/ens/modules/common/ctgy/intgrnnoti/**, - - - - - - src/main/resources - - mybatis-mapper/** - - - - - - - prod-traffic-cheonan - - prod-traffic-cheonan - - ${package.include.base} - WEB-INF/classes/**/ens/batch/**/EnsIntgrnScheduler.class, - WEB-INF/classes/**/ens/batch/**/EnsKkoMydocScheduler.class, - WEB-INF/classes/**/ens/batch/**/EnsKtGibisScheduler.class, - WEB-INF/classes/**/ens/modules/**, - - - - - WEB-INF/classes/**/ens/biz/traffic/cheonan/**, - WEB-INF/classes/application-prod-traffic-cheonan.yml, - WEB-INF/classes/mybatis-mapper/**, - - - ${package.exclude.base} - - ojdbc6 - - diff --git a/src/main/java/cokr/xit/ens/ModulePostApplication.java b/src/main/java/cokr/xit/ens/ModulePostApplication.java index 399307d..c8b5780 100644 --- a/src/main/java/cokr/xit/ens/ModulePostApplication.java +++ b/src/main/java/cokr/xit/ens/ModulePostApplication.java @@ -25,7 +25,7 @@ public class ModulePostApplication { if (Checks.isEmpty(System.getProperty("spring.profiles.active"))) { log.error("===================================================================="); log.error(">>>>>>>>>>>>>> Undefined start option <<<<<<<<<<<<<<"); - log.error(">>>>>>>>>>>>>> -Dspring.profiles.active=local|dev|prod-traffic/prod-traffic-cheonan/prod-iup <<<<<<<<<<<<<<"); + log.error(">>>>>>>>>>>>>> -Dspring.profiles.active=local|dev|prod <<<<<<<<<<<<<<"); log.error("============== ENS Application start fail ==============="); log.error("===================================================================="); System.exit(-1); diff --git a/src/main/java/cokr/xit/ens/biz/iup/init/IupJpaRunner.java b/src/main/java/cokr/xit/ens/biz/iup/init/IupJpaRunner.java index c2026fe..5f42400 100644 --- a/src/main/java/cokr/xit/ens/biz/iup/init/IupJpaRunner.java +++ b/src/main/java/cokr/xit/ens/biz/iup/init/IupJpaRunner.java @@ -1,20 +1,22 @@ package cokr.xit.ens.biz.iup.init; -import cokr.xit.ens.core.init.InitJpaRunner; -import cokr.xit.ens.modules.common.code.PostSeCd; -import cokr.xit.ens.modules.common.ctgy.sys.mng.model.OrgMngDTO; -import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + import org.springframework.context.annotation.Profile; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; +import com.fasterxml.jackson.databind.ObjectMapper; + +import cokr.xit.ens.core.init.InitJpaRunner; +import cokr.xit.ens.modules.common.code.PostSeCd; +import cokr.xit.ens.modules.common.ctgy.sys.mng.model.OrgMngDTO; @Component @Transactional -@Profile({"prod-iup", "local-maria", "local-oracle"}) +@Profile({"prod", "local"}) public class IupJpaRunner extends InitJpaRunner { ObjectMapper mapper = new ObjectMapper(); @@ -139,4 +141,4 @@ public class IupJpaRunner extends InitJpaRunner { } -} \ No newline at end of file +} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/code/SndngProcessSttusCd.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/code/SndngProcessSttusCd.java deleted file mode 100644 index dcf8688..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/code/SndngProcessSttusCd.java +++ /dev/null @@ -1,40 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.code; - -import cokr.xit.ens.core.code.CodeMapperType; - - - -/** - * 주정차웹 전자고지 발송처리상태 코드 - */ -public enum SndngProcessSttusCd implements CodeMapperType { - - accept("접수") - , acptok("접수성공") - , acptfail("접수실패") - - , ensmake("제작") - , ensstart("전송시작") - , ensok("전송성공") - , ensfail("전송실패") - , ensopen("열람중") - , ensclose("조회기간마감") - ; - - private final String code; - private final String codeNm; - SndngProcessSttusCd(String codeNm) { - this.code = this.name(); - this.codeNm = codeNm; - } - - @Override - public String getCode() { - return this.code; - } - - @Override - public String getCodeNm() { - return this.codeNm; - } -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/code/SndngResultSttusCd.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/code/SndngResultSttusCd.java deleted file mode 100644 index 0cd07a9..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/code/SndngResultSttusCd.java +++ /dev/null @@ -1,66 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.code; - -import cokr.xit.ens.core.code.CodeMapperType; - - -/** - * 주정차웹 전자고지 발송결과상태 코드 - */ -public enum SndngResultSttusCd implements CodeMapperType { - - UNKNOWN("알수없음") - - , REG("등록") - , MAKING("제작") - - , ACPT_OK("접수요청성공") - , ACPT_FAIL("접수실패") - , ACPT_CMPLT("접수완료") - - - , UNIDENTIFIED_USER("비회원") - , FORBIDDEN("수신거부") - , INVALID_VALUE("파라미터 오류") - , INTERNAL_ERROR("API 서버 내부 오류") - , INVALID_REQUEST("유효하지 않은 요청") - , FORBIDDEN_USER("허용되지 않은 사용자") - - , FAIL("전송실패") - , SENT("송신") - , RECEIVED("수신") - , READ("열람") - , EXPIRED("만료") - ; - - private final String code; - private final String codeNm; - - SndngResultSttusCd(String codeNm) { - this.code = this.name(); - this.codeNm = codeNm; - } - - @Override - public String getCode() { - return this.code; - } - - @Override - public String getCodeNm() { - return this.codeNm; - } - - - public static SndngResultSttusCd valueOfEnum(String statCd) { - if (statCd == null) - return SndngResultSttusCd.UNKNOWN; - - SndngResultSttusCd sndngResultSttusCd = null; - try { - sndngResultSttusCd = SndngResultSttusCd.valueOf(statCd); - } catch (IllegalArgumentException e) { - sndngResultSttusCd = SndngResultSttusCd.UNKNOWN; - } - return sndngResultSttusCd; - } -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/code/SndngSeCd.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/code/SndngSeCd.java deleted file mode 100644 index 6af68d3..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/code/SndngSeCd.java +++ /dev/null @@ -1,49 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.code; - -import cokr.xit.ens.core.code.CodeMapperType; - - -/** - * 주정차웹 전자고지 발송구분 코드 - */ -public enum SndngSeCd implements CodeMapperType { - - UNKNOWN("알수없음") - ,intgrnNoti("통합 전자고지") - ,kkoMydoc("카카오페이 내문서함(인증톡)") - ,kkoAlimtalk("카카오페이 알림톡") - ,nvSigntalk("네이버 고지서(인증톡)") - ,ktSigntalk("KT 인증톡") - ,ktGibis("KT 인증톡(지비스)"); - ; - - private final String code; - private final String codeNm; - SndngSeCd(String codeNm) { - this.code = this.name(); - this.codeNm = codeNm; - } - - @Override - public String getCode() { - return this.code; - } - - @Override - public String getCodeNm() { - return this.codeNm; - } - - public static SndngSeCd valueOfEnum(String statCd) { - if (statCd == null) - return SndngSeCd.UNKNOWN; - - SndngSeCd SndngSeCd = null; - try { - SndngSeCd = SndngSeCd.valueOf(statCd); - } catch (IllegalArgumentException e) { - SndngSeCd = SndngSeCd.UNKNOWN; - } - return SndngSeCd; - } -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/init/TrafficCaJpaRunner.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/init/TrafficCaJpaRunner.java deleted file mode 100644 index d02c00c..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/init/TrafficCaJpaRunner.java +++ /dev/null @@ -1,130 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.init; - -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.repository.TcaNhtTmplatManageRepository; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.repository.TcaRlaybsnmManageRepository; -import cokr.xit.ens.core.init.InitJpaRunner; -import cokr.xit.ens.modules.common.code.PostSeCd; -import cokr.xit.ens.modules.common.ctgy.sys.mng.model.OrgMngDTO; -import cokr.xit.ens.modules.ktsigntalk.common.code.MTypeCd; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Profile; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - - -/** - * 주정차웹-천안 - */ -//TODO: 데이터초기화 목적으로 사용. ex) 최초 배포 시 -//@Component -@Transactional -@Profile({"prod-traffic-cheonan", "local-test"}) -public class TrafficCaJpaRunner extends InitJpaRunner { - ObjectMapper mapper = new ObjectMapper(); - -// @Value("${contract.custom.dng.nice.dici.rest.client-id}") -// private String DNG_NICE_CD_CLIENT_ID; -// @Value("${contract.custom.dng.nice.dici.rest.client-secret}") -// private String DNG_NICE_CD_CLIENT_SECRET; -// @Value("${contract.custom.dng.kakao.pay.mydoc.access-token}") -// private String DNG_KKO_MD_ACCESS_TOKEN; -// @Value("${contract.custom.dng.kakao.pay.mydoc.contract-uuid}") -// private String DNG_KKO_MD_CONTRACT_UUID; -// -// @Value("${contract.custom.sbg.nice.dici.rest.client-id}") -// private String SBG_NICE_CD_CLIENT_ID; -// @Value("${contract.custom.sbg.nice.dici.rest.client-secret}") -// private String SBG_NICE_CD_CLIENT_SECRET; -// @Value("${contract.custom.sbg.kakao.pay.mydoc.access-token}") -// private String SBG_KKO_MD_ACCESS_TOKEN; -// @Value("${contract.custom.sbg.kakao.pay.mydoc.contract-uuid}") -// private String SBG_KKO_MD_CONTRACT_UUID; - - @Autowired - private TcaRlaybsnmManageRepository tcaRlaybsnmManageRepository; - @Autowired - private TcaNhtTmplatManageRepository tcaNhtTmplatManageRepository; - - @Override - protected List createOrgMngDTO() { -// List list = new ArrayList<>(); -// list.add(createOrgMngDTO("TCA01", "", "천안-동남구", "N", null, null, DNG_NICE_CD_CLIENT_ID, DNG_NICE_CD_CLIENT_SECRET, DNG_KKO_MD_ACCESS_TOKEN, DNG_KKO_MD_CONTRACT_UUID)); -// list.add(createOrgMngDTO("TCA02", "", "천안-서북구", "N", null, null, SBG_NICE_CD_CLIENT_ID, SBG_NICE_CD_CLIENT_SECRET, SBG_KKO_MD_ACCESS_TOKEN, SBG_KKO_MD_CONTRACT_UUID)); -// return list; - return tcaRlaybsnmManageRepository.findAll().stream() - .map(entity -> OrgMngDTO.builder() - .orgCd(entity.getSignguCode()) - .orgNm(entity.getSignguNm()) - - .kkoMdAccessToken(entity.getKakaoAccessToken()) - .kkoMdContractUuid(entity.getKakaoContractUuid()) - - .kkoBpCsignYn("N") -// .kkoBpBillerCode(KKO_BP_BILLER_CODE) -// .kkoBpAuthorization(KKO_BP_AUTHORIZATION) -// .kkoBpCsignPrepayApi(kkoBpPrepayApi) -// .kkoBpCsignPayResultApi(kkoBpPayResultApi) - -// .kkoAtBsid(KKO_AT_BSID) -// .kkoAtPasswd(KKO_AT_PASSWD) -// .kkoAtSenderKey(KKO_AT_SENDER_KEY) - - .niceCdSiteCode(null) - .niceCdSitePw(entity.getNiceSiteCode()) - .niceCdClientId(entity.getNiceClientId()) - .niceCdClientSercet(entity.getNiceClientSecret()) - -// .nvStXNaverClientId(NV_ST_X_NAVER_CLIENT_ID) -// .nvStXNaverClientSecret(NV_ST_X_NAVER_CLIENT_SECRET) -// .nvStOrgId(nvOrgId) - -// .ktStAccessToken(null) -// .ktStServiceCd(null) -// .ktStServiceKey(null) - .ktStClientId(entity.getKtClientId()) - .ktStClientSecret(entity.getKtClientSecret()) - .build()) - .collect(Collectors.toList()); - } - - @Override - protected List> createTmpltMngDTO() { -// List> list = new ArrayList<>(); -// list.add(mapper.convertValue(createTmpltMngIntgrn(PostSeCd.kkoMydoc, PostSeCd.ktGibis, null, "TCA01", "TCA0001", "주정차단속-천안-동남구", "[천안-동남구] 소유차량(#{CAR_NO})의 주정차과태료", "Y" -// , null -// , createTmpltMngKkoMydoc(null, null, null, null, null, "044-211-3377", "문의처", "Y", "Y", "Y") -// , null -// , null -// , createTmpltMngKtGibis(null, null, null, null, null, "MC001", MTypeCd.mms, 1, "044-211-3377", "044-211-3377", "Y", "Y", "Y") -// ) -// , Map.class)); -// list.add(mapper.convertValue(createTmpltMngIntgrn(PostSeCd.kkoMydoc, PostSeCd.ktGibis, null, "TCA02", "TCA0001", "주정차단속-천안-서북구", "[천안-서북구] 소유차량(#{CAR_NO})의 주정차과태료", "Y" -// , null -// , createTmpltMngKkoMydoc(null, null, null, null, null, "044-211-3377", "문의처", "Y", "Y", "Y") -// , null -// , null -// , createTmpltMngKtGibis(null, null, null, null, null, "MC001", MTypeCd.mms, 1, "044-211-3377", "044-211-3377", "Y", "Y", "Y") -// ) -// , Map.class)); -// return list; - - - return tcaNhtTmplatManageRepository.findAll().stream() - .map(entity -> createTmpltMngIntgrn(PostSeCd.kkoMydoc, PostSeCd.ktGibis, null, entity.getSignguCode(), entity.getNhtTmplatId(), entity.getNhtSj(), entity.getNhtCn(), "Y" - , null - , createTmpltMngKkoMydoc(null, null, null, null, null, entity.getCstmrCnterTlphonNo(), entity.getCstmrCnterNm() == null ? "문의처" : entity.getCstmrCnterNm(), "Y", "Y", "Y") - , null - , null - , createTmpltMngKtGibis(null, null, null, null, null, "?????", MTypeCd.mms, "2", 1, entity.getCstmrCnterTlphonNo(), entity.getCstmrCnterTlphonNo(), "Y", "Y", "Y") - )) - .map(tmpltMngIntgrnDTO -> (Map) mapper.convertValue(tmpltMngIntgrnDTO, Map.class)) - .collect(Collectors.toList()); - } - - -} \ No newline at end of file diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/TcaElctrnNticSndng.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/TcaElctrnNticSndng.java deleted file mode 100644 index 60120e8..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/TcaElctrnNticSndng.java +++ /dev/null @@ -1,70 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.domain; - -import cokr.xit.ens.biz.traffic.cheonan.code.SndngProcessSttusCd; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.embeded.FieldCreate; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.embeded.FieldUpdate; -import lombok.*; - -import javax.persistence.*; - -/** - * 전자고지 발송 - */ -@Getter -@ToString -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Entity -@Table(name = "tb_elctrn_ntic_sndng") -public class TcaElctrnNticSndng { - - @Id - @Column(name = "elctrn_ntic_sndng_id", length = 20) - private String elctrnNticSndngId; - - @Column(name = "signgu_code", length = 5) - private String signguCode; - - @OneToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "nht_tmplat_id") - private TcaNhtTmplatManage tcaNhtTmplatManage; - - @Column(name = "sndng_ty_code", length = 5) - private String sndngTyCode; - - @Column(name = "sndng_co", length = 10) - private Integer sndngCo; - - @Column(name = "sndng_process_sttus", length = 2) - @Setter - @Enumerated(EnumType.STRING) - private SndngProcessSttusCd sndngProcessSttus; - - @Column(name = "sndng_dt", length = 14) - private String sndngDt; - - @Column(name = "clos_dt", length = 14) - private String closDt; - - @Embedded - private FieldCreate create; - - @Embedded - @Setter - private FieldUpdate update; - - @Column(name = "error_cn", length = 1000) - @Setter - private String errorCn; - - @Lob - @Setter - @Column(name = "error_dtls") - private String errorDtls; - - - @Column(name = "ffnlg_code", length = 2) - private String ffnlgCode; - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/TcaElctrnNticSndngDetail.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/TcaElctrnNticSndngDetail.java deleted file mode 100644 index cceb70e..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/TcaElctrnNticSndngDetail.java +++ /dev/null @@ -1,82 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.domain; - -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.embeded.FieldCreate; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.embeded.FieldUpdate; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import org.hibernate.annotations.DynamicUpdate; - -import javax.persistence.*; - -/** - * 전자고지 발송상세 - */ -@Getter -@ToString -@Builder -@DynamicUpdate -@NoArgsConstructor -@AllArgsConstructor -@Entity -@Table(name = "tb_elctrn_ntic_sndng_detail", schema = "", catalog = "", indexes = { - @Index(name = "idx_tca_ens_detail_01", columnList = "main_code"), -// @Index(name = "idx_tca_ens_detail_02", columnList = "external_document_uuid"), -}) -public class TcaElctrnNticSndngDetail { - - - @Id - @Column(name = "elctrn_ntic_sndng_detail_id", length = 20) - private String elctrnNticSndngDetailId; - - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "elctrn_ntic_sndng_id") - private TcaElctrnNticSndng elctrnNticSndng; - - - @Column(name = "signgu_code", length = 5) - private String signguCode; - - - @Column(name = "main_code", length = 20) - private String mainCode; - - - @Column(name = "ihidnum", length = 100, updatable = false) - private String ihidnum; - - -// @Lob -// @Column(name = "cn_detail") -// private String cnDetail; - - - @Lob - @Column(name = "tmplt_msg_data") - private String tmpltMsgData; - - - @Lob - @Column(name = "mobile_page_cn") - private String mobilePageCn; - - @Embedded - private FieldCreate create; - - @Embedded - private FieldUpdate update; - - - @Column(name = "external_document_uuid", length = 40) - @Setter - private String externalDocumentUuid; - - - - @Column(name = "ffnlg_code", length = 2) - private String ffnlgCode; - - @Column(name = "use_instt_idntfc_id") - private Integer useInsttIdntfcId; -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/TcaElctrnNticSndngResult.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/TcaElctrnNticSndngResult.java deleted file mode 100644 index 96672f8..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/TcaElctrnNticSndngResult.java +++ /dev/null @@ -1,65 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.domain; - -import cokr.xit.ens.biz.traffic.cheonan.code.SndngResultSttusCd; -import cokr.xit.ens.biz.traffic.cheonan.code.SndngSeCd; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.embeded.FieldCreate; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import org.hibernate.annotations.UpdateTimestamp; - -import javax.persistence.*; -import java.time.LocalDateTime; - -/** - * 전자고지 발송결과 - */ -@Getter -@ToString -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Entity -@Table(name = "tb_elctrn_ntic_sndng_result") -public class TcaElctrnNticSndngResult { - - - - @Id - @Column(name = "elctrn_ntic_sndng_detail_id", length = 20) - private String elctrnNticSndngDetailId; - - - @Column(name = "sndng_result_sttus", length = 20) - @Enumerated(EnumType.STRING) - private SndngResultSttusCd sndngResultSttus; - - - @Column(name = "requst_dt", length = 14) - private String requstDt; - - - @Column(name = "inqire_dt", length = 14) - private String inqireDt; - - - @Column(name = "readng_dt", length = 14) - private String readngDt; - - - @Column(name = "error_cn", length = 1000) - private String errorCn; - - @Embedded - private FieldCreate create; - - - @UpdateTimestamp - @Column(name = "last_updt_dt", nullable = true) - private LocalDateTime lastUpdtDt; - - - - @Column(name = "sndng_se", length = 10) - @Enumerated(EnumType.STRING) - private SndngSeCd sndngSe; -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/TcaNhtTmplatManage.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/TcaNhtTmplatManage.java deleted file mode 100644 index 2c4eef6..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/TcaNhtTmplatManage.java +++ /dev/null @@ -1,69 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.domain; - -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.embeded.FieldCreate; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.embeded.FieldUpdate; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; - -import javax.persistence.*; - -/** - * 전자고지 템플릿관리 - */ -@Getter -@ToString -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Entity -@Table(name = "tb_nht_tmplat_manage") -public class TcaNhtTmplatManage { - - - @Id - @Column(name = "nht_tmplat_id", length = 5) - private String nhtTmplatId; - - - @Column(name = "signgu_code", length = 5) - private String signguCode; - - - @Column(name = "sndng_ty_code", length = 1) - private String sndngTyCode; - - - @Column(name = "nht_nm", length = 1000) - private String nhtNm; - - - @Column(name = "nht_sj", length = 1000) - private String nhtSj; - - @Column(name = "nhtCn", length = 4000) - private String nhtCn; - - - @Column(name = "cstmr_cnter_nm", length = 100) - private String cstmrCnterNm; - - - @Column(name = "cstmr_cnter_tlphon_no", length = 14) - private String cstmrCnterTlphonNo; - - - @Column(name = "redirect_url", length = 255) - private String redirectUrl; - - - @Column(name = "use_at", length = 1) - private String useAt; - - @Embedded - private FieldCreate create; - - @Embedded - private FieldUpdate update; - - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/TcaRlaybsnmManage.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/TcaRlaybsnmManage.java deleted file mode 100644 index 1623975..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/TcaRlaybsnmManage.java +++ /dev/null @@ -1,70 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.domain; - -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.embeded.FieldCreate; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.embeded.FieldUpdate; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; - -import javax.persistence.*; - -/** - * 전자고지 기관관리 - */ -@Getter -@ToString -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Entity -@Table(name = "tb_rlaybsnm_manage") -public class TcaRlaybsnmManage { - - - @Id - @Column(name = "signgu_code", length = 5) - private String signguCode; - - - @Column(name = "ffnlg_code") - private String ffnlgCode; - - - @Column(name = "signgu_nm") - private String signguNm; - - - @Column(name = "kakao_access_token") - private String kakaoAccessToken; - - - @Column(name = "kakao_contract_uuid") - private String kakaoContractUuid; - - - @Column(name = "nice_site_code") - private String niceSiteCode; - - - @Column(name = "nice_client_id") - private String niceClientId; - - - @Column(name = "nice_client_secret") - private String niceClientSecret; - - - @Column(name = "kt_client_id") - private String ktClientId; - - - @Column(name = "kt_client_secret") - private String ktClientSecret; - - @Embedded - private FieldCreate create; - - @Embedded - private FieldUpdate update; - - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/embeded/FieldCreate.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/embeded/FieldCreate.java deleted file mode 100644 index de2418b..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/embeded/FieldCreate.java +++ /dev/null @@ -1,37 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.embeded; - -import lombok.Builder; -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -import javax.persistence.Column; -import javax.persistence.Embeddable; -import javax.persistence.PrePersist; -import java.time.LocalDateTime; - - -@Embeddable -@Getter -@RequiredArgsConstructor -public class FieldCreate { - -// @CreationTimestamp -// @Temporal(TemporalType.TIMESTAMP) - @Column(name = "regist_dt") - private LocalDateTime registDt; - @Column(name = "register", length = 50) - private String register; - - - @PrePersist - public void preUpdate() { - this.registDt = LocalDateTime.now(); - } - - - @Builder(builderMethodName = "builder") - public FieldCreate(String register, LocalDateTime registDt) { - this.register = register; - this.registDt = registDt; - } -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/embeded/FieldUpdate.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/embeded/FieldUpdate.java deleted file mode 100644 index 1e035f9..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/embeded/FieldUpdate.java +++ /dev/null @@ -1,34 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.embeded; - -import lombok.Builder; -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -import javax.persistence.Column; -import javax.persistence.Embeddable; -import javax.persistence.PreUpdate; -import java.time.LocalDateTime; - -@Embeddable -@Getter -@RequiredArgsConstructor -public class FieldUpdate { - -// @UpdateTimestamp -// @Temporal(TemporalType.TIMESTAMP) - @Column(name = "updt_dt") - private LocalDateTime updtDt; - @Column(name = "updusr", length = 50) - private String updusr; - - @PreUpdate - public void preUpdate() { - this.updtDt = LocalDateTime.now(); - } - - @Builder(builderMethodName = "builder") - public FieldUpdate(String updusr, LocalDateTime updtDt) { - this.updusr = updusr; - this.updtDt = updtDt; - } -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngDetailRepository.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngDetailRepository.java deleted file mode 100644 index 0109063..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngDetailRepository.java +++ /dev/null @@ -1,13 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.repository; - -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.TcaElctrnNticSndngDetail; -import org.springframework.data.jpa.repository.JpaRepository; - -import java.util.Optional; - - -public interface TcaElctrnNticSndngDetailRepository extends JpaRepository, TcaElctrnNticSndngDetailRepositoryCustom { - - Optional findByExternalDocumentUuid(String externalDocumentUuid); - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngDetailRepositoryCustom.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngDetailRepositoryCustom.java deleted file mode 100644 index 479561c..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngDetailRepositoryCustom.java +++ /dev/null @@ -1,20 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.repository; - -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.TcaElctrnNticSndng; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.TcaElctrnNticSndngDetail; - -import java.util.List; -import java.util.Optional; - -public interface TcaElctrnNticSndngDetailRepositoryCustom { - - - List findAllDecByElctrnNticSndng(TcaElctrnNticSndng elctrnNticSndng); - - - List findAllFetchByElctrnNticSndngId(String elctrnNticSndngId); - - Optional findLastSendMastIdByElctrnNticSndngId(String elctrnNticSndngId); - - String findIhidnumDecByElctrnNticSndngDetailId(String elctrnNticSndngDetailId); -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngDetailRepositoryImpl.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngDetailRepositoryImpl.java deleted file mode 100644 index 609e88a..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngDetailRepositoryImpl.java +++ /dev/null @@ -1,86 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.repository; - -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.TcaElctrnNticSndng; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.TcaElctrnNticSndngDetail; -import com.querydsl.core.types.Projections; -import com.querydsl.core.types.dsl.Expressions; -import com.querydsl.jpa.impl.JPAQueryFactory; -import lombok.RequiredArgsConstructor; - -import java.util.List; -import java.util.Optional; - -import static cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.QTcaElctrnNticSndng.tcaElctrnNticSndng; -import static cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.QTcaElctrnNticSndngDetail.tcaElctrnNticSndngDetail; -import static cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.QTcaNhtTmplatManage.tcaNhtTmplatManage; -import static cokr.xit.ens.modules.common.ctgy.intgrnnoti.domain.QIntgrnSendDetail.intgrnSendDetail; - -@RequiredArgsConstructor -public class TcaElctrnNticSndngDetailRepositoryImpl implements TcaElctrnNticSndngDetailRepositoryCustom { - - private final JPAQueryFactory query; - - @Override - public List findAllDecByElctrnNticSndng(TcaElctrnNticSndng elctrnNticSndng) { - - return query.select(Projections.fields(TcaElctrnNticSndngDetail.class - , tcaElctrnNticSndngDetail.elctrnNticSndngDetailId - , tcaElctrnNticSndngDetail.elctrnNticSndng - , tcaElctrnNticSndngDetail.signguCode - , tcaElctrnNticSndngDetail.mainCode - , Expressions.stringTemplate("ECL_DECRYPT({0})", tcaElctrnNticSndngDetail.ihidnum).as("ihidnum") - , tcaElctrnNticSndngDetail.tmpltMsgData - , tcaElctrnNticSndngDetail.mobilePageCn - , tcaElctrnNticSndngDetail.create - , tcaElctrnNticSndngDetail.update - , tcaElctrnNticSndngDetail.externalDocumentUuid - , tcaElctrnNticSndngDetail.ffnlgCode - , tcaElctrnNticSndngDetail.useInsttIdntfcId - )) - .from(tcaElctrnNticSndngDetail) - .where(tcaElctrnNticSndngDetail.elctrnNticSndng.eq(elctrnNticSndng)) - .fetch(); - } - - - @Override - public List findAllFetchByElctrnNticSndngId(String elctrnNticSndngId) { - return query.selectFrom(tcaElctrnNticSndngDetail) - .innerJoin(tcaElctrnNticSndngDetail.elctrnNticSndng, tcaElctrnNticSndng) - .fetchJoin() - .innerJoin(tcaElctrnNticSndng.tcaNhtTmplatManage, tcaNhtTmplatManage) - .fetchJoin() - .where(tcaElctrnNticSndngDetail.elctrnNticSndng.elctrnNticSndngId.eq(elctrnNticSndngId)) - .fetch(); - - } - - - @Override - public Optional findLastSendMastIdByElctrnNticSndngId(String elctrnNticSndngId) { - return Optional.ofNullable(query.select(intgrnSendDetail.intgrnSendMast.intSendMastId) - .from(intgrnSendDetail) -// .where(intgrnSendDetail.linkedUuid.in(findExternalDocumentUuidsByLnkInputId(elctrnNticSndngId))) - .innerJoin(tcaElctrnNticSndngDetail).on(intgrnSendDetail.linkedUuid.eq(tcaElctrnNticSndngDetail.externalDocumentUuid)) - .where(tcaElctrnNticSndngDetail.elctrnNticSndng.elctrnNticSndngId.eq(elctrnNticSndngId)) - .groupBy(intgrnSendDetail.intgrnSendMast.intSendMastId) - .orderBy(intgrnSendDetail.intgrnSendMast.intSendMastId.desc()) - .fetchFirst()); - } - - private List findExternalDocumentUuidsByLnkInputId(String elctrnNticSndngId) { - return query.select(tcaElctrnNticSndngDetail.externalDocumentUuid) - .from(tcaElctrnNticSndngDetail) - .where(tcaElctrnNticSndngDetail.elctrnNticSndng.elctrnNticSndngId.eq(elctrnNticSndngId)) - .fetch(); - } - - - @Override - public String findIhidnumDecByElctrnNticSndngDetailId(String tcaElctrnNticSndngDetailId) { - return query.select(Expressions.stringTemplate("ECL_DECRYPT({0})", tcaElctrnNticSndngDetail.ihidnum).as("ihidnum")) - .from(tcaElctrnNticSndngDetail) - .where(tcaElctrnNticSndngDetail.elctrnNticSndngDetailId.eq(tcaElctrnNticSndngDetailId)) - .fetchOne(); - } -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngRepository.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngRepository.java deleted file mode 100644 index 947e2a7..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngRepository.java +++ /dev/null @@ -1,16 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.repository; - -import cokr.xit.ens.biz.traffic.cheonan.code.SndngProcessSttusCd; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.TcaElctrnNticSndng; -import org.springframework.data.jpa.repository.JpaRepository; - -import java.util.List; - -public interface TcaElctrnNticSndngRepository extends JpaRepository { - - - List findAllBySndngProcessSttus(SndngProcessSttusCd sndngProcessSttus); - - List findAllBySndngProcessSttusIn(List sndngProcessSttuss); - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngResultRepository.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngResultRepository.java deleted file mode 100644 index be3fd5c..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngResultRepository.java +++ /dev/null @@ -1,8 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.repository; - -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.TcaElctrnNticSndngResult; -import org.springframework.data.jpa.repository.JpaRepository; - -public interface TcaElctrnNticSndngResultRepository extends JpaRepository, TcaElctrnNticSndngResultRepositoryCustom { - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngResultRepositoryCustom.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngResultRepositoryCustom.java deleted file mode 100644 index 1820718..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngResultRepositoryCustom.java +++ /dev/null @@ -1,11 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.repository; - -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.TcaElctrnNticSndngResult; - -import java.util.List; - -public interface TcaElctrnNticSndngResultRepositoryCustom { - - - void modifyByElctrnNticSndngResults(List tcaElctrnNticSndngResults); -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngResultRepositoryImpl.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngResultRepositoryImpl.java deleted file mode 100644 index 3d31d04..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaElctrnNticSndngResultRepositoryImpl.java +++ /dev/null @@ -1,35 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.repository; - -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.TcaElctrnNticSndngResult; -import com.querydsl.jpa.impl.JPAQueryFactory; -import lombok.RequiredArgsConstructor; - -import java.time.LocalDateTime; -import java.util.List; - -import static cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.QTcaElctrnNticSndngResult.tcaElctrnNticSndngResult; - -@RequiredArgsConstructor -public class TcaElctrnNticSndngResultRepositoryImpl implements TcaElctrnNticSndngResultRepositoryCustom { - - private final JPAQueryFactory query; - - @Override - public void modifyByElctrnNticSndngResults(List tcaElctrnNticSndngResults) { - tcaElctrnNticSndngResults.forEach(data -> - query.update(tcaElctrnNticSndngResult) - .set(tcaElctrnNticSndngResult.sndngSe, data.getSndngSe()) - .set(tcaElctrnNticSndngResult.sndngResultSttus, data.getSndngResultSttus()) - .set(tcaElctrnNticSndngResult.requstDt, data.getRequstDt()) - .set(tcaElctrnNticSndngResult.inqireDt, data.getInqireDt()) - .set(tcaElctrnNticSndngResult.readngDt, data.getReadngDt()) - .set(tcaElctrnNticSndngResult.errorCn, data.getErrorCn()) -// .set(tcaElctrnNticSndngResult.create, FieldCreate.builder().build()) - .set(tcaElctrnNticSndngResult.lastUpdtDt, LocalDateTime.now()) - .where(tcaElctrnNticSndngResult.elctrnNticSndngDetailId.eq(data.getElctrnNticSndngDetailId())) - .execute() - ); - } - - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaNhtTmplatManageRepository.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaNhtTmplatManageRepository.java deleted file mode 100644 index 505ab9b..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaNhtTmplatManageRepository.java +++ /dev/null @@ -1,8 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.repository; - -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.TcaNhtTmplatManage; -import org.springframework.data.jpa.repository.JpaRepository; - -public interface TcaNhtTmplatManageRepository extends JpaRepository { - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaRlaybsnmManageRepository.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaRlaybsnmManageRepository.java deleted file mode 100644 index d2a6042..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/domain/repository/TcaRlaybsnmManageRepository.java +++ /dev/null @@ -1,8 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.repository; - -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.TcaRlaybsnmManage; -import org.springframework.data.jpa.repository.JpaRepository; - -public interface TcaRlaybsnmManageRepository extends JpaRepository { - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/model/TrafficCaSigntalkReqDTO.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/model/TrafficCaSigntalkReqDTO.java deleted file mode 100644 index 1384c97..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/model/TrafficCaSigntalkReqDTO.java +++ /dev/null @@ -1,12 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.model; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; - -@Getter -@Schema(name = "TrafficCaSigntalkReqDTO") -public class TrafficCaSigntalkReqDTO { - - @Schema(required = true, title = "전자 고지 발송 Id", example = " ") - private String elctrnNticSndngId; -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/presentation/TrafficCaSigntalkController.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/presentation/TrafficCaSigntalkController.java deleted file mode 100644 index 9a4dfec..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/presentation/TrafficCaSigntalkController.java +++ /dev/null @@ -1,53 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.presentation; - -import cokr.xit.ens.biz.traffic.cheonan.signtalk.model.TrafficCaSigntalkReqDTO; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.service.TrafficCaSigntalkService; -import cokr.xit.ens.core.aop.EnsResponseVO; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; - -@Tag(name = "TrafficCaSigntalkController") -@Slf4j -@Controller -@RequiredArgsConstructor -public class TrafficCaSigntalkController { - - private final TrafficCaSigntalkService trafficCaSigntalkService; - - @Operation(summary = "접수") - @PostMapping(value = "/traffic/ca/signtalk/accept", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity accept(@RequestBody TrafficCaSigntalkReqDTO reqDTO) { - EnsResponseVO responseVO = trafficCaSigntalkService.accept(reqDTO.getElctrnNticSndngId()); - return new ResponseEntity(responseVO, HttpStatus.OK); - } - - @Operation(summary = "제작") - @PutMapping(value = "/traffic/ca/signtalk/re/make", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity reMake(@RequestBody TrafficCaSigntalkReqDTO reqDTO) { - EnsResponseVO responseVO = trafficCaSigntalkService.reMake(reqDTO.getElctrnNticSndngId()); - return new ResponseEntity(responseVO, HttpStatus.OK); - } - - @Operation(summary = "전송") - @PutMapping(value = "/traffic/ca/signtalk/re/send", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity reSend(@RequestBody TrafficCaSigntalkReqDTO reqDTO) { - EnsResponseVO responseVO = trafficCaSigntalkService.reSend(reqDTO.getElctrnNticSndngId()); - return new ResponseEntity(responseVO, HttpStatus.OK); - } - - @Operation(summary = "전송결과가져오기") - @PostMapping(value = "/traffic/ca/signtalk/fetch", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity fetch(@RequestBody TrafficCaSigntalkReqDTO reqDTO) { - EnsResponseVO responseVO = trafficCaSigntalkService.fetch(reqDTO.getElctrnNticSndngId()); - return new ResponseEntity(responseVO, HttpStatus.OK); - } -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/sched/TrafficCaSigntalkScheduler.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/sched/TrafficCaSigntalkScheduler.java deleted file mode 100644 index b5279fa..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/sched/TrafficCaSigntalkScheduler.java +++ /dev/null @@ -1,46 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.sched; - -import cokr.xit.ens.biz.traffic.cheonan.signtalk.service.TrafficCaSigntalkService; -import cokr.xit.ens.core.aop.EnsResponseVO; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.context.annotation.Profile; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -@Slf4j -@Component -@Profile("prod-traffic-cheonan") -@RequiredArgsConstructor -public class TrafficCaSigntalkScheduler { - - private final TrafficCaSigntalkService trafficCaSigntalkService; - - /** - * 인증톡 접수 - * -. 인증톡 전송을 위해 TRAFFIC에 등록된 기초데이터를 ENS에 이관 등록 한다. - */ - @Scheduled(cron = "0 */1 7-22 * * *") - public void accepted(){ - EnsResponseVO responseVO = trafficCaSigntalkService.acceptAll(); - log.info("======================================================="); - log.info("[TRAFFIC] 인증톡 접수처리 결과"); - log.info(responseVO.toString()); - log.info("======================================================="); - } - - - /** - * 인증톡 결과 가져오기 - * -. 전송이 완료된 인증톡 전송결과(성공/실패)를 ENS -> TRAFFIC 로 가져와 DB에 저장한다. - */ - @Scheduled(cron = "0 */15 7-22 * * *") - public void fetched(){ - EnsResponseVO responseVO = trafficCaSigntalkService.fetchAll(); - - log.info("======================================================="); - log.info("[TRAFFIC] 인증톡 요청문서정보 Fetch 결과"); - log.info(responseVO.toString()); - log.info("======================================================="); - } -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/TrafficCaSigntalkService.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/TrafficCaSigntalkService.java deleted file mode 100644 index a58e762..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/TrafficCaSigntalkService.java +++ /dev/null @@ -1,169 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.service; - -import cokr.xit.ens.biz.traffic.cheonan.code.SndngProcessSttusCd; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.TcaElctrnNticSndng; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.repository.TcaElctrnNticSndngRepository; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.service.support.TrafficCaSigntalkAcceptor; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.service.support.TrafficCaSigntalkFetcher; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.service.support.TrafficCaSigntalkMaker; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.service.support.TrafficCaSigntalkSender; -import cokr.xit.ens.core.aop.EnsResponseVO; -import cokr.xit.ens.core.exception.EnsException; -import cokr.xit.ens.core.exception.code.EnsErrCd; -import cokr.xit.ens.core.utils.CmmnUtil; -import cokr.xit.ens.modules.common.ctgy.intgrnnoti.service.event.IntgrnNotiSendReserveEvent; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.context.ApplicationEventPublisher; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -@Slf4j -@Service -@RequiredArgsConstructor -@Transactional -public class TrafficCaSigntalkService { - - private final TcaElctrnNticSndngRepository tcaElctrnNticSndngRepository; - - private final TrafficCaSigntalkAcceptor trafficCaSigntalkAcceptor; - private final TrafficCaSigntalkMaker trafficCaSigntalkMaker; - private final TrafficCaSigntalkSender trafficCaSigntalkSender; - private final TrafficCaSigntalkFetcher trafficCaSigntalkFetcher; - - private final ApplicationEventPublisher applicationEventPublisher; - - - /** - * 인증톡 접수(TRAFFIC -> ENS) - */ - public EnsResponseVO accept(String elctrnNticSndngId) { - - try { - - TcaElctrnNticSndng elctrnNticSndng = tcaElctrnNticSndngRepository.findById(elctrnNticSndngId) - .orElseThrow(() -> new EnsException(EnsErrCd.ACPT404, "일치하는 자료가 없습니다.")); - if (!SndngProcessSttusCd.accept.equals(elctrnNticSndng.getSndngProcessSttus())) - throw new EnsException(EnsErrCd.ACPT405, String.format("\"%s(%s)\" 상태가 아닙니다.", SndngProcessSttusCd.accept.getCodeNm(), SndngProcessSttusCd.accept)); - - return this.accept(Arrays.asList(elctrnNticSndng)).getResultInfo().get(0); - } catch (EnsException e) { - return EnsResponseVO.errBuilder() - .errCode(e.getErrCd()) - .errMsg(e.getMessage()) - .build(); - } - } - - /** - * 인증톡 접수(TRAFFIC -> ENS) - */ - public EnsResponseVO> acceptAll() { - try { - - List tcaElctrnNticSndngs = tcaElctrnNticSndngRepository.findAllBySndngProcessSttus(SndngProcessSttusCd.accept); - if (CmmnUtil.isEmpty(tcaElctrnNticSndngs)) - throw new EnsException(EnsErrCd.ACPT404, String.format("\"%s(%s)\" 상태의 자료가 없습니다.", SndngProcessSttusCd.accept.getCodeNm(), SndngProcessSttusCd.accept)); - - return this.accept(tcaElctrnNticSndngs); - } catch (EnsException e) { - return EnsResponseVO.>errBuilder() - .errCode(e.getErrCd()) - .errMsg(e.getMessage()) - .build(); - } - } - - private EnsResponseVO> accept(List tcaElctrnNticSndngs) { - EnsResponseVO responseVO = trafficCaSigntalkAcceptor.statReady(tcaElctrnNticSndngs.stream() - .map(row -> row.getElctrnNticSndngId()) - .collect(Collectors.toList())); - if (!EnsErrCd.OK.equals(responseVO.getErrCode())) - return responseVO; - - List resultInfo = tcaElctrnNticSndngs.stream() - .map(row -> trafficCaSigntalkAcceptor.execute(row.getElctrnNticSndngId())) - .collect(Collectors.toList()); - - - List sendMastIds = resultInfo.stream() - .filter(ensResponseVO -> EnsErrCd.OK.equals(ensResponseVO.getErrCode())) - .map(ensResponseVO -> (Long) ((Map) ensResponseVO.getResultInfo()).get("intSendMastId")) - .collect(Collectors.toList()); - IntgrnNotiSendReserveEvent event = IntgrnNotiSendReserveEvent.builder() - .sendMastIds(sendMastIds) - .callback(() -> this.fetch(tcaElctrnNticSndngs)) - .build(); - applicationEventPublisher.publishEvent(event); - - return EnsResponseVO.>okBuilder().resultInfo(resultInfo).build(); - } - - - /** - * 인증톡 제작 재요청 - * - * @param elctrnNticSndngId - * @return - */ - public EnsResponseVO reMake(String elctrnNticSndngId) { - return trafficCaSigntalkMaker.execute(elctrnNticSndngId); - } - - - /** - * 인증톡 전송 재요청 - * - * @param elctrnNticSndngId - * @return - */ - public EnsResponseVO reSend(String elctrnNticSndngId) { - return trafficCaSigntalkSender.execute(elctrnNticSndngId); - } - - - /** - * 인증톡 전송(성공/실패) 결과 가져오기 - */ - public EnsResponseVO fetch(String elctrnNticSndngId) { - TcaElctrnNticSndng elctrnNticSndng = null; - try { - elctrnNticSndng = tcaElctrnNticSndngRepository.findById(elctrnNticSndngId) - .orElseThrow(() -> new EnsException(EnsErrCd.ERR404, String.format("[ elctrnNticSndngId %s ]와 일치하는 자료가 없습니다.", elctrnNticSndngId))); - } catch (EnsException e) { - return EnsResponseVO.errBuilder() - .errCode(e.getErrCd()) - .errMsg(e.getMessage()) - .build(); - } - - return this.fetch(Arrays.asList(elctrnNticSndng)); - } - - /** - * 인증톡 전송(성공/실패) 결과 모두 가져오기 - */ - public EnsResponseVO fetchAll() { - List tcaElctrnNticSndngs = tcaElctrnNticSndngRepository.findAllBySndngProcessSttusIn(Arrays.asList(SndngProcessSttusCd.acptok, SndngProcessSttusCd.ensmake, SndngProcessSttusCd.ensstart, SndngProcessSttusCd.ensok, SndngProcessSttusCd.ensopen)); - - return this.fetch(tcaElctrnNticSndngs); - } - - private EnsResponseVO fetch(List tcaElctrnNticSndngs) { - - return EnsResponseVO.okBuilder() - .resultInfo( - tcaElctrnNticSndngs.stream() - .map(row -> trafficCaSigntalkFetcher.execute(row.getElctrnNticSndngId())) - .collect(Collectors.toList()) - ) - .build(); - } - - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/TrafficCaSigntalkAcceptor.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/TrafficCaSigntalkAcceptor.java deleted file mode 100644 index 87adc6a..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/TrafficCaSigntalkAcceptor.java +++ /dev/null @@ -1,247 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.service.support; - -import cokr.xit.ens.biz.traffic.cheonan.code.SndngProcessSttusCd; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.TcaElctrnNticSndng; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.TcaElctrnNticSndngDetail; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.embeded.FieldUpdate; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.repository.TcaElctrnNticSndngDetailRepository; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.repository.TcaElctrnNticSndngRepository; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.service.support.accept.AcptDocKkoMd; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.service.support.accept.AcptDocKtGbs; -import cokr.xit.ens.core.aop.EnsResponseVO; -import cokr.xit.ens.core.exception.EnsException; -import cokr.xit.ens.core.exception.code.EnsErrCd; -import cokr.xit.ens.core.utils.Checks; -import cokr.xit.ens.core.utils.CmmnUtil; -import cokr.xit.ens.core.utils.MapDeserailizer; -import cokr.xit.ens.modules.common.biztmplt.EnsPhaseProcSupport; -import cokr.xit.ens.modules.common.code.VenderCd; -import cokr.xit.ens.core.model.EnsBillAcptReqDTO; -import cokr.xit.ens.modules.common.ctgy.intgrnnoti.model.IntgrnNotiAcceptReqDTO; -import cokr.xit.ens.modules.common.ctgy.intgrnnoti.model.config.AcptData; -import cokr.xit.ens.modules.common.ctgy.intgrnnoti.model.config.Document; -import cokr.xit.ens.modules.common.ctgy.intgrnnoti.model.config.Receiver; -import cokr.xit.ens.modules.common.ctgy.intgrnnoti.model.config.XitProperty; -import cokr.xit.ens.modules.common.ctgy.intgrnnoti.service.IntgrnNotiService; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import net.bytebuddy.utility.RandomString; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.stream.Collectors; - -@Slf4j -@Component -@RequiredArgsConstructor -public class TrafficCaSigntalkAcceptor implements EnsPhaseProcSupport { - - private final TcaElctrnNticSndngRepository tcaElctrnNticSndngRepository; - private final TcaElctrnNticSndngDetailRepository elctrnNticSndngDetailRepository; - - private final IntgrnNotiService intgrnNotiService; - - private Gson gson = new GsonBuilder().registerTypeAdapter(Map.class, new MapDeserailizer()).serializeNulls().create(); - - - @Value("${xit.mblpage.postse.intgrn.url}") - private String MBLPAGE_URL; - @Value("${xit.mblpage.postse.intgrn.path}") - private String MBLPAGE_PATH; - - /** - * Accept 준비 - * - * @param elctrnNticSndngIds - * @return - */ - @Override - @Transactional(propagation = Propagation.REQUIRES_NEW) - public EnsResponseVO statReady(List elctrnNticSndngIds) { - try { - AtomicInteger index = new AtomicInteger(); - String prefixExternalDocumentUuid = String.format("B-%s%s", LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS")), RandomString.make(5)); - elctrnNticSndngIds.stream() - .map(elctrnNticSndngId -> tcaElctrnNticSndngRepository.findById(elctrnNticSndngId).get()) - .map(elctrnNticSndng -> elctrnNticSndngDetailRepository.findAllDecByElctrnNticSndng(elctrnNticSndng)) - .forEach(list -> { - list.stream() - .forEach(row -> { - row.setExternalDocumentUuid(String.format("%s%09d", prefixExternalDocumentUuid, index.getAndIncrement() + 1)); - }); - elctrnNticSndngDetailRepository.saveAll(list); - - } - - ); - return EnsResponseVO.okBuilder().build(); - } catch (Exception e) { - return EnsResponseVO.errBuilder() - .errCode(EnsErrCd.ACPT500) - .errMsg(String.format("문서식별번호(외부) 생성에 실패 했습니다. %s", e.getMessage())) - .build(); - } - - } - - - @Override - @Transactional(propagation = Propagation.REQUIRES_NEW) - public EnsResponseVO statBegin(String elctrnNticSndngId) { - log.info("no process"); - return null; - } - - - /** - * 인증톡 전자고지 접수 - */ - @Override - @Transactional(propagation = Propagation.REQUIRES_NEW) - public EnsResponseVO execute(String elctrnNticSndngId) { - Map resultInfo = new HashMap<>(); - resultInfo.put("elctrnNticSndngId", elctrnNticSndngId); - - EnsResponseVO responseVO = null; - TcaElctrnNticSndng elctrnNticSndng = null; - try { - elctrnNticSndng = tcaElctrnNticSndngRepository.findById(elctrnNticSndngId) - .orElseThrow(() -> new EnsException(EnsErrCd.ACPT404, String.format("일치하는 TB_ELCTRN_NTIC_SNDNG 데이터가 없습니다. [ elctrnNticSndngId %s ]", elctrnNticSndngId))); - - IntgrnNotiAcceptReqDTO reqDTO = this.convertTbInputDataToAcceptReqDTO(elctrnNticSndngDetailRepository.findAllFetchByElctrnNticSndngId(elctrnNticSndng.getElctrnNticSndngId())); - - EnsResponseVO reqResp = intgrnNotiService.accept(reqDTO); - - - if (EnsErrCd.OK.equals(reqResp.getErrCode())) { - resultInfo.put("intSendMastId", (Long) ((Map) reqResp.getResultInfo()).get("intSendMastId")); - responseVO = EnsResponseVO.okBuilder().resultInfo(resultInfo).build(); - } else { - responseVO = EnsResponseVO.errRsltBuilder() - .errCode(reqResp.getErrCode()) - .errMsg(reqResp.getErrMsg()) - .resultInfo(reqResp.getResultInfo()) - .build(); - } - } catch (EnsException e) { - responseVO = EnsResponseVO.errRsltBuilder() - .errCode(e.getErrCd()) - .errMsg(String.format("인증톡 \"접수\" 처리 실패. [%s] %s", e.getErrCd().getCode(), e.getMessage())) - .resultInfo(resultInfo) - .build(); - - } catch (Exception e) { - responseVO = EnsResponseVO.errRsltBuilder() - .errCode(EnsErrCd.ACPT500) - .errMsg(String.format("인증톡 \"접수\" 처리 실패. %s", e.getMessage())) - .resultInfo(resultInfo) - .build(); - - } finally { - if (EnsErrCd.OK.equals(responseVO.getErrCode())) { - elctrnNticSndng.setUpdate(FieldUpdate.builder() - .updusr("ENS_SYS") - .updtDt(LocalDateTime.now()) - .build()); - elctrnNticSndng.setSndngProcessSttus(SndngProcessSttusCd.acptok); - elctrnNticSndng.setErrorCn(null); - } else { - elctrnNticSndng.setUpdate(FieldUpdate.builder() - .updusr("ENS_SYS") - .updtDt(LocalDateTime.now()) - .build()); - elctrnNticSndng.setSndngProcessSttus(SndngProcessSttusCd.acptfail); - elctrnNticSndng.setErrorCn(responseVO.getErrMsg()); - if (responseVO.getResultInfo() != null && (responseVO.getResultInfo() instanceof List || responseVO.getResultInfo() instanceof Map)) - elctrnNticSndng.setErrorDtls(gson.toJson(responseVO.getResultInfo())); - } - } - - return responseVO; - } - - - private IntgrnNotiAcceptReqDTO convertTbInputDataToAcceptReqDTO(List list) { - - return IntgrnNotiAcceptReqDTO.builder() - .vender(VenderCd.none.getCode()) - .org_cd(list.get(0).getElctrnNticSndng().getSignguCode()) - .tmplt_cd(list.get(0).getElctrnNticSndng().getTcaNhtTmplatManage().getNhtTmplatId()) - .post_bundle_title( - String.format("%s(%s건)-%s" - , list.get(0).getElctrnNticSndng().getTcaNhtTmplatManage().getNhtNm() - , list.get(0).getElctrnNticSndng().getSndngCo() - , LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")) - ) - ) - .send_dt(list.get(0).getElctrnNticSndng().getSndngDt()) - .close_dt(list.get(0).getElctrnNticSndng().getClosDt()) - .documents( - list.stream() - .map(row -> this.createDocument(row)) - .collect(Collectors.toList()) - ) - .build(); - } - - private Document createDocument(TcaElctrnNticSndngDetail data) throws EnsException { - - String jid = elctrnNticSndngDetailRepository.findIhidnumDecByElctrnNticSndngDetailId(data.getElctrnNticSndngDetailId()); - jid = Checks.isCheckJid(jid) ? jid : "1111111111111"; - - Map tmpltMsgData = null; - if (!CmmnUtil.isEmpty(data.getTmpltMsgData())) - try { - tmpltMsgData = gson.fromJson(data.getTmpltMsgData(), Map.class); - } catch (Exception e) { - throw new EnsException(EnsErrCd.ACPT411, "템플릿메시지데이터의 값은 JSON 포맷만 가능 합니다."); - } - - return Document.builder() - .linked_uuid(data.getExternalDocumentUuid()) - .receiver(Receiver.builder() - .ci(null) -// .jid(data.getIhidnum()) - .jid(jid) - .mblphon_no(null) - .build()) - .acpt_data(AcptData.builder() - .kko_md(new AcptDocKkoMd(data, MBLPAGE_URL + MBLPAGE_PATH).createDocument()) - .kko_at(null) - .nv_st(null) - .kt_gbs(new AcptDocKtGbs(data, MBLPAGE_URL + MBLPAGE_PATH).createDocument()) - .build()) - .xit_property(XitProperty.builder() - .bill_acpt_data(this.createBillAcptData(data)) - .tmplt_msg_data(tmpltMsgData) - .mbl_page_data(this.createDetails(data)) - .build()) - .build(); - } - - private EnsBillAcptReqDTO createBillAcptData(TcaElctrnNticSndngDetail data) { - return null; - } - - private Map>> createDetails(TcaElctrnNticSndngDetail data) { - try { - Map>> m = gson.fromJson(data.getMobilePageCn(), Map.class); - return m; - } catch (Exception e) { - log.error("\"mobilePageCn\" Json Parse 실패. {}", data.getMobilePageCn()); - return null; - } - } - - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/TrafficCaSigntalkFetcher.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/TrafficCaSigntalkFetcher.java deleted file mode 100644 index 71b9416..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/TrafficCaSigntalkFetcher.java +++ /dev/null @@ -1,179 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.service.support; - -import cokr.xit.ens.biz.traffic.cheonan.code.SndngProcessSttusCd; -import cokr.xit.ens.biz.traffic.cheonan.code.SndngResultSttusCd; -import cokr.xit.ens.biz.traffic.cheonan.code.SndngSeCd; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.TcaElctrnNticSndng; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.TcaElctrnNticSndngDetail; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.TcaElctrnNticSndngResult; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.embeded.FieldCreate; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.embeded.FieldUpdate; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.repository.TcaElctrnNticSndngDetailRepository; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.repository.TcaElctrnNticSndngRepository; -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.repository.TcaElctrnNticSndngResultRepository; -import cokr.xit.ens.core.aop.EnsResponseVO; -import cokr.xit.ens.core.exception.EnsException; -import cokr.xit.ens.core.exception.code.EnsErrCd; -import cokr.xit.ens.core.utils.CmmnUtil; -import cokr.xit.ens.modules.common.biztmplt.EnsPhaseProcSupport; -import cokr.xit.ens.modules.common.ctgy.intgrnnoti.model.IntgrnDetailStatVO; -import cokr.xit.ens.modules.common.ctgy.intgrnnoti.model.IntgrnNotiRsltRespDTO; -import cokr.xit.ens.modules.common.ctgy.intgrnnoti.service.IntgrnNotiService; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import java.time.LocalDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -@Slf4j -@Component -@RequiredArgsConstructor -public class TrafficCaSigntalkFetcher implements EnsPhaseProcSupport { - - private final TcaElctrnNticSndngRepository tcaElctrnNticSndngRepository; - private final TcaElctrnNticSndngDetailRepository elctrnNticSndngDetailRepository; - - private final TcaElctrnNticSndngResultRepository tcaElctrnNticSndngResultRepository; - - private final IntgrnNotiService intgrnNotiService; - - - /** - * Fetch 준비 - * - * @param elctrnNticSndngIds - * @return - */ - @Override - @Transactional(propagation = Propagation.REQUIRES_NEW) - public EnsResponseVO statReady(List elctrnNticSndngIds) { - log.info("no process"); - return null; - } - - - @Override - @Transactional(propagation = Propagation.REQUIRES_NEW) - public EnsResponseVO statBegin(String elctrnNticSndngId) { - log.info("no process"); - return null; - } - - - /** - * 인증톡 발송(성공/실패) 자료에 대한 결과 가져오기 - * - * @param elctrnNticSndngId - */ - @Override - @Transactional(propagation = Propagation.REQUIRES_NEW) - public EnsResponseVO execute(String elctrnNticSndngId) { - EnsResponseVO responseVO = null; - Map resultInfo = new HashMap<>(); - resultInfo.put("elctrnNticSndngId", elctrnNticSndngId); - - IntgrnNotiRsltRespDTO respDTO = null; - try { - Long intSendMastId = elctrnNticSndngDetailRepository.findLastSendMastIdByElctrnNticSndngId(elctrnNticSndngId) - .orElseThrow(() -> new EnsException(EnsErrCd.RSLT404, "일치하는 ENS 접수자료가 없습니다.")); - resultInfo.put("intSendMastId", intSendMastId); - - - EnsResponseVO apiRespVO = intgrnNotiService.sendResultProvide(intSendMastId); - respDTO = (IntgrnNotiRsltRespDTO) apiRespVO.getResultInfo(); - - - List tcaElctrnNticSndngResults = respDTO.getDocuments().stream() - .map(row -> { - return TcaElctrnNticSndngResult.builder() - .sndngSe(SndngSeCd.valueOfEnum(row.getCurPostSe().getCode())) - .elctrnNticSndngDetailId(elctrnNticSndngDetailRepository.findByExternalDocumentUuid(row.getLinkedUuid()) - .orElse(new TcaElctrnNticSndngDetail()) - .getElctrnNticSndngDetailId()) - .sndngResultSttus(this.sndngResultSttus(row)) - .requstDt(row.getDocSentDt()) - .inqireDt(row.getDocReceivedDt()) - .readngDt(row.getDocReadFrstDt()) - .errorCn(CmmnUtil.isEmpty(row.getErrorMessage()) ? null : row.getErrorMessage()) - .create(FieldCreate.builder() - .register("ENS_SYS") - .registDt(LocalDateTime.now()) - .build()) - .build(); - }) - .collect(Collectors.toList()); - if (tcaElctrnNticSndngResultRepository.findById(tcaElctrnNticSndngResults.get(0).getElctrnNticSndngDetailId()).isPresent()) - tcaElctrnNticSndngResultRepository.modifyByElctrnNticSndngResults(tcaElctrnNticSndngResults); - else - tcaElctrnNticSndngResultRepository.saveAll(tcaElctrnNticSndngResults); - - responseVO = EnsResponseVO.okBuilder().resultInfo(resultInfo).build(); - } catch (EnsException e) { - responseVO = EnsResponseVO.errBuilder() - .errCode(e.getErrCd()) - .errMsg(e.getMessage()) - .build(); - } catch (Exception e) { - responseVO = EnsResponseVO.errBuilder() - .errCode(EnsErrCd.RSLT999) - .errMsg(String.format("[elctrnNticSndngId %s]에 대한 전송결과 FETCH 처리 실패. %s", elctrnNticSndngId, e.getMessage())) - .build(); - } finally { - TcaElctrnNticSndng elctrnNticSndng = tcaElctrnNticSndngRepository.findById(elctrnNticSndngId).orElseThrow(() -> new EnsException(EnsErrCd.RSLT404, "일치하는 tbInputXit 자료가 없습니다.")); - if (EnsErrCd.OK.equals(responseVO.getErrCode())) { - elctrnNticSndng.setUpdate(FieldUpdate.builder() - .updusr("ENS_SYS") - .updtDt(LocalDateTime.now()) - .build()); - elctrnNticSndng.setSndngProcessSttus(this.sndngProcessSttus(respDTO, elctrnNticSndng.getSndngProcessSttus())); - elctrnNticSndng.setErrorCn(null); - } else { - elctrnNticSndng.setUpdate(FieldUpdate.builder() - .updusr("ENS_SYS") - .updtDt(LocalDateTime.now()) - .build()); - elctrnNticSndng.setSndngProcessSttus(SndngProcessSttusCd.ensfail); - elctrnNticSndng.setErrorCn(responseVO.getErrMsg()); - } - } - - return responseVO; - } - - private SndngProcessSttusCd sndngProcessSttus(IntgrnNotiRsltRespDTO respDTO, SndngProcessSttusCd sndngProcessSttus) { - switch (respDTO.getStatCd()) { - case accept: - return sndngProcessSttus; - case makefail: - case sendfail: - return SndngProcessSttusCd.ensfail; - case makerdy: - case making: - case makeok: - return SndngProcessSttusCd.ensmake; - case sendrdy: - case sending: - return SndngProcessSttusCd.ensstart; - case sendok: - case sendcmplt: - return SndngProcessSttusCd.ensok; - case open: - return SndngProcessSttusCd.ensopen; - case close: - return SndngProcessSttusCd.ensclose; - default: - return sndngProcessSttus; - } - } - - private SndngResultSttusCd sndngResultSttus(IntgrnDetailStatVO row) { - return SndngResultSttusCd.valueOfEnum(row.getCurStatCd().getIntgrnDtlStatCd().getCode()); - } - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/TrafficCaSigntalkMaker.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/TrafficCaSigntalkMaker.java deleted file mode 100644 index 7e98b6c..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/TrafficCaSigntalkMaker.java +++ /dev/null @@ -1,64 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.service.support; - -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.repository.TcaElctrnNticSndngDetailRepository; -import cokr.xit.ens.core.aop.EnsResponseVO; -import cokr.xit.ens.core.exception.EnsException; -import cokr.xit.ens.core.exception.code.EnsErrCd; -import cokr.xit.ens.modules.common.biztmplt.EnsPhaseProcSupport; -import cokr.xit.ens.modules.common.ctgy.intgrnnoti.service.IntgrnNotiService; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; - -@Slf4j -@Component -@RequiredArgsConstructor -public class TrafficCaSigntalkMaker implements EnsPhaseProcSupport { - - private final TcaElctrnNticSndngDetailRepository elctrnNticSndngDetailRepository; - - private final IntgrnNotiService intgrnNotiService; - - - @Override - @Transactional(propagation = Propagation.REQUIRES_NEW) - public EnsResponseVO statReady(List elctrnNticSndngIds) { - log.info("no process"); - return null; - } - - - @Override - @Transactional(propagation = Propagation.REQUIRES_NEW) - public EnsResponseVO statBegin(String elctrnNticSndngId) { - log.info("no process"); - return null; - } - - - /** - * 인증톡 전자고지 제작 - */ - @Override - @Transactional(propagation = Propagation.REQUIRES_NEW) - public EnsResponseVO execute(String elctrnNticSndngId) { - EnsResponseVO responseVO = null; - try { - Long intSendMastId = elctrnNticSndngDetailRepository.findLastSendMastIdByElctrnNticSndngId(elctrnNticSndngId) - .orElseThrow(() -> new EnsException(EnsErrCd.MAKE404, "일치하는 ENS 접수자료가 없습니다.")); - - responseVO = intgrnNotiService.remake(intSendMastId); - } catch (EnsException e) { - responseVO = EnsResponseVO.errBuilder() - .errCode(e.getErrCd()) - .errMsg(e.getMessage()) - .build(); - } - return responseVO; - } - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/TrafficCaSigntalkSender.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/TrafficCaSigntalkSender.java deleted file mode 100644 index e131c2e..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/TrafficCaSigntalkSender.java +++ /dev/null @@ -1,64 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.service.support; - -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.repository.TcaElctrnNticSndngDetailRepository; -import cokr.xit.ens.core.aop.EnsResponseVO; -import cokr.xit.ens.core.exception.EnsException; -import cokr.xit.ens.core.exception.code.EnsErrCd; -import cokr.xit.ens.modules.common.biztmplt.EnsPhaseProcSupport; -import cokr.xit.ens.modules.common.ctgy.intgrnnoti.service.IntgrnNotiService; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; - -@Slf4j -@Component -@RequiredArgsConstructor -public class TrafficCaSigntalkSender implements EnsPhaseProcSupport { - - private final TcaElctrnNticSndngDetailRepository elctrnNticSndngDetailRepository; - - private final IntgrnNotiService intgrnNotiService; - - - @Override - @Transactional(propagation = Propagation.REQUIRES_NEW) - public EnsResponseVO statReady(List elctrnNticSndngIds) { - log.info("no process"); - return null; - } - - - @Override - @Transactional(propagation = Propagation.REQUIRES_NEW) - public EnsResponseVO statBegin(String elctrnNticSndngId) { - log.info("no process"); - return null; - } - - - /** - * 인증톡 전자고지 전송요청 - */ - @Override - @Transactional(propagation = Propagation.REQUIRES_NEW) - public EnsResponseVO execute(String elctrnNticSndngId) { - EnsResponseVO responseVO = null; - try { - Long intSendMastId = elctrnNticSndngDetailRepository.findLastSendMastIdByElctrnNticSndngId(elctrnNticSndngId) - .orElseThrow(() -> new EnsException(EnsErrCd.SEND404, "일치하는 ENS 접수자료가 없습니다.")); - - responseVO = intgrnNotiService.sendBulk(intSendMastId); - } catch (EnsException e) { - responseVO = EnsResponseVO.errBuilder() - .errCode(e.getErrCd()) - .errMsg(e.getMessage()) - .build(); - } - return responseVO; - } - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/accept/Accept.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/accept/Accept.java deleted file mode 100644 index b146796..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/accept/Accept.java +++ /dev/null @@ -1,5 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.service.support.accept; - -public interface Accept { - T createDocument(); -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/accept/AcptDocKkoMd.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/accept/AcptDocKkoMd.java deleted file mode 100644 index e1a23f7..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/accept/AcptDocKkoMd.java +++ /dev/null @@ -1,40 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.service.support.accept; - -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.TcaElctrnNticSndngDetail; -import cokr.xit.ens.core.utils.DateUtil; -import cokr.xit.ens.modules.kkomydoc.model.config.DocumentConfKkoMd; -import cokr.xit.ens.modules.kkomydoc.model.config.Property; -import lombok.RequiredArgsConstructor; - -import java.util.Arrays; - -@RequiredArgsConstructor -public class AcptDocKkoMd implements Accept { - - private final TcaElctrnNticSndngDetail tcaElctrnNticSndngDetail; - private final String redirectUrl; - - @Override - public DocumentConfKkoMd createDocument() { - return DocumentConfKkoMd.builder() - .hash(null) - .common_categories(Arrays.asList("NOTICE")) - .read_expired_at(DateUtil.dateToAbsTimeSec(tcaElctrnNticSndngDetail.getElctrnNticSndng().getClosDt())) -// .read_expired_sec() - .property(this.createProperty()) - .bridge(null) - .build(); - } - - - private Property createProperty() { - return Property.builder() - .link(this.redirectUrl) - .payload(null) - .message(null) - .cs_name(null) - .cs_number(null) - .build(); - } - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/accept/AcptDocKtGbs.java b/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/accept/AcptDocKtGbs.java deleted file mode 100644 index f3d3d4c..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/cheonan/signtalk/service/support/accept/AcptDocKtGbs.java +++ /dev/null @@ -1,26 +0,0 @@ -package cokr.xit.ens.biz.traffic.cheonan.signtalk.service.support.accept; - -import cokr.xit.ens.biz.traffic.cheonan.signtalk.domain.TcaElctrnNticSndngDetail; -import cokr.xit.ens.modules.ktsigntalk.gibis.model.config.DocumentConfKtGbs; -import lombok.RequiredArgsConstructor; - -@RequiredArgsConstructor -public class AcptDocKtGbs implements Accept { - - private final TcaElctrnNticSndngDetail tcaElctrnNticSndngDetail; - private final String redirectUrl; - - @Override - public DocumentConfKtGbs createDocument() { - return DocumentConfKtGbs.builder() - .hash(null) - .srcSeq(null) - .mmsDtlCnts(null) -// .mmsTitle() - .rcsDtlCnts(null) - .url(redirectUrl) - .mdn(null) - .build(); - - } -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/init/TrafficCcJpaRunner.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/init/TrafficCcJpaRunner.java deleted file mode 100644 index e1e7a79..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/init/TrafficCcJpaRunner.java +++ /dev/null @@ -1,125 +0,0 @@ -package cokr.xit.ens.biz.traffic.chuncheon.init; - -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.repository.NhtTmplatManageRepository; -import cokr.xit.ens.core.aop.EnsResponseVO; -import cokr.xit.ens.modules.common.ctgy.sys.mng.model.OrgMngDTO; -import cokr.xit.ens.modules.common.ctgy.sys.mng.service.OrgMngService; -import cokr.xit.ens.modules.common.ctgy.sys.mng.service.TmpltMngService; -import cokr.xit.ens.modules.kkomydoc.model.TmpltMngKkoMydocDTO; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.ApplicationArguments; -import org.springframework.boot.ApplicationRunner; -import org.springframework.context.annotation.Profile; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - - -/** - * 주정차웹-춘천 - */ -@Component -@Transactional -@Profile({"prod-traffic"}) -public class TrafficCcJpaRunner implements ApplicationRunner { - - @Autowired - private OrgMngService orgMngService; - @Autowired - private TmpltMngService tmpltMngService; - - ObjectMapper mapper = new ObjectMapper(); - @Value("${contract.kakao.pay.mydoc.access-token}") - private String KKO_MD_ACCESS_TOKEN = "b40d3c623d1011ecbceae6cf4630da62"; - @Value("${contract.kakao.pay.mydoc.contract-uuid}") - private String KKO_MD_CONTRACT_UUID = "CON-b4126c833d1011ecbceae6cf4630da62"; - private String KKO_BP_BILLER_CODE = null; - private String KKO_BP_AUTHORIZATION = null; - private String KKO_AT_BSID = null; - private String KKO_AT_PASSWD = null; - private String KKO_AT_SENDER_KEY = null; - @Value("${contract.nice.dici.socket.site-code}") - private final String NICE_CD_SITE_CODE = "EQ00"; - @Value("${contract.nice.dici.socket.site-pw}") - private String NICE_CD_SITE_PW = "76646885"; - private String NV_ST_X_NAVER_CLIENT_ID = null; - private String NV_ST_X_NAVER_CLIENT_SECRET = null; - - @Autowired - private NhtTmplatManageRepository nhtTmplatManageRepository; - - @Override - public void run(ApplicationArguments args) throws Exception { - List orgMngResult = createOrgMngDTO().stream().map(dto -> orgMngService.add(dto)).collect(Collectors.toList()); - List tmpltMngResult = createTmpltMngDTO().stream().map(map -> tmpltMngService.add(map, (String) map.get("dtype"))).collect(Collectors.toList()); - System.out.println("============================================================================================================"); - System.out.println("======== Initailize Information [OrgMng & TmpltMng] :: active profiles - " + System.getProperty("spring.profiles.active") + " ========"); - System.out.println(orgMngResult.toString()); - System.out.println(tmpltMngResult.toString()); - System.out.println("============================================================================================================"); - - } - - - private List createOrgMngDTO() { - List list = nhtTmplatManageRepository.findAll() - .stream() - .map(data -> createOrgMngDTO(data.getSignguCode(), "주정차웹CC-" + data.getSignguCode())) - .collect(Collectors.toList()); - return list; - } - - - private List> createTmpltMngDTO() { - List> list = nhtTmplatManageRepository.findAll() - .stream() - .map(data -> createTmpltMngKkoMydoc(data.getSignguCode(), data.getNhtTmplatId(), data.getNhtSj(), data.getNhtCn(), "Y", data.getCstmrCnterTlphonNo(), data.getCstmrCnterNm(), "Y", "Y", "Y")) - .collect(Collectors.toList()); - return list; - } - - final private OrgMngDTO createOrgMngDTO(String orgCd, String orgNm) { - return OrgMngDTO.builder() - .orgCd(orgCd) - .orgNm(orgNm) - .kkoMdAccessToken(KKO_MD_ACCESS_TOKEN) - .kkoMdContractUuid(KKO_MD_CONTRACT_UUID) - .kkoBpBillerCode(KKO_BP_BILLER_CODE) - .kkoBpAuthorization(KKO_BP_AUTHORIZATION) - .kkoBpCsignYn("N") - .kkoBpPrepayApi(null) - .kkoBpPayResultApi(null) - .kkoAtBsid(KKO_AT_BSID) - .kkoAtPasswd(KKO_AT_PASSWD) - .kkoAtSenderKey(KKO_AT_SENDER_KEY) - .niceCdSiteCode(NICE_CD_SITE_CODE) - .niceCdSitePw(NICE_CD_SITE_PW) - .nvStXNaverClientId(NV_ST_X_NAVER_CLIENT_ID) - .nvStXNaverClientSecret(NV_ST_X_NAVER_CLIENT_SECRET) - .nvStOrgId(null) - .build(); - } - - final private Map createTmpltMngKkoMydoc(String orgCd, String tmpltCd, String title, String message, String useYn, String csNumber, String csName, String ciTransUseYn, String tmpltMsgUseYn, String tmpltCsInfoUseYn) { - return mapper.convertValue(TmpltMngKkoMydocDTO.builder() - .dtype("kkomd") - .orgCd(orgCd) - .tmpltCd(tmpltCd) - .title(title) - .message(message) - .useYn(useYn == null ? "Y" : useYn) - .csNumber(csNumber) - .csName(csName) - .ciTransUseYn(ciTransUseYn) - .tmpltMsgUseYn(tmpltMsgUseYn) - .tmpltCsInfoUseYn(tmpltCsInfoUseYn) - .build(), Map.class); - } - - -} \ No newline at end of file diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/ElctrnNticSndng.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/ElctrnNticSndng.java deleted file mode 100644 index 697161e..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/ElctrnNticSndng.java +++ /dev/null @@ -1,73 +0,0 @@ -package cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain; - -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.embeded.FieldCreate; -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.embeded.FieldUpdate; -import lombok.*; -import org.springframework.context.annotation.Profile; - -import javax.persistence.*; - -/** - *
    - *
  • 업무 그룹명: 전자고지발송 테이블
  • - *
  • 설 명:
  • - *
  • 작성일: 2021. 12. 22. 오후 5:44:32 - *
- * - * @author 박민규 - */ -@Getter -@ToString -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Entity -@Table(name = "tb_elctrn_ntic_sndng") -@Profile("prod-traffic") -public class ElctrnNticSndng { - - - @Id - @Column(name = "elctrn_ntic_sndng_id", length = 20) - private String elctrnNticSndngId; - - @Column(name = "signgu_code", length = 5) - private String signguCode; - - @OneToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "nht_tmplat_id") - private NhtTmplatManage nhtTmplatManage; - - @Column(name = "sndng_ty_code", length = 5) - private String sndngTyCode; - - @Column(name = "sndng_co", length = 10) - private Integer sndngCo; - - @Column(name = "sndng_process_sttus", length = 2) - @Setter - private String sndngProcessSttus; - - @Column(name = "sndng_dt", length = 14) - private String sndngDt; - - @Column(name = "clos_dt", length = 14) - private String closDt; - - @Embedded - private FieldCreate create; - - @Embedded - @Setter - private FieldUpdate update; - - @Column(name = "error_cn", length = 1000) - @Setter - private String errorCn; - @Lob - @Setter - @Column(name = "error_dtls") - private String errorDtls; - - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/ElctrnNticSndngDetail.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/ElctrnNticSndngDetail.java deleted file mode 100644 index 1be1d57..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/ElctrnNticSndngDetail.java +++ /dev/null @@ -1,68 +0,0 @@ -package cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain; - -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.embeded.FieldCreate; -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.embeded.FieldUpdate; -import lombok.*; -import org.hibernate.annotations.DynamicUpdate; -import org.springframework.context.annotation.Profile; - -import javax.persistence.*; - -/** - *
    - *
  • 업무 그룹명: 전자고지발송상세 테이블
  • - *
  • 설 명:
  • - *
  • 작성일: 2021. 12. 22. 오후 5:45:01 - *
- * - * @author mk1126sj - */ -@Getter -@ToString -@Builder -@DynamicUpdate -@NoArgsConstructor -@AllArgsConstructor -@Entity -@Table(name = "tb_elctrn_ntic_sndng_detail", schema = "", catalog = "", indexes = { - @Index(name = "idx_tcc_ens_detail_01", columnList = "external_document_uuid") -}) -@Profile("prod-traffic") -public class ElctrnNticSndngDetail { - - - @Id - @Column(name = "elctrn_ntic_sndng_detail_id", length = 20) - private String elctrnNticSndngDetailId; - - @ManyToOne(fetch = FetchType.LAZY) - @JoinColumn(name = "elctrn_ntic_sndng_id") - private ElctrnNticSndng elctrnNticSndng; - - @Column(name = "signgu_code", length = 5, columnDefinition = "char") - private String signguCode; - - @Column(name = "main_code", length = 20) - private String mainCode; - - @Column(name = "ihidnum", length = 100, updatable = false) - private String ihidnum; - - @Lob - @Column(name = "cn_detail") - private String cnDetail; - - @Lob - @Column(name = "mobile_page_cn") - private String mobilePageCn; - - @Embedded - private FieldCreate create; - - @Embedded - private FieldUpdate update; - - @Column(name = "external_document_uuid", length = 40) - @Setter - private String externalDocumentUuid; -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/ElctrnNticSndngResult.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/ElctrnNticSndngResult.java deleted file mode 100644 index b3cabe4..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/ElctrnNticSndngResult.java +++ /dev/null @@ -1,52 +0,0 @@ -package cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain; - -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.embeded.FieldCreate; -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import org.hibernate.annotations.UpdateTimestamp; -import org.springframework.context.annotation.Profile; - -import javax.persistence.*; -import java.time.LocalDateTime; - -/** - *
    - *
  • 업무 그룹명: 전자고지발송결과 테이블
  • - *
  • 설 명:
  • - *
  • 작성일: 2021. 12. 22. 오후 5:45:14 - *
- * - * @author mk1126sj - */ -@Getter -@ToString -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Entity -@Table(name = "tb_elctrn_ntic_sndng_result") -@Profile("prod-traffic") -public class ElctrnNticSndngResult { - - - @Id - @Column(name = "elctrn_ntic_sndng_detail_id", length = 20) - private String elctrnNticSndngDetailId; - @Column(name = "sndng_result_code", length = 4) - private String sndngResultCode; - @Column(name = "requst_dt", length = 14) - private String requstDt; - @Column(name = "inqire_dt", length = 14) - private String inqireDt; - @Column(name = "readng_dt", length = 14) - private String readngDt; - @Column(name = "error_cn", length = 1000) - private String errorCn; - @Embedded - private FieldCreate create; - - - @UpdateTimestamp - @Column(name = "last_updt_dt", nullable = true) - private LocalDateTime lastUpdtDt; -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/NhtTmplatManage.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/NhtTmplatManage.java deleted file mode 100644 index bb41cf5..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/NhtTmplatManage.java +++ /dev/null @@ -1,68 +0,0 @@ -package cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain; - -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.embeded.FieldCreate; -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.embeded.FieldUpdate; -import lombok.*; -import org.springframework.context.annotation.Profile; - -import javax.persistence.*; - -/** - *
    - *
  • 업무 그룹명: 고지서템플릿관리 테이블
  • - *
  • 설 명:
  • - *
  • 작성일: 2021. 12. 22. 오후 5:44:32 - *
- * - * @author 박민규 - */ -@Getter -@ToString -@Builder -@NoArgsConstructor -@AllArgsConstructor -@Entity -@Table(name = "tb_nht_tmplat_manage") -@Profile("prod-traffic") -public class NhtTmplatManage { - - - @Id - @Column(name = "nht_tmplat_id", length = 5) - private String nhtTmplatId; - - @Column(name = "signgu_code", columnDefinition = "char(5)") - private String signguCode; - - @Column(name = "sndng_ty_code", length = 1) - private String sndngTyCode; - - @Column(name = "nht_nm", length = 1000) - private String nhtNm; - - @Column(name = "nht_sj", length = 1000) - private String nhtSj; - - @Column(name = "nhtCn", length = 4000) - private String nhtCn; - - @Column(name = "cstmr_cnter_nm", length = 100) - private String cstmrCnterNm; - - @Column(name = "cstmr_cnter_tlphon_no", length = 14) - private String cstmrCnterTlphonNo; - - @Column(name = "redirect_url", length = 255) - private String redirectUrl; - - @Column(name = "use_at", length = 1) - private String useAt; - - @Embedded - private FieldCreate create; - - @Embedded - private FieldUpdate update; - - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/embeded/FieldCreate.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/embeded/FieldCreate.java deleted file mode 100644 index 4562563..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/embeded/FieldCreate.java +++ /dev/null @@ -1,35 +0,0 @@ -package cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.embeded; - -import lombok.*; - -import javax.persistence.Column; -import javax.persistence.Embeddable; -import javax.persistence.PrePersist; -import java.time.LocalDateTime; - - -@Embeddable -@Getter -@RequiredArgsConstructor -public class FieldCreate { - -// @CreationTimestamp -// @Temporal(TemporalType.TIMESTAMP) - @Column(name = "regist_dt") - private LocalDateTime registDt; - @Column(name = "register", length = 50) - private String register; - - - @PrePersist - public void preUpdate() { - this.registDt = LocalDateTime.now(); - } - - - @Builder(builderMethodName = "builder") - public FieldCreate(String register, LocalDateTime registDt) { - this.register = register; - this.registDt = registDt; - } -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/embeded/FieldUpdate.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/embeded/FieldUpdate.java deleted file mode 100644 index 57a1078..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/embeded/FieldUpdate.java +++ /dev/null @@ -1,34 +0,0 @@ -package cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.embeded; - -import lombok.Builder; -import lombok.Getter; -import lombok.RequiredArgsConstructor; - -import javax.persistence.Column; -import javax.persistence.Embeddable; -import javax.persistence.PreUpdate; -import java.time.LocalDateTime; - -@Embeddable -@Getter -@RequiredArgsConstructor -public class FieldUpdate { - -// @UpdateTimestamp -// @Temporal(TemporalType.TIMESTAMP) - @Column(name = "updt_dt") - private LocalDateTime updtDt; - @Column(name = "updusr", length = 50) - private String updusr; - - @PreUpdate - public void preUpdate() { - this.updtDt = LocalDateTime.now(); - } - - @Builder(builderMethodName = "builder") - public FieldUpdate(String updusr, LocalDateTime updtDt) { - this.updusr = updusr; - this.updtDt = updtDt; - } -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngDetailRepository.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngDetailRepository.java deleted file mode 100644 index 9362b08..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngDetailRepository.java +++ /dev/null @@ -1,12 +0,0 @@ -package cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.repository; - -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.ElctrnNticSndngDetail; -import org.springframework.data.jpa.repository.JpaRepository; - -import java.util.Optional; - -public interface ElctrnNticSndngDetailRepository extends JpaRepository, ElctrnNticSndngDetailRepositoryCustom { - - Optional findByExternalDocumentUuid(String externalDocumentUuid); - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngDetailRepositoryCustom.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngDetailRepositoryCustom.java deleted file mode 100644 index df814f8..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngDetailRepositoryCustom.java +++ /dev/null @@ -1,20 +0,0 @@ -package cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.repository; - -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.ElctrnNticSndng; -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.ElctrnNticSndngDetail; - -import java.util.List; -import java.util.Optional; - -public interface ElctrnNticSndngDetailRepositoryCustom { - - - List findAllDecByElctrnNticSndng(ElctrnNticSndng elctrnNticSndng); - - - List findAllFetchByElctrnNticSndngId(String elctrnNticSndngId); - - Optional findLastSendMastIdByElctrnNticSndngId(String elctrnNticSndngId); - - String findIhidnumDecByElctrnNticSndngDetailId(String elctrnNticSndngDetailId); -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngDetailRepositoryImpl.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngDetailRepositoryImpl.java deleted file mode 100644 index 33c70c1..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngDetailRepositoryImpl.java +++ /dev/null @@ -1,83 +0,0 @@ -package cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.repository; - -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.ElctrnNticSndng; -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.ElctrnNticSndngDetail; -import com.querydsl.core.types.Projections; -import com.querydsl.core.types.dsl.Expressions; -import com.querydsl.jpa.impl.JPAQueryFactory; -import lombok.RequiredArgsConstructor; - -import java.util.List; -import java.util.Optional; - -import static cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.QElctrnNticSndng.elctrnNticSndng; -import static cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.QElctrnNticSndngDetail.elctrnNticSndngDetail; -import static cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.QNhtTmplatManage.nhtTmplatManage; -import static cokr.xit.ens.modules.kkomydoc.domain.QSendDetailKkoMydoc.sendDetailKkoMydoc; - -@RequiredArgsConstructor -public class ElctrnNticSndngDetailRepositoryImpl implements ElctrnNticSndngDetailRepositoryCustom { - - private final JPAQueryFactory query; - - @Override - public List findAllDecByElctrnNticSndng(ElctrnNticSndng elctrnNticSndng) { - - return query.select(Projections.fields(ElctrnNticSndngDetail.class - , elctrnNticSndngDetail.elctrnNticSndngDetailId - , elctrnNticSndngDetail.elctrnNticSndng - , elctrnNticSndngDetail.signguCode - , elctrnNticSndngDetail.mainCode - , Expressions.stringTemplate("ECL_DECRYPT({0})", elctrnNticSndngDetail.ihidnum).as("ihidnum") - , elctrnNticSndngDetail.cnDetail - , elctrnNticSndngDetail.mobilePageCn - , elctrnNticSndngDetail.create - , elctrnNticSndngDetail.update - , elctrnNticSndngDetail.externalDocumentUuid)) - .from(elctrnNticSndngDetail) - .where(elctrnNticSndngDetail.elctrnNticSndng.eq(elctrnNticSndng)) - .fetch(); - } - - - @Override - public List findAllFetchByElctrnNticSndngId(String elctrnNticSndngId) { - return query.selectFrom(elctrnNticSndngDetail) - .innerJoin(elctrnNticSndngDetail.elctrnNticSndng, elctrnNticSndng) - .fetchJoin() - .innerJoin(elctrnNticSndng.nhtTmplatManage, nhtTmplatManage) - .fetchJoin() - .where(elctrnNticSndngDetail.elctrnNticSndng.elctrnNticSndngId.eq(elctrnNticSndngId)) - .fetch(); - - } - - - @Override - public Optional findLastSendMastIdByElctrnNticSndngId(String elctrnNticSndngId) { - return Optional.ofNullable(query.select(sendDetailKkoMydoc.sendMast.sendMastId) - .from(sendDetailKkoMydoc) -// .where(sendDetailKkoMydoc.propExternalDocumentUuid.in(findExternalDocumentUuidsByLnkInputId(elctrnNticSndngId))) - .innerJoin(elctrnNticSndngDetail).on(sendDetailKkoMydoc.propExternalDocumentUuid.eq(elctrnNticSndngDetail.externalDocumentUuid)) - .where(elctrnNticSndngDetail.elctrnNticSndng.elctrnNticSndngId.eq(elctrnNticSndngId)) - .groupBy(sendDetailKkoMydoc.sendMast.sendMastId) - .orderBy(sendDetailKkoMydoc.sendMast.sendMastId.desc()) - .fetchFirst()); - } - - private List findExternalDocumentUuidsByLnkInputId(String elctrnNticSndngId) { - return query.select(elctrnNticSndngDetail.externalDocumentUuid) - .from(elctrnNticSndngDetail) - .where(elctrnNticSndngDetail.elctrnNticSndng.elctrnNticSndngId.eq(elctrnNticSndngId)) - .fetch(); - } - - - @Override - public String findIhidnumDecByElctrnNticSndngDetailId(String elctrnNticSndngDetailId) { - return query.select(Expressions.stringTemplate("ECL_DECRYPT({0})", elctrnNticSndngDetail.ihidnum).as("ihidnum")) - .from(elctrnNticSndngDetail) - .where(elctrnNticSndngDetail.elctrnNticSndngDetailId.eq(elctrnNticSndngDetailId)) - .fetchOne(); - } -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngRepository.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngRepository.java deleted file mode 100644 index 252728b..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngRepository.java +++ /dev/null @@ -1,15 +0,0 @@ -package cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.repository; - -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.ElctrnNticSndng; -import org.springframework.data.jpa.repository.JpaRepository; - -import java.util.List; - -public interface ElctrnNticSndngRepository extends JpaRepository { - - - List findAllBySndngProcessSttus(String sndngProcessSttus); - - List findAllBySndngProcessSttusIn(List sndngProcessSttuss); - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngResultRepository.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngResultRepository.java deleted file mode 100644 index 6e14c2d..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngResultRepository.java +++ /dev/null @@ -1,8 +0,0 @@ -package cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.repository; - -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.ElctrnNticSndngResult; -import org.springframework.data.jpa.repository.JpaRepository; - -public interface ElctrnNticSndngResultRepository extends JpaRepository, ElctrnNticSndngResultRepositoryCustom { - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngResultRepositoryCustom.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngResultRepositoryCustom.java deleted file mode 100644 index 3069fab..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngResultRepositoryCustom.java +++ /dev/null @@ -1,13 +0,0 @@ -package cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.repository; - -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.ElctrnNticSndngResult; - -import java.util.List; - -public interface ElctrnNticSndngResultRepositoryCustom { - - - - - void modifyByElctrnNticSndngResults(List elctrnNticSndngResults); -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngResultRepositoryImpl.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngResultRepositoryImpl.java deleted file mode 100644 index 2631832..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/ElctrnNticSndngResultRepositoryImpl.java +++ /dev/null @@ -1,34 +0,0 @@ -package cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.repository; - -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.ElctrnNticSndngResult; -import com.querydsl.jpa.impl.JPAQueryFactory; -import lombok.RequiredArgsConstructor; - -import java.time.LocalDateTime; -import java.util.List; - -import static cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.QElctrnNticSndngResult.elctrnNticSndngResult; - -@RequiredArgsConstructor -public class ElctrnNticSndngResultRepositoryImpl implements ElctrnNticSndngResultRepositoryCustom { - - private final JPAQueryFactory query; - - @Override - public void modifyByElctrnNticSndngResults(List elctrnNticSndngResults) { - elctrnNticSndngResults.forEach(data -> - query.update(elctrnNticSndngResult) - .set(elctrnNticSndngResult.sndngResultCode, data.getSndngResultCode()) - .set(elctrnNticSndngResult.requstDt, data.getRequstDt()) - .set(elctrnNticSndngResult.inqireDt, data.getInqireDt()) - .set(elctrnNticSndngResult.readngDt, data.getReadngDt()) - .set(elctrnNticSndngResult.errorCn, data.getErrorCn()) -// .set(elctrnNticSndngResult.create, FieldCreate.builder().build()) - .set(elctrnNticSndngResult.lastUpdtDt, LocalDateTime.now()) - .where(elctrnNticSndngResult.elctrnNticSndngDetailId.eq(data.getElctrnNticSndngDetailId())) - .execute() - ); - } - - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/NhtTmplatManageRepository.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/NhtTmplatManageRepository.java deleted file mode 100644 index 20c9cce..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/domain/repository/NhtTmplatManageRepository.java +++ /dev/null @@ -1,9 +0,0 @@ -package cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.repository; - -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.NhtTmplatManage; -import org.springframework.data.jpa.repository.JpaRepository; - - -public interface NhtTmplatManageRepository extends JpaRepository { - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v1/mq/UserElctrnNticProducer.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v1/mq/UserElctrnNticProducer.java deleted file mode 100644 index 43d38bc..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v1/mq/UserElctrnNticProducer.java +++ /dev/null @@ -1,32 +0,0 @@ -//package cokr.xit.ens.biz.traffic.chuncheon.mydoc.v1.mq; -// -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.kafka.core.KafkaTemplate; -//import org.springframework.stereotype.Component; -// -//import lombok.extern.slf4j.Slf4j; -// -//@Slf4j -//@Component -//public class UserElctrnNticProducer { -// -// @Autowired -// private KafkaTemplate kafkaTemplate; -// -// -// public void pubBulkSend(String message) { -// final String topicName = "kkomydoc-send-bulk"; -// -// log.info(String.format("[%s] pub message : %s", topicName, message)); -// -// this.kafkaTemplate.send(topicName, message); -// } -// -// public void pubBulkStatus(String message) { -// final String topicName = "kkomydoc-status-bulk"; -// -// log.info(String.format("[%s] pub message : %s", topicName, message)); -// -// this.kafkaTemplate.send(topicName, message); -// } -//} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v1/sched/TrafficKkoMydocScheduler.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v1/sched/TrafficKkoMydocScheduler.java deleted file mode 100644 index 75e8917..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v1/sched/TrafficKkoMydocScheduler.java +++ /dev/null @@ -1,55 +0,0 @@ -//package cokr.xit.ens.biz.traffic.chuncheon.mydoc.v1.sched; -// -//import cokr.xit.ens.biz.traffic.chuncheon.mydoc.v1.service.UserElctrnNticService; -//import lombok.extern.slf4j.Slf4j; -//import org.springframework.context.annotation.Profile; -//import org.springframework.scheduling.annotation.Scheduled; -//import org.springframework.stereotype.Component; -// -//import javax.annotation.Resource; -// -//@Slf4j -//@Component -////@Profile("!local") -//@Profile("prod-traffic") -//public class TrafficKkoMydocScheduler { -// -// @Resource -// private UserElctrnNticService service; -// -// /** -// * 인증톡 전송요청 -// */ -// @Scheduled(cron = "0 */1 * * * *") -// public void runSend() { -// log.info("[Schduler]KkoMydoc \"send\" run..."); -// service.send(); -// } -// -// /** -// * 인증톡 전송결과 갱신 -// */ -// @Scheduled(cron = "0 */3 * * * *") -// public void runResult() { -// log.info("[Schduler]KkoMydoc \"result\" run..."); -// service.result(); -// } -// -// /** -// * 인증톡 상태 갱신 -// */ -// @Scheduled(cron = "0 0 */1 * * *") -// public void runStatus() { -// log.info("[Schduler]KkoMydoc \"status\" run..."); -// service.status(); -// } -// -// /** -// * 인증톡 상태 가져오기 -// */ -// @Scheduled(cron = "0 */30 * * * *") -// public void runFetchStatus() { -// log.info("[Schduler]KkoMydoc \"fetchStatus\" run..."); -// service.fetchStatus(); -// } -//} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v1/service/UserElctrnNticService.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v1/service/UserElctrnNticService.java deleted file mode 100644 index b219f01..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v1/service/UserElctrnNticService.java +++ /dev/null @@ -1,296 +0,0 @@ -//package cokr.xit.ens.biz.traffic.chuncheon.mydoc.v1.service; -// -//import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.ElctrnNticSndng; -//import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.ElctrnNticSndngDetail; -//import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.ElctrnNticSndngResult; -//import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.repository.ElctrnNticSndngDetailRepository; -//import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.repository.ElctrnNticSndngRepository; -//import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.repository.ElctrnNticSndngResultRepository; -//import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.repository.NhtTmplatManageRepository; -//import cokr.xit.ens.biz.traffic.chuncheon.mydoc.v1.mq.UserElctrnNticProducer; -//import cokr.xit.ens.core.aop.EnsResponseVO; -//import cokr.xit.ens.core.exception.EnsException; -//import cokr.xit.ens.core.exception.code.EnsErrCd; -//import cokr.xit.ens.core.utils.CmmnUtil; -//import cokr.xit.ens.core.utils.crypto.SHA256; -//import cokr.xit.ens.modules.kkomydoc.v1.domain.repository.SendDetailKkoMydocRepository; -//import cokr.xit.ens.modules.kkomydoc.v1.model.BulkSendReqDTO; -//import cokr.xit.ens.modules.kkomydoc.v1.model.child.Document; -//import cokr.xit.ens.modules.kkomydoc.v1.model.child.NotiDocument; -//import cokr.xit.ens.modules.kkomydoc.v1.model.child.Property; -//import cokr.xit.ens.modules.kkomydoc.v1.model.child.Receiver; -//import cokr.xit.ens.modules.nicedici.service.NiceDiCiService; -//import com.fasterxml.jackson.databind.ObjectMapper; -//import lombok.RequiredArgsConstructor; -//import lombok.extern.slf4j.Slf4j; -//import net.bytebuddy.utility.RandomString; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.beans.factory.annotation.Value; -//import org.springframework.stereotype.Service; -//import org.springframework.transaction.annotation.Transactional; -//import org.springframework.util.StringUtils; -// -//import java.text.SimpleDateFormat; -//import java.util.*; -// -//@Slf4j -//@Service -//@RequiredArgsConstructor -//public class UserElctrnNticService { -// private final ElctrnNticSndngRepository elctrnNticSndngRepository; -// private final ElctrnNticSndngDetailRepository elctrnNticSndngDetailRepository; -// private final ElctrnNticSndngResultRepository elctrnNticSndngResultRepository; -// private final NhtTmplatManageRepository nhtTmplatManageRepository; -// private final SendDetailKkoMydocRepository sendDetailKkoMydocRepository; -// private final NiceDiCiService nicedDiCiService; -// -// -// @Autowired -// private UserElctrnNticProducer userElctrnNticProducer; -// -// @Value("${contract.nice.dici.socket.site-code}") -// private String SITE_CODE; -// @Value("${contract.nice.dici.socket.site-pw}") -// private String SITE_PW; -// @Value("${contract.kakao.pay.mydoc.access-token}") -// private String ACCESS_TOKEN; -// @Value("${contract.kakao.pay.mydoc.contract-uuid}") -// private String CONTRACT_UUID; -// -// -// /** -// * 발송 -// */ -// @Transactional -// public void send() { -// -// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmm"); -// String yyyyMMddHHmm = dateFormat.format(new Date()); -// String beginSndngDt = String.format("%s00", yyyyMMddHHmm); -// String endSndngDt = String.format("%s59", yyyyMMddHHmm); -// this.send(beginSndngDt, endSndngDt); -// } -// /** -// * 발송 -// */ -// @Transactional -// public void send(String beginSndngDt, String endSndngDt) { -// -// List list = elctrnNticSndngRepository.findAllBySndngProcessSttusAndSndngDtBetween("01", beginSndngDt, endSndngDt); -// for(ElctrnNticSndng row : list) { -// List detailList = elctrnNticSndngDetailRepository.findAllDecByElctrnNticSndng(row); -// -// List jsonStrList = new ArrayList<>(); -// try { -// jsonStrList = makeMessage(row, detailList); -// } catch (Exception e) { -// row.setSndngProcessSttus("99"); -// row.setErrorCn(e.getMessage()); -// elctrnNticSndngRepository.save(row); -// continue; -// } -// -// for(String jsonStr : jsonStrList) { -// Map m = new HashMap<>(); -// m.put("accessToken", ACCESS_TOKEN); -// m.put("contractUuid", CONTRACT_UUID); -// m.put("jsonStr", jsonStr); -// userElctrnNticProducer.pubBulkSend(CmmnUtil.toJsonString(m)); -// } -// -// -// elctrnNticSndngDetailRepository.saveAll(detailList); -// } -// -// -// } -// -// -// /** -// * 메시지포맷 작성 -// */ -// @SuppressWarnings("deprecation") -// private List makeMessage(ElctrnNticSndng sndng, List sndngDetails) throws EnsException { -// List jsonStrList = new ArrayList<>(); -// -// List documents = new ArrayList<>(); -// List notidocuments = new ArrayList<>(); -// SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmssSSS"); -// String prefixExternalDocumentUuid = String.format("B-%s%s", simpleDateFormat.format(new Date()), RandomString.make(5)); -// int seq = 0; -// for(ElctrnNticSndngDetail row : sndngDetails) { -// -// String siteCode = SITE_CODE; -// String sitePw = SITE_PW; -// String payload = row.getMainCode(); -// String hash = null; -// try { -// if(StringUtils.isEmpty(row.getCnDetail())) -// hash = SHA256.encrypt(row.getMainCode()); -// else -// hash = SHA256.encrypt(row.getCnDetail()); -//// } catch (NoSuchAlgorithmException e) { -// } catch (Exception e) { -// log.error(String.format("Hash 값 생성에 실패 하였습니다. [%s]. ", row.getCnDetail()), e); -// } -// -// EnsResponseVO ensResponseVO = nicedDiCiService.ci(siteCode, sitePw, row.getIhidnum()); -// String ci = ((Map)ensResponseVO.getResultInfo()).get("ci"); -// Document document = new Document(); -// document.setTitle(sndng.getNhtTmplatManage().getNhtSj()); -// document.setCommon_categories(new String[] {"NOTICE"}); -// document.setHash(hash); -// Receiver receiver = new Receiver(); -// if(ci==null) { -// receiver.setPhone_number(null); -// receiver.setName(null); -// receiver.setBirthday(null); -// receiver.setIs_required_verify_name(true); -// }else { -// receiver.setCi(ci); -// } -// document.setReceiver(receiver); -// Property property = new Property(); -// String externalDocumentUuid = String.format("%s%09d", prefixExternalDocumentUuid, ++seq); -// row.setLinkedUuid(externalDocumentUuid); -// property.setLink(sndng.getNhtTmplatManage().getRedirectUrl()); -// property.setPayload(payload); -// property.setMessage(sndng.getNhtTmplatManage().getNhtCn()); -// property.setCs_number(sndng.getNhtTmplatManage().getCstmrCnterTlphonNo()); -// property.setCs_name(StringUtils.isEmpty(sndng.getNhtTmplatManage().getCstmrCnterNm())?"문의처":sndng.getNhtTmplatManage().getCstmrCnterNm()); -// property.setExternal_document_uuid(externalDocumentUuid); -// document.setProperty(property); -// documents.add(document); -// -// -// -// if(!StringUtils.isEmpty(row.getElctrnNticSndng())) { -// if(!StringUtils.isEmpty(row.getMobilePageCn())) -// try { -// -//// NotiDocument notiDocument = (NotiDocument) CmmnUtil.jsonStringtoObj(NotiDocument.class, row.getMobilePageCn()); -// ObjectMapper mapper = new ObjectMapper(); -// NotiDocument notiDocument = mapper.readValue(row.getMobilePageCn(), NotiDocument.class); -// notiDocument.setPayload``(payload); -// notidocuments.add(notiDocument); -// } catch (Exception e) { -// // log.error(String.format("고지정보 변환에 실패 했습니다. [%s]", row.getMobilePageCn()), e); -// throw new EnsException(EnsErrCd.ERR405, String.format("고지정보 변환에 실패 했습니다. [%s]. %s", row.getMobilePageCn(), e.getMessage())); -// } -// } -// -// -// -// if(documents.size()==100) { -// BulkSendReqDTO bulkSendReqDTO = new BulkSendReqDTO(); -// bulkSendReqDTO.setDocuments(documents); -// bulkSendReqDTO.setNotidocuments(notidocuments); -// jsonStrList.add(CmmnUtil.toJsonString(bulkSendReqDTO)); -// documents = new ArrayList<>(); -// notidocuments = new ArrayList<>(); -// } -// -// } -// -// -// -// BulkSendReqDTO bulkSendReqDTO = new BulkSendReqDTO(); -// bulkSendReqDTO.setDocuments(documents); -// bulkSendReqDTO.setNotidocuments(notidocuments); -// jsonStrList.add(CmmnUtil.toJsonString(bulkSendReqDTO)); -// -// -// -// return jsonStrList; -// } -// -// -// -// /** -// * 발송결과 업데이트 -// */ -// @Transactional -// public void result() { -// -// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmm"); -// Calendar cal = Calendar.getInstance(); -// Date date = new Date(); -// cal.setTime(date); -// cal.add(Calendar.MINUTE, -3); -// String beginSndngDt = String.format("%s00", dateFormat.format(cal.getTime())); -// cal.setTime(date); -// cal.add(Calendar.MINUTE, -1); -// String endSndngDt = String.format("%s59", dateFormat.format(new Date())); -// -// this.result(beginSndngDt, endSndngDt); -// } -// /** -// * 발송결과 업데이트 -// */ -// @SuppressWarnings("deprecation") -// @Transactional -// public void result(String beginSndngDt, String endSndngDt) { -// List list = elctrnNticSndngRepository.findAllBySndngProcessSttusAndSndngDtBetween("01", beginSndngDt, endSndngDt); -// -// -// for(ElctrnNticSndng row : list) { -// List sndngResultList = elctrnNticSndngResultRepository.findAllByElctrnNticSndngId(row.getElctrnNticSndngId()); -// elctrnNticSndngResultRepository.saveAll(sndngResultList); -// row.setSndngProcessSttus("99"); -// for(ElctrnNticSndngResult sndngResult : sndngResultList) { -// if(StringUtils.isEmpty(sndngResult.getErrorCn())) { -// row.setSndngProcessSttus("02"); -// break; -// } -// } -// elctrnNticSndngRepository.save(row); -// -// } -// -// } -// -// /** -// * -// * 메소드 설명: 상태변경 -// * @author: mk1126sj -// * @date: 2021. 12. 29. -// */ -// @Transactional -// public void status() { -// -// List list = elctrnNticSndngRepository.findAllBySndngProcessSttus("02"); -// -// for(ElctrnNticSndng row : list) { -// List externalDocumentUuidList = elctrnNticSndngDetailRepository.findExternalDocumentUuidByElctrnNticSndng(row); -// -// Map m = new HashMap<>(); -// m.put("accessToken", ACCESS_TOKEN); -// m.put("contractUuid", CONTRACT_UUID); -// m.put("externalDocumentUuidList", externalDocumentUuidList); -// userElctrnNticProducer.pubBulkStatus(CmmnUtil.toJsonString(m)); -// } -// -// } -// -// -// /** -// * -// * 메소드 설명: 발송마스터 및 발송상세 상태정보 fetch -// * void 요청처리 후 응답객체 -// * @author: mk1126sj -// * @date: 2021. 12. 29. -// */ -// public void fetchStatus() { -// -// List list = elctrnNticSndngRepository.findAllBySndngProcessSttus("02"); -// -// for(ElctrnNticSndng row : list) { -// elctrnNticSndngResultRepository.saveFetchStatus(row); -// } -// -// } -// -// -// -// -//} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/model/TrafficCcMydocReqDTO.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/model/TrafficCcMydocReqDTO.java deleted file mode 100644 index b42ce0f..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/model/TrafficCcMydocReqDTO.java +++ /dev/null @@ -1,12 +0,0 @@ -package cokr.xit.ens.biz.traffic.chuncheon.mydoc.v2.model; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.Getter; - -@Getter -@Schema(name = "TrafficCcMydocReqDTO") -public class TrafficCcMydocReqDTO { - - @Schema(required = true, title = "전자 고지 발송 Id", example = " ") - private String elctrnNticSndngId; -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/presentation/TrafficCcMydocController.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/presentation/TrafficCcMydocController.java deleted file mode 100644 index c6b79d2..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/presentation/TrafficCcMydocController.java +++ /dev/null @@ -1,53 +0,0 @@ -package cokr.xit.ens.biz.traffic.chuncheon.mydoc.v2.presentation; - -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.v2.model.TrafficCcMydocReqDTO; -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.v2.service.TrafficCcMydocService; -import cokr.xit.ens.core.aop.EnsResponseVO; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.tags.Tag; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; - -@Tag(name = "TrafficCcSigntalkController") -@Slf4j -@Controller -@RequiredArgsConstructor -public class TrafficCcMydocController { - - private final TrafficCcMydocService trafficCcMydocService; - - @Operation(summary = "접수") - @PostMapping(value = "/traffic/cc/mydoc/accept", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity accept(@RequestBody TrafficCcMydocReqDTO reqDTO){ - EnsResponseVO responseVO = trafficCcMydocService.accept(reqDTO.getElctrnNticSndngId()); - return new ResponseEntity(responseVO, HttpStatus.OK); - } - - @Operation(summary = "제작") - @PutMapping(value = "/traffic/cc/mydoc/re/make", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity reMake(@RequestBody TrafficCcMydocReqDTO reqDTO){ - EnsResponseVO responseVO = trafficCcMydocService.reMake(reqDTO.getElctrnNticSndngId()); - return new ResponseEntity(responseVO, HttpStatus.OK); - } - - @Operation(summary = "전송") - @PutMapping(value = "/traffic/cc/mydoc/re/send", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity reSend(@RequestBody TrafficCcMydocReqDTO reqDTO){ - EnsResponseVO responseVO = trafficCcMydocService.reSend(reqDTO.getElctrnNticSndngId()); - return new ResponseEntity(responseVO, HttpStatus.OK); - } - - @Operation(summary = "전송결과가져오기") - @PostMapping(value = "/traffic/cc/mydoc/fetch", produces = MediaType.APPLICATION_JSON_VALUE) - public ResponseEntity fetch(@RequestBody TrafficCcMydocReqDTO reqDTO){ - EnsResponseVO responseVO = trafficCcMydocService.fetch(reqDTO.getElctrnNticSndngId()); - return new ResponseEntity(responseVO, HttpStatus.OK); - } -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/sched/TrafficCcMydocScheduler.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/sched/TrafficCcMydocScheduler.java deleted file mode 100644 index c6575bc..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/sched/TrafficCcMydocScheduler.java +++ /dev/null @@ -1,46 +0,0 @@ -package cokr.xit.ens.biz.traffic.chuncheon.mydoc.v2.sched; - -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.v2.service.TrafficCcMydocService; -import cokr.xit.ens.core.aop.EnsResponseVO; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.context.annotation.Profile; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -@Slf4j -@Component -@Profile("prod-traffic") -@RequiredArgsConstructor -public class TrafficCcMydocScheduler { - - private final TrafficCcMydocService trafficCcMydocService; - - /** - * 인증톡 접수 - * -. 인증톡 전송을 위해 TRAFFIC에 등록된 기초데이터를 ENS에 이관 등록 한다. - */ - @Scheduled(cron = "0 */1 7-22 * * *") - public void accepted(){ - EnsResponseVO responseVO = trafficCcMydocService.acceptAll(); - log.info("======================================================="); - log.info("[TRAFFIC] 인증톡 접수처리 결과"); - log.info(responseVO.toString()); - log.info("======================================================="); - } - - - /** - * 인증톡 결과 가져오기 - * -. 전송이 완료된 인증톡 전송결과(성공/실패)를 ENS -> TRAFFIC 로 가져와 DB에 저장한다. - */ - @Scheduled(cron = "0 */15 7-22 * * *") - public void fetched(){ - EnsResponseVO responseVO = trafficCcMydocService.fetchAll(); - - log.info("======================================================="); - log.info("[TRAFFIC] 인증톡 요청문서정보 Fetch 결과"); - log.info(responseVO.toString()); - log.info("======================================================="); - } -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/service/TrafficCcMydocService.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/service/TrafficCcMydocService.java deleted file mode 100644 index 28bb58c..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/service/TrafficCcMydocService.java +++ /dev/null @@ -1,167 +0,0 @@ -package cokr.xit.ens.biz.traffic.chuncheon.mydoc.v2.service; - -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.ElctrnNticSndng; -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.repository.ElctrnNticSndngRepository; -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.v2.service.support.TrafficCcMydocAcceptor; -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.v2.service.support.TrafficCcMydocFetcher; -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.v2.service.support.TrafficCcMydocMaker; -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.v2.service.support.TrafficCcMydocSender; -import cokr.xit.ens.core.aop.EnsResponseVO; -import cokr.xit.ens.core.exception.EnsException; -import cokr.xit.ens.core.exception.code.EnsErrCd; -import cokr.xit.ens.core.utils.CmmnUtil; -import cokr.xit.ens.modules.kkomydoc.service.event.KkoMydocSendReserveEvent; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.context.ApplicationEventPublisher; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -@Slf4j -@Service -@RequiredArgsConstructor -@Transactional -public class TrafficCcMydocService { - - private final ElctrnNticSndngRepository elctrnNticSndngRepository; - - private final TrafficCcMydocAcceptor trafficCcMydocAcceptor; - private final TrafficCcMydocMaker trafficCcMydocMaker; - private final TrafficCcMydocSender trafficCcMydocSender; - private final TrafficCcMydocFetcher trafficCcMydocFetcher; - - private final ApplicationEventPublisher applicationEventPublisher; - - - - /** - * 인증톡 접수(TRAFFIC -> ENS) - */ - public EnsResponseVO accept(String elctrnNticSndngId){ - - try { - - ElctrnNticSndng elctrnNticSndng = elctrnNticSndngRepository.findById(elctrnNticSndngId) - .orElseThrow(()->new EnsException(EnsErrCd.ACPT404, "일치하는 자료가 없거나 \"요청(01)\" 상태가 아닙니다.")); - - return this.accept(Arrays.asList(elctrnNticSndng)).getResultInfo().get(0); - } catch (EnsException e){ - return EnsResponseVO.errBuilder() - .errCode(e.getErrCd()) - .errMsg(e.getMessage()) - .build(); - } - } - /** - * 인증톡 접수(TRAFFIC -> ENS) - */ - public EnsResponseVO> acceptAll(){ - try { - - List elctrnNticSndngs = elctrnNticSndngRepository.findAllBySndngProcessSttus("01"); - if(CmmnUtil.isEmpty(elctrnNticSndngs)) - throw new EnsException(EnsErrCd.ACPT404, "\"요청(01)\" 상태의 자료가 없습니다."); - - return this.accept(elctrnNticSndngs); - } catch (EnsException e){ - return EnsResponseVO.>errBuilder() - .errCode(e.getErrCd()) - .errMsg(e.getMessage()) - .build(); - } - } - private EnsResponseVO> accept(List elctrnNticSndngs){ - EnsResponseVO responseVO = trafficCcMydocAcceptor.statReady(elctrnNticSndngs.stream() - .map(row -> row.getElctrnNticSndngId()) - .collect(Collectors.toList())); - if(!EnsErrCd.OK.equals(responseVO.getErrCode())) - return responseVO; - - List resultInfo = elctrnNticSndngs.stream() - .map(row -> trafficCcMydocAcceptor.execute(row.getElctrnNticSndngId())) - .collect(Collectors.toList()); - - - List sendMastIds = resultInfo.stream() - .filter(ensResponseVO -> EnsErrCd.OK.equals(ensResponseVO.getErrCode())) - .map(ensResponseVO -> (Long)((Map)ensResponseVO.getResultInfo()).get("sendMastId")) - .collect(Collectors.toList()); - KkoMydocSendReserveEvent event = KkoMydocSendReserveEvent.builder() - .sendMastIds(sendMastIds) - .callback(() -> this.fetch(elctrnNticSndngs)) - .build(); - applicationEventPublisher.publishEvent(event); - - return EnsResponseVO.>okBuilder().resultInfo(resultInfo).build(); - } - - - - - - /** - * 인증톡 제작 재요청 - * @param elctrnNticSndngId - * @return - */ - public EnsResponseVO reMake(String elctrnNticSndngId){ - return trafficCcMydocMaker.execute(elctrnNticSndngId); - } - - - /** - * 인증톡 전송 재요청 - * @param elctrnNticSndngId - * @return - */ - public EnsResponseVO reSend(String elctrnNticSndngId){ - return trafficCcMydocSender.execute(elctrnNticSndngId); - } - - - /** - * 인증톡 전송(성공/실패) 결과 가져오기 - */ - public EnsResponseVO fetch(String elctrnNticSndngId){ - ElctrnNticSndng elctrnNticSndng = null; - try { - elctrnNticSndng = elctrnNticSndngRepository.findById(elctrnNticSndngId) - .orElseThrow(() -> new EnsException(EnsErrCd.ERR404, String.format("[ elctrnNticSndngId %s ]와 일치하는 자료가 없습니다.", elctrnNticSndngId))); - } catch (EnsException e) { - return EnsResponseVO.errBuilder() - .errCode(e.getErrCd()) - .errMsg(e.getMessage()) - .build(); - } - - return this.fetch(Arrays.asList(elctrnNticSndng)); - } - - /** - * 인증톡 전송(성공/실패) 결과 모두 가져오기 - */ - public EnsResponseVO fetchAll(){ - List elctrnNticSndngs = elctrnNticSndngRepository.findAllBySndngProcessSttusIn(Arrays.asList("02", "08")); - - return this.fetch(elctrnNticSndngs); - } - - private EnsResponseVO fetch(List elctrnNticSndngs){ - - return EnsResponseVO.okBuilder() - .resultInfo( - elctrnNticSndngs.stream() - .map(row -> trafficCcMydocFetcher.execute(row.getElctrnNticSndngId())) - .collect(Collectors.toList() - ) - ) - .build(); - } - - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/service/support/TrafficCcMydocAcceptor.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/service/support/TrafficCcMydocAcceptor.java deleted file mode 100644 index ddea2f1..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/service/support/TrafficCcMydocAcceptor.java +++ /dev/null @@ -1,245 +0,0 @@ -package cokr.xit.ens.biz.traffic.chuncheon.mydoc.v2.service.support; - -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.ElctrnNticSndng; -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.ElctrnNticSndngDetail; -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.embeded.FieldUpdate; -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.repository.ElctrnNticSndngDetailRepository; -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.repository.ElctrnNticSndngRepository; -import cokr.xit.ens.core.aop.EnsResponseVO; -import cokr.xit.ens.core.exception.EnsException; -import cokr.xit.ens.core.exception.code.EnsErrCd; -import cokr.xit.ens.core.utils.Checks; -import cokr.xit.ens.core.utils.DateUtil; -import cokr.xit.ens.core.utils.MapDeserailizer; -import cokr.xit.ens.modules.common.biztmplt.EnsPhaseProcSupport; -import cokr.xit.ens.modules.common.code.VenderCd; -import cokr.xit.ens.modules.kkomydoc.model.KkoMydocAcceptReqDTO; -import cokr.xit.ens.modules.kkomydoc.model.config.Document; -import cokr.xit.ens.modules.kkomydoc.model.config.Property; -import cokr.xit.ens.modules.kkomydoc.model.config.Receiver; -import cokr.xit.ens.modules.kkomydoc.model.config.XitProperty; -import cokr.xit.ens.modules.kkomydoc.service.KkoMydocService; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import net.bytebuddy.utility.RandomString; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import java.time.LocalDateTime; -import java.time.format.DateTimeFormatter; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.atomic.AtomicInteger; -import java.util.stream.Collectors; - -@Slf4j -@Component -@RequiredArgsConstructor -public class TrafficCcMydocAcceptor implements EnsPhaseProcSupport { - - private final ElctrnNticSndngRepository elctrnNticSndngRepository; - private final ElctrnNticSndngDetailRepository elctrnNticSndngDetailRepository; - - private final KkoMydocService kkoMydocService; - - private Gson gson = new GsonBuilder().registerTypeAdapter(Map.class, new MapDeserailizer()).serializeNulls().create(); - - /** - * Accept 준비 - * - * @param elctrnNticSndngIds - * @return - */ - @Override - @Transactional(propagation = Propagation.REQUIRES_NEW) - public EnsResponseVO statReady(List elctrnNticSndngIds) { - try { - AtomicInteger index = new AtomicInteger(); - String prefixExternalDocumentUuid = String.format("B-%s%s", LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSS")), RandomString.make(5)); - elctrnNticSndngIds.stream() - .map(elctrnNticSndngId -> elctrnNticSndngRepository.findById(elctrnNticSndngId).get()) - .map(elctrnNticSndng -> elctrnNticSndngDetailRepository.findAllDecByElctrnNticSndng(elctrnNticSndng)) - .forEach(list -> { - list.stream() - .forEach(row -> { - row.setExternalDocumentUuid(String.format("%s%09d", prefixExternalDocumentUuid, index.getAndIncrement() + 1)); - }); - elctrnNticSndngDetailRepository.saveAll(list); - - } - - ); - return EnsResponseVO.okBuilder().build(); - } catch (Exception e) { - return EnsResponseVO.errBuilder() - .errCode(EnsErrCd.ACPT500) - .errMsg(String.format("문서식별번호(외부) 생성에 실패 했습니다. %s", e.getMessage())) - .build(); - } - - } - - - @Override - @Transactional(propagation = Propagation.REQUIRES_NEW) - public EnsResponseVO statBegin(String elctrnNticSndngId) { - log.info("no process"); - return null; - } - - - /** - * 인증톡 전자고지 접수 - */ - @Override - @Transactional(propagation = Propagation.REQUIRES_NEW) - public EnsResponseVO execute(String elctrnNticSndngId) { - Map resultInfo = new HashMap<>(); - resultInfo.put("elctrnNticSndngId", elctrnNticSndngId); - - EnsResponseVO responseVO = null; - ElctrnNticSndng elctrnNticSndng = null; - try { - elctrnNticSndng = elctrnNticSndngRepository.findById(elctrnNticSndngId) - .orElseThrow(() -> new EnsException(EnsErrCd.ACPT404, String.format("일치하는 TB_ELCTRN_NTIC_SNDNG 데이터가 없습니다. [ elctrnNticSndngId %s ]", elctrnNticSndngId))); - - KkoMydocAcceptReqDTO reqDTO = this.convertTbInputDataToAcceptReqDTO(elctrnNticSndngDetailRepository.findAllFetchByElctrnNticSndngId(elctrnNticSndng.getElctrnNticSndngId())); - - EnsResponseVO reqResp = kkoMydocService.accept(reqDTO); - - - if (EnsErrCd.OK.equals(reqResp.getErrCode())) { - resultInfo.put("sendMastId", (Long) ((Map) reqResp.getResultInfo()).get("sendMastId")); - responseVO = EnsResponseVO.okBuilder().resultInfo(resultInfo).build(); - } else { - responseVO = EnsResponseVO.errRsltBuilder() - .errCode(reqResp.getErrCode()) - .errMsg(reqResp.getErrMsg()) - .resultInfo(reqResp.getResultInfo()) - .build(); - } - } catch (EnsException e) { - responseVO = EnsResponseVO.errRsltBuilder() - .errCode(e.getErrCd()) - .errMsg(String.format("인증톡 \"접수\" 처리 실패. [%s] %s", e.getErrCd().getCode(), e.getMessage())) - .resultInfo(resultInfo) - .build(); - - } catch (Exception e) { - responseVO = EnsResponseVO.errRsltBuilder() - .errCode(EnsErrCd.ACPT500) - .errMsg(String.format("인증톡 \"접수\" 처리 실패. %s", e.getMessage())) - .resultInfo(resultInfo) - .build(); - - } finally { - if (EnsErrCd.OK.equals(responseVO.getErrCode())) { - elctrnNticSndng.setUpdate(FieldUpdate.builder() - .updusr("ENS_SYS") - .updtDt(LocalDateTime.now()) - .build()); - elctrnNticSndng.setSndngProcessSttus("02"); - elctrnNticSndng.setErrorCn(null); - } else { - elctrnNticSndng.setUpdate(FieldUpdate.builder() - .updusr("ENS_SYS") - .updtDt(LocalDateTime.now()) - .build()); - elctrnNticSndng.setSndngProcessSttus("99"); - elctrnNticSndng.setErrorCn(responseVO.getErrMsg()); - if (responseVO.getResultInfo() != null && (responseVO.getResultInfo() instanceof List || responseVO.getResultInfo() instanceof Map)) - elctrnNticSndng.setErrorDtls(gson.toJson(responseVO.getResultInfo())); - } - } - - return responseVO; - } - - - private KkoMydocAcceptReqDTO convertTbInputDataToAcceptReqDTO(List list) { - - return KkoMydocAcceptReqDTO.builder() - .vender(VenderCd.intech.getCode()) - .org_cd(list.get(0).getElctrnNticSndng().getSignguCode()) - .tmplt_cd(list.get(0).getElctrnNticSndng().getNhtTmplatManage().getNhtTmplatId()) - .post_bundle_title( - String.format("%s(%s건)-%s" - , list.get(0).getElctrnNticSndng().getNhtTmplatManage().getNhtNm() - , list.get(0).getElctrnNticSndng().getSndngCo() - , LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")) - ) - ) - .send_dt(list.get(0).getElctrnNticSndng().getSndngDt()) - .close_dt(list.get(0).getElctrnNticSndng().getClosDt()) - .documents( - list.stream() - .map(row -> createDocument(row)) - .collect(Collectors.toList()) - ) - .build(); - } - - private Document createDocument(ElctrnNticSndngDetail data) throws EnsException { - - return Document.builder() - .external_document_uuid(data.getExternalDocumentUuid()) - .hash(null) - .common_categories(Arrays.asList("NOTICE")) - .read_expired_at(DateUtil.dateToAbsTimeSec(data.getElctrnNticSndng().getClosDt())) -// .read_expired_sec() - .receiver(this.createReceiver(data)) - .property(this.createProperty(data)) - .bridge(null) - .xit_property(this.createXitProperty(data)) - .build(); - } - - private Receiver createReceiver(ElctrnNticSndngDetail data) { - return Receiver.builder() - .ci(null) - .phone_number(null) - .name(null) - .birthday(null) - .is_required_verify_name(null) - .build(); - } - - private Property createProperty(ElctrnNticSndngDetail data) { - return Property.builder() - .link(data.getElctrnNticSndng().getNhtTmplatManage().getRedirectUrl()) - .payload(null) -// .external_document_uuid(data.getExternalDocumentUuid()) - .build(); - } - - private XitProperty createXitProperty(ElctrnNticSndngDetail data) { - Map>> mobilePage = new HashMap<>(); - mobilePage.put("details", this.createDetails(data)); - - String jid = elctrnNticSndngDetailRepository.findIhidnumDecByElctrnNticSndngDetailId(data.getElctrnNticSndngDetailId()); - return XitProperty.builder() - .mbl_page_data(mobilePage) -// .ci_trans_use_yn("Y") -// .jid(data.getIhidnum()) - .jid(Checks.isCheckJid(jid) ? jid : "1111111111111") - .tmplt_msg_data(null) - .build(); - } - - private List> createDetails(ElctrnNticSndngDetail data) { - try { - Map>> m = gson.fromJson(data.getMobilePageCn(), Map.class); - return m.get("details"); - } catch (Exception e) { - log.error("\"mobilePageCn\" Json Parse 실패. {}", data.getMobilePageCn()); - return null; - } - } - - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/service/support/TrafficCcMydocFetcher.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/service/support/TrafficCcMydocFetcher.java deleted file mode 100644 index e84db66..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/service/support/TrafficCcMydocFetcher.java +++ /dev/null @@ -1,213 +0,0 @@ -package cokr.xit.ens.biz.traffic.chuncheon.mydoc.v2.service.support; - -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.ElctrnNticSndng; -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.ElctrnNticSndngDetail; -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.ElctrnNticSndngResult; -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.embeded.FieldCreate; -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.embeded.FieldUpdate; -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.repository.ElctrnNticSndngDetailRepository; -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.repository.ElctrnNticSndngRepository; -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.repository.ElctrnNticSndngResultRepository; -import cokr.xit.ens.core.aop.EnsResponseVO; -import cokr.xit.ens.core.exception.EnsException; -import cokr.xit.ens.core.exception.code.EnsErrCd; -import cokr.xit.ens.core.utils.CmmnUtil; -import cokr.xit.ens.modules.common.biztmplt.EnsPhaseProcSupport; -import cokr.xit.ens.modules.kkomydoc.model.KkoMydocRsltRespDTO; -import cokr.xit.ens.modules.kkomydoc.model.config.KkoMydocStat; -import cokr.xit.ens.modules.kkomydoc.service.KkoMydocService; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import java.time.LocalDateTime; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -@Slf4j -@Component -@RequiredArgsConstructor -public class TrafficCcMydocFetcher implements EnsPhaseProcSupport { - - private final ElctrnNticSndngRepository elctrnNticSndngRepository; - private final ElctrnNticSndngDetailRepository elctrnNticSndngDetailRepository; - - private final ElctrnNticSndngResultRepository elctrnNticSndngResultRepository; - - private final KkoMydocService kkoMydocService; - - - /** - * Fetch 준비 - * - * @param elctrnNticSndngIds - * @return - */ - @Override - @Transactional(propagation = Propagation.REQUIRES_NEW) - public EnsResponseVO statReady(List elctrnNticSndngIds) { - log.info("no process"); - return null; - } - - - @Override - @Transactional(propagation = Propagation.REQUIRES_NEW) - public EnsResponseVO statBegin(String elctrnNticSndngId) { - log.info("no process"); - return null; - } - - - /** - * 인증톡 발송(성공/실패) 자료에 대한 결과 가져오기 - * - * @param elctrnNticSndngId - */ - @Override - @Transactional(propagation = Propagation.REQUIRES_NEW) - public EnsResponseVO execute(String elctrnNticSndngId) { - EnsResponseVO responseVO = null; - Map resultInfo = new HashMap<>(); - resultInfo.put("elctrnNticSndngId", elctrnNticSndngId); - - KkoMydocRsltRespDTO respDTO = null; - try { - Long sendMastId = elctrnNticSndngDetailRepository.findLastSendMastIdByElctrnNticSndngId(elctrnNticSndngId) - .orElseThrow(() -> new EnsException(EnsErrCd.RSLT404, "일치하는 ENS 접수자료가 없습니다.")); - resultInfo.put("sendMastId", sendMastId); - - - EnsResponseVO apiRespVO = kkoMydocService.sendResultProvide(sendMastId); - respDTO = (KkoMydocRsltRespDTO) apiRespVO.getResultInfo(); - - -// elctrnNticSndngResultRepository.saveAll(respDTO.getDocuments().stream() -// .map(row -> { -// return ElctrnNticSndngResult.builder() -// .elctrnNticSndngDetailId(elctrnNticSndngDetailRepository.findByExternalDocumentUuid(row.getExternalDocumentUuid()) -// .orElse(new ElctrnNticSndngDetail()) -// .getElctrnNticSndngDetailId()) -// .sndngResultCode(this.sndngResultCode(row)) -// .requstDt(row.getKkoDocSentDt()) -// .inqireDt(row.getKkoDocReceivedDt()) -// .readngDt(row.getKkoDocReadFrstDt()) -// .errorCn(CmmnUtil.isEmpty(row.getErrorMessage()) ? null : row.getErrorMessage()) -// .create(FieldCreate.builder() -// .REGISTER("ENS_SYS") -// .REGIST_DT(LocalDateTime.now()) -// .build()) -// .build(); -// }) -// .collect(Collectors.toList()) -// ); - List elctrnNticSndngResults = respDTO.getDocuments().stream() - .map(row -> { - return ElctrnNticSndngResult.builder() - .elctrnNticSndngDetailId(elctrnNticSndngDetailRepository.findByExternalDocumentUuid(row.getExternalDocumentUuid()) - .orElse(new ElctrnNticSndngDetail()) - .getElctrnNticSndngDetailId()) - .sndngResultCode(this.sndngResultCode(row)) - .requstDt(row.getKkoDocSentDt()) - .inqireDt(row.getKkoDocReceivedDt()) - .readngDt(row.getKkoDocReadFrstDt()) - .errorCn(CmmnUtil.isEmpty(row.getErrorMessage()) ? null : row.getErrorMessage()) - .create(FieldCreate.builder() - .register("ENS_SYS") - .registDt(LocalDateTime.now()) - .build()) - .build(); - }) - .collect(Collectors.toList()); - if (elctrnNticSndngResultRepository.findById(elctrnNticSndngResults.get(0).getElctrnNticSndngDetailId()).isPresent()) - elctrnNticSndngResultRepository.modifyByElctrnNticSndngResults(elctrnNticSndngResults); - else - elctrnNticSndngResultRepository.saveAll(elctrnNticSndngResults); - - responseVO = EnsResponseVO.okBuilder().resultInfo(resultInfo).build(); - } catch (EnsException e) { - responseVO = EnsResponseVO.errBuilder() - .errCode(e.getErrCd()) - .errMsg(e.getMessage()) - .build(); - } catch (Exception e) { - responseVO = EnsResponseVO.errBuilder() - .errCode(EnsErrCd.RSLT999) - .errMsg(String.format("[elctrnNticSndngId %s]에 대한 전송결과 FETCH 처리 실패. %s", elctrnNticSndngId, e.getMessage())) - .build(); - } finally { - ElctrnNticSndng elctrnNticSndng = elctrnNticSndngRepository.findById(elctrnNticSndngId).orElseThrow(() -> new EnsException(EnsErrCd.RSLT404, "일치하는 tbInputXit 자료가 없습니다.")); - if (EnsErrCd.OK.equals(responseVO.getErrCode())) { - elctrnNticSndng.setUpdate(FieldUpdate.builder() - .updusr("ENS_SYS") - .updtDt(LocalDateTime.now()) - .build()); - elctrnNticSndng.setSndngProcessSttus(this.sndngProcessSttus(respDTO, elctrnNticSndng.getSndngProcessSttus())); - elctrnNticSndng.setErrorCn(null); - } else { - elctrnNticSndng.setUpdate(FieldUpdate.builder() - .updusr("ENS_SYS") - .updtDt(LocalDateTime.now()) - .build()); - elctrnNticSndng.setSndngProcessSttus("99"); - elctrnNticSndng.setErrorCn(responseVO.getErrMsg()); - } - } - - return responseVO; - } - - private String sndngProcessSttus(KkoMydocRsltRespDTO respDTO, String sndngProcessSttus) { - - switch (respDTO.getStatCd()) { - case makefail: - case sendfail: - return "99"; - case sendok: - case sendcmplt: - return "02"; - case open: - return "08"; - case close: - return "09"; - default: - return sndngProcessSttus; - } - } - - private String sndngResultCode(KkoMydocStat row) { - - - String sndngResultCode = null; - try { - switch (row.getKkoDocStat()) { - case SENT: - case RECEIVED: - case EXPIRED: - sndngResultCode = "1"; - break; - case READ: - sndngResultCode = "2"; - break; - case UNIDENTIFIED_USER: - case FORBIDDEN: - case INVALID_VALUE: - case INTERNAL_ERROR: - case INVALID_REQUEST: - case INTERNAL_SENT_ERR: - sndngResultCode = "3"; - break; - default: - break; - } - } catch (Exception e) { - log.info("IupSendSttusCd와 일치하는 값 없음. [ dataId {} KkoDocStat {} ]", row.getExternalDocumentUuid(), row.getKkoDocStat()); - } - return sndngResultCode; - } - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/service/support/TrafficCcMydocMaker.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/service/support/TrafficCcMydocMaker.java deleted file mode 100644 index 059c13e..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/service/support/TrafficCcMydocMaker.java +++ /dev/null @@ -1,65 +0,0 @@ -package cokr.xit.ens.biz.traffic.chuncheon.mydoc.v2.service.support; - -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.repository.ElctrnNticSndngDetailRepository; -import cokr.xit.ens.core.aop.EnsResponseVO; -import cokr.xit.ens.core.exception.EnsException; -import cokr.xit.ens.core.exception.code.EnsErrCd; -import cokr.xit.ens.modules.common.biztmplt.EnsPhaseProcSupport; -import cokr.xit.ens.modules.kkomydoc.service.KkoMydocService; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; - -@Slf4j -@Component -@RequiredArgsConstructor -public class TrafficCcMydocMaker implements EnsPhaseProcSupport { - - private final ElctrnNticSndngDetailRepository elctrnNticSndngDetailRepository; - - private final KkoMydocService kkoMydocService; - - - @Override - @Transactional(propagation = Propagation.REQUIRES_NEW) - public EnsResponseVO statReady(List elctrnNticSndngIds) { - log.info("no process"); - return null; - } - - - @Override - @Transactional(propagation = Propagation.REQUIRES_NEW) - public EnsResponseVO statBegin(String elctrnNticSndngId) { - log.info("no process"); - return null; - } - - - - /** - * 인증톡 전자고지 제작 - */ - @Override - @Transactional(propagation = Propagation.REQUIRES_NEW) - public EnsResponseVO execute(String elctrnNticSndngId){ - EnsResponseVO responseVO = null; - try { - Long sendMastId = elctrnNticSndngDetailRepository.findLastSendMastIdByElctrnNticSndngId(elctrnNticSndngId) - .orElseThrow(() -> new EnsException(EnsErrCd.MAKE404, "일치하는 ENS 접수자료가 없습니다.")); - - responseVO = kkoMydocService.remake(sendMastId); - } catch (EnsException e){ - responseVO = EnsResponseVO.errBuilder() - .errCode(e.getErrCd()) - .errMsg(e.getMessage()) - .build(); - } - return responseVO; - } - -} diff --git a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/service/support/TrafficCcMydocSender.java b/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/service/support/TrafficCcMydocSender.java deleted file mode 100644 index ce2f9d5..0000000 --- a/src/main/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/service/support/TrafficCcMydocSender.java +++ /dev/null @@ -1,65 +0,0 @@ -package cokr.xit.ens.biz.traffic.chuncheon.mydoc.v2.service.support; - -import cokr.xit.ens.biz.traffic.chuncheon.mydoc.domain.repository.ElctrnNticSndngDetailRepository; -import cokr.xit.ens.core.aop.EnsResponseVO; -import cokr.xit.ens.core.exception.EnsException; -import cokr.xit.ens.core.exception.code.EnsErrCd; -import cokr.xit.ens.modules.common.biztmplt.EnsPhaseProcSupport; -import cokr.xit.ens.modules.kkomydoc.service.KkoMydocService; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Propagation; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; - -@Slf4j -@Component -@RequiredArgsConstructor -public class TrafficCcMydocSender implements EnsPhaseProcSupport { - - private final ElctrnNticSndngDetailRepository elctrnNticSndngDetailRepository; - - private final KkoMydocService kkoMydocService; - - - @Override - @Transactional(propagation = Propagation.REQUIRES_NEW) - public EnsResponseVO statReady(List elctrnNticSndngIds) { - log.info("no process"); - return null; - } - - - @Override - @Transactional(propagation = Propagation.REQUIRES_NEW) - public EnsResponseVO statBegin(String elctrnNticSndngId) { - log.info("no process"); - return null; - } - - - - /** - * 인증톡 전자고지 전송요청 - */ - @Override - @Transactional(propagation = Propagation.REQUIRES_NEW) - public EnsResponseVO execute(String elctrnNticSndngId){ - EnsResponseVO responseVO = null; - try { - Long sendMastId = elctrnNticSndngDetailRepository.findLastSendMastIdByElctrnNticSndngId(elctrnNticSndngId) - .orElseThrow(() -> new EnsException(EnsErrCd.SEND404, "일치하는 ENS 접수자료가 없습니다.")); - - responseVO = kkoMydocService.sendBulk(sendMastId); - } catch (EnsException e){ - responseVO = EnsResponseVO.errBuilder() - .errCode(e.getErrCd()) - .errMsg(e.getMessage()) - .build(); - } - return responseVO; - } - -} diff --git a/src/main/java/cokr/xit/ens/core/config/SpringDocConfig.java b/src/main/java/cokr/xit/ens/core/config/SpringDocConfig.java index 7fe381f..8019606 100644 --- a/src/main/java/cokr/xit/ens/core/config/SpringDocConfig.java +++ b/src/main/java/cokr/xit/ens/core/config/SpringDocConfig.java @@ -1,18 +1,19 @@ package cokr.xit.ens.core.config; -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Contact; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.servers.Server; +import java.util.Arrays; +import java.util.List; + import org.springdoc.core.GroupedOpenApi; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; -import java.util.Arrays; -import java.util.List; +import io.swagger.v3.oas.models.OpenAPI; +import io.swagger.v3.oas.models.info.Contact; +import io.swagger.v3.oas.models.info.Info; +import io.swagger.v3.oas.models.info.License; +import io.swagger.v3.oas.models.servers.Server; @Configuration public class SpringDocConfig { @@ -69,7 +70,7 @@ public class SpringDocConfig { .build(); } - @Profile({"local", "local-test", "local-maria", "local-oracle", "prod-iup", "dev-oracle"}) + @Profile({"local", "prod", "dev"}) @Bean public GroupedOpenApi cmmnFtBillPaysApiDoc() { return GroupedOpenApi.builder() @@ -77,7 +78,7 @@ public class SpringDocConfig { .pathsToMatch("/bill/pay/**") .build(); } - @Profile({"local", "local-test", "local-maria", "local-oracle", "prod-iup", "dev-oracle"}) + @Profile({"local", "prod", "dev"}) @Bean public GroupedOpenApi cmmnFtBillKkopayApiDoc() { return GroupedOpenApi.builder() @@ -85,7 +86,7 @@ public class SpringDocConfig { .pathsToMatch("/bill/kko/**") .build(); } - @Profile({"local", "local-test", "local-maria", "local-oracle", "prod-iup", "dev-oracle"}) + @Profile({"local", "prod", "dev"}) @Bean public GroupedOpenApi cmmnFtBillNvpayApiDoc() { return GroupedOpenApi.builder() @@ -94,7 +95,7 @@ public class SpringDocConfig { .build(); } - @Profile({"local", "local-test", "local-maria", "local-oracle", "prod-traffic", "prod-traffic-cheonan", "prod-iup"}) + @Profile({"local", "prod", "dev"}) @Bean public GroupedOpenApi cmmnFtNiceCiDiApiDoc() { return GroupedOpenApi.builder() @@ -114,7 +115,7 @@ public class SpringDocConfig { } - @Profile({"local", "local-test", "local-maria", "local-oracle", "prod-iup"}) + @Profile({"local", "prod"}) @Bean public GroupedOpenApi kkoAlimtalkApiDoc() { return GroupedOpenApi.builder() @@ -123,7 +124,7 @@ public class SpringDocConfig { .build(); } - @Profile({"local", "local-test", "local-maria", "local-oracle", "prod-traffic", "prod-traffic-cheonan", "prod-iup", "dev-oracle"}) + @Profile({"local", "prod", "dev"}) @Bean public GroupedOpenApi kkoMydocApiDoc() { return GroupedOpenApi.builder() @@ -132,7 +133,7 @@ public class SpringDocConfig { .build(); } - @Profile({"local", "local-test", "local-maria", "local-oracle", "prod-iup", "dev-oracle"}) + @Profile({"local", "prod", "dev"}) @Bean public GroupedOpenApi nvSigntalkApiDoc() { return GroupedOpenApi.builder() @@ -141,7 +142,7 @@ public class SpringDocConfig { .build(); } - @Profile({"local", "local-test", "local-maria", "local-oracle"}) + @Profile({"local"}) @Bean public GroupedOpenApi ktSigntalkApiDoc() { return GroupedOpenApi.builder() @@ -150,7 +151,7 @@ public class SpringDocConfig { .build(); } - @Profile({"local", "local-test", "local-maria", "local-oracle", "prod-traffic-cheonan"}) + @Profile({"local", "prod"}) @Bean public GroupedOpenApi ktGibisApiDoc() { return GroupedOpenApi.builder() @@ -159,7 +160,7 @@ public class SpringDocConfig { .build(); } - @Profile({"local", "local-test", "local-maria", "local-oracle", "prod-iup", "prod-traffic-cheonan", "dev-oracle"}) + @Profile({"local", "prod", "dev"}) @Bean public GroupedOpenApi intgrnNotiApiDoc() { return GroupedOpenApi.builder() @@ -169,7 +170,7 @@ public class SpringDocConfig { } - @Profile({"local", "local-test", "local-maria", "local-oracle", "prod-iup", "dev-oracle"}) + @Profile({"local", "prod", "dev"}) @Bean public GroupedOpenApi iupServiceApiDoc() { return GroupedOpenApi.builder() @@ -178,24 +179,6 @@ public class SpringDocConfig { .build(); } - @Profile({"local", "local-test", "local-maria", "local-oracle", "prod-traffic"}) - @Bean - public GroupedOpenApi trafficCcServiceApiDoc() { - return GroupedOpenApi.builder() - .group("BIZ. 이용시스템-주정차웹(TRAFFIC-춘천)") - .pathsToMatch("/traffic/cc/**") - .build(); - } - - @Profile({"local", "local-test", "local-maria", "local-oracle", "prod-traffic-cheonan"}) - @Bean - public GroupedOpenApi trafficCaServiceApiDoc() { - return GroupedOpenApi.builder() - .group("BIZ. 이용시스템-주정차웹(TRAFFIC-천안)") - .pathsToMatch("/traffic/ca/**") - .build(); - } - // @Bean // public GroupedOpenApi adminApiDoc() { diff --git a/src/main/resources/application-dev-oracle.yml b/src/main/resources/application-dev.yml similarity index 85% rename from src/main/resources/application-dev-oracle.yml rename to src/main/resources/application-dev.yml index e160789..5a9cb5b 100644 --- a/src/main/resources/application-dev-oracle.yml +++ b/src/main/resources/application-dev.yml @@ -2,11 +2,11 @@ server: port: 18090 #port - + spring: config: activate: - on-profile: dev-oracle + on-profile: dev @@ -16,17 +16,17 @@ spring: mode: always # Database 벤더(h2,oracle,mysql,postgresql,...) platform: oracle -# schema-locations: classpath:/db/test/schema.sql -# data-locations: classpath:/db/test/data.sql + # schema-locations: classpath:/db/test/schema.sql + # data-locations: classpath:/db/test/data.sql datasource: -# jndi-name: java:jdbc/ensOracleDB + # jndi-name: java:jdbc/ensOracleDB driver-class-name: oracle.jdbc.OracleDriver -# url: jdbc:oracle:thin:@211.119.124.118:1521:bustms?rewriteBatchedStatements=true&profileSQL=true&logger=Slf4JLogger&maxQuerySizeToLog=999999 + # url: jdbc:oracle:thin:@211.119.124.118:1521:bustms?rewriteBatchedStatements=true&profileSQL=true&logger=Slf4JLogger&maxQuerySizeToLog=999999 url: jdbc:oracle:thin:@211.119.124.118:1521:bustms username: iup password: iup!0202 hikari: -# auto-commit: false + # auto-commit: false connection-test-query: SELECT 1 FROM DUAL transaction-isolation: TRANSACTION_READ_COMMITTED hikari: @@ -48,7 +48,7 @@ spring: enabled: true path: /h2-console - + kafka: producer: bootstrap-servers: minkyu1128.synology.me:49092 diff --git a/src/main/resources/application-local-oracle.yml b/src/main/resources/application-local-h2.yml similarity index 58% rename from src/main/resources/application-local-oracle.yml rename to src/main/resources/application-local-h2.yml index de10622..32a3572 100644 --- a/src/main/resources/application-local-oracle.yml +++ b/src/main/resources/application-local-h2.yml @@ -2,47 +2,50 @@ server: port: 18090 #port - + spring: config: activate: - on-profile: local-oracle + on-profile: local-h2 + sql: init: mode: always - platform: oracle -# schema-locations: classpath:/db/test/schema.sql -# data-locations: classpath:/db/test/data.sql + platform: h2 datasource: - driver-class-name: oracle.jdbc.OracleDriver - url: jdbc:oracle:thin:@211.119.124.118:1521:bustms - username: iup - password: iup!0202 - hikari: -# auto-commit: false - connection-test-query: SELECT 1 FROM DUAL - transaction-isolation: TRANSACTION_READ_COMMITTED + # url: "jdbc:h2:tcp://localhost:19092/~/ens" + url: jdbc:h2:mem:xitdb?rewriteBatchedStatements=true&profileSQL=true&logger=Slf4JLogger&maxQuerySizeToLog=999999 + driver-class-name: org.h2.Driver + username: sa + password: + # url: "jdbc:log4jdbc:h2:tcp://localhost/~/dev_post" + # driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy + # username: sa + # password: hikari: driver-class-name: ${spring.datasource.driver-class-name} jdbc-url: ${spring.datasource.url} username: ${spring.datasource.username} password: ${spring.datasource.password} - jpa: - database-platform: org.hibernate.dialect.Oracle10gDialect - show-sql: false #하이버네이트SQL 콘솔 출력 여부 + database-platform: org.hibernate.dialect.H2Dialect hibernate: - ddl-auto: none + # create / create-drop / update / validate / none + ddl-auto: update + open-in-view: true + + h2: console: enabled: true path: /h2-console - + + kafka: producer: bootstrap-servers: minkyu1128.synology.me:49092 @@ -50,11 +53,8 @@ spring: value-serializer: org.apache.kafka.common.serialization.StringSerializer consumer: bootstrap-servers: minkyu1128.synology.me:49092 - key-deserializer: org.apache.kafka.common.serialization.StringDeserializer - value-deserializer: org.apache.kafka.common.serialization.StringDeserializer group-id: group-id-ens auto-offset-reset: latest + key-deserializer: org.apache.kafka.common.serialization.StringDeserializer + value-deserializer: org.apache.kafka.common.serialization.StringDeserializer max-poll-records: 1 -# enable-auto-commit: true -# auto-commit-interval: 1000 - diff --git a/src/main/resources/application-local-maria.yml b/src/main/resources/application-local-maria.yml deleted file mode 100644 index a998513..0000000 --- a/src/main/resources/application-local-maria.yml +++ /dev/null @@ -1,46 +0,0 @@ -server: - port: 18090 #port - - - -spring: - config: - activate: - on-profile: local-maria - sql: - init: - mode: always - platform: mysql -# schema-locations: classpath:/db/test/schema.sql -# data-locations: classpath:/db/test/data.sql - datasource: - driver-class-name: org.mariadb.jdbc.Driver - url: jdbc:mariadb://211.119.124.117:53306/ens?rewriteBatchedStatements=true&profileSQL=true&logger=Slf4JLogger&maxQuerySizeToLog=999999 - username: ens - password: xit5811807 - hikari: - driver-class-name: ${spring.datasource.driver-class-name} - jdbc-url: ${spring.datasource.url} - username: ${spring.datasource.username} - password: ${spring.datasource.password} - jpa: -# database-platform: org.hibernate.dialect.MariaDB103Dialect - database-platform: cokr.xit.ens.core.jpa.dialect.MariaDB103DialectCustom - hibernate: - # create / create-drop / update / validate / none - ddl-auto: update - - - h2: - console: - enabled: true - path: /h2-console - - - -xit: - mblpage: - payinf: - host: http://localhost:8080/ens-middleware - - diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml index b8ee87b..1e96ba8 100644 --- a/src/main/resources/application-local.yml +++ b/src/main/resources/application-local.yml @@ -2,7 +2,7 @@ server: port: 18090 #port - + spring: config: activate: @@ -10,41 +10,38 @@ spring: - sql: init: mode: always - platform: h2 + platform: oracle + # schema-locations: classpath:/db/test/schema.sql + # data-locations: classpath:/db/test/data.sql datasource: -# url: "jdbc:h2:tcp://localhost:19092/~/ens" - url: jdbc:h2:mem:xitdb?rewriteBatchedStatements=true&profileSQL=true&logger=Slf4JLogger&maxQuerySizeToLog=999999 - driver-class-name: org.h2.Driver - username: sa - password: -# url: "jdbc:log4jdbc:h2:tcp://localhost/~/dev_post" -# driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy -# username: sa -# password: + driver-class-name: oracle.jdbc.OracleDriver + url: jdbc:oracle:thin:@211.119.124.118:1521:bustms + username: iup + password: iup!0202 + hikari: + # auto-commit: false + connection-test-query: SELECT 1 FROM DUAL + transaction-isolation: TRANSACTION_READ_COMMITTED hikari: driver-class-name: ${spring.datasource.driver-class-name} jdbc-url: ${spring.datasource.url} username: ${spring.datasource.username} password: ${spring.datasource.password} + jpa: - database-platform: org.hibernate.dialect.H2Dialect + database-platform: org.hibernate.dialect.Oracle10gDialect + show-sql: false #하이버네이트SQL 콘솔 출력 여부 hibernate: - # create / create-drop / update / validate / none - ddl-auto: update - open-in-view: true - - + ddl-auto: none h2: console: enabled: true path: /h2-console - kafka: producer: @@ -53,8 +50,11 @@ spring: value-serializer: org.apache.kafka.common.serialization.StringSerializer consumer: bootstrap-servers: minkyu1128.synology.me:49092 - group-id: group-id-ens - auto-offset-reset: latest key-deserializer: org.apache.kafka.common.serialization.StringDeserializer value-deserializer: org.apache.kafka.common.serialization.StringDeserializer + group-id: group-id-ens + auto-offset-reset: latest max-poll-records: 1 +# enable-auto-commit: true +# auto-commit-interval: 1000 + diff --git a/src/main/resources/application-prod-traffic-cheonan.yml b/src/main/resources/application-prod-traffic-cheonan.yml deleted file mode 100644 index 83958c2..0000000 --- a/src/main/resources/application-prod-traffic-cheonan.yml +++ /dev/null @@ -1,98 +0,0 @@ -server: - port: 18090 #port - servlet: - context-path: /goji - - - -spring: - config: - activate: - on-profile: prod-traffic-cheonan - - - - sql: - init: - mode: always - platform: oracle - datasource: - driver-class-name: oracle.jdbc.OracleDriver - url: jdbc:oracle:thin:@108.1.143.28:11521:ora11g - username: xit_traffic - password: traffic5 - hikari: - connection-test-query: SELECT 1 FROM DUAL - transaction-isolation: TRANSACTION_READ_COMMITTED - hikari: - driver-class-name: ${spring.datasource.driver-class-name} - jdbc-url: ${spring.datasource.url} - username: ${spring.datasource.username} - password: ${spring.datasource.password} - jpa: - database-platform: cokr.xit.ens.core.dialect.Oracle10gDialectCustom - show-sql: false - hibernate: - ddl-auto: none - open-in-view: true - - - - - - - - -xit: - app: - url: https://parking.cheonan.go.kr - ctx: /goji - mblpage: - intgrn: - url: ${xit.app.url}${xit.app.ctx} - path: /intgrn/noti/page/prnt - swagger: - conf: - api: - url: ${xit.app.url}${xit.app.ctx} - version: '@project.version@' - - -contract: - kakao: - pay: - mydoc: - host: http://parking.cheonan.go.kr - api: - send: /pxy/kkost/v1/documents - token: /pxy/kkost/v1/tokens - readcompleted: /pxy/kkost/v1/documents/change - status: /pxy/kkost/v1/documents/status - bulksend: /pxy/kkost/v1/documents/bulk - bulksend-batch-unit: 100 - bulkstatus: /pxy/kkost/v1/documents/bulk/status - nice: - dici: - type: rest - rest: - host: http://parking.cheonan.go.kr - api: - generate-token: /pxy/niceci/digital/niceid/oauth/oauth/token - revoke-token: /pxy/niceci/digital/niceid/oauth/oauth/token/revokeById - publickey: /pxy/niceci/digital/niceid/api/v1.0/common/crypto/publickey - symmetrickey: /pxy/niceci/digital/niceid/api/v1.0/common/crypto/symmetrickey - ci: /pxy/niceci/digital/niceid/cert/v1.0/ipin/addinfo/ci - kt: - signtalk: - gibis: - host: http://108.1.143.27:8071 - - - - - - -decorator: - datasource: - p6spy: - enable-logging: false #p6spy logging 활성화 여부 diff --git a/src/main/resources/application-prod-traffic.yml b/src/main/resources/application-prod-traffic.yml deleted file mode 100644 index bd6ef2a..0000000 --- a/src/main/resources/application-prod-traffic.yml +++ /dev/null @@ -1,69 +0,0 @@ -server: - port: 18090 #port - - -spring: - config: - activate: - on-profile: prod-traffic - - - - sql: - init: - mode: always - platform: mysql - datasource: - driver-class-name: org.mariadb.jdbc.Driver - url: "jdbc:mariadb://152.99.141.30:60001/xplatform?rewriteBatchedStatements=true&profileSQL=true&logger=Slf4JLogger&maxQuerySizeToLog=999999" - username: root - password: xit5811807 - hikari: - connection-test-query: SELECT 1 FROM DUAL - transaction-isolation: TRANSACTION_READ_COMMITTED - hikari: - driver-class-name: ${spring.datasource.driver-class-name} - jdbc-url: ${spring.datasource.url} - username: ${spring.datasource.username} - password: ${spring.datasource.password} - jpa: - database-platform: cokr.xit.ens.core.jpa.dialect.MariaDB103DialectCustom - hibernate: - ddl-auto: none - open-in-view: true - - - - - - - - - - - -contract: - kakao: - pay: - mydoc: - host: https://docs-gw.kakaopay.com - access-token: b40d3c623d1011ecbceae6cf4630da62 - contract-uuid: CON-b4126c833d1011ecbceae6cf4630da62 - nice: - dici: - type: socket - socket: - site-code: EQ00 - site-pw: 76646885 - deposit: - token: sha5120e6d1bdf446185e836fd61aa4c645ab0ff4161a4a5919f5d31ea4c2c5ca800bbb5d31f7fbbff2350ebb350f29b5e3ae8cd4a451789823532b8455e7929e578ee - - - - - - -decorator: - datasource: - p6spy: - enable-logging: false diff --git a/src/main/resources/application-prod-iup.yml b/src/main/resources/application-prod.yml similarity index 72% rename from src/main/resources/application-prod-iup.yml rename to src/main/resources/application-prod.yml index 906a8ba..7b76b18 100644 --- a/src/main/resources/application-prod-iup.yml +++ b/src/main/resources/application-prod.yml @@ -6,7 +6,7 @@ server: spring: config: activate: - on-profile: prod-iup + on-profile: prod sql: @@ -15,18 +15,18 @@ spring: platform: oracle datasource: jndi-name: java:jdbc/cephis_toll -# driver-class-name: oracle.jdbc.driver.OracleDriver -# url: jdbc:oracle:thin:@10.1.1.103:1521:PUBLICDB -# username: cephis_toll -# password: cephis_toll@044@!! + # driver-class-name: oracle.jdbc.driver.OracleDriver + # url: jdbc:oracle:thin:@10.1.1.103:1521:PUBLICDB + # username: cephis_toll + # password: cephis_toll@044@!! hikari: connection-test-query: SELECT 1 FROM DUAL transaction-isolation: TRANSACTION_READ_COMMITTED -# hikari: -# driver-class-name: ${spring.datasource.driver-class-name} -# jdbc-url: ${spring.datasource.url} -# username: ${spring.datasource.username} -# password: ${spring.datasource.password} + # hikari: + # driver-class-name: ${spring.datasource.driver-class-name} + # jdbc-url: ${spring.datasource.url} + # username: ${spring.datasource.username} + # password: ${spring.datasource.password} jpa: database-platform: org.hibernate.dialect.Oracle10gDialect show-sql: false @@ -71,11 +71,11 @@ contract: bulkstatus: /v1/documents/bulk/status #TODO feat.ens-proxy 배포 시 아래 path 변경 할 것. -# send: /pxy/kkost/v1/documents -# token: /pxy/kkost/v1/tokens -# readcompleted: /pxy/kkost/v1/documents/change -# status: /pxy/kkost/v1/documents/status -# bulksend: /pxy/kkost/v1/documents/bulk + # send: /pxy/kkost/v1/documents + # token: /pxy/kkost/v1/tokens + # readcompleted: /pxy/kkost/v1/documents/change + # status: /pxy/kkost/v1/documents/status + # bulksend: /pxy/kkost/v1/documents/bulk bill: dozn: host: ${xit.app.url} @@ -88,9 +88,9 @@ contract: notice: /iup/kakao/notice prepay: /iup/kakao/prepay payresult: /iup/kakao/pay-result -# notice: /bill/kko/pay/notice -# prepay: /bill/kko/pay/able -# payresult: /bill/kko/pay/result + # notice: /bill/kko/pay/notice + # prepay: /bill/kko/pay/able + # payresult: /bill/kko/pay/result alimtalk: biztalk: @@ -116,9 +116,9 @@ contract: pay: easy: #TODO feat.NaverPay 운영전환 시 네이버 직접호출 불가할 경우 web서버 통해서 호출하도록 설정 -# host: https://dev.apis.naver.com + # host: https://dev.apis.naver.com host: https://apis.naver.com -# host: ${xit.app.url} + # host: ${xit.app.url} partner-id: np_mtbfw423545 client-id: eN8fbl2qw0tox78Z3D5C client-secret: nvE6dSSnGf @@ -126,12 +126,12 @@ contract: ep-sdk-mode: production api: # TODO feat.NaverPay - 변경된 ens-proxy URL 적용 -# pay-apply: /pxy/nvbill/ep/pay-apply -# pay-cancel: /pxy/nvbill/ep/pay-cancel -# pay-hist: /pxy/nvbill/ep/pay-hist -# purchase-confirm: /pxy/nvbill/ep/purchase-confirm -# point-save: /pxy/nvbill/ep/point-save -# cash-amount: /pxy/nvbill/ep/cash-amount + # pay-apply: /pxy/nvbill/ep/pay-apply + # pay-cancel: /pxy/nvbill/ep/pay-cancel + # pay-hist: /pxy/nvbill/ep/pay-hist + # purchase-confirm: /pxy/nvbill/ep/purchase-confirm + # point-save: /pxy/nvbill/ep/point-save + # cash-amount: /pxy/nvbill/ep/cash-amount validate: #TODO feat.NaverPay 네이버페이측에서 결제검증 요청 시 ens-middleware 주소인 https://paytoll.koti.re.kr 로 변경 요함 host: ${xit.middle.url} @@ -165,4 +165,4 @@ cors: decorator: datasource: p6spy: - enable-logging: false \ No newline at end of file + enable-logging: false diff --git a/src/test/java/cokr/xit/TempTest.java b/src/test/java/cokr/xit/TempTest.java deleted file mode 100644 index 7d0c083..0000000 --- a/src/test/java/cokr/xit/TempTest.java +++ /dev/null @@ -1,146 +0,0 @@ -package cokr.xit; - -import cokr.xit.ens.core.utils.DateUtil; -import cokr.xit.ens.core.utils.crypto.Crypto; -import cokr.xit.ens.core.utils.crypto.SHA256; -import cokr.xit.ens.modules.common.ctgy.nicedici.support.rest.model.NiceCiRespDTO; -import cokr.xit.ens.modules.common.ctgy.nicedici.support.rest.model.conf.DataBodyGenerateTokenResp; -import cokr.xit.ens.modules.common.ctgy.nicedici.support.rest.model.conf.DataBodySymkeyResp; -import cokr.xit.ens.core.utils.crypto.AES256; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.gson.Gson; -import org.junit.jupiter.api.Test; - -import java.security.NoSuchAlgorithmException; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.*; - -public class TempTest { - - @Test - public void t() throws NoSuchAlgorithmException { - List jids = Arrays.asList("861128-1018410", "8611281234567", "9311281234567", "1211281234567", "1111281234567", "3211281234567"); - jids.forEach(s -> { - AES256 aes = new AES256(Crypto.AES256.getKey()); - String encStr = aes.encrypt(s); - String decStr = aes.decrypt(encStr); - System.out.println("AES256 enc:::" + encStr); - System.out.println("AES256 dec:::" + decStr); - }); - String enc = SHA256.encrypt("8611281018410"); - System.out.println("SHA256 enc:::" + enc); - System.out.println("688787d8ff144c502c7f5cffaafe2cc588d86079f9de88304c26b0cb99ce91c6".length()); - -// Collections.singletonList(Collections.singletonMap()) -// new Gson(). - } - - @Test - public void test() { - Gson gson = new Gson(); - ObjectMapper mapper = new ObjectMapper(); - String json = "{ \"access_token\": \"a12341234\"}"; - - try { - DataBodyGenerateTokenResp dto = gson.fromJson(json, DataBodyGenerateTokenResp.class); - DataBodyGenerateTokenResp dto2 = mapper.readValue(json, DataBodyGenerateTokenResp.class); - System.out.println("========================================="); - System.out.println("dto " + dto.toString()); - System.out.println("dto2 " + dto2.toString()); - - Map m = gson.fromJson(json, Map.class); - DataBodyGenerateTokenResp dto3 = mapper.convertValue(m, DataBodyGenerateTokenResp.class); - System.out.println("dto3 " + dto3.toString()); - - } catch (Exception e) { - e.printStackTrace(); - } - } - - @Test - public void test2() throws ParseException { - System.out.println(DateUtil.daysByFromBetweenTo(new SimpleDateFormat("yyyyMMdd").parse("20220403"), new Date())); - System.out.println(DateUtil.absTimeSecToDate(1576983012, "yyyyMMdd")); - int curSec = (int) (new SimpleDateFormat("yyyyMMdd").parse("20220503").getTime() / 1000); - System.out.println(DateUtil.daysByFromBetweenTo(1576983012, curSec)); - System.out.println(1576983012 + curSec); - System.out.println((1576983012 / 24 / 60 / 60)); -// System.out.println(new Date().getTime()); - - - Calendar calendar = Calendar.getInstance(); - calendar.setTimeInMillis((1576983012 * 1000L) + (curSec * 1000L)); - Date date = calendar.getTime(); - System.out.println(new SimpleDateFormat("yyyyMMdd").format(date)); - System.out.println(DateUtil.relTimeSecToDate(1576983012, "yyyyMMdd")); - - } - - @Test - public void test3() { - System.out.println(randomAlphaWord(30)); - System.out.println(randomAlphaWord(16)); - System.out.println(randomAlphaWord(2)); - } - - public static String randomAlphaWord(int wordLength) { - Random r = new Random(); - - StringBuilder sb = new StringBuilder(wordLength); - for (int i = 0; i < wordLength; i++) { - char tmp = (char) ('a' + r.nextInt('z' - 'a')); - sb.append(tmp); - - } - return sb.toString(); - - } - - @Test - public void test4() { - - final ObjectMapper mapper = new ObjectMapper() -// .disable(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT) - .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES); - - -// Map dataHeader = new HashMap<>(); -// dataHeader.put("GW_RSLT_CD", "abcd"); -// dataHeader.put("GW_RSLT_MSG", "aaaaa"); -// Map dataBody = new HashMap<>(); -// dataBody.put("rsp_cd", "1234"); -// dataBody.put("res_msg", "hahahah"); -// Map mParam = new HashMap<>(); -// mParam.put("dataHeader", dataHeader); -//// mParam.put("dataBody", dataBody); -// mParam.put("dataBody", ""); -//// mParam.put("dataBody", null); -// -// -// - try { -// String jsonStr = mapper.writeValueAsString(mParam); -//// System.out.println(jsonStr); -//// jsonStr = jsonStr.replaceAll("\"\"", "null"); -//// System.out.println(jsonStr); -// -// NiceCiRespDTO respDTO = mapper.readValue(jsonStr, NiceCiRespDTO.class); -//// NiceCiRespDTO respDTO = mapper.readValue(jsonStr, new TypeReference>(){}); -//// NiceCiRespDTO respDTO = mapper.readValue(jsonStr, mapper.getTypeFactory().constructType(DataBodyCiResp.class)); -// System.out.println(respDTO.toString()); - - String strRespBody = "{ \"dataHeader\": { \"CNTY_CD\": \"ko\", \"GW_RSLT_CD\": \"1200\", \"GW_RSLT_MSG\": \"오류 없음\" }, \"dataBody\": { \"rsp_cd\": \"P000\", \"result_cd\": \"0000\", \"symkey_stat_info\": \"{\\\"cur_symkey_version\\\":\\\"20220506A6834B1B-1288-IPCD-965C-8C9B30558CCF\\\",\\\"cur_valid_dtim\\\":\\\"20221106180509\\\"}\" }}"; - strRespBody = strRespBody.replace("\\", "").replace("\"{", "{").replace("}\"", "}"); - NiceCiRespDTO result = mapper.readValue(strRespBody, new TypeReference>() { - }); - System.out.println(result); - - } catch (Exception e) { - e.printStackTrace(); - } - } - -} diff --git a/src/test/java/cokr/xit/ens/biz/iup/service/IupAlimtalkEnsAcceptorTest.java b/src/test/java/cokr/xit/ens/biz/iup/service/IupAlimtalkEnsAcceptorTest.java deleted file mode 100644 index 2d2a403..0000000 --- a/src/test/java/cokr/xit/ens/biz/iup/service/IupAlimtalkEnsAcceptorTest.java +++ /dev/null @@ -1,183 +0,0 @@ -//package cokr.xit.ens.biz.iup.service; -// -//import cokr.xit.ens.core.exception.EnsException; -//import cokr.xit.ens.core.exception.code.EnsErrCd; -//import cokr.xit.ens.modules.common.code.PostSeCd; -//import cokr.xit.ens.modules.common.code.StatCd; -//import cokr.xit.ens.modules.common.code.VenderCd; -//import cokr.xit.ens.modules.common.domain.SendMast; -//import cokr.xit.ens.modules.common.domain.repository.SendMastRepository; -//import cokr.xit.ens.modules.kkoalimtalk.domain.SendDetailKkoAlimtalk; -//import cokr.xit.ens.modules.kkoalimtalk.domain.repository.SendDetailKkoAlimtalkRepository; -//import cokr.xit.ens.modules.common.ctgy.bill.kko.domain.KkoBillMast; -//import cokr.xit.ens.modules.common.ctgy.bill.kko.domain.repository.KkoBillMastRepository; -//import com.fasterxml.jackson.core.JsonProcessingException; -//import com.fasterxml.jackson.databind.ObjectMapper; -//import org.junit.jupiter.api.Test; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.boot.test.context.SpringBootTest; -// -//import java.time.LocalDateTime; -//import java.util.*; -// -//@SpringBootTest -//class IupAlimtalkEnsAcceptorTest { -// -// @Autowired -// private SendMastRepository sendMastRepository; -// @Autowired -// private KkoBillMastRepository kkoBillMastRepository; -// @Autowired -// private SendDetailKkoAlimtalkRepository sendDetailKkoAlimtalkRepository; -// -// -// final String ORG_CD = "123"; -// final String TMPLT_CD = "IUP_001"; -// -// @Test -// void alimtalk() { -// -// SendMast sendMast = this.makeSendMast(10); -// List sendDetails = Arrays.asList( -// convertTbInputDataToSendDetailKkoAlimtalk("data-1",sendMast), -// convertTbInputDataToSendDetailKkoAlimtalk("data-2", sendMast), -// convertTbInputDataToSendDetailKkoAlimtalk("data-3", sendMast), -// convertTbInputDataToSendDetailKkoAlimtalk("data-4", sendMast), -// convertTbInputDataToSendDetailKkoAlimtalk("data-5", sendMast), -// convertTbInputDataToSendDetailKkoAlimtalk("data-6", sendMast), -// convertTbInputDataToSendDetailKkoAlimtalk("data-7", sendMast), -// convertTbInputDataToSendDetailKkoAlimtalk("data-8", sendMast), -// convertTbInputDataToSendDetailKkoAlimtalk("data-9", sendMast), -// convertTbInputDataToSendDetailKkoAlimtalk("data-10", sendMast), -// convertTbInputDataToSendDetailKkoAlimtalk("data-11", sendMast), -// convertTbInputDataToSendDetailKkoAlimtalk("data-12", sendMast) -// ); -// -// -// sendMastRepository.save(sendMast); -// sendDetails.stream().forEach(row -> kkoBillMastRepository.save(row.getKkoBillMast())); -// List result = sendDetailKkoAlimtalkRepository.saveAll(sendDetails); -//// System.out.println(result.toString()); -// } -// -// -// /** -// * 발송마스터 -// * @param sendCnt -// * @return -// */ -// private SendMast makeSendMast(int sendCnt){ -// -// return SendMast.builder() -// .vender(VenderCd.biztalk) -// .postSe(PostSeCd.kkoAlimtalk) -// .orgCd(ORG_CD) -// .tmpltCd(TMPLT_CD) -// .postBundleTitle("") -//// .acceptDt() -// .statCd(StatCd.accept) -// .sendDt(LocalDateTime.now()) -// .sendCnt(sendCnt) -// .readCnt(0) -// .closeDt(LocalDateTime.now()) -// .build(); -// } -// -// /** -// * 카카오청구서 마스터 -// * @param dataId -// * @return -// */ -// private KkoBillMast makeKkoBillMast(String dataId){ -// -// ObjectMapper mapper = new ObjectMapper(); -// -// -// Map mParameters = new HashMap(); -// mParameters.put("orgCd", ORG_CD); -// mParameters.put("tmpltCd", TMPLT_CD); -// String parameters = null; -// try { -// parameters = mapper.writeValueAsString(parameters); -// } catch (JsonProcessingException e) { -// throw new EnsException(EnsErrCd.ACPT511, "청구서 parameters 데이터 변환 실패"); -// } -// Map mCutomUrl = new HashMap(); -// mCutomUrl.put("notice_url", "http://localhost/kakao/notice"); -// mCutomUrl.put("prepay_url", "http://localhost/kakao/prepay"); -// mCutomUrl.put("pay_result_url", "http://localhost/kakao/pay-result"); -// String customUrl = null; -// try { -// customUrl = mapper.writeValueAsString(mCutomUrl); -// } catch (JsonProcessingException e) { -// throw new EnsException(EnsErrCd.ACPT511, "청구서 customUrl 데이터 변환 실패"); -// } -// return KkoBillMast.builder() -// .billerUserKey(dataId) -// .billedYearMonth(null) -// .ordinal(null) -// .billerNoticeKey(null) -// .expireAt(String.format("%s235959", "20220221")) -// .parameters(parameters) -// .customUrl(customUrl) -// .build(); -// -// } -// -// /** -// * 데이터변환( InputData => SendDetailKkoAlimtalk ) -// * @param dataId -// * @param sendMast -// * @return -// */ -// private SendDetailKkoAlimtalk convertTbInputDataToSendDetailKkoAlimtalk(String dataId, SendMast sendMast) { -// ObjectMapper mapper = new ObjectMapper(); -// -// KkoBillMast kkobillMast = this.makeKkoBillMast(dataId); -// -// Map button = new HashMap<>(); -// button.put("name", "납부하기"); -// button.put("type", "WL"); -// button.put("url_mobile", "#{billlink_url}"); -// button.put("url_pc", "#{billlink_url}"); -// ArrayList> buttons = new ArrayList<>(); -// buttons.add(button); -// Map mAttach = new HashMap<>(); -// mAttach.put("button", buttons); -// String attach = null; -// try { -// attach = mapper.writeValueAsString(mAttach); -// } catch (JsonProcessingException e) { -// throw new EnsException(EnsErrCd.ACPT511, "청구서 attach 데이터 변환 실패"); -// } -// -// -// -// return SendDetailKkoAlimtalk.builder() -// .sendMast(sendMast) -// .msgIdx(dataId) -// .countryCode("82") -// .recipient(null) -// .senderKey("SENDER_KEY") -// .appUserId(null) -// .orgCode(null) -// .message("NONasfasdf") -// .tmpltCode(TMPLT_CD) -// .title(null) -// .resMethod("PUSH") -// .attach(attach) -// .supplement(null) -// .messageType("AT") -// .useFailback(null) -// .mmsAttach("N") -// .kkoBillMast(kkobillMast) -// .mkName("data.getName()") -// .mkBirthday("data.getBirthday()") -// .mkSid("data.getSid()") -// .mkGender("data.getGender()") -// .mkTmpltMsgJsonData("data.getMsgData()") -// .mkMblJsonData("data.getMsgDtlData()") -// .mkPayBillJsonData(null) -// .build(); -// } -//} \ No newline at end of file diff --git a/src/test/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/service/TrafficCcMydocServiceTest.java b/src/test/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/service/TrafficCcMydocServiceTest.java deleted file mode 100644 index 9d54e27..0000000 --- a/src/test/java/cokr/xit/ens/biz/traffic/chuncheon/mydoc/v2/service/TrafficCcMydocServiceTest.java +++ /dev/null @@ -1,39 +0,0 @@ -package cokr.xit.ens.biz.traffic.chuncheon.mydoc.v2.service; - -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.junit.jupiter.SpringExtension; - -@SpringBootTest -@ExtendWith(SpringExtension.class) -class TrafficCcMydocServiceTest { - @Autowired - private TrafficCcMydocService trafficCcMydocService; - - - @Test - void accept() { - } - - @Test - void acceptAll() { - } - - @Test - void reMake() { - } - - @Test - void reSend() { - } - - @Test - void fetch() { - } - - @Test - void fetchAll() { - } -} \ No newline at end of file diff --git a/src/test/java/cokr/xit/ens/modules/post/domains/sign/domain/KakaoSignTalkSendInfoRepositoryTest.java b/src/test/java/cokr/xit/ens/modules/post/domains/sign/domain/KakaoSignTalkSendInfoRepositoryTest.java deleted file mode 100644 index d329598..0000000 --- a/src/test/java/cokr/xit/ens/modules/post/domains/sign/domain/KakaoSignTalkSendInfoRepositoryTest.java +++ /dev/null @@ -1,53 +0,0 @@ -//package cokr.xit.modules.post.domains.sign.domain; -// -//import static org.junit.jupiter.api.Assertions.assertEquals; -// -//import org.junit.jupiter.api.Test; -//import org.junit.jupiter.api.extension.ExtendWith; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; -//import org.springframework.test.context.junit.jupiter.SpringExtension; -// -//import cokr.xit.modules.domain.SendMast; -// -//@ExtendWith(SpringExtension.class) -//@DataJpaTest -//class KakaoSignTalkSendInfoRepositoryTest { -// -// @Autowired -// private KakaoSignTalkSendInfoRepository kakaoSignTalkSendInfoRepository; -// -// @Test -// void testFindByTxId() { -// String txId = "abcdefg123456"; -// -// final KakaoSignTalkSendInfo param = KakaoSignTalkSendInfo.builder() -// .sendMast(SendMast.builder().vender("kt").build()) -// .phone_no("01012341234") -// .name("test") -// .birthday("021025") -// .expires_in(86400) -// .call_center_no("070-1234-1234") -// .title("test") -// .publish_certified_electronic_doc("N") -// .redirect_url("http://xxx.xxx.com") -// .result("N") -// .txId(txId) -// .build(); -// -// final KakaoSignTalkSendInfo vo = kakaoSignTalkSendInfoRepository.save(param); -// -// assertEquals(txId, vo.getTxId()); -// } -// -//// @Test -//// void testFindBySendMast() { -//// fail("Not yet implemented"); -//// } -//// -//// @Test -//// void testBatchUpdateByResult() { -//// fail("Not yet implemented"); -//// } -// -//} diff --git a/src/test/java/cokr/xit/problems/FindDuplicateNumber.java b/src/test/java/cokr/xit/problems/FindDuplicateNumber.java deleted file mode 100644 index 2620288..0000000 --- a/src/test/java/cokr/xit/problems/FindDuplicateNumber.java +++ /dev/null @@ -1,43 +0,0 @@ -package cokr.xit.problems; - -import org.junit.jupiter.api.Test; - -public class FindDuplicateNumber { - - @Test - public void main(){ - int[] nums = {1,3,4,2,2}; - System.out.println(String.format("{1,3,4,2,2} in duplicate number => %s", findDuplicate(nums))); - - nums = new int[]{3,1,3,4,2}; - System.out.println(String.format("{3,1,3,4,2} in duplicate number => %s", findDuplicate(nums))); - - nums = new int[]{1,1}; - System.out.println(String.format("{1,1} in duplicate number => %s", findDuplicate(nums))); - - nums = new int[]{1,1,2}; - System.out.println(String.format("{1,1,2} in duplicate number => %s", findDuplicate(nums))); - - nums = new int[]{4,1,2,3,4}; - System.out.println(String.format("{4,1,2,3,4} in duplicate number => %s", findDuplicate(nums))); - - } - - private int findDuplicate(int[] nums) { - - int slow = nums[0], fast = nums[nums[0]]; - while (slow != fast) { - slow = nums[slow]; - fast = nums[nums[fast]]; - } - - - int index = 0; - while (slow != index) { - index = nums[index]; - slow = nums[slow]; - } - - return index; - } -} diff --git a/src/test/java/cokr/xit/problems/Permutation.java b/src/test/java/cokr/xit/problems/Permutation.java deleted file mode 100644 index 26d3e18..0000000 --- a/src/test/java/cokr/xit/problems/Permutation.java +++ /dev/null @@ -1,68 +0,0 @@ -package cokr.xit.problems; - - -import org.junit.jupiter.api.Test; - -public class Permutation { - - - @Test - public void main() { - int n = 3; - int[] arr = {1, 2, 3}; - int[] output = new int[n]; - boolean[] visited = new boolean[n]; - - perm(arr, output, visited, 0, n, 3); - System.out.println(); - permutation(arr, 0, n, 3); - } - - - - - private void perm(int[] arr, int[] output, boolean[] visited, int depth, int n, int r) { - if (depth == r) { - print(output, r); - return; - } - - for (int i = 0; i < n; i++) { - if (visited[i] != true) { - visited[i] = true; - output[depth] = arr[i]; - perm(arr, output, visited, depth + 1, n, r); - visited[i] = false; - } - } - } - - - - - private void permutation(int[] arr, int depth, int n, int r) { - if (depth == r) { - print(arr, r); - return; - } - - for (int i = depth; i < n; i++) { - swap(arr, depth, i); - permutation(arr, depth + 1, n, r); - swap(arr, depth, i); - } - } - - private void swap(int[] arr, int depth, int i) { - int temp = arr[depth]; - arr[depth] = arr[i]; - arr[i] = temp; - } - - - private void print(int[] arr, int r) { - for (int i = 0; i < r; i++) - System.out.print(arr[i] + " "); - System.out.println(); - } -} diff --git a/src/test/java/cokr/xit/problems/Solution.java b/src/test/java/cokr/xit/problems/Solution.java deleted file mode 100644 index 485dd5d..0000000 --- a/src/test/java/cokr/xit/problems/Solution.java +++ /dev/null @@ -1,64 +0,0 @@ -package cokr.xit.problems; - -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.List; - -class Solution { - - - @Test - public void main(){ - int[] progresses = new int[0]; - int[] speeds = new int[0]; - - - progresses = new int[]{93,30,55}; - speeds = new int[]{1,30,5}; - solution(progresses, speeds); - - - progresses = new int[]{95,91,95,95, 1}; - speeds = new int[]{4,2,3,4,20}; - solution(progresses, speeds); - - } - - public int[] solution(int[] progresses, int[] speeds) { - int[] answer = {}; - - - int[] endDays = new int[progresses.length]; - List releases = new ArrayList<>(); - for(int i=0; i0?1:0; - endDays[i] = day; - } - - check(releases, endDays, endDays[0], 1, 1, false); - answer = releases.stream().mapToInt(value -> value).toArray(); - - return answer; - } - - - private void check(List release, int[] endDays, int endDay, int idx, int cnt, boolean isRangeEnd){ - if(isRangeEnd){ - release.add(cnt); - cnt = 1; - } - if(endDays.length == idx){ - release.add(cnt); - return; - } - - if(endDays[idx] <= endDay){ - check(release, endDays, endDay, ++idx, ++cnt, false); - }else{ - check(release, endDays, endDays[idx], ++idx, cnt, true); - } - - } -} \ No newline at end of file diff --git a/src/test/java/cokr/xit/problems/Solution1.java b/src/test/java/cokr/xit/problems/Solution1.java deleted file mode 100644 index d4f8f90..0000000 --- a/src/test/java/cokr/xit/problems/Solution1.java +++ /dev/null @@ -1,104 +0,0 @@ -package cokr.xit.problems; - -import org.junit.jupiter.api.Test; - -import java.util.*; - -class Solution1 { - - - @Test - public void main(){ - String path = null; - - path = "EEESEEEEEENNNN"; - solution(path); -// System.out.println(solution(path)); - path = "SSSSSSWWWNNNNNN"; - solution(path); -// System.out.println(solution(path)); - - - } - - - public String[] solution(String path){ - String[] answer = {}; - - Map> mDirection = createLeftRigthByDirection(); - - List> infos = new ArrayList<>(); - Map info = new HashMap<>(); - - - String curD = null; - int m = 0; - for(int i=0; i(); - } - } - } - - - String msgTmplt = "Time %d: Go straight %dm and turn %s"; - - - List messages = new ArrayList<>(); - for(int i=0; i inf = infos.get(i); - int x = (int) inf.get("time"); - int y = (int) inf.get("meter"); - String direction = (String) inf.get("direction"); - if(i==0 && y <= 5) - messages.add(String.format(msgTmplt, 0, (y*100), direction)); - else - if(y > 5) - messages.add(String.format(msgTmplt, x-5, 500, direction)); - else - messages.add(String.format(msgTmplt, x-1, (y*100), direction)); - } - System.out.println(messages.toString()); - answer = new String[messages.size()]; - for(int i=0; i> createLeftRigthByDirection(){ - - Map lrE = new HashMap<>(); - lrE.put("N", "left"); - lrE.put("S", "right"); - Map lrW = new HashMap<>(); - lrW.put("S", "left"); - lrW.put("N", "right"); - Map lrS = new HashMap<>(); - lrS.put("E", "left"); - lrS.put("W", "right"); - Map lrN = new HashMap<>(); - lrN.put("W", "left"); - lrN.put("E", "right"); - Map> mDirection = new HashMap<>(); - mDirection.put("E", lrE); - mDirection.put("W", lrW); - mDirection.put("S", lrS); - mDirection.put("N", lrN); - return mDirection; - } - - - -} \ No newline at end of file diff --git a/src/test/java/cokr/xit/problems/Solution2.java b/src/test/java/cokr/xit/problems/Solution2.java deleted file mode 100644 index 556644e..0000000 --- a/src/test/java/cokr/xit/problems/Solution2.java +++ /dev/null @@ -1,58 +0,0 @@ -package cokr.xit.problems; - -import org.junit.jupiter.api.Test; - -import java.util.*; - -class Solution2 { - - - @Test - public void main(){ - - String call = null; - - - - call = "abcabcdefabc"; - System.out.println(solution(call)); - - call = "abxdeydeabz"; - System.out.println(solution(call)); - - call = "abcabca"; - System.out.println(solution(call)); - - call = "ABCabcA"; - System.out.println(solution(call)); - } - - private String solution(String call){ - String answer = ""; - - - - Map map = new HashMap(); - for(int i=0; i it = map.keySet().iterator(); - while(it.hasNext()){ - String key = it.next(); - int value = map.get(key); - if(maxCnt == value){ - call = call.replace(key, "").replaceAll(key.toUpperCase(), ""); - } - } - - return call; - } - - - -} \ No newline at end of file diff --git a/src/test/java/cokr/xit/problems/Sort.java b/src/test/java/cokr/xit/problems/Sort.java deleted file mode 100644 index c3fe351..0000000 --- a/src/test/java/cokr/xit/problems/Sort.java +++ /dev/null @@ -1,66 +0,0 @@ -package cokr.xit.problems; - -import org.junit.jupiter.api.Test; - -import java.util.Arrays; -import java.util.Collections; - -public class Sort { - @Test - public void fncSortInteger(){ - int[] nums = {21,31,19,4,16}; - - System.out.println("=================================="); - System.out.println("index 2 부터 정렬"); - System.out.println("=================================="); - Arrays.sort(nums, 2, nums.length); - Arrays.stream(nums).asLongStream() - .forEach(System.out::println); - - - System.out.println("=================================="); - System.out.println("index 0 부터 정렬"); - System.out.println("=================================="); - Arrays.sort(nums); - Arrays.stream(nums).asLongStream() - .forEach(System.out::println); - - - System.out.println("=================================="); - System.out.println("내림차순(desc) 정렬"); - System.out.println("=================================="); - Integer[] nums2 = {4,2,1,5,3}; - Arrays.sort(nums2, Collections.reverseOrder()); - Arrays.stream(nums2) - .forEach(System.out::println); - } - - @Test - public void fncSortString(){ - String[] strs = {"efg","dab","bff","abc",}; - - System.out.println("=================================="); - System.out.println("index 2 부터 정렬"); - System.out.println("=================================="); - Arrays.sort(strs, 2, strs.length); - Arrays.asList(strs).stream() - .forEach(System.out::println); - - - System.out.println("=================================="); - System.out.println("index 0 부터 정렬"); - System.out.println("=================================="); -// Arrays.sort(strs); - Arrays.asList(strs).stream() - .sorted() - .forEach(System.out::println); - - - System.out.println("=================================="); - System.out.println("내림차순(desc) 정렬"); - System.out.println("=================================="); - Arrays.sort(strs, Collections.reverseOrder()); - Arrays.asList(strs).stream() - .forEach(System.out::println); - } -}