Compare commits

...

85 Commits
main ... dev

Author SHA1 Message Date
Jonguk. Lim e77f1e6568 fix: LocalDateTime.toString()시 초가 잘리는 문제 fix 3 days ago
kjh eb627d5407 docs: 카카오페이 결제 신규 테스트 url 적용 1 week ago
kjh af077b867b docs: 카카오톡 전자고지 cron 설정 추가 1 week ago
kjh 7496870790 docs: ddl IUP. 제거 2 weeks ago
Jonguk. Lim 2421dd0b05 fix: cokr.xit.ens package logging level 지정 3 weeks ago
Jonguk. Lim a87442a95b fix: jeus 서버를 위한 반영
- System.property 이용 제거
3 weeks ago
Jonguk. Lim f910907d0d fix: maven spring.profiles.active 설정 3 weeks ago
kjh 77ac5e065d docs: cron 설정 현행화 3 weeks ago
kjh 31259c340b docs: application 적용 3 weeks ago
kjh f257877442 docs: 운영 application 적용 3 weeks ago
kjh 2d94553e66 docs : 배포 내용 작성 3 weeks ago
kjh b517f35e42 docs : accept 실행 로그 추가 3 weeks ago
kjh 51d2e14d19 docs: 카카오톡 전자고지 api 호출 url 적용 3 weeks ago
Jonguk. Lim a68c0c356c fix: nice ci 전문 처리 fix
응답 반복부가 없을 경우에 대한 처리 추가
4 weeks ago
Jonguk. Lim 221c652786 fix: nice ci 전문 처리 fix
전송대상 조회시 err_msg 초기화 적용
     NICE CI 설정 fix
4 weeks ago
Jonguk. Lim 1c86c405f7 fix: nice ci 테스트 적용 4 weeks ago
Jonguk. Lim 036abf14bb docs: SQL 필드 코멘트 추가 1 month ago
kjh 87725de55f docs: 카카오톡 전자고지 제목 40자까지 VARCHAR2(80)으로 변경 1 month ago
Jonguk. Lim a3d5e7f82e docs: FIXME 활성화 1 month ago
Jonguk. Lim 46b4aaf6e6 build: macOS ARM64 지원 네이티브 라이브러리 추가
- netty의 UnsatisfiedLinkerror 오류 방지
1 month ago
Jonguk. Lim 5aed628da0 refactor: Nice CI Accept, Send code refactoring 1 month ago
Jonguk. Lim 9565456542 refactor: Nice CI Accept, Send code refactoring 1 month ago
Jonguk. Lim 1abe698e9c Merge branch 'main' into dev 1 month ago
Jonguk. Lim 6a3d2f680a docs: SQL 필드 코멘트 추가 1 month ago
Jonguk. Lim 953b73fda1 docs: javadoc 추가 1 month ago
Jonguk. Lim 6671698b50 fix: SQL 필드 코멘트 추가 1 month ago
Jonguk. Lim 8474421c8e fix: SQL 필드 코멘트 추가 1 month ago
Jonguk. Lim 0efe06fc7e fix: code cleansing
property 설정 정리
1 month ago
Jonguk. Lim 55cac28529 fix: Exception 메세지 처리 1 month ago
Jonguk. Lim 7eea9fe722 feat: NICE CI 인증톡 반영 완료
close 처리
1 month ago
Jonguk. Lim 1c8378ddb3 feat: NICE CI 인증톡 진행
send, status 반영
1 month ago
Jonguk. Lim 79b32bf50d feat: NICE CI 인증톡 진행
send, status 반영
1 month ago
Jonguk. Lim f5c07f7086 feat: NICE CI 인증톡 진행
send, status 반영
1 month ago
Jonguk. Lim acf7794a75 feat: NICE CI 인증톡 진행
send, status 반영
1 month ago
kjh b30edafbfa fix: 나이스 알림톡템플릿코드 적용 1 month ago
kjh 93149e8153 docs : 나이스 알림톡 이력 조회 설정 값 추가 1 month ago
kjh 43f4eefde1 docs : 나이스 알림톡 이력 조회 설정 값 추가 1 month ago
Jonguk. Lim 3ac3f94f26 feat: NICE CI 인증톡 진행 - sendBulk 반영
API logging 반영
1 month ago
kjh b20af3fcd3 docs : 나이스 알림톡 A0003 샘플 추가 1 month ago
Jonguk. Lim dd5b4d26b1 feat: NICE CI 인증톡 진행 - sendBulk 반영 1 month ago
Jonguk. Lim 542eddf511 feat: NICE CI 인증톡 진행 - sendBulk API 파라메터 set 1 month ago
Jonguk. Lim bc271d09cc feat: NICE CI 인증톡 진행 - sendBulk API 파라메터 set 1 month ago
Jonguk. Lim 3ad2b1e1ac feat: NICE CI 인증톡 진행 - sendBulk API 파라메터 set 1 month ago
kjh a4ab009b83 docs : 나이스 알림톡 키 값 10자리로 변경 1 month ago
kjh 7812b7161a Merge remote-tracking branch 'origin/dev' into dev 1 month ago
kjh e96092c0ec docs : 나이스 알림톡 템플릿 코드 컬럼 추가 1 month ago
Jonguk. Lim baf910a449 feat: NICE CI 인증톡 진행 - NICE CI API 호출 결과 반영 fix 1 month ago
Jonguk. Lim 6bd34dc6ba feat: NICE CI 인증톡 진행
cron 적용 반영
1 month ago
Jonguk. Lim 613ad05383 feat: NICE CI accept 진행
NICE CI API 호출 fix
1 month ago
Jonguk. Lim abaeb3bbc3 feat: NICE CI accept 진행
NICE CI API 호출
1 month ago
Jonguk. Lim 6492b10934 feat: NICE CI accept 진행
expire_at 설정 반영
1 month ago
Jonguk. Lim b43760d9d7 feat: NICE CI accept 진행
BillHistory save 반영
1 month ago
Jonguk. Lim 08b732b2e4 feat: NICE CI accept 진행
BillHistory save 반영
1 month ago
Jonguk. Lim f02f92aede feat: NICE CI accept 진행
BillHistory save 반영
1 month ago
Jonguk. Lim 6d524ddecb feat: 결재API 호출결과 반영 1 month ago
Jonguk. Lim ee392bb1e9 feat: NICE CI accept 진행 1 month ago
kjh bb0cce3a6b docs : 더즌 카카오 청구서 생성 샘플 추가 1 month ago
Jonguk. Lim c869981f59 feat: NICE CI accept 진행 1 month ago
Jonguk. Lim b0946c2201 feat: NICE CI accept 진행 2 months ago
kjh 9df9cd0a24 docs : 나이스 알림톡 업무 쿼리 추가 2 months ago
Jonguk. Lim 2e1f2684d2 feat: NICE CI 소켓 통신 추가
- 전문 응답 parsing
2 months ago
Jonguk. Lim c0a723538f feat: NICE CI 소켓 통신 추가
- 전문 응답 parsing
2 months ago
kjh fd9d600f55 docs : 나이스 알림톡 accept 쿼리 추가 2 months ago
kjh bada945392 docs : 카카오페이 결제 주석 추가 2 months ago
Jonguk. Lim 4a3a1785d1 feat: NICE CI 소켓 통신 추가
- 전문 응답 parsing
2 months ago
Jonguk. Lim 3b2cb5b344 feat: NICE CI 소켓 통신 추가
- 전문 응답 parsing 오류 fix
2 months ago
Jonguk. Lim 54ad7bfafa feat: NICE CI 소켓 통신 추가
- 전문 응답 parsing
2 months ago
Jonguk. Lim b46b24b6b6 feat: NICE CI 소켓 통신 추가
- 전문 응답 parsing
2 months ago
Jonguk. Lim 8faa62c169 feat: NICE CI 소켓 통신 추가 2 months ago
Jonguk. Lim dca46fa392 feat: NICE CI 소켓 통신 추가 2 months ago
kjh 6771f69594 docs : 나이스 알림톡 ddl, 쿼리 추가 2 months ago
Jonguk. Lim 0667900527 Merge branch 'main' into dev
# Conflicts:
#	src/main/java/cokr/xit/ens/core/utils/DateUtil.java
#	src/main/java/cokr/xit/ens/modules/kkotalk/service/support/KkoTalkAcceptor.java
2 months ago
Jonguk. Lim a5c8dbf21d feat: NICE CI 전문 처리 반영
테스트를 위한 소켓 통신모듈 추가
2 months ago
Jonguk. Lim 3f0b367fd4 feat: NICE CI 전문 처리 반영
테스트를 위한 소켓 통신모듈 추가
2 months ago
Jonguk. Lim 4007291d3f feat: NICE CI 전문 처리 반영
-> 한글 2, 그외 1 자리로 처리 하도록 반영
      -> name, message 필드
2 months ago
Jonguk. Lim 462f03d932 feat: NICE CI 전문 처리 반영
-> 한글 2, 그외 1 자리로 처리 하도록 반영
      -> name, message 필드
2 months ago
Jonguk. Lim de9138de55 fix: 재열람만료일시와 마감일시 유효성 체크 활성화 2 months ago
Jonguk. Lim 65948b18de fix: 카카오톡 재열람 만료시간 설정 반영
최초열람마감시간 + 1일
2 months ago
Jonguk. Lim 2af51825ab fix: FIXME 정리 2 months ago
Jonguk. Lim 9a0f255eb9 feat: NICE CI 연락처 이력 조회 전문 및 parser 추가 2 months ago
Jonguk. Lim 056c43a7a4 feat: NICE CI 연락처 이력 조회 전문 및 parser 추가 2 months ago
Jonguk. Lim 82e595f725 feat: NICE CI 응답 전문 parse 추가 2 months ago
Jonguk. Lim 5b2aa87d10 feat: NICE CI 응답 전문 parse 추가 2 months ago
Jonguk. Lim 766751eab7 feat: NICE CI 응답 전문 parse 추가 2 months ago
Jonguk. Lim 15d02657ce feat: NICE CI 전문 추가 2 months ago

@ -13,8 +13,17 @@ annotations, java 폴더가 Excluded 상태인데 마우스 우클릭해서 Sour
### 배포
```text
[민자]
[war 생성]
mvn clean package -P prod
[서버 war 반영]
경로 : /DATA/was/deploy-app/phts-manager/war
war명 : module-post-0.0.1-SNAPSHOT.war
[실행]
시작 : phts-manager_boot
종료 : phts-manager_down
참고 : deploy.sh
```
### 업무

@ -3,29 +3,39 @@
#---------------------------------------------#
# 인증톡
## 업무 테이블 자료 접수
*/2 * * * * curl -X POST https://phts-manager.koti.re.kr/iup/signtalk/accept/all
*/5 * * * * curl -X POST https://phts-manager.koti.re.kr/iup/signtalk/accept/all
## FIXME: 업무 테이블 자료 접수 - NICE CI 추가
*/2 * * * * curl -X POST https://phts-manager.koti.re.kr/nice/talk/accept/all
## 업무 테이블 전송 결과 반영
7 7-23 * * * curl -X POST https://phts-manager.koti.re.kr/iup/signtalk/fetch/all
9 7-23 * * * curl -X POST https://phts-manager.koti.re.kr/iup/signtalk/fetch/all
#---------------------------------------------#
# [ENS] 전송모듈 스케줄러
#---------------------------------------------#
# 통합고지
*/1 9-18 * * * curl -X POST https://phts-manager.koti.re.kr/intgrn/noti/send/bulk/all
*/5 9-18 * * * curl -X POST https://phts-manager.koti.re.kr/intgrn/noti/send/bulk/all
#*/2 7-21 * * * curl -X POST https://phts-manager.koti.re.kr/intgrn/noti/stat/bulk/all
0 9-21 * * * curl -X POST https://phts-manager.koti.re.kr/intgrn/noti/stat/closed
0 10 * * * curl -k -X POST https://phts-manager.koti.re.kr/intgrn/noti/stat/closed
# 카카오 내문서함(인증톡)
*/1 9-18 * * * curl -X POST https://phts-manager.koti.re.kr/kko/mydoc/send/bulk/all
*/30 9-21 * * * curl -X POST https://phts-manager.koti.re.kr/kko/mydoc/stat/bulk/all
*/5 9-18 * * * curl -X POST https://phts-manager.koti.re.kr/kko/mydoc/send/bulk/all
15,45 8-21 * * * curl -X POST https://phts-manager.koti.re.kr/kko/mydoc/stat/bulk/all
# 카카오톡 전자고지(인증톡)
*/5 9-18 * * * curl -X POST https://phts-manager.koti.re.kr/kko/talk/send/bulk/all
20,50 8-21 * * * curl -X POST https://phts-manager.koti.re.kr/kko/talk/stat/bulk/all
# 카카오 알림톡
*/1 9-18 * * * curl -X POST https://phts-manager.koti.re.kr/kko/alimtalk/send/bulk/all
*/30 9-21 * * * curl -X POST https://phts-manager.koti.re.kr/kko/alimtalk/stat/bulk/all
*/10 9-18 * * * curl -X POST https://phts-manager.koti.re.kr/kko/alimtalk/send/bulk/all
*/30 9-21 * * * curl -X POST https://phts-manager.koti.re.kr/kko/alimtalk/stat/bulk/a
# 네이버 고지서(인증톡)
*/1 9-18 * * * curl -X POST https://phts-manager.koti.re.kr/nv/signtalk/send/bulk/all
*/30 9-21 * * * curl -X POST https://phts-manager.koti.re.kr/nv/signtalk/stat/bulk/all
*/5 9-18 * * * curl -X POST https://phts-manager.koti.re.kr/nv/signtalk/send/bulk/all
20,50 8-21 * * * curl -X POST https://phts-manager.koti.re.kr/nv/signtalk/stat/bulk/all
# FIXME: NICE CI 인증톡 추가
*/1 9-18 * * * curl -X POST https://phts-manager.koti.re.kr/nice/talk/send/bulk/all
*/30 9-21 * * * curl -X POST https://phts-manager.koti.re.kr/nice/talk/stat/bulk/all
0 9-21 * * * curl -X POST https://phts-manager.koti.re.kr/nice/talk/stat/closed
#---------------------------------------------#
# [ENS] 로그 데이터 삭제 스케줄러

File diff suppressed because it is too large Load Diff

@ -20,7 +20,7 @@ create table ENS_SND_DTL_KKO_TALK
primary key,
ENVELOPE_ID VARCHAR2(34),
EXTERNAL_ID VARCHAR2(40),
TITLE VARCHAR2(40),
TITLE VARCHAR2(80),
LINK VARCHAR2(500),
HASH VARCHAR2(99),
GUIDE VARCHAR2(2000),
@ -50,10 +50,10 @@ create table ENS_SND_DTL_KKO_TALK
REGIST_DT TIMESTAMP(6),
BILL_UID VARCHAR2(45)
constraint FK_BILL_UID
references IUP.ENS_BILL (BILL_UID),
references ENS_BILL (BILL_UID),
SEND_MAST_ID NUMBER(19)
constraint FK_SEND_MAST_ID
references IUP.ENS_SND_MAST
references ENS_SND_MAST
);
comment on table ENS_SND_DTL_KKO_TALK is '카카오톡 상세';
@ -159,3 +159,347 @@ ALTER TABLE ENS_ORG_MNG ADD KAKAO_PROD_SETTLE_ID VARCHAR2(100);
ALTER TABLE ENS_INTGRN_SND_DTL ADD SEND_DETAIL_ID_KKO_TALK NUMBER(19);
ALTER TABLE ENS_INTGRN_SND_DTL ADD J_ACPT_DOC_KKO_TALK CLOB;
/* **********************************************
*
********************************************** */
CREATE TABLE TB_NICE_SMS_SNDNG_INQIRE_REPTI
(
NICE_SMS_SNDNG_INQIRE_ID CHAR(10) NOT NULL ,
SN NUMBER(2) NOT NULL ,
INQIRE_DT VARCHAR2(20) NULL ,
INDVDL_BSNM_CPR_SE VARCHAR2(1) NULL ,
IHIDNUM VARCHAR2(28) NULL ,
NM VARCHAR2(20) NULL ,
RANK_CTTPC_1 VARCHAR2(11) NULL ,
RANK_CTTPC_2 VARCHAR2(11) NULL ,
RANK_CTTPC_3 VARCHAR2(11) NULL ,
RESULT_SE VARCHAR2(2) NULL ,
SMS_SNDNG_REQUST_SE VARCHAR2(1) NULL ,
SNDNG_MSSAGE VARCHAR2(1000) NULL ,
DSPTCH_NO VARCHAR2(12) NULL ,
SMS_SNDNG_CTTPC_RANK VARCHAR2(1) NULL ,
SMS_SNDNG_CTTPC_NO VARCHAR2(11) NULL ,
SMS_SNDNG_DT VARCHAR2(14) NULL ,
OPETR_ID VARCHAR2(9) NULL ,
CTTPC_INQIRE_SE VARCHAR2(1) NULL ,
MSSAGE_SNDNG_RESULT_SE VARCHAR2(1) NULL ,
RSPNS_REPTIT_BLNK VARCHAR2(11) NULL ,
CREAT_DT DATE NULL ,
CRTR VARCHAR2(50) NULL
);
CREATE UNIQUE INDEX TB_NICE_SMS_SNDNG_INQIRE_REPTI ON TB_NICE_SMS_SNDNG_INQIRE_REPTI
(NICE_SMS_SNDNG_INQIRE_ID ASC,SN ASC);
ALTER TABLE TB_NICE_SMS_SNDNG_INQIRE_REPTI
ADD CONSTRAINT TB_NICE_SMS_SNDNG_INQIRE_REPTI PRIMARY KEY (NICE_SMS_SNDNG_INQIRE_ID,SN);
CREATE TABLE TB_NICE_SMS_SNDNG_INQIRE_REQUS
(
NICE_SMS_SNDNG_INQIRE_ID CHAR(10) NOT NULL ,
TRNSC_ID VARCHAR2(10) NULL ,
SPCLTY_GROUPCODE VARCHAR2(9) NULL ,
DELNG_ASORTCODE NUMBER(4) NULL ,
DELNG_SECODE NUMBER(5) NULL ,
TRSMRCV_AT VARCHAR2(1) NULL ,
TRMNL_SE VARCHAR2(3) NULL ,
RSPNS_CODE VARCHAR2(4) NULL ,
PARTCPT_INSTT_ID VARCHAR2(9) NULL ,
INSTT_SPCLTY_MANAGENO VARCHAR2(10) NULL ,
INSTT_SPCLTY_TRNSMISTIME VARCHAR2(14) NULL ,
NICE_SPCLTY_MANAGENO VARCHAR2(10) NULL ,
NICE_SPCLTY_TRNSMISTIME VARCHAR2(14) NULL ,
BLNK VARCHAR2(17) NULL ,
SEARCH_PD_FROM VARCHAR2(20) NULL ,
SEARCH_PD_TO VARCHAR2(20) NULL ,
INDVDL_BSNM_CPR_SE VARCHAR2(1) NULL ,
IHIDNUM VARCHAR2(28) NULL ,
RESULT_SE VARCHAR2(2) NULL ,
SMS_SNDNG_REQUST_SE VARCHAR2(1) NULL ,
REQUST_CO VARCHAR2(10) NULL ,
ACCMLT_RECPTN_CO VARCHAR2(10) NULL ,
INDVDLZ_REQUST_BLNK VARCHAR2(23) NULL ,
CREAT_DT DATE NULL ,
CRTR VARCHAR2(50) NULL
);
CREATE UNIQUE INDEX TB_NICE_SMS_SNDNG_INQIRE_REQUS ON TB_NICE_SMS_SNDNG_INQIRE_REQUS
(NICE_SMS_SNDNG_INQIRE_ID ASC);
ALTER TABLE TB_NICE_SMS_SNDNG_INQIRE_REQUS
ADD CONSTRAINT TB_NICE_SMS_SNDNG_INQIRE_REQUS PRIMARY KEY (NICE_SMS_SNDNG_INQIRE_ID);
CREATE TABLE TB_NICE_SMS_SNDNG_INQIRE_RSPNS
(
NICE_SMS_SNDNG_INQIRE_ID CHAR(10) NOT NULL ,
TRNSC_ID VARCHAR2(10) NULL ,
SPCLTY_GROUPCODE VARCHAR2(9) NULL ,
DELNG_ASORTCODE NUMBER(4) NULL ,
DELNG_SECODE NUMBER(5) NULL ,
TRSMRCV_AT VARCHAR2(1) NULL ,
TRMNL_SE VARCHAR2(3) NULL ,
RSPNS_CODE VARCHAR2(4) NULL ,
PARTCPT_INSTT_ID VARCHAR2(9) NULL ,
INSTT_SPCLTY_MANAGENO VARCHAR2(10) NULL ,
INSTT_SPCLTY_TRNSMISTIME VARCHAR2(14) NULL ,
NICE_SPCLTY_MANAGENO VARCHAR2(10) NULL ,
NICE_SPCLTY_TRNSMISTIME VARCHAR2(14) NULL ,
BLNK VARCHAR2(17) NULL ,
TOT_CO VARCHAR2(10) NULL ,
ACCMLT_CO VARCHAR2(10) NULL ,
RSPNS_CO VARCHAR2(10) NULL ,
CREAT_DT DATE NULL ,
CRTR VARCHAR2(50) NULL
);
CREATE UNIQUE INDEX TB_NICE_SMS_SNDNG_INQIRE_RSPNS ON TB_NICE_SMS_SNDNG_INQIRE_RSPNS
(NICE_SMS_SNDNG_INQIRE_ID ASC);
ALTER TABLE TB_NICE_SMS_SNDNG_INQIRE_RSPNS
ADD CONSTRAINT TB_NICE_SMS_SNDNG_INQIRE_RSPNS PRIMARY KEY (NICE_SMS_SNDNG_INQIRE_ID);
CREATE TABLE TB_NICE_SMS_SNDNG_REQUST
(
NICE_SMS_SNDNG_REQUST_ID CHAR(10) NOT NULL ,
DATA_ID VARCHAR2(30) NULL ,
TRNSC_ID VARCHAR2(10) NULL ,
SPCLTY_GROUPCODE VARCHAR2(9) NULL ,
DELNG_ASORTCODE NUMBER(4) NULL ,
DELNG_SECODE NUMBER(5) NULL ,
TRSMRCV_AT VARCHAR2(1) NULL ,
TRMNL_SE VARCHAR2(3) NULL ,
RSPNS_CODE VARCHAR2(4) NULL ,
PARTCPT_INSTT_ID VARCHAR2(9) NULL ,
INSTT_SPCLTY_MANAGENO VARCHAR2(10) NULL ,
INSTT_SPCLTY_TRNSMISTIME VARCHAR2(14) NULL ,
NICE_SPCLTY_MANAGENO VARCHAR2(10) NULL ,
NICE_SPCLTY_TRNSMISTIME VARCHAR2(14) NULL ,
BLNK VARCHAR2(16) NULL ,
INQIRE_AGRE_RESN VARCHAR2(1) NULL ,
INQIRE_RESN VARCHAR2(2) NULL ,
INQIRE_REQUST_CO NUMBER(2) NULL ,
SMS_SNDNG_REQUST_SE VARCHAR2(1) NULL ,
SNDNG_MSSAGE VARCHAR2(2000) NULL ,
DSPTCH_NO VARCHAR2(12) NULL ,
CTTPC_INQIRE_SE VARCHAR2(1) NULL ,
NTCNTALK_SNDNG_REQUST_SE VARCHAR2(1) NULL ,
NTCNTALK_TMPLAT_CODE VARCHAR2(100) NULL ,
BTTON_REQUST_CO NUMBER(1) NULL ,
INDVDLZ_REQUST_BLNK VARCHAR2(880) NULL ,
INDVDL_BSNM_CPR_SE VARCHAR2(1) NULL ,
IHIDNUM VARCHAR2(28) NULL ,
INQIRE_REQUST_BLNK VARCHAR2(36) NULL ,
BTTON_TY VARCHAR2(2) NULL ,
BTTON_NM VARCHAR2(56) NULL ,
BTTON_URL_WEB_LINK_1 VARCHAR2(1000) NULL ,
BTTON_URL_WEB_LINK_2 VARCHAR2(1000) NULL ,
BTTON_REQUST_BLNK VARCHAR2(942) NULL ,
CREAT_DT DATE NULL ,
CRTR VARCHAR2(50) NULL
);
CREATE UNIQUE INDEX TB_NICE_SMS_SNDNG_REQUST_PK ON TB_NICE_SMS_SNDNG_REQUST
(NICE_SMS_SNDNG_REQUST_ID ASC);
ALTER TABLE TB_NICE_SMS_SNDNG_REQUST
ADD CONSTRAINT TB_NICE_SMS_SNDNG_REQUST_PK PRIMARY KEY (NICE_SMS_SNDNG_REQUST_ID);
CREATE TABLE TB_NICE_SMS_SNDNG_RSPNS
(
NICE_SMS_SNDNG_REQUST_ID CHAR(10) NOT NULL ,
TRNSC_ID VARCHAR2(10) NULL ,
SPCLTY_GROUPCODE VARCHAR2(9) NULL ,
DELNG_ASORTCODE NUMBER(4) NULL ,
DELNG_SECODE NUMBER(5) NULL ,
TRSMRCV_AT VARCHAR2(1) NULL ,
TRMNL_SE VARCHAR2(3) NULL ,
RSPNS_CODE VARCHAR2(4) NULL ,
PARTCPT_INSTT_ID VARCHAR2(9) NULL ,
INSTT_SPCLTY_MANAGENO VARCHAR2(10) NULL ,
INSTT_SPCLTY_TRNSMISTIME VARCHAR2(14) NULL ,
NICE_SPCLTY_MANAGENO VARCHAR2(10) NULL ,
NICE_SPCLTY_TRNSMISTIME VARCHAR2(14) NULL ,
BLNK VARCHAR2(17) NULL ,
RSPNS_CO NUMBER(2) NULL ,
SMS_SNDNG_REQUST_SE VARCHAR2(1) NULL ,
SNDNG_MSSAGE VARCHAR2(2000) NULL ,
DSPTCH_NO VARCHAR2(12) NULL ,
CTTPC_INQIRE_SE VARCHAR2(1) NULL ,
INDVDLZ_RSPNS_BLNK VARCHAR2(84) NULL ,
INDVDL_BSNM_CPR_SE VARCHAR2(1) NULL ,
IHIDNUM VARCHAR2(28) NULL ,
NM VARCHAR2(20) NULL ,
RANK_CTTPC_1 VARCHAR2(11) NULL ,
RANK_CTTPC_2 VARCHAR2(11) NULL ,
RANK_CTTPC_3 VARCHAR2(11) NULL ,
RESULT_SE VARCHAR2(2) NULL ,
SMS_SNDNG_CTTPC_RANK VARCHAR2(1) NULL ,
SMS_SNDNG_CTTPC_NO VARCHAR2(11) NULL ,
SMS_SNDNG_DT VARCHAR2(14) NULL ,
RSPNS_REPTIT_BLNK VARCHAR2(15) NULL ,
CREAT_DT DATE NULL ,
CRTR VARCHAR2(50) NULL
);
CREATE UNIQUE INDEX TB_NICE_SMS_SNDNG_RSPNS_PK ON TB_NICE_SMS_SNDNG_RSPNS
(NICE_SMS_SNDNG_REQUST_ID ASC);
ALTER TABLE TB_NICE_SMS_SNDNG_RSPNS
ADD CONSTRAINT TB_NICE_SMS_SNDNG_RSPNS_PK PRIMARY KEY (NICE_SMS_SNDNG_REQUST_ID);
COMMENT ON TABLE TB_NICE_SMS_SNDNG_INQIRE_REPTI IS 'NICE SMS 발송 조회 반복';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REPTI.NICE_SMS_SNDNG_INQIRE_ID IS 'NICE_SMS_발송_조회_ID';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REPTI.SN IS '순번';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REPTI.INQIRE_DT IS '조회_일시';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REPTI.INDVDL_BSNM_CPR_SE IS '개인_사업자_법인_구분';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REPTI.IHIDNUM IS '주민번호';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REPTI.NM IS '성명';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REPTI.RANK_CTTPC_1 IS '1_순위_연락처';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REPTI.RANK_CTTPC_2 IS '2_순위_연락처';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REPTI.RANK_CTTPC_3 IS '3_순위_연락처';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REPTI.RESULT_SE IS '결과_구분';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REPTI.SMS_SNDNG_REQUST_SE IS 'SMS_발송_요청_구분';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REPTI.SNDNG_MSSAGE IS '발송_메시지';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REPTI.DSPTCH_NO IS '발신_번호';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REPTI.SMS_SNDNG_CTTPC_RANK IS 'SMS_발송_연락처_순위';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REPTI.SMS_SNDNG_CTTPC_NO IS 'SMS_발송_연락처_번호';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REPTI.SMS_SNDNG_DT IS 'SMS_발송_일시';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REPTI.OPETR_ID IS '처리자_ID';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REPTI.CTTPC_INQIRE_SE IS '연락처_조회_구분';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REPTI.MSSAGE_SNDNG_RESULT_SE IS '메시지_발송_결과_구분';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REPTI.RSPNS_REPTIT_BLNK IS '응답_반복_공란';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REPTI.CREAT_DT IS '생성_일시';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REPTI.CRTR IS '생성자';
COMMENT ON TABLE TB_NICE_SMS_SNDNG_INQIRE_REQUS IS 'NICE SMS 발송 조회 요청';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REQUS.NICE_SMS_SNDNG_INQIRE_ID IS 'NICE_SMS_발송_조회_ID';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REQUS.TRNSC_ID IS '트랜잭션_ID';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REQUS.SPCLTY_GROUPCODE IS '전문_그룹코드';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REQUS.DELNG_ASORTCODE IS '거래_종별코드';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REQUS.DELNG_SECODE IS '거래_구분코드';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REQUS.TRSMRCV_AT IS '송수신_플래그';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REQUS.TRMNL_SE IS '단말기_구분';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REQUS.RSPNS_CODE IS '응답_코드';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REQUS.PARTCPT_INSTT_ID IS '참가_기관_ID';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REQUS.INSTT_SPCLTY_MANAGENO IS '기관_전문_관리번호';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REQUS.INSTT_SPCLTY_TRNSMISTIME IS '기관_전문_전송시간';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REQUS.NICE_SPCLTY_MANAGENO IS 'NICE_전문_관리번호';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REQUS.NICE_SPCLTY_TRNSMISTIME IS 'NICE_전문_전송시간';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REQUS.BLNK IS '공란';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REQUS.SEARCH_PD_FROM IS '검색_기간_FROM';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REQUS.SEARCH_PD_TO IS '검색_기간_TO';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REQUS.INDVDL_BSNM_CPR_SE IS '개인_사업자_법인_구분';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REQUS.IHIDNUM IS '주민번호';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REQUS.RESULT_SE IS '결과_구분';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REQUS.SMS_SNDNG_REQUST_SE IS 'SMS_발송_요청_구분';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REQUS.REQUST_CO IS '요청_건수';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REQUS.ACCMLT_RECPTN_CO IS '누적_수신_건수';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REQUS.INDVDLZ_REQUST_BLNK IS '개별_요청_공란';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REQUS.CREAT_DT IS '생성_일시';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_REQUS.CRTR IS '생성자';
COMMENT ON TABLE TB_NICE_SMS_SNDNG_INQIRE_RSPNS IS 'NICE SMS 발송 조회 응답';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_RSPNS.NICE_SMS_SNDNG_INQIRE_ID IS 'NICE_SMS_발송_조회_ID';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_RSPNS.TRNSC_ID IS '트랜잭션_ID';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_RSPNS.SPCLTY_GROUPCODE IS '전문_그룹코드';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_RSPNS.DELNG_ASORTCODE IS '거래_종별코드';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_RSPNS.DELNG_SECODE IS '거래_구분코드';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_RSPNS.TRSMRCV_AT IS '송수신_플래그';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_RSPNS.TRMNL_SE IS '단말기_구분';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_RSPNS.RSPNS_CODE IS '응답_코드';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_RSPNS.PARTCPT_INSTT_ID IS '참가_기관_ID';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_RSPNS.INSTT_SPCLTY_MANAGENO IS '기관_전문_관리번호';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_RSPNS.INSTT_SPCLTY_TRNSMISTIME IS '기관_전문_전송시간';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_RSPNS.NICE_SPCLTY_MANAGENO IS 'NICE_전문_관리번호';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_RSPNS.NICE_SPCLTY_TRNSMISTIME IS 'NICE_전문_전송시간';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_RSPNS.BLNK IS '공란';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_RSPNS.TOT_CO IS '총_건수';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_RSPNS.ACCMLT_CO IS '누적_건수';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_RSPNS.RSPNS_CO IS '응답_건수';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_RSPNS.CREAT_DT IS '생성_일시';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_INQIRE_RSPNS.CRTR IS '생성자';
COMMENT ON TABLE TB_NICE_SMS_SNDNG_REQUST IS 'NICE SMS 발송 요청';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.NICE_SMS_SNDNG_REQUST_ID IS 'NICE_SMS_발송_요청_ID';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.DATA_ID IS 'DATA_ID';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.TRNSC_ID IS '트랜잭션_ID';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.SPCLTY_GROUPCODE IS '전문_그룹코드';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.DELNG_ASORTCODE IS '거래_종별코드';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.DELNG_SECODE IS '거래_구분코드';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.TRSMRCV_AT IS '송수신_플래그';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.TRMNL_SE IS '단말기_구분';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.RSPNS_CODE IS '응답_코드';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.PARTCPT_INSTT_ID IS '참가_기관_ID';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.INSTT_SPCLTY_MANAGENO IS '기관_전문_관리번호';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.INSTT_SPCLTY_TRNSMISTIME IS '기관_전문_전송시간';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.NICE_SPCLTY_MANAGENO IS 'NICE_전문_관리번호';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.NICE_SPCLTY_TRNSMISTIME IS 'NICE_전문_전송시간';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.BLNK IS '공란';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.INQIRE_AGRE_RESN IS '조회_동의_사유';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.INQIRE_RESN IS '조회_사유';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.INQIRE_REQUST_CO IS '조회_요청_건수';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.SMS_SNDNG_REQUST_SE IS 'SMS_발송_요청_구분';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.SNDNG_MSSAGE IS '발송_메시지';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.DSPTCH_NO IS '발신_번호';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.CTTPC_INQIRE_SE IS '연락처_조회_구분';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.NTCNTALK_SNDNG_REQUST_SE IS '알림톡_발송_요청_구분';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.NTCNTALK_TMPLAT_CODE IS '알림톡_템플릿_코드';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.BTTON_REQUST_CO IS '버튼_요청_건수';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.INDVDLZ_REQUST_BLNK IS '개별_요청_공란';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.INDVDL_BSNM_CPR_SE IS '개인_사업자_법인_구분';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.IHIDNUM IS '주민번호';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.INQIRE_REQUST_BLNK IS '조회_요청_공란';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.BTTON_TY IS '버튼_타입';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.BTTON_NM IS '버튼_이름';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.BTTON_URL_WEB_LINK_1 IS '버튼_URL_웹_링크_1';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.BTTON_URL_WEB_LINK_2 IS '버튼_URL_웹_링크_2';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.BTTON_REQUST_BLNK IS '버튼_요청_공란';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.CREAT_DT IS '생성_일시';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_REQUST.CRTR IS '생성자';
COMMENT ON TABLE TB_NICE_SMS_SNDNG_RSPNS IS 'NICE SMS 발송 응답';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.NICE_SMS_SNDNG_REQUST_ID IS 'NICE_SMS_발송_요청_ID';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.TRNSC_ID IS '트랜잭션_ID';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.SPCLTY_GROUPCODE IS '전문_그룹코드';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.DELNG_ASORTCODE IS '거래_종별코드';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.DELNG_SECODE IS '거래_구분코드';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.TRSMRCV_AT IS '송수신_플래그';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.TRMNL_SE IS '단말기_구분';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.RSPNS_CODE IS '응답_코드';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.PARTCPT_INSTT_ID IS '참가_기관_ID';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.INSTT_SPCLTY_MANAGENO IS '기관_전문_관리번호';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.INSTT_SPCLTY_TRNSMISTIME IS '기관_전문_전송시간';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.NICE_SPCLTY_MANAGENO IS 'NICE_전문_관리번호';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.NICE_SPCLTY_TRNSMISTIME IS 'NICE_전문_전송시간';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.BLNK IS '공란';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.RSPNS_CO IS '응답_건수';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.SMS_SNDNG_REQUST_SE IS 'SMS_발송_요청_구분';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.SNDNG_MSSAGE IS '발송_메시지';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.DSPTCH_NO IS '발신_번호';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.CTTPC_INQIRE_SE IS '연락처_조회_구분';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.INDVDLZ_RSPNS_BLNK IS '개별_응답_공란';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.INDVDL_BSNM_CPR_SE IS '개인_사업자_법인_구분';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.IHIDNUM IS '주민번호';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.NM IS '성명';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.RANK_CTTPC_1 IS '1_순위_연락처';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.RANK_CTTPC_2 IS '2_순위_연락처';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.RANK_CTTPC_3 IS '3_순위_연락처';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.RESULT_SE IS '결과_구분';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.SMS_SNDNG_CTTPC_RANK IS 'SMS_발송_연락처_순위';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.SMS_SNDNG_CTTPC_NO IS 'SMS_발송_연락처_번호';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.SMS_SNDNG_DT IS 'SMS_발송_일시';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.RSPNS_REPTIT_BLNK IS '응답_반복_공란';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.CREAT_DT IS '생성_일시';
COMMENT ON COLUMN TB_NICE_SMS_SNDNG_RSPNS.CRTR IS '생성자';
CREATE SEQUENCE SEQ_NICE_SMS_SNDNG_REQUST_ID START WITH 1 INCREMENT BY 1 MAXVALUE 9999999999 MINVALUE 1 NOCYCLE;
CREATE SEQUENCE SEQ_NICE_SMS_SNDNG_INQIRE_ID START WITH 1 INCREMENT BY 1 MAXVALUE 9999999999 MINVALUE 1 NOCYCLE;
-- 나이스 알림톡 템플릿 코드 컬럼 추가
ALTER TABLE ENS_TMPLT_MNG ADD NTCNTALK_TMPLAT_CODE VARCHAR2(100);

@ -1,20 +1,55 @@
-- A001 한국교통연구원 민자도로 관리지원센터 미납통행료 납부고지서
Insert into TB_INPUT_XIT
(LNK_INPUT_ID, ORG_CD, JOB_CD, TOT_CNT, PRCS_CD, RUN_DT, EXPIRES_DT, SEND_TYPE, REG_ID, REG_DT, PAY_EXPIRES_DT)
Values
(302400001123, '0002', 'B0001', 1, 'TGRG', SYSDATE, SYSDATE + 30
, 'KP', 'cntc', SYSDATE, SYSDATE+30);
(302400012002, '0001', 'A0001', 2, 'TGRG', SYSDATE, SYSDATE + 1
, 'NI', 'cntc', SYSDATE, SYSDATE+30);
Insert into TB_INPUT_DATA_XIT
(LNK_INPUT_ID, DATA_ID, SID, NAME, BIRTHDAY,
GENDER, MSG_DATA, REG_ID, REG_DT, UPD_ID,
UPD_DT, PAY_STATUS_CD, PAY_URL, CAR_NO)
Values
(302400012002, 'EL3004202408080439501', '8312181111111', '홍길동', '19831218',
'1', '{"~~@@!!CAR_NO!!@@~~":"24주9434","~~@@!!COMPANY!!@@~~":"수도권제1순환","~~@@!!TERM!!@@~~":"2020년 11월 16일~2021년 04월 15일","~~@@!!DEGREE!!@@~~":"24주9434","~~@@!!FEE!!@@~~":"147,400","~~@@!!COUNT!!@@~~":"69","~~@@!!METHOD!!@@~~":"가상계좌 및 카카오페이","~~@@!!BANK_ACCOUNT!!@@~~":"-(가상계좌) : 농협은행 792000-37-048721\n국민은행 731190-72-112238\n우리은행 283753-54-918171\n신한은행 562146-27-216570","~~@@!!DEADLINE!!@@~~":"2024년09월10일","~~@@!!CALL_NO!!@@~~":"044-211-3377"}', 'cephis00', SYSDATE, '',
'', '', '', '24주9434');
Insert into TB_INPUT_DATA_XIT
(LNK_INPUT_ID, DATA_ID, SID, NAME, BIRTHDAY, GENDER, MSG_DATA, MSG_DTL_DATA, REG_ID, REG_DT, CAR_NO, CALL_CENTER_NO)
(LNK_INPUT_ID, DATA_ID, SID, NAME, BIRTHDAY,
GENDER, MSG_DATA, REG_ID, REG_DT, UPD_ID,
UPD_DT, PAY_STATUS_CD, PAY_URL, CAR_NO)
Values
(302400001123, '300799990000000001123', '8312181157213', '김지호', '19831218','1'
, '{"~~@@!!CAR_NO!!@@~~":"20우3412","~~@@!!DEGREE!!@@~~":"3","~~@@!!FEE!!@@~~":"1,900","~~@@!!YYYY!!@@~~":"2022","~~@@!!MM!!@@~~":"03","~~@@!!DD!!@@~~":"11","~~@@!!BANK!!@@~~":"우체국","~~@@!!ACCOUNT!!@@~~":"8608-90-80907938","~~@@!!HISTORY!!@@~~":"-2021-11-29 12:33 (별내 550)\n-2021-11-29 12:19 (양주 900)\n-2021-11-30 14:33 (불암산② 450)","~~@@!!CALL_NO!!@@~~":"(031)522-6400~1","~~@@!!HOMEPAGE!!@@~~":"https://seoulbeltway.co.kr/main/esccar.jsp"}'
, '{"details":[{"item_type":"TEXT","elements":[],"title":"미납통행료 안내문(1차)","properties":{"use_toggle":false}},{"item_type":"PRE_TEXT","elements":"수도권제1순환고속도로 안내문(1차)이 도착하였습니다.\n미납통행료 종이고지서를 모바일 전자문서로 고지하고 있으며, 본 전자문서를 받으신 경우 종이고지서는 발송되지 않습니다.","title":"","properties":{"use_toggle":false}},{"item_type":"KEY_VALUE","elements":[{"level":1,"value":"67어3853","key":"차량번호"},{"level":1,"value":"수도권제1순환","key":"미납발생\n노선명"},{"level":1,"value":"미납통행료 안내문(1차)","key":"고지서명"},{"level":1,"value":"1,260원","key":"납부하실 통행료"},{"level":1,"value":"1,260원","key":"- 미납통행료"},{"level":1,"value":"0원","key":"- 부가통행료"},{"level":1,"value":"2023년 06월 22일까지","key":"납부기한"}],"title":"안내내역","properties":{"use_toggle":false}},{"item_type":"TEXT","elements":[],"title":"상세내역","properties":{"use_toggle":false}},{"item_type":"KEY_VALUE","elements":[{"level":1,"value":"2023-05-20 13:10","key":"통행일시"},{"level":1,"value":"양주","key":"통행영업소"},{"level":1,"value":"1,260 원","key":"통행요금"},{"level":1,"value":"SC잔액부족","key":"미납사유"}],"title":"","properties":{"use_toggle":false}},{"item_type":"PRE_TEXT","elements":" \n","title":"","properties":{"use_toggle":false}},{"item_type":"PRE_TEXT","elements":"※ 해당 통행을 포함하여 최근 1년 이내에 20회 이상 통행료 미납 시 누적 20회부터 즉시 부가통행료(미납통행료의 10배)가 미납통행료와 함께 부과될 수 있음을 알려드립니다.","title":"","properties":{"style":{"highlight":{"※ 해당 통행을 포함하여 최근 1년 이내에 20회 이상 통행료 미납 시 누적 20회부터 즉시 부가통행료(미납통행료의 10배)가 미납통행료와 함께 부과될 수 있음을 알려드립니다.":{"font-color":"black","font-weight":"bold"}}},"use_toggle":false}},{"item_type":"KEY_VALUE","elements":[{"level":1,"value":"하단의 납부하기 클릭 또는\n가상계좌 납부\n(우체국 8608-89-80215603)","key":"납부방법"},{"level":1,"value":"수도권제1순환고속도로\n고객센터 ☎ (031)894-6300~1\n홈페이지 https://seoulbeltway.co.kr/main/esccar.jsp","key":"문의처"}],"title":"납부방법 및 문의처","properties":{"hyperlink":["https://seoulbeltway.co.kr/main/esccar.jsp"],"style":{"highlight":{"(031)894-6300~1":{"font-color":"blue","font-weight":"bold","font-size":"35px","use-clipboard":true},"우체국":{"font-weight":"bold"},"고객센터 ☎ ":{"font-color":"blue","font-weight":"bold","font-size":"35px"},"8608-89-80215603":{"font-weight":"bold","use-clipboard":true}}},"use_toggle":false}},{"item_type":"TABLE","elements":{"head":[""],"rows":[["발송처 : 민자도로 관리지원센터\n(044-211-3377)"]]},"title":"","properties":{"style":{"highlight":{"발송처 : 민자도로 관리지원센터":{"font-size":"25px"},"(044-211-3377)":{"font-size":"25px"}},"text_align":["right"]},"use_toggle":false}},{"item_type":"PAY_BUTTON","title":"납부하기"}]}'
, 'cntc', SYSDATE, '20우3412', '1599-2509');
(302400012002, 'EL3004202408080441611', '8312181111111', '홍길동', '19831218',
'1', '{"~~@@!!CAR_NO!!@@~~":"806노9066","~~@@!!COMPANY!!@@~~":"수도권제1순환","~~@@!!TERM!!@@~~":"2024년 03월 21일~2024년 06월 04일","~~@@!!DEGREE!!@@~~":"806노9066","~~@@!!FEE!!@@~~":"988,600","~~@@!!COUNT!!@@~~":"61","~~@@!!METHOD!!@@~~":"가상계좌 및 카카오페이","~~@@!!BANK_ACCOUNT!!@@~~":"-(가상계좌) : 농협은행 792000-37-100871\n국민은행 731190-72-160185\n우리은행 282376-85-718212\n신한은행 562146-27-582924","~~@@!!DEADLINE!!@@~~":"2024년09월10일","~~@@!!CALL_NO!!@@~~":"044-211-3377"}', 'cephis00', SYSDATE, '',
'', '', '', '806노9066');
commit;
-- A003 통행료 미납에 따른 예금 압류 예고 안내
Insert into TB_INPUT_XIT
(LNK_INPUT_ID, ORG_CD, JOB_CD, TOT_CNT, PRCS_CD, RUN_DT, EXPIRES_DT, SEND_TYPE, REG_ID, REG_DT, PAY_EXPIRES_DT)
Values
(302400022002, '0001', 'A0003', 2, 'TGRG', SYSDATE, SYSDATE + 1
, 'NI', 'cntc', SYSDATE, SYSDATE+30);
Insert into TB_INPUT_DATA
(LNK_INPUT_ID, DATA_ID, SID, NAME, BIRTHDAY,
GENDER, MSG_DATA, REG_ID, REG_DT, UPD_ID,
UPD_DT, PAY_STATUS_CD, PAY_URL, CAR_NO)
Values
(302400022002, 'EL3004202408080431755', '8312181111111', '홍길동', '19670710',
'2', '{"~~@@!!NAME!!@@~~":"홍길동","~~@@!!CAR_NO!!@@~~":"11소5184","~~@@!!COMPANY!!@@~~":"수도권제1순환","~~@@!!TERM!!@@~~":"2023년 04월 14일~2024년 07월 03일","~~@@!!FEE!!@@~~":"538,200","~~@@!!COUNT!!@@~~":"40","~~@@!!METHOD!!@@~~":"가상계좌 및 카카오페이","~~@@!!BANK_ACCOUNT!!@@~~":"-(가상계좌) : 농협은행 792000-36-695641\n국민은행 730890-72-818540\n우리은행 282376-66-218815\n신한은행 562146-27-146150","~~@@!!DEADLINE!!@@~~":"2024년10월13일","~~@@!!CALL_NO!!@@~~":"044-211-3377"}', 'cephis00', SYSDATE, 'sender_1',
'', '', '', '11소5184');
Insert into TB_INPUT_DATA
(LNK_INPUT_ID, DATA_ID, SID, NAME, BIRTHDAY,
GENDER, MSG_DATA, REG_ID, REG_DT, UPD_ID,
UPD_DT, PAY_STATUS_CD, PAY_URL, CAR_NO)
Values
(302400022002, 'EL3004202408080441445', '8312181111111', '김길동', '19550720',
'1', '{"~~@@!!NAME!!@@~~":"김길동","~~@@!!CAR_NO!!@@~~":"46서9187","~~@@!!COMPANY!!@@~~":"수도권제1순환","~~@@!!TERM!!@@~~":"2024년 01월 11일~2024년 07월 27일","~~@@!!FEE!!@@~~":"57,700","~~@@!!COUNT!!@@~~":"62","~~@@!!METHOD!!@@~~":"가상계좌 및 카카오페이","~~@@!!BANK_ACCOUNT!!@@~~":"-(가상계좌) : 농협은행 792000-37-100706\n국민은행 731190-72-160044\n우리은행 282376-85-718059\n신한은행 562146-27-582784","~~@@!!DEADLINE!!@@~~":"2024년10월13일","~~@@!!CALL_NO!!@@~~":"044-211-3377"}', 'cephis00', SYSDATE, 'sender_1',
'', '', '', '46서9187');
COMMIT;
@ -43,3 +78,226 @@ select * from ENS_NICE_CI_MNG order by regist_dt desc;
select to_char(to_timestamp(null, 'yyyy-mm-dd"T"hh24:mi:ss'), 'yyyymmddhh24miss')
from dual;
/* **********************************************
*
********************************************** */
-- [31896] 압류예고 연락처 조회 및 SMS 요청 전문
-- NICE_SMS_SNDNG_REQUST_ID = SEQ_NICE_SMS_SNDNG_REQUST_ID (시퀀스 사용)
-- [요청] 요청 메시지가 가변이여서 1건 발송만 가능
SELECT * FROM TB_NICE_SMS_SNDNG_REQUST;
-- [응답]
SELECT * FROM TB_NICE_SMS_SNDNG_RSPNS;
-- [31893] 압류예고 연락처 조회 및 SMS 이력 조회 전문
-- NICE_SMS_SNDNG_INQIRE_ID = SEQ_NICE_SMS_SNDNG_INQIRE_ID (시퀀스 사용)
-- [요청] 검색기간(from) ~ 검색기간(to) 로 요청 / 주민번호로 요청 할 경우 2건이상 발생할 수 있어서 기간으로 검색
SELECT * FROM TB_NICE_SMS_SNDNG_INQIRE_REQUS;
-- [응답 공통]
SELECT * FROM TB_NICE_SMS_SNDNG_INQIRE_RSPNS;
-- [응답 반복] NICE_SMS_SNDNG_INQIRE_ID, SN : 요청 하나에 여러 건이 발생하여 순번 사용
SELECT * FROM TB_NICE_SMS_SNDNG_INQIRE_REPTI;
-- 검색기간 조회 쿼리
SELECT TO_CHAR(MIN(run_dt), 'YYYYMMDD')||'000000000000' AS "from"
, TO_CHAR(MAX(run_dt+1), 'YYYYMMDD')||'000000000000' AS "to"
FROM tb_input_xit tix
WHERE tix.send_type='NI'
AND tix.prcs_cd='IPCP';
-- [요청건수] 0000000100 고정
/* **********************************************
** [ ]
* 0000000000
* 100
* 259 3
* 0000000000
* 0000000100
* 0000000200
********************************************** */
-- [응답반복부에서 개별 자료 찾기]
-- 응답받은 주민번호와 발송메시지로 조회하여 DATA_ID 찾음
SELECT *
FROM TB_NICE_SMS_SNDNG_REQUST tnssr
WHERE tnssr.IHIDNUM = '' -- 응답받은 주민번호
AND REGEXP_REPLACE(tnssr.SNDNG_MSSAGE, '[[:space:]]+', '') = ''; -- 응답받은 발송메시지
/* **********************************************
* accept
********************************************** */
-- 1. 대상 조회
SELECT *
FROM tb_input_xit tix
JOIN tb_input_data_xit tidx
ON tix.lnk_input_id=tidx.lnk_input_id
WHERE 1=1
-- AND tix.send_type='NI'
AND tix.prcs_cd='TGRG';
-- 2. bill 생성
-- 3. 카카오 청구서 생성
-- 4. tb_input_data_xit 테이블 pay_url 에 청구서 URL UPDATE
-- 5. tb_input_xit 테이블 prcs_cd='GRUC' / 실패 시 prcs_cd='TGRF'
/* **********************************************
* send
********************************************** */
-- 1. 대상 조회
SELECT *
FROM tb_input_xit tix
WHERE tix.send_type='NI'
AND tix.prcs_cd='GRUC'
AND tix.RUN_DT < SYSDATE;
-- 2. 나이스 연계
-- 3. tb_input_xit 테이블 prcs_cd='IPCP' / 실패 시 prcs_cd='FAIL'
-- A001 Message 샘플
/*
.
: 8069066
: 1
: 2024 03 21~2024 06 04
: 988,600(61)
: 20240910
:
()
-() : 792000-37-100871
731190-72-160185
282376-85-718212
562146-27-582924
.
: 044-211-3377
*/
-- A003 Message 샘플
/*
.
21 6 .
, , 24 .
: 566109
: -
: 2023 09 18~2023 12 29
: 98,500(68)
:
-() : 792000-36-752211
731190-72-119419
283754-88-618368
562146-27-238987
: 20240607
: 044-211-3377
: 044-211-3377
*/
/* **********************************************
* status
********************************************** */
-- 1. 대상 조회
SELECT *
FROM tb_input_xit tix
WHERE tix.send_type='NI'
AND tix.prcs_cd='IPCP';
-- 2.결과 INSERT OR UPDATE tb_send_result
SELECT * FROM tb_send_result;
/* **********************************************
** send_sttus_cd
* TALK_SEND
* SMS_SEND KT
* FAIL
********************************************** */
/* **********************************************
* close
********************************************** */
-- 1. 대상 조회
SELECT *
FROM tb_input_xit tix
WHERE tix.send_type='NI'
AND tix.prcs_cd='IPCP'
AND tix.expires_dt < SYSDATE - 1;
-- 2. tb_input_xit 테이블 prcs_cd='CLOS' / 실패 시 prcs_cd='FAIL'
-- 요청 전문 : {"data":{"biller_user_key":"EL3020202408060407773","expire_at":"20241010235900","parameters":{"orgCd":"0001"},"custom_url":{"notice_url":"https://phts-manager.koti.re.kr/iup/kakao/notice","prepay_url":"https://phts-manager.koti.re.kr/iup/kakao/prepay","pay_result_url":"https://phts-manager.koti.re.kr/iup/kakao/pay-result"}}}
-- 응답 전문 : {"res_code":"OK","message":"정상응답","data":{"url":"https://billgates-web.kakao.com/r/platform/pages/paynow/search/1832/11/0b7bc3fa-4845-40eb-9b23-62b0eb806655"}}
Insert into ENS_BILL
(BILL_ID, LAST_UPDT_DT, REGIST_DT, BILL_UID, BILL_SE_CD,
ORG_CD, BILLER_USER_KEY, PAID_AT)
Values
(8394718, TO_TIMESTAMP('2024/10/02 PM 1:25:02.713000','YYYY/MM/DD AM fmHH12fm:MI:SS.FF'), TO_TIMESTAMP('2024/10/02 PM 1:25:02.713000','YYYY/MM/DD AM fmHH12fm:MI:SS.FF'), 'intgrnNoti-1727843102-fn.x8QpG4JnaBd6psESO6l', 'privt',
'0001', 'EL3020202408060407773', 'N');
Insert into ENS_BILL_KKO
(BILL_ID, LAST_UPDT_DT, REGIST_DT, BILL_UID, BILLER_NOTICE_KEY,
BILLER_USER_KEY, CUSTOM_URL, EXPIRE_AT, URL)
Values
(4993792, TO_TIMESTAMP('2024/10/02 PM 4:45:05.328000','YYYY/MM/DD AM fmHH12fm:MI:SS.FF'), TO_TIMESTAMP('2024/10/02 PM 4:45:05.167000','YYYY/MM/DD AM fmHH12fm:MI:SS.FF'), 'intgrnNoti-1727843102-fn.x8QpG4JnaBd6psESO6l', 'intgrnNoti-1727843102-fn.x8QpG4JnaBd6psESO6l',
'EL3020202408060407773', '{"notice_url":"https://phts-manager.koti.re.kr/iup/kakao/notice","prepay_url":"https://phts-manager.koti.re.kr/iup/kakao/prepay","pay_result_url":"https://phts-manager.koti.re.kr/iup/kakao/pay-result"}', '20241010235900', 'https://billgates-web.kakao.com/r/platform/pages/paynow/search/1832/11/1a481760-b0da-4a77-9a7a-74951db5fa01');
Insert into ENS_BILL_HIS
(ID, LAST_UPDT_DT, REGIST_DT, BILL_SE, BILL_UID,
LINKED_UUID, REQ_SE, REQUEST_DATA, RESPONSE_DATA, ORG_CD)
Values
(40336145, TO_TIMESTAMP('2024/10/02 PM 4:45:05.331000','YYYY/MM/DD AM fmHH12fm:MI:SS.FF'), TO_TIMESTAMP('2024/10/02 PM 4:45:05.331000','YYYY/MM/DD AM fmHH12fm:MI:SS.FF'), 'bpKko', 'intgrnNoti-1727843102-fn.x8QpG4JnaBd6psESO6l',
'EL3020202408060407773', 'VD_URL', '{"data":{"biller_user_key":"EL3020202408060407773","expire_at":"20241010235900","parameters":{"orgCd":"0001"},"custom_url":{"notice_url":"https://phts-manager.koti.re.kr/iup/kakao/notice","prepay_url":"https://phts-manager.koti.re.kr/iup/kakao/prepay","pay_result_url":"https://phts-manager.koti.re.kr/iup/kakao/pay-result"}}}', '{"res_code":"OK","message":"정상응답","data":{"url":"https://billgates-web.kakao.com/r/platform/pages/paynow/search/1832/11/1a481760-b0da-4a77-9a7a-74951db5fa01"}}', '0001');
select nvl(max(id), 0) + 1
from IUP.ENS_BILL_HIS
where id = 99999999999999999999;;
-- eom.org_nm, etm.message, etm.ntcntalk_tmplat_code
SELECT etm.*
FROM ens_org_mng eom
JOIN ens_tmplt_mng etm
ON eom.ORG_CD = etm.ORG_CD
WHERE etm.tmplt_cd='A0001';
SELECT
TO_CHAR(MIN(run_dt),
'YYYYMMDD')||'000000000000' AS searchPdFrom ,
TO_CHAR(MAX(run_dt+1),
'YYYYMMDD')||'000000000000' AS searchPdTo
FROM
tb_input_xit
WHERE
send_type = 'NI'
AND prcs_cd = 'IPCP';
select *
from TB_SEND_RESULT
where 1=1
and LNK_INPUT_ID = 20211006000001
and SEND_STTUS_CD = 'FAIL';

@ -260,6 +260,13 @@
</dependency>
<!-- JSONArray -->
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-resolver-dns-native-macos</artifactId>
<version>4.1.68.Final</version>
<classifier>osx-aarch_64</classifier>
</dependency>
</dependencies>
<build>
@ -375,12 +382,14 @@
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<spring.profiles.active>local</spring.profiles.active>
<env>local</env>
</properties>
</profile>
<profile>
<id>prod</id>
<properties>
<spring.profiles.active>prod</spring.profiles.active>
<env>prod</env>
</properties>
</profile>

@ -0,0 +1,24 @@
echo "1.remove...."
rm -r /DATA/was/phts-manager/*
echo "2.file move...."
cp /DATA/was/deploy-app/phts-manager/war/module-post-0.0.1-SNAPSHOT.war /DATA/was/phts-manager/phts-manager.war
echo "3.unzip..."
cd /DATA/was/phts-manager/
jar xvf ./phts-manager.war
echo "4.add jar..."
cp /DATA/was/deploy-app/phts-manager/lib/tomcat-juli-8.5.4.jar /DATA/was/phts-manager/WEB-INF/lib/
cp /DATA/was/deploy-app/phts-manager/lib/javaee.jar /DATA/was/phts-manager/WEB-INF/lib/
#cp /was/deploy-app/phts-manager/lib/ojdbc8.jar /was/phts-manager/WEB-INF/lib/
#echo "5.remove jar..."
#rm -r /was/phts-manager/WEB-INF/lib/log4j-api-*.jar
#rm -r /was/phts-manager/WEB-INF/lib/log4j-to-slf4j-*.jar
#rm -r /was/phts-manager/WEB-INF/lib/tomcat-embed*.jar
#rm -r /was/phts-manager/WEB-INF/lib-provided/tomcat-embed*.jar
#echo "5.redis start..."
#java -jar ./war/redis-0.0.1-SNAPSHOT.jar

@ -129,12 +129,12 @@ public class AccessLogAspect {
accessLog.setResponseFail(String.format("%s: %s", e.getErrCd(), e.getMessage()));
accessLogRepository.save(accessLog);
if (result == null) {
EnsResponseVO restResponseVO = EnsResponseVO
EnsResponseVO<?> restResponseVO = EnsResponseVO
.errBuilder()
.errCode(e.getErrCd())
.errMsg(e.getMessage())
.build();
result = new ResponseEntity<EnsResponseVO>(restResponseVO, HttpStatus.INTERNAL_SERVER_ERROR);
result = new ResponseEntity<>(restResponseVO, HttpStatus.INTERNAL_SERVER_ERROR);
}
} catch (Exception e) {
@ -142,12 +142,12 @@ public class AccessLogAspect {
accessLog.setResponseFail(String.format("%s: %s", EnsErrCd.UNKNOWN, CmmnUtil.printStackTraceToString(e)));
accessLogRepository.save(accessLog);
if (result == null) {
EnsResponseVO restResponseVO = EnsResponseVO
EnsResponseVO<?> restResponseVO = EnsResponseVO
.errBuilder()
.errCode(EnsErrCd.UNKNOWN)
.errMsg("알수없는 오류 입니다. 시스템관리자에게 문의하시기 바랍니다.")
.build();
result = new ResponseEntity<EnsResponseVO>(restResponseVO, HttpStatus.INTERNAL_SERVER_ERROR);
result = new ResponseEntity<>(restResponseVO, HttpStatus.INTERNAL_SERVER_ERROR);
applicationEventPublisher.publishEvent(MonitorEvent.builder()
@ -370,7 +370,6 @@ public class AccessLogAspect {
}
// FIXME: JPA 쿼리 로그 출력 코드 추가
//@ConditionalOnProperty(value = "app.jpa.logging.enabled", havingValue = "true", matchIfMissing = false)
@Around("execution(* org.springframework.data.repository.CrudRepository+.*(..))")
public Object logJpaQuery(ProceedingJoinPoint joinPoint) throws Throwable {
String methodName = joinPoint.getSignature().getDeclaringType().getSimpleName() + "." + joinPoint.getSignature().getName();

@ -1,19 +1,14 @@
package cokr.xit.ens.core.config;
import java.util.Arrays;
import java.util.List;
import java.util.*;
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 org.springdoc.core.*;
import org.springframework.beans.factory.annotation.*;
import org.springframework.context.annotation.*;
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 io.swagger.v3.oas.models.*;
import io.swagger.v3.oas.models.info.*;
import io.swagger.v3.oas.models.servers.*;
@Configuration
public class SpringDocConfig {
@ -188,6 +183,14 @@ public class SpringDocConfig {
.build();
}
@Profile({"local", "prod", "dev"})
@Bean
public GroupedOpenApi niceApiDoc() {
return GroupedOpenApi.builder()
.group("전자고지-NICE 인증톡")
.pathsToMatch("/nice/talk/**")
.build();
}
// @Bean
// public GroupedOpenApi adminApiDoc() {

@ -530,7 +530,7 @@ public class DateUtil {
public static String getNowTimeMicrosecond() {
ZonedDateTime now = ZonedDateTime.now(ZoneId.of("Asia/Seoul"));
// 6자리 나노초까지 포함된 포맷 지정
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSSSSSS");
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSSSSS");
return now.format(formatter);
}
@ -592,7 +592,8 @@ public class DateUtil {
localDateTime = localDateTime.plusHours(hour);
localDateTime = localDateTime.plusMinutes(minute);
localDateTime = localDateTime.plusSeconds(second);
result = localDateTime.toString();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss");
result = localDateTime.format(formatter);
} catch (Exception e) {
log.error("DateUtils::getCalculatorDateAndTime", e);
}
@ -600,6 +601,18 @@ public class DateUtil {
return result;
}
/**
* LocalDateTime pattern return
* @param localDateTime LocalDateTime
* @param pattern yyyyMMddHHmmss
* @return pattern
*/
public static String getStringFromLocalDate(final LocalDateTime localDateTime, String pattern) {
if ("".equals(pattern) || pattern == null)
pattern = DEFAULT_YMD_DT_FMT;
return localDateTime.format(DateTimeFormatter.ofPattern(pattern));
}
public static void main(String[] args) {
System.out.println(getAddDayT("2024-10-30T23:59:59", 1));
System.out.println(isAfterLocalDateTimeT("2024-10-30T23:59:59", "2024-10-30T23:59:58"));

@ -91,8 +91,11 @@ public class KkoPayUrlService implements PayUrlService<PayUrlData<BillKkoPay>, S
/**
* FIXME: NICE CI
* FIXME: Comment Url API
* [ ]
* [ () ]
* @Operation(summary = "납부(결제)정보 요청")
* @GetMapping(value = "/bill/pay/trg/{paySe}/{billUid}/payinf", produces = MediaType.APPLICATION_JSON_VALUE)
* 1. payUseSysApi.payUrl
* : https://phts-manager.koti.re.kr/iup/bill/kkopay/gnr/url
* : https://localhost:18090/iup/bill/kkopay/gnr/url/test
@ -101,6 +104,8 @@ public class KkoPayUrlService implements PayUrlService<PayUrlData<BillKkoPay>, S
* ENS_BILL_KKO
* 3. billKkoPayApi.url
* (dozn.co.kr) API
* : {"data":{"biller_user_key":"EL3020202408060407773","expire_at":"20241010235900","parameters":{"orgCd":"0001"},"custom_url":{"notice_url":"https://phts-manager.koti.re.kr/iup/kakao/notice","prepay_url":"https://phts-manager.koti.re.kr/iup/kakao/prepay","pay_result_url":"https://phts-manager.koti.re.kr/iup/kakao/pay-result"}}}
* : {"res_code":"OK","message":"정상응답","data":{"url":"https://billgates-web.kakao.com/r/platform/pages/paynow/search/1832/11/0b7bc3fa-4845-40eb-9b23-62b0eb806655"}}
* 4. saveUrl
* URL
* : https://billgates-web.kakao.com/r/platform/pages/paynow/search/1832/11/4c3405cd-8da5-4f68-9035-a893b546353f
@ -108,14 +113,17 @@ public class KkoPayUrlService implements PayUrlService<PayUrlData<BillKkoPay>, S
* API RE API
*/
Optional.ofNullable(data.getBillDetail())
// GET billerUserKey
.map(billKkoPay -> {
log.info("KkoPayUrlService::callApi - createMessage: {}", billKkoPay.getBillerUserKey());
return safely(() -> createMessage(billKkoPay.getBillerUserKey()));
})
// ens_org_mng 테이블 kko_bp_url_api -> PayUrlData<BillKkoPay> url로 set
.map(param -> {
log.info("KkoPayUrlService::callApi - loadReqData: {}", param);
return safely(() -> loadReqData(data, useSysUrl, param));
})
//
.map(param -> {
log.info("KkoPayUrlService::callApi - payUseSysApi.payUrl", param);
return safely(() -> payUseSysApi.payUrl(useSysUrl, param, null));

@ -22,31 +22,6 @@ import lombok.*;
*/
public class ApiConstants {
/**
* profile
*/
public static final String PROFILE = System.getProperty("spring.profiles.active");
/**
* profile : local
*/
public static final boolean IS_PROFILE_LOCAL = PROFILE.matches("local.*");
/**
* profile :
*/
public static final boolean IS_CCN = PROFILE.matches(".*-ccn");
public static final String FFNLN_CODE = "11";
/**
* date-time
*/
public static final String FMT_DT_EMPTY_DLT = "yyyyMMddHHmmss";
/**
* date-time
*/
public static final String FMT_DT_STD = "yyyy-MM-dd HH:mm:ss";
/**
* <pre>
*

@ -42,13 +42,8 @@ import lombok.extern.slf4j.*;
@Component
public class KkoTalkApiService {
private static final String PROFILE = System.getProperty("spring.profiles.active");
/**
* profile : local
*/
private static final boolean IS_PROFILE_LOCAL = PROFILE.matches("local.*");
private static final String PRODUCT_CD = IS_PROFILE_LOCAL ? "D10_1T" : "D10_2";
@Value("${spring.profiles.active}")
private String PROFILE;
@Value("${contract.kakao.talk.host}")
private String HOST;
@ -83,7 +78,7 @@ public class KkoTalkApiService {
* @return KkotalkDTO.SendResponse
*/
public ResponseEntity<String> requestSend(final OrgMng orgMng, final KkotalkDTO.SendRequest reqDTO) {
reqDTO.setProductCode(PRODUCT_CD);
reqDTO.setProductCode(getProductCd());
List<String> errors = new ArrayList<>();
errors = validate(reqDTO.getEnvelope(), errors);
@ -183,7 +178,7 @@ public class KkoTalkApiService {
*/
public ResponseEntity<String> requestSendBulk(final OrgMng orgMng, final KkotalkDTO.BulkSendRequest reqDTO) {
ResponseEntity<String> resEntity = null;
reqDTO.setProductCode(PRODUCT_CD);
reqDTO.setProductCode(getProductCd());
List<String> errors = new ArrayList<>();
@ -374,9 +369,14 @@ public class KkoTalkApiService {
headers.setContentType(new MediaType(MediaType.APPLICATION_JSON, Charset.forName("utf-8")));
headers.set(HttpHeaders.AUTHORIZATION, String.format("KakaoAK %s", orgMng.getKakaoDealerRestApiKey()));
headers.set("Target-Authorization", String.format("KakaoAK %s", orgMng.getKakaoPartnerRestApiKey()));
headers.set("settle-Id", IS_PROFILE_LOCAL ? orgMng.getKakaoDevSettleId() : orgMng.getKakaoProdSettleId());
headers.set("settle-Id", PROFILE.matches("local.*") ? orgMng.getKakaoDevSettleId() : orgMng.getKakaoProdSettleId());
return headers;
}
private String getProductCd() {
final boolean IS_PROFILE_LOCAL = PROFILE.matches("local.*");
return IS_PROFILE_LOCAL ? "D10_1T" : "D10_2";
}
}

@ -0,0 +1,244 @@
package cokr.xit.ens.modules.nice.cmm;
import java.io.*;
import java.nio.charset.*;
import org.apache.commons.lang3.*;
import cokr.xit.ens.core.exception.*;
import lombok.extern.slf4j.*;
/**
* <pre>
* description :
* packageName : cokr.xit.ens.modules.nice.cmm
* fileName : NiceCiUtils
* author : limju
* date : 2024 9 25
* ======================================================================
*
* ----------------------------------------------------------------------
* 2024 9 25 limju
*
* </pre>
*/
@Slf4j
public class NiceCiUtils {
/**
* "ISO-8859-1", "UTF-8", "EUC-KR"
* @param src
* @param charset
* @return String
*/
public static String covertCharset(final String src, final String charset){
try {
return new String(src.getBytes(), charset);
} catch (UnsupportedEncodingException e) {
throw BizRuntimeException.create(e.getMessage());
}
}
/**
* "ISO-8859-1", "UTF-8", "EUC-KR" -> "ISO-8859-1", "UTF-8", "EUC-KR"
* @param src "ISO-8859-1", "UTF-8", "EUC-KR"
* @param srcCharset "ISO-8859-1", "UTF-8", "EUC-KR"
* @param tgtCharset "ISO-8859-1", "UTF-8", "EUC-KR"
* @return String
*/
public static String covertCharset(final String src, final Charset srcCharset, final Charset tgtCharset) {
//CharBuffer cb = srcCharset.decode(ByteBuffer.wrap(src.getBytes(srcCharset)));
//try {
return new String(src.getBytes(srcCharset), tgtCharset);
//} catch (UnsupportedEncodingException e) {
// throw BizRuntimeException.create(e.getMessage());
// }
}
/**
* "ISO-8859-1", "UTF-8", "EUC-KR" -> "ISO-8859-1", "UTF-8", "EUC-KR"
* @param src "ISO-8859-1", "UTF-8", "EUC-KR"
* @param srcCharset "ISO-8859-1", "UTF-8", "EUC-KR"
* @param tgtCharset "ISO-8859-1", "UTF-8", "EUC-KR"
* @return String
*/
public static String covertCharset(final String src, final String srcCharset, final String tgtCharset) {
try {
return new String(src.getBytes(srcCharset), tgtCharset);
} catch (UnsupportedEncodingException e) {
throw BizRuntimeException.create(e.getMessage());
}
}
public static String leftKr(String str, int len) {
if (str == null) {
return null;
} else if (len < 0) {
return "";
} else {
return lengthKr(str) <= len ? str : getStringKr(str, len);
}
}
public static String rightPadKr(String str, int size, String padStr) {
if (str == null) {
return null;
} else {
if (StringUtils.isEmpty(padStr)) {
padStr = " ";
}
int padLen = padStr.length();
int strLen = lengthKr(str);
int pads = size - strLen;
if (pads <= 0) {
return str;
} else if (padLen == 1 && pads <= 8192) {
return rightPadKr(str, size, padStr.charAt(0));
} else if (pads == padLen) {
return str.concat(padStr);
} else if (pads < padLen) {
return str.concat(padStr.substring(0, pads));
} else {
char[] padding = new char[pads];
char[] padChars = padStr.toCharArray();
for(int i = 0; i < pads; ++i) {
padding[i] = padChars[i % padLen];
}
return str.concat(new String(padding));
}
}
}
/**
* <pre>
* 2, 1 : UTF-8
* 10 , 10 .
* -> 10 2
* -> 2 , 10-2 = 8 .
* @param strText
* @param beginIndex
* @return
* </pre>
*/
public static String substringKr(String strText, int beginIndex) {
if(beginIndex == 0) return strText;
StringBuilder strRtnText = new StringBuilder();
boolean isSkip = true;
for (int i = 0, skipIdx = 0; i<strText.length(); i++) {
if(!isSkip) {
strRtnText.append(strText.charAt(i));
continue;
}
char c = strText.charAt(i);
if (c > 127)
skipIdx += 2;
else
skipIdx++;
if (skipIdx >= beginIndex){
isSkip = false;
if(skipIdx > beginIndex) strRtnText.append(strText.charAt(i));
}
}
return strRtnText.toString();
}
/**
* <pre>
* : UTF-8
* 2(2), 1(1)
* @param strText
* @param iBytes
* @return
* </pre>
*/
public static String getStringKr(String strText, int iBytes) {
StringBuilder strRtnText = new StringBuilder();
int iByte = 0;
// 문자열을 문자 배열로 변환하여 반복문을 통해 처리
for (int i = 0; i < strText.length(); i++) {
char c = strText.charAt(i);
strRtnText.append(c);
// 한글 등의 2바이트 문자 처리
if(c > 127) {
iByte += 2;
}else{
iByte++;
}
// 지정된 바이트 수를 넘으면 반복 종료
if (iByte >= iBytes) {
break; // for 루프 종료
}
}
return strRtnText.toString();
}
public static int lengthKr(String strText) {
return strText.chars()
//.map(ch -> (ch > 127 || ch == '\n' || ch == '\t') ? 2 : 1) // 한글(또는 다른 비 ASCII 문자)인 경우 2바이트, 아니면 1바이트
.map(ch -> (ch > 127) ? 2 : 1) // 한글(또는 다른 비 ASCII 문자)인 경우 2바이트, 아니면 1바이트
.sum();
}
public static String rightPadKr(String str, int size, char padChar) {
if (str == null) {
return null;
} else {
int pads = size - lengthKr(str);
if (pads <= 0) {
return str;
} else {
return pads > 8192 ? rightPadKr(str, size, java.lang.String.valueOf(padChar)) : str.concat(StringUtils.repeat(padChar, pads));
}
}
}
public static String decodeText(String input, String sourceEncoding, String encoding) throws IOException {
return
new BufferedReader(
new InputStreamReader(
new ByteArrayInputStream(input.getBytes("euc-kr")),
Charset.forName(encoding)))
.readLine();
}
public static void main(String[] args) throws IOException {
final String tgt = new String("123ab한글이ㅂa들어있다열자ㅁ".getBytes(), StandardCharsets.UTF_8);
final String tgt2 = new String("123ab한글이ㅂa들어있다열자ㅁ".getBytes(), StandardCharsets.ISO_8859_1);
final String tgt3 = new String("123ab한글이ㅂa들어있다열자ㅁ".getBytes(), "euc-kr");
System.out.println(tgt2);
System.out.println(covertCharset(tgt2, StandardCharsets.ISO_8859_1, StandardCharsets.UTF_8));
//System.out.println(decodeText(tgt3, "ISO_8859_1", "UTF-8"));
System.out.println(tgt3);
System.out.println(decodeText(tgt3, "euc-kr", "UTF-8"));
System.out.println(covertCharset(tgt3, Charset.forName("euc-kr"), StandardCharsets.UTF_8));
//System.out.println(covertCharset(tgt3, "EUC-KR", "UTF-8"));
System.out.println(substringKr(tgt, 1));
System.out.println(substringKr(tgt, 5));
System.out.println(substringKr(tgt, 6));
System.out.println(substringKr(tgt, 7));
System.out.println(substringKr(tgt, 8));
System.out.println(substringKr("gks한글이시작되는데", 8));
System.out.println(substringKr("한글로abcdefgh계속", 12));
System.out.println(substringKr("1한글2ㅇ ab", 10));
System.out.println(leftKr(tgt, 18));
System.out.println(leftKr(tgt2, 18));
System.out.println(leftKr(tgt3, 18));
System.out.println("["+rightPadKr("1한글2ㅇ", 10, " ")+"]");
}
}

@ -0,0 +1,161 @@
package cokr.xit.ens.modules.nice.mapper;
import java.util.*;
import org.apache.ibatis.annotations.*;
import cokr.xit.ens.modules.common.ctgy.sys.mng.domain.*;
import cokr.xit.ens.modules.nice.model.*;
/**
* <pre>
* description :
* packageName : cokr.xit.ens.modules.nice.mapper
* fileName : INiceMapper
* author : limju
* date : 2024 9 30
* ======================================================================
*
* ----------------------------------------------------------------------
* 2024 9 30 limju
*
* </pre>
*/
@Mapper
public interface INiceCiMapper {
//----------------------------------------------------------------------
// 공통
//----------------------------------------------------------------------
/**
* tb_input_xit
*
* @param niceCiParam NiceCiDTO.NiceCiParam
* @return List<NiceCiDTO.InputXit> InputXit .
*/
List<NiceCiDTO.InputXit> selectInputXits(final NiceCiDTO.NiceCiParam niceCiParam);
/**
* tb_input_data_xit
*
* @param niceCiParam NiceCiDTO.NiceCiParam
* @return List<NiceCiDTO.InputDataXit> InputDataXit .
*/
List<NiceCiDTO.InputDataXit> selectInputDataXits(final NiceCiDTO.NiceCiParam niceCiParam);
//----------------------------------------------------------------------
// 공통
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// accept
//----------------------------------------------------------------------
/**
* ()
*
* @param billDTO NiceCiDTO.BillDTO
*/
void insertBill(final NiceCiDTO.BillDTO billDTO);
/**
* ()
*
* @param billDTO NiceCiDTO.BillDTO
*/
void updateBill(final NiceCiDTO.BillDTO billDTO);
/**
* () -
*
* @param billKkoDTO NiceCiDTO.BillKkoDTO
*/
void mergeBillKko(final NiceCiDTO.BillKkoDTO billKkoDTO);
/**
* NICE CI API URL - tb_input_data_xit
* @param inputDataXit NiceCiDTO.InputDataXit
*/
void updatePayUrlOfDataInput(final NiceCiDTO.InputDataXit inputDataXit);
/**
* - tb_input_xit
* @param inputXit
*/
void updatePrcsCdAndErrorOfInputXit(final NiceCiDTO.InputXit inputXit);
/**
* API
* @param orgCd
* @return Optional<OrgMng>
*/
Optional<OrgMng> selectKkoBpApiUrlFromEnsOrgMng(final String orgCd);
//----------------------------------------------------------------------
// accept
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// send
//----------------------------------------------------------------------
/**
* GET NICE CI request unique PK - sequence
* @return Optional<String> leftPad "0", 10 String
*/
Optional<String> selectNiceCiRequestId();
/**
* 릿
* @param tmpltId 릿 ID
* @return Optional<NiceCiDTO.TmpltMngDTO>
*/
Optional<NiceCiDTO.TmpltMngDTO> selectTmpltMsg(final String tmpltId);
/**
* SMS
* @param requestDTO NiceCiApiSendDTO.Request
*/
void insertNiceSmsSndngRequest(final NiceCiApiSendDTO.Request requestDTO);
/**
* SMS
* @param responseDTO NiceCiApiSendDTO.Response
*/
void insertNiceSmsSndngResponse(final NiceCiApiSendDTO.Response responseDTO);
//----------------------------------------------------------------------
// send
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// status
//----------------------------------------------------------------------
/**
* <pre>
* GET NICE CI (from ~ to)
* -> tb_input_xit run_dt MIN(run_dt) ~ MAX(run_dt) + 1
* @param niceCiParam NiceCiDTO.NiceCiParam
* @return Optional<NiceCiApiStatusDTO.Request>
* </pre>
*/
Optional<NiceCiApiStatusDTO.Request> selectFromAndToOfStatusParam(final NiceCiDTO.NiceCiParam niceCiParam);
/**
* GET NICE CI inquire unique PK - sequence
* @return Optional<String> leftPad "0", 10 String
*/
Optional<String> selectNiceCiInqireId();
/**
* SMS
* @param requestDTO NiceCiApiStatusDTO.Request
*/
void insertNiceSmsSndngInquireRequest(final NiceCiApiStatusDTO.Request requestDTO);
/**
* SMS
* @param responseDTO NiceCiApiStatusDTO.Response
*/
void insertNiceSmsSndngInquireResponse(final NiceCiApiStatusDTO.Response responseDTO);
//----------------------------------------------------------------------
// status
//----------------------------------------------------------------------
}

@ -0,0 +1,72 @@
package cokr.xit.ens.modules.nice.mapper;
import java.util.*;
import org.apache.ibatis.annotations.*;
import cokr.xit.ens.modules.nice.model.*;
/**
* <pre>
* description : NICE CI mapper
* packageName : cokr.xit.ens.modules.nice.mapper
* fileName : INiceMapper
* author : limju
* date : 2024 9 30
* ======================================================================
*
* ----------------------------------------------------------------------
* 2024 9 30 limju
*
* </pre>
*/
@Mapper
public interface INiceCiNewTransactionMapper {
//----------------------------------------------------------------------
// accept
//----------------------------------------------------------------------
/**
*
* @param billHistDTO NiceCiDTO.BillHistDTO
*/
void insertBillHistory(final NiceCiDTO.BillHistDTO billHistDTO);
/**
*
* @param billHistDTO NiceCiDTO.BillHistDTO
*/
void updateBillHistory(final NiceCiDTO.BillHistDTO billHistDTO);
//----------------------------------------------------------------------
// accept
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// status
//----------------------------------------------------------------------
/**
* NICE CI SMS
* @param resultList List<NiceCiApiResult>
*/
void insertNiceSmsSndngInquireResponseRepeats(final List<NiceCiApiResult> resultList);
/**
* <pre>
* DATA ID
* NICE CI SMS NICE CI SMS DATA ID GET
* @param result NiceCiApiResult
* @return Optional<NiceCiDTO.SendResult>
* </pre>
*/
Optional<NiceCiDTO.SendResult> selectDataIdFromSendResult(final NiceCiApiResult result);
/**
* SMS
* @param sendResults NiceCiDTO.SendResult
*/
void insertSendResults(final List<NiceCiDTO.SendResult> sendResults);
//----------------------------------------------------------------------
// status
//----------------------------------------------------------------------
}

@ -0,0 +1,292 @@
package cokr.xit.ens.modules.nice.model;
import javax.validation.constraints.*;
import org.apache.commons.lang3.*;
import cokr.xit.ens.core.utils.*;
import io.swagger.v3.oas.annotations.media.*;
import lombok.*;
import lombok.extern.slf4j.*;
/**
* <pre>
* description : NICE CI API DTO
* packageName : cokr.xit.ens.modules.nice.model
* fileName : NiceCiCommon
* author : limju
* date : 2024 9 25
* ======================================================================
*
* ----------------------------------------------------------------------
* 2024 9 25 limju
*
* </pre>
*/
@Schema(name = "NiceCiApiCommon", description = "NICE CI API 전문 공통 DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Slf4j
public class NiceCiApiCommon {
/**
* <pre>
* - 9
* "NICEIF "
* </pre>
*/
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "전문그룹코드(9자리)", example = "NICEIF ")
@Size(min = 9, max = 9, message = "전문그룹코드는 9자리 입니다.")
private String spcltyGroupcode = StringUtils.rightPad("NICEIF", 9, StringUtils.SPACE);
public void setSpcltyGroupcode(String spcltyGroupcode) {
this.spcltyGroupcode = StringUtils.rightPad(nvl(spcltyGroupcode), 9, StringUtils.SPACE);
}
/**
* <pre>
* - / 4
* "0200" set
* NICE "0210" set
* </pre>
*/
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "거래종별코드(4자리)", example = "0200")
@Size(min = 4, max = 4, message = "거래 종별 코드는 4자리 입니다.")
private String delngAsortcode = "0200";
public void setDelngAsortcode(String delngAsortcode) {
this.delngAsortcode = StringUtils.rightPad(nvl(delngAsortcode), 4, StringUtils.SPACE);
}
/**
* <pre>
* - 5
* "31896" set
* </pre>
*/
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "거래구분코드(5자리)", example = "31895")
@Size(min = 5, max = 5, message = "거래 구분 코드는 5자리 입니다.")
private String delngSecode = "31896";
public void setDelngSecode(String delngSecode) {
this.delngSecode = StringUtils.rightPad(nvl(delngSecode), 5, StringUtils.SPACE);
}
/**
* <pre>
* - / 1
* : "B" set
* NICE "N" set
* </pre>
*/
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "송수신플래그(1자리)", example = "B")
@Size(min = 1, max = 1, message = "송수신 플래그는 1자리 입니다.")
@Setter
private String trsmrcvAt = "B";
/**
* <pre>
* - 3
* "503" set
* </pre>
*/
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "단말기구분(3자리)", example = "503")
@Size(min = 3, max = 3, message = "단말기 구분은 3자리 입니다.")
private String trmnlSe = "503";
public void setTrmnlSe(String trmnlSe) {
this.trmnlSe = StringUtils.rightPad(nvl(trmnlSe), 3, StringUtils.SPACE);
}
/**
* <pre>
* - 4 NICE 4
* P000
* P001
* P005 ID
* E998 TimeOut
* E999
* S602
* S702
* S722 Server System
* S316 ( )
* S317 10
* </pre>
*/
@Schema(title = "응답코드(4자리)", example = " ")
@Pattern(regexp = "^\\s{4}$|$|^[P|E|S][\\d]{3}$", message = "응답코드(4자리)는 4자리 입니다")
private String rspnsCode = StringUtils.rightPad(StringUtils.EMPTY, 4, StringUtils.SPACE);
public void setRspnsCode(String rspnsCode) {
this.rspnsCode = StringUtils.rightPad(nvl(rspnsCode), 4, StringUtils.SPACE);
}
/**
* <pre>
* ID - 9
* CB H/I NICE USER ID
* </pre>
*/
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "참가기관ID(9자리)", example = "503")
@Size(min = 9, max = 9, message = "참가기관ID는 9자리 입니다.")
private String partcptInsttId = StringUtils.rightPad(StringUtils.EMPTY, 9, StringUtils.SPACE);
public void setPartcptInsttId(String partcptInsttId) {
this.partcptInsttId = StringUtils.rightPad(nvl(partcptInsttId), 9, StringUtils.SPACE);
}
/**
* <pre>
* - 10
* set
* </pre>
*/
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "기관전문관리번호(10자리)", example = " ")
@Size(min = 10, max = 10, message = "기관전문관리번호는 10자리 입니다.")
private String insttSpcltyManageno = StringUtils.rightPad(StringUtils.EMPTY, 10, StringUtils.SPACE);
public void setInsttSpcltyManageno(String insttSpcltyManageno) {
this.insttSpcltyManageno = StringUtils.rightPad(nvl(insttSpcltyManageno), 10, StringUtils.SPACE);
}
/**
* <pre>
* - 14
* set
* </pre>
*/
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "기관전문전송시간(14자리)", example = " ")
@Size(min = 14, max = 14, message = "기관전문전송시간은 14자리 입니다.")
private String insttSpcltyTrnsmistime = DateUtil.getTodayAndNowTime("yyyyMMddHHmmss");
public void setInsttSpcltyTrnsmistime(String insttSpcltyTrnsmistime) {
this.insttSpcltyTrnsmistime = StringUtils.rightPad(nvl(insttSpcltyTrnsmistime), 14, StringUtils.SPACE);
}
/**
* <pre>
* NICE - 10
* NICE set
* </pre>
*/
@Schema(title = "NICE전문관리번호(10자리)", example = " ")
@Size(min = 10, max = 10, message = "NICE전문관리번호 10자리 입니다.")
private String niceSpcltyManageno = StringUtils.rightPad(StringUtils.EMPTY, 10, StringUtils.SPACE);
public void setNiceSpcltyManageno(String niceSpcltyManageno) {
this.niceSpcltyManageno = StringUtils.rightPad(nvl(niceSpcltyManageno), 10, StringUtils.SPACE);
}
/**
* <pre>
* NICE - 14
* NICE set
* </pre>
*/
@Schema(title = "NICE전문전송시간(14자리)", example = " ")
@Size(min = 14, max = 14, message = "NICE전문전송시간은 14자리 입니다.")
private String niceSpcltyTrnsmistime = StringUtils.rightPad(StringUtils.EMPTY, 14, StringUtils.SPACE);
public void setNiceSpcltyTrnsmistime(String niceSpcltyTrnsmistime) {
this.niceSpcltyTrnsmistime = StringUtils.rightPad(nvl(niceSpcltyTrnsmistime), 14, StringUtils.SPACE);
}
/**
* <pre>
* - 16 , 17
* </pre>
*/
@Schema(title = "공란", example = " ")
private String blnk;
/**
* <pre>
* : 4,
* </pre>
*/
@Schema(title = "조회동의사유", example = "4")
@Size(min = 1, max = 1, message = "조회동의사유는 1자리 입니다")
private String inqireAgreResn = "4";
/**
* NICE CI API - 2, 1
* @param isSend send
* @return String NICE CI
*/
public String ofString(boolean isSend) {
StringBuilder sb = new StringBuilder();
sb.append(spcltyGroupcode);
sb.append(delngAsortcode);
sb.append(delngSecode);
sb.append(trsmrcvAt);
sb.append(trmnlSe);
sb.append(rspnsCode);
sb.append(partcptInsttId);
sb.append(insttSpcltyManageno);
sb.append(insttSpcltyTrnsmistime);
sb.append(niceSpcltyManageno);
sb.append(niceSpcltyTrnsmistime);
sb.append(blnk);
if(isSend) sb.append(inqireAgreResn);
return sb.toString();
}
/**
* NICE CI API - 2, 1
* @param tgtString
* @return NiceCiApiCommon NICE CI DTO
*/
public static NiceCiApiCommon parse(String tgtString) {
final int[] parseLength = {
9, // 전문그룹코드
4, // 거래종별코드
5, // 거래구분코드
1, // 송수신Flag
3, // 단말기구분
4, // 응답코드
9, // 참가기관ID
10, // 기관전문관리번호
14, // 기관전문전송시간
10, //NICE 전문관리번호
14, // NICE 전문전송시간
17 // 공란
};
if (StringUtils.isNotBlank(tgtString) && tgtString.length() >= 83) {
NiceCiApiCommon nc = new NiceCiApiCommon();
int idx = 0;
nc.setSpcltyGroupcode(StringUtils.trim(StringUtils.left(tgtString, parseLength[idx])));
tgtString = tgtString.substring(parseLength[idx++]);
nc.setDelngAsortcode(StringUtils.trim(StringUtils.left(tgtString, parseLength[idx])));
tgtString = tgtString.substring(parseLength[idx++]);
nc.setDelngSecode(StringUtils.trim(StringUtils.left(tgtString, parseLength[idx])));
tgtString = tgtString.substring(parseLength[idx++]);
nc.setTrsmrcvAt(StringUtils.trim(StringUtils.left(tgtString, parseLength[idx])));
tgtString = tgtString.substring(parseLength[idx++]);
nc.setTrmnlSe(StringUtils.trim(StringUtils.left(tgtString, parseLength[idx])));
tgtString = tgtString.substring(parseLength[idx++]);
nc.setRspnsCode(StringUtils.trim(StringUtils.left(tgtString, parseLength[idx])));
tgtString = tgtString.substring(parseLength[idx++]);
nc.setPartcptInsttId(StringUtils.trim(StringUtils.left(tgtString, parseLength[idx])));
tgtString = tgtString.substring(parseLength[idx++]);
nc.setInsttSpcltyManageno(StringUtils.trim(StringUtils.left(tgtString, parseLength[idx])));
tgtString = tgtString.substring(parseLength[idx++]);
nc.setInsttSpcltyTrnsmistime(StringUtils.trim(StringUtils.left(tgtString, parseLength[idx])));
tgtString = tgtString.substring(parseLength[idx++]);
nc.setNiceSpcltyManageno(StringUtils.trim(StringUtils.left(tgtString, parseLength[idx])));
tgtString = tgtString.substring(parseLength[idx++]);
nc.setNiceSpcltyTrnsmistime(StringUtils.trim(StringUtils.left(tgtString, parseLength[idx])));
tgtString = tgtString.substring(parseLength[idx++]);
nc.setBlnk(StringUtils.trim(StringUtils.left(tgtString, parseLength[idx])));
return nc;
}
return null;
}
private static String nvl(String src){
return StringUtils.defaultIfEmpty(src, StringUtils.EMPTY);
}
}

@ -0,0 +1,395 @@
package cokr.xit.ens.modules.nice.model;
import org.apache.commons.lang3.*;
import cokr.xit.ens.modules.nice.cmm.*;
import io.swagger.v3.oas.annotations.media.*;
import lombok.*;
/**
* <pre>
* description : NICE CI API DTO
* packageName : cokr.xit.ens.modules.nice.model
* fileName : NiceCiApiResult
* author : limju
* date : 2024 9 25
* ======================================================================
*
* ----------------------------------------------------------------------
* 2024 9 25 limju
*
* </pre>
*/
@Schema(name = "NiceCiApiResult", description = "NICE CI API 결과 DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class NiceCiApiResult {
//------------------------------------------------------------------------------------
// 연락처 이력 조회시만
//------------------------------------------------------------------------------------
/**
* nice sms ID - PK
*/
private String niceSmsSndngInqireId;
/**
* <pre>
* - - 20
* YYYYMMDDHHMMSS(14)+microSecond(6)
* </pre>
*/
private String inqireDt;
public void setInqireDt(String inqireDt) {
this.inqireDt = StringUtils.trim(inqireDt);
}
//------------------------------------------------------------------------------------
// 연락처 이력 조회시만
//------------------------------------------------------------------------------------
/**
* <pre>
* // - 1
* 1()
* </pre>
*/
private String indvdlBsnmCprSe;
/**
* <pre>
* - 13
* </pre>
*/
private String ihidnum;
public void setIhidnum(String ihidnum) {
this.ihidnum = StringUtils.trim(ihidnum);
}
/**
* <pre>
* - 20
* NiceCiUtils.leftKr, substringKr
* </pre>
*/
private String nm;
public void setNm(String nm) {
this.nm = StringUtils.trim(nm);
}
/**
* <pre>
* 1 - 11
* </pre>
*/
private String rankCttpc_1;
public void setRankCttpc_1(String rankCttpc_1) {
this.rankCttpc_1 = StringUtils.trim(rankCttpc_1);
}
/**
* <pre>
* 2 - 11
* </pre>
*/
private String rankCttpc_2;
public void setRankCttpc_2(String rankCttpc_2) {
this.rankCttpc_2 = StringUtils.trim(rankCttpc_2);
}
/**
* <pre>
* 3 - 11
* </pre>
*/
private String rankCttpc_3;
public void setRankCttpc_3(String rankCttpc_3) {
this.rankCttpc_3 = StringUtils.trim(rankCttpc_3);
}
/**
* <pre>
* - 2
* 00 (SMS , SMS )
* 01
* 02
* 10 ( SMS )
* 99
* </pre>
*/
private String resultSe;
public void setResultSe(String resultSe) {
this.resultSe = StringUtils.trim(resultSe);
}
//------------------------------------------------------------------------------------
// 연락처 이력 조회시만
//------------------------------------------------------------------------------------
/**
* <pre>
* - SMS: 1
* 1 ~ 3 :
* 0 : ,
* 4: (31894)
* </pre>
*/
private String smsSndngRequstSe;
public void setSmsSndReq(String smsSndReqCode) {
this.smsSndngRequstSe = StringUtils.trim(smsSndReqCode);
}
/**
* <pre>
* - : 10 ~ 2000
* (smsSndReqCode) 1, 2, 3
* NiceCiUtils.leftKr, substringKr
* </pre>
*/
private String sndngMssage;
public void setSndngMssage(String sndngMssage) {
this.sndngMssage = StringUtils.trim(sndngMssage);
}
/**
* <pre>
* - : 12
* (smsSndReqCode) 1, 2, 3
* </pre>
*/
private String dsptchNo;
public void setDsptchNo(String dsptchNo) {
this.dsptchNo = StringUtils.trim(dsptchNo);
}
//------------------------------------------------------------------------------------
// 연락처 이력 조회시만
//------------------------------------------------------------------------------------
/**
* <pre>
* SMS - 1
* 0 : ,
* 1: 1 ,
* 2: 2
* 3: 3
* </pre>
*/
private String smsSndngCttpcRank;
/**
* <pre>
* SMS - 11
* </pre>
*/
private String smsSndngCttpcNo;
public void setSmsSndngCttpcNo(String smsSndngCttpcNo) {
this.smsSndngCttpcNo = StringUtils.trim(smsSndngCttpcNo);
}
/**
* <pre>
* SMS - 14
* </pre>
*/
private String smsSndngDt;
public void setSmsSndngDt(String smsSndngDt) {
this.smsSndngDt = StringUtils.trim(smsSndngDt);
}
//------------------------------------------------------------------------------------
// 연락처 이력 조회시만
//------------------------------------------------------------------------------------
/**
* <pre>
* - ID : 9
* </pre>
*/
private String opetrId;
public void setOpetrId(String opetrId) {
this.opetrId = StringUtils.trim(opetrId);
}
/**
* <pre>
* - : 1
* default: 3
* 1: 1 ,
* 2: 2
* 3: 3
* </pre>
*/
private String cttpcInqireSe;
/**
* <pre>
* - : 1
* 0(), 1( ), 2(SMS/LMS)
* , 0
* </pre>
*/
private String mssageSndngResultSe;
//------------------------------------------------------------------------------------
// 연락처 이력 조회시만
//------------------------------------------------------------------------------------
/**
* <pre>
* - 15, 11
* </pre>
*/
private String rspnsReptitBlnk;
public void setRspnsReptitBlnk(String rspnsReptitBlnk) {
this.rspnsReptitBlnk = StringUtils.trim(rspnsReptitBlnk);
}
/**
* NICE CI API - 2, 1
* @param tgtString
* @return NiceCiApiResult NICE CI DTO
*/
public static NiceCiApiResult parse(String tgtString) {
// 110 자리
final int[] parseLength = {
1, // 개인.사업자.법인구분
13, // 주민번호
20, // 성명
11, // 1순위 연락처
11, // 2순위 연락처
11, // 3순위 연락처
2, // 결과구분
1, // SMS발송 연락처 순위
11, // SMS발송 연락처 번호
14, // SMS발송(예정)일시
15, // 공란
};
if (StringUtils.isNotBlank(tgtString) && NiceCiUtils.lengthKr(tgtString)%110 == 0) {
NiceCiApiResult result = new NiceCiApiResult();
int idx = 0;
result.setIndvdlBsnmCprSe(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
result.setIhidnum(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
result.setNm(NiceCiUtils.leftKr(tgtString, parseLength[idx]));
tgtString = NiceCiUtils.substringKr(tgtString, parseLength[idx++]);
result.setRankCttpc_1(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
result.setRankCttpc_2(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
result.setRankCttpc_3(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
result.setResultSe(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
result.setSmsSndngCttpcRank(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
result.setSmsSndngCttpcNo(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
result.setSmsSndngDt(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
result.setRspnsReptitBlnk(StringUtils.left(tgtString, parseLength[idx]));
return result;
}
return null;
}
public static NiceCiApiResult parseStatus(String tgtString) {
// 1150
final int[] parseLength = {
20, // 조회일시 - 이력조회시만 사용
1, // 개인.사업자.법인구분
13, // 주민번호
20, // 성명
11, // 1순위 연락처
11, // 2순위 연락처
11, // 3순위 연락처
2, // 결과구분
1, // SMS발송 요청 구분 - 이력조회시만 사용
1000, // 발송메세지 - 이력조회시만 사용
12, // 발신번호 - 이력조회시만 사용
1, // SMS발송 연락처 순위
11, // SMS발송 연락처 번호
14, // SMS발송(예정)일시
9, // 처리자ID - 이력조회시만 사용
1, // 연락처 조회 구분 - 이력조회시만 사용
1, // 메세지발송결과 구붑
11, // 공란
};
if (StringUtils.isNotBlank(tgtString) && NiceCiUtils.lengthKr(tgtString)%1150 == 0) {
NiceCiApiResult result = new NiceCiApiResult();
int idx = 0;
// 이력조회시만 사용 ////////////////////////////////////////////////////////
result.setInqireDt(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
// 이력조회시만 사용 ////////////////////////////////////////////////////////
result.setIndvdlBsnmCprSe(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
result.setIhidnum(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
result.setNm(NiceCiUtils.leftKr(tgtString, parseLength[idx]));
tgtString = NiceCiUtils.substringKr(tgtString, parseLength[idx++]);
result.setRankCttpc_1(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
result.setRankCttpc_2(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
result.setRankCttpc_3(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
result.setResultSe(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
// 이력조회시만 사용 ////////////////////////////////////////////////////////
result.setSmsSndngRequstSe(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
result.setSndngMssage(NiceCiUtils.leftKr(tgtString, parseLength[idx]));
tgtString = NiceCiUtils.substringKr(tgtString, parseLength[idx++]);
result.setSmsSndngCttpcNo(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
// 이력조회시만 사용 ////////////////////////////////////////////////////////
result.setSmsSndngCttpcRank(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
result.setSmsSndngCttpcNo(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
result.setSmsSndngDt(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
// 이력조회시만 사용 ////////////////////////////////////////////////////////
result.setOpetrId(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
result.setCttpcInqireSe(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
result.setResultSe(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
// 이력조회시만 사용 ////////////////////////////////////////////////////////
result.setRspnsReptitBlnk(StringUtils.left(tgtString, parseLength[idx]));
return result;
}
return null;
}
private static String nvl(String src){
return StringUtils.defaultIfEmpty(src, StringUtils.EMPTY);
}
}

@ -0,0 +1,561 @@
package cokr.xit.ens.modules.nice.model;
import java.io.*;
import java.util.*;
import java.util.stream.*;
import javax.validation.*;
import javax.validation.constraints.*;
import org.apache.commons.lang3.*;
import cokr.xit.ens.core.exception.*;
import cokr.xit.ens.core.exception.code.*;
import cokr.xit.ens.modules.nice.cmm.*;
import io.swagger.v3.oas.annotations.media.*;
import lombok.*;
/**
* <pre>
* description : Nice CI DTO
* Builder X
* -> setter
* packageName : cokr.xit.ens.modules.nice.model
* fileName : NiceCiApiSendDTO
* author : limju
* date : 2024 9 23
* ======================================================================
*
* ----------------------------------------------------------------------
* 2024 9 23 limju
*
* </pre>
*/
public class NiceCiApiSendDTO {
@Schema(name = "Request(Nice CI Send) API DTO", description = "NICE CI API Send 요청 전문 DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class Request implements Serializable {
private static final long serialVersionUID = 1L;
//----------------------------------------------------------------------------------------------
// TR-CODE : 0 ~ 9 자리
//----------------------------------------------------------------------------------------------
/**
* <pre>
* TR-CODE
* 10
* set
* </pre>
*/
private String trnscId = StringUtils.EMPTY;
public void setTrnscId(String trnscId) {
this.trnscId = StringUtils.leftPad(nvl(trnscId), 10, "0");
}
/**
* nice sms ID - PK
*/
private String niceSmsSndngRequstId;
/**
* data_id
*/
private String dataId;
//----------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------
// 공통부 : 100 자리
//----------------------------------------------------------------------------------------------
@Schema(requiredMode = Schema.RequiredMode.REQUIRED)
@Valid
NiceCiApiCommon niceCommon;
//----------------------------------------------------------------------------------------------
// 공통부 : 100 자리
//----------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------
// 개별요청부 : 3000 자리
//----------------------------------------------------------------------------------------------
/**
* <pre>
* : 2
* </pre>
*/
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "조회사유", example = " ")
@Size(min = 2, max = 2, message = "조회사유는 2자리 입니다")
private String inqireResn = "17";
public void setInqireResn(String inqireResn) {
this.inqireResn = StringUtils.rightPad(nvl(inqireResn), 2, StringUtils.SPACE);
}
/**
* <pre>
* : 2
* 48
* </pre>
*/
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "조회요청건수", example = " ")
@Pattern(regexp = "^\\s{2}$|\\d{1,2}", message = "조회요청 최대건수는 48입니다(2자리)")
private String inqireRequstCo = "01";
public void setInqireRequstCo(Integer inqireRequstCo) {
this.inqireRequstCo = StringUtils.leftPad(nvl(inqireRequstCo == null? "": inqireRequstCo.toString()), 2, "0");
}
/**
* <pre>
* SMS: 1
* 1 ~ 3
* 0 : ,
* 1: 1 ,
* 2: 1 ~ 2 1
* 3: 1 ~ 3 1
* </pre>
*/
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "SMS발송요청구분코드", example = " ", allowableValues = {"0", "1", "2", "3"})
@Pattern(regexp = "[0-3]", message = "SMS발송요청구분코드 0 ~ 3 입니다(1자리)")
private String smsSndngRequstSe = "3";
/**
* <pre>
* : 10 ~ 2000
* (smsSndReqCode) 1, 2, 3
* </pre>
*/
@Schema(title = "SMS 발송메세지", example = " ")
@Pattern(regexp = "^[\\s\\S]{10,2000}$", message = "SMS발송메세지는 10 ~ 2000자리 입니다")
private String sndngMssage = StringUtils.rightPad(StringUtils.EMPTY, 2000, StringUtils.SPACE);
public void setSndngMssage(String sndngMssage) {
this.sndngMssage = NiceCiUtils.rightPadKr(nvl(sndngMssage), 2000, StringUtils.SPACE);
}
/**
* <pre>
* : 12
* (smsSndReqCode) 1, 2, 3
* </pre>
*/
@Schema(title = "SMS 발신번호", example = " ")
@Pattern(regexp = "^[\\s\\S]{3,12}$", message = "SMS 발신번호는 3 ~ 12자리 입니다")
private String dsptchNo = StringUtils.rightPad("0442113377", 12, StringUtils.SPACE);
public void setDsptchNo(String dsptchNo) {
this.dsptchNo = StringUtils.rightPad(nvl(dsptchNo), 12, StringUtils.SPACE);
}
/**
* <pre>
* : 1
* default: 3
* 1: 1 ,
* 2: 2
* 3: 3
* </pre>
*/
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "연락처조회구분코드", example = " ", allowableValues = {"1", "2", "3"})
@Pattern(regexp = "[1-3]", message = "연락처조회구분 코드는 1 ~ 3 입니다(1자리)")
private String cttpcInqireSe = "3";
/**
* <pre>
* : 1
* 1(+SMS), 2( ), 3(default: SMS)
* 릿 .
* 1 , SMS. 2 .
* </pre>
*/
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "알림톡발송요청구분", example = " ")
@Size(min = 1, max = 1, message = "알림톡발송요청구분 코드는 1자리 입니다")
private String ntcntalkSndngRequstSe = "1";
/**
* <pre>
* 릿: 100
* </pre>
*/
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "알림톡템플릿코드", example = " ")
@Size(min = 100, max = 100, message = "알림톡템플릿 코드는 100자리 입니다")
private String ntcntalkTmplatCode = StringUtils.rightPad(StringUtils.EMPTY, 100, StringUtils.SPACE);
public void setNtcntalkTmplatCode(String ntcntalkTmplatCode) {
this.ntcntalkTmplatCode = StringUtils.rightPad(nvl(ntcntalkTmplatCode), 100, StringUtils.SPACE);
}
/**
* <pre>
* : 1
* 5
* </pre>
*/
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "버튼요청건수", example = " ")
@Pattern(regexp = "^[0-5]$", message = "버튼요청건수는 1자리로 최대 5 입니다.")
private String bttonRequstCo = "1";
public void setBttonRequstCo(Integer bttonRequstCo) {
this.bttonRequstCo = StringUtils.rightPad(nvl(bttonRequstCo == null ? "" : bttonRequstCo.toString()), 1, StringUtils.SPACE);
}
/**
* <pre>
* - 880
* </pre>
*/
@Schema(title = "공란", example = " ")
@Size(min = 880, max = 880, message = "공란(880자리)")
private String indvdlzRequstBlnk = StringUtils.rightPad(StringUtils.EMPTY, 880, StringUtils.SPACE);
//----------------------------------------------------------------------------------------------
// 개별요청부 : 3000 자리
//----------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------
// 조회요청부 반복: 50 자리
//----------------------------------------------------------------------------------------------
List<QueryRequest> queryRequests = new ArrayList<>();
//----------------------------------------------------------------------------------------------
// 조회요청부 반복: 50 자리
//----------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------
// 버튼요청부 반복: 3000 자리
//----------------------------------------------------------------------------------------------
List<ButtonRequest> buttonRequests = new ArrayList<>();
//----------------------------------------------------------------------------------------------
// 버튼요청부 반복: 3000 자리
//----------------------------------------------------------------------------------------------
/**
* NICE CI API - 2, 1
* @return String NICE CI send
*/
public String ofString() {
StringBuilder sb = new StringBuilder();
//sb.append(trCode);
// 공통부
sb.append(niceCommon.ofString(true));
// 개별요청부
sb.append(inqireResn);
sb.append(inqireRequstCo);
sb.append(smsSndngRequstSe);
sb.append(sndngMssage);
sb.append(dsptchNo);
sb.append(cttpcInqireSe);
sb.append(ntcntalkSndngRequstSe);
sb.append(ntcntalkTmplatCode);
sb.append(bttonRequstCo);
sb.append(indvdlzRequstBlnk);
sb.append(queryRequests.stream().map(QueryRequest::ofString).collect(Collectors.joining()));
sb.append(buttonRequests.stream().map(ButtonRequest::ofString).collect(Collectors.joining()));
// FIXME: 인코딩확인후 적용
//return NiceCiUtils.covertCharset(sb.toString(), "EUC-KR");
return sb.toString();
}
}
@Schema(name = "Response(Nice CI) DTO", description = "NICE CI 응답 전문 DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class Response implements Serializable {
private static final long serialVersionUID = 1L;
/**
* nice sms ID - PK
*/
private String niceSmsSndngRequstId;
//----------------------------------------------------------------------------------------------
// TR-CODE : 0 ~ 9 자리
//----------------------------------------------------------------------------------------------
/**
* <pre>
* TR-CODE
* - max: 9
* </pre>
*/
private String trnscId;
public void setTrnscId(String trnscId) {
this.trnscId = StringUtils.trim(trnscId);
}
//----------------------------------------------------------------------------------------------
// 공통부 : 100 자리
//----------------------------------------------------------------------------------------------
NiceCiApiCommon niceCommon;
//----------------------------------------------------------------------------------------------
// 공통부 : 100 자리
//----------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------
// 개별응답부 : 2100 자리
//----------------------------------------------------------------------------------------------
/**
* <pre>
* : 2
* 48
* </pre>
*/
private String rspnsCo;
public void setRspnsCo(String rspnsCo) {
this.rspnsCo = StringUtils.trim(rspnsCo);
}
/**
* <pre>
* SMS: 1
* 1 ~ 3
* 0 : ,
* 1: 1 ,
* 2: 1 ~ 2 1
* 3: 1 ~ 3 1
* </pre>
*/
private String smsSndngRequstSe;
public void setSmsSndReq(String smsSndReqCode) {
this.smsSndngRequstSe = StringUtils.trim(smsSndReqCode);
}
/**
* <pre>
* : 10 ~ 2000
* (smsSndReqCode) 1, 2, 3
* NiceCiUtils.leftKr, substringKr
* </pre>
*/
private String sndngMssage;
public void setSndngMssage(String sndngMssage) {
this.sndngMssage = StringUtils.trim(sndngMssage);
}
/**
* <pre>
* : 12
* (smsSndReqCode) 1, 2, 3
* </pre>
*/
private String dsptchNo;
public void setDsptchNo(String dsptchNo) {
this.dsptchNo = StringUtils.trim(dsptchNo);
}
/**
* <pre>
* : 1
* default: 3
* 1: 1 ,
* 2: 2
* 3: 3
* </pre>
*/
private String cttpcInqireSe = "3";
/**
* <pre>
* - 84
* </pre>
*/
private String indvdlzRspnsBlnk;
public void setIndvdlzRspnsBlnk(String indvdlzRspnsBlnk) {
this.indvdlzRspnsBlnk = StringUtils.trim(indvdlzRspnsBlnk);
}
//----------------------------------------------------------------------------------------------
// 개별응답부 : 2100 자리
//----------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------
// 응답반복부 : 110 자리
//----------------------------------------------------------------------------------------------
List<NiceCiApiResult> niceCiResults = new ArrayList<>();
//----------------------------------------------------------------------------------------------
// 응답반복부 : 110 자리
//----------------------------------------------------------------------------------------------
public static Response parse(String tgtString) {
final int repeatLength = 110;
final int[] parseLength = {
10, // tr-code
100, // 공통부
// FIXME: spec과 상이 - 확인 필요 : "1"이 들어오고 있다
2, // 응답건수
1, // SMS발송요청구분코드
2000, // SMS 발송메세지
12, // SMS 발신번호
1, // 연락처조회구분
84, // 공란
};
if (StringUtils.isNotBlank(tgtString) && NiceCiUtils.lengthKr(tgtString) >= 2210) {
Response response = new Response();
int idx = 0;
response.setTrnscId(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
response.setNiceCommon(NiceCiApiCommon.parse(tgtString));
tgtString = tgtString.substring(parseLength[idx++]);
response.setRspnsCo(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
response.setSmsSndngRequstSe(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
response.setSndngMssage(NiceCiUtils.leftKr(tgtString, parseLength[idx]));
tgtString = NiceCiUtils.substringKr(tgtString, parseLength[idx++]);
response.setDsptchNo(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
response.setCttpcInqireSe(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
response.setIndvdlzRspnsBlnk(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx]);
if(NiceCiUtils.lengthKr(tgtString) > 0 && NiceCiUtils.lengthKr(tgtString) % repeatLength == 0){
int repeat = NiceCiUtils.lengthKr(tgtString) / repeatLength;
String finalTgtString = tgtString;
List<NiceCiApiResult> resResults = IntStream.range(0, repeat)
.mapToObj(i -> {
String currentString = NiceCiUtils.substringKr(finalTgtString, i * repeatLength);
return NiceCiApiResult.parse(currentString);
})
.collect(Collectors.toList());
response.setNiceCiResults(resResults);
}else{
if((NiceCiUtils.lengthKr(tgtString) != 0)){
throw new EnsException(EnsErrCd.INVALID_RESPONSE, "NICE CI 송신 응답 반복부 전문 오류:: length - " + NiceCiUtils.lengthKr(tgtString));
}
}
return response;
}
throw new EnsException(EnsErrCd.INVALID_RESPONSE, "NICE CI 송신 응답 전문 오류:: length - " + NiceCiUtils.lengthKr(tgtString));
}
}
@Schema(name = "QueryRequest", description = "NICE CI 조회 요청 DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class QueryRequest {
/**
* <pre>
* // - 1
* 1()
* </pre>
*/
@Schema(title = "개인/사업자/법인구분", example = "1")
@Size(min = 1, max = 1, message = "개인/사업자/법인구분은 1자리 입니다.")
private String indvdlBsnmCprSe = "1";
/**
* <pre>
* - 13
* </pre>
*/
@Schema(title = "주민번호", example = " ")
@Size(min = 13, max = 13, message = "주민번호는 13자리 입니다.")
private String ihidnum = StringUtils.rightPad(StringUtils.EMPTY, 13, StringUtils.SPACE);
public void setIhidnum(String ihidnum) {
this.ihidnum = StringUtils.rightPad(nvl(ihidnum), 13, StringUtils.SPACE);
}
/**
* <pre>
* - 880
* </pre>
*/
@Schema(title = "공란", example = " ")
@Size(min = 36, max = 36, message = "공란(36자리)")
private String inqireRequstBlnk = StringUtils.rightPad(StringUtils.EMPTY, 36, StringUtils.SPACE);
public String ofString() {
StringBuilder sb = new StringBuilder();
sb.append(indvdlBsnmCprSe);
sb.append(ihidnum);
sb.append(inqireRequstBlnk);
return sb.toString();
}
}
@Schema(name = "ButtonRequest", description = "NICE CI 버튼 요청 DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class ButtonRequest {
/**
* <pre>
* - 2
* WL|AL
* </pre>
*/
@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "버튼타입", example = " ", allowableValues = {"WL", "AL"})
@Pattern(regexp = "[WL|AL]", message = "버튼 타입은 2자리 입니다.")
private String bttonTy = "WL";
public void setBttonTy(String bttonTy) {
this.bttonTy = StringUtils.rightPad(nvl(bttonTy), 2, StringUtils.SPACE);
}
/**
* <pre>
* - 56
* </pre>
*/
@Schema(title = "버튼이름", example = "1")
@Size(min = 56, max = 56, message = "버튼이름은 56자리 입니다.")
private String bttonNm = NiceCiUtils.rightPadKr("납부하기", 56, StringUtils.SPACE);
public void setBttonNm(String bttonNm) {
this.bttonNm = NiceCiUtils.rightPadKr(nvl(bttonNm), 56, StringUtils.SPACE);
}
/**
* <pre>
* URL1 - 1000
* (btnType) WL URL, AL Android scheme
* </pre>
*/
@Schema(title = "버튼URL웹링크1", example = " ")
@Size(min = 1000, max = 1000, message = "버튼URL웹링크1 은 1000자리 입니다.")
private String bttonUrlWebLink_1 = StringUtils.rightPad(
"https://billgates-web.kakao.com/r/platform/pages/paynow/search/1832/11/01819e09-8b4c-4287-9f0f-1c5c2df80bf0",
1000,
StringUtils.SPACE);
public void setBttonUrlWebLink_1(String bttonUrlWebLink_1) {
this.bttonUrlWebLink_1 = StringUtils.rightPad(nvl(bttonUrlWebLink_1), 1000, StringUtils.SPACE);
}
/**
* <pre>
* URL2 - 1000
* (btnType) WL PC URL, AL IOS scheme
* </pre>
*/
@Schema(title = "버튼URL웹링크2", example = " ")
@Size(min = 1000, max = 1000, message = "버튼URL웹링크2 은 1000자리 입니다.")
private String bttonUrlWebLink_2 = StringUtils.rightPad(StringUtils.EMPTY, 1000, StringUtils.SPACE);
public void setBttonUrlWebLink_2(String bttonUrlWebLink_2) {
this.bttonUrlWebLink_2 = StringUtils.rightPad(nvl(bttonUrlWebLink_2), 1000, StringUtils.SPACE);
}
/**
* <pre>
* - 942
* </pre>
*/
@Schema(title = "공란", example = " ")
@Size(min = 942, max = 942, message = "공란(36자리)")
private String bttonRequstBlnk = StringUtils.rightPad(StringUtils.EMPTY, 942, StringUtils.SPACE);
public String ofString() {
StringBuilder sb = new StringBuilder();
sb.append(bttonTy);
sb.append(bttonNm);
sb.append(bttonUrlWebLink_1);
sb.append(bttonUrlWebLink_2);
sb.append(bttonRequstBlnk);
return sb.toString();
}
}
private static String nvl(String src){
return StringUtils.defaultIfEmpty(src, StringUtils.EMPTY);
}
}

@ -0,0 +1,361 @@
package cokr.xit.ens.modules.nice.model;
import java.io.*;
import java.nio.charset.*;
import java.util.*;
import java.util.stream.*;
import javax.validation.*;
import javax.validation.constraints.*;
import org.apache.commons.lang3.*;
import cokr.xit.ens.core.exception.*;
import cokr.xit.ens.core.exception.code.*;
import cokr.xit.ens.modules.nice.cmm.*;
import io.swagger.v3.oas.annotations.media.*;
import lombok.*;
/**
* <pre>
* description : Nice CI DTO
* Builder X
* -> setter
* packageName : cokr.xit.ens.modules.nice.model
* fileName : NiceCiApiStatusDTO
* author : limju
* date : 2024 9 23
* ======================================================================
*
* ----------------------------------------------------------------------
* 2024 9 23 limju
*
* </pre>
*/
public class NiceCiApiStatusDTO {
@Schema(name = "Request(Nice CI History) API DTO", description = "NICE CI API 이력 요청 전문 DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class Request implements Serializable {
private static final long serialVersionUID = 1L;
//----------------------------------------------------------------------------------------------
// TR-CODE : 0 ~ 9 자리
//----------------------------------------------------------------------------------------------
/**
* <pre>
* TR-CODE
* 10
* set
* </pre>
*/
//@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "TR Code", example = " ")
//@Size(min = 10, max = 10, message = "트랜잭션 코드는 10자리 입니다.")
private String trnscId = StringUtils.EMPTY;
public void setTrnscId(String trnscId) {
this.trnscId = StringUtils.leftPad(nvl(trnscId), 10, "0");
}
/**
* nice sms ID - PK
*/
private String niceSmsSndngInqireId;
//----------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------
// 공통부 : 100 자리
//----------------------------------------------------------------------------------------------
@Schema(requiredMode = Schema.RequiredMode.REQUIRED)
@Valid
NiceCiApiCommon niceCommon;
//----------------------------------------------------------------------------------------------
// 공통부 : 100 자리
//----------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------
// 개별요청부 : 100 자리
//----------------------------------------------------------------------------------------------
/**
* <pre>
* from - 20
* YYYYMMDDHHMMSS(14)+microSecond(6)
* DateUtils.getNowTimeMicrosecond()
* </pre>
*/
@Schema(title = "검색기간 from", example = " ")
@Size(min = 20, max = 20, message = "검색기간 from")
private String searchPdFrom;
public void setSearchPdFrom(String searchPdFrom) {
this.searchPdFrom = StringUtils.rightPad(nvl(searchPdFrom), 20, "0");
}
/**
* <pre>
* to - 20
* YYYYMMDDHHMMSS(14)+microSecond(6)
* </pre>
*/
@Schema(title = "검색기간 to", example = " ")
@Size(min = 20, max = 20, message = "검색기간 to")
private String searchPdTo;
public void setSearchPdTo(String searchPdTo) {
this.searchPdTo = StringUtils.rightPad(nvl(searchPdTo), 20, "0");
}
/**
* <pre>
* // - 1
* 1()
* </pre>
*/
@Schema(title = "개인/사업자/법인구분", example = "1")
@Size(min = 1, max = 1, message = "개인/사업자/법인구분은 1자리 입니다.")
private String indvdlBsnmCprSe = "1";
/**
* <pre>
* - 13
* </pre>
*/
@Schema(title = "주민번호", example = " ")
//@Size(min = 13, max = 13, message = "주민번호는 13자리 입니다.")
private String ihidnum = StringUtils.rightPad(StringUtils.EMPTY, 13, StringUtils.SPACE);
public void setIhidnum(String ihidnum) {
this.ihidnum = StringUtils.rightPad(nvl(ihidnum), 13, StringUtils.SPACE);
}
/**
* <pre>
* - 2
* " " -
* 00 - (SMS , SMS )
* 01 - (// )
* 10 - ( SMS )
* </pre>
*/
@Schema(title = "결과구분코드", example = " ", allowableValues = {" ", "00", "01", "10"})
@Size(min = 2, max = 2, message = "결과구분코드는 2자리 입니다.")
private String resultSe = " ";
public void setResultSe(String resultSe) {
this.resultSe = StringUtils.rightPad(nvl(resultSe), 2, StringUtils.SPACE);
}
/**
* <pre>
* SMS - 1
* 0 : ,
* 1: 1 ,
* 2: 1 ~ 2 1
* 3: 1 ~ 3 1
* 4: 1{1 } + 2{1~2 } + 3{1~3 }
* </pre>
*/
@Schema(title = "SMS발송요청구분", example = " ", allowableValues = {"0", "1", "2", "3", "4"})
@Size(min = 1, max = 1, message = "SMS발송요청구분은 1자리 입니다.")
private String smsSndngRequstSe = "0";
/**
* <pre>
* - 10
* : 100
* </pre>
*/
@Schema(title = "요청건수", example = " ")
@Pattern(regexp = "^[\\s\\S]{10}$", message = "요청건수는 10자리(max 100)입니다")
private String requstCo;
public void setRequstCo(String requstCo){
this.requstCo = StringUtils.leftPad(nvl(requstCo), 10, "0");
}
/**
* <pre>
* - 10
* "0000000000"
* </pre>
*/
@Schema(title = "누적수신건수", example = " ")
@Size(min = 10, max = 10, message = "누적수신건수는 10자리 입니다.")
@Pattern(regexp = "^\\d{10}$", message = "요청건수는 10자리(max 100)입니다")
private String accmltRecptnCo;
public void setAccmltRecptnCo(String accmltRecptnCo) {
this.accmltRecptnCo = StringUtils.leftPad(nvl(accmltRecptnCo), 10, "0");
}
/**
* <pre>
* - 880
* </pre>
*/
@Schema(title = "공란", example = " ")
@Size(min = 23, max = 23, message = "공란(23자리)")
private String indvdlzRequstBlnk = StringUtils.rightPad(StringUtils.EMPTY, 23, StringUtils.SPACE);
public void setIndvdlzRequstBlnk(String indvdlzRequstBlnk) {
this.indvdlzRequstBlnk = StringUtils.rightPad(nvl(indvdlzRequstBlnk), 23, StringUtils.SPACE);
}
//----------------------------------------------------------------------------------------------
// 개별요청부 : 100 자리
//----------------------------------------------------------------------------------------------
/**
* NICE CI API - 2, 1
* @return String NICE CI
*/
public String ofString() {
StringBuilder sb = new StringBuilder();
sb.append(trnscId);
// 공통부
sb.append(niceCommon.ofString(false));
// 개별요청부
sb.append(searchPdFrom);
sb.append(searchPdTo);
sb.append(indvdlBsnmCprSe);
sb.append(ihidnum);
sb.append(resultSe);
sb.append(smsSndngRequstSe);
sb.append(requstCo);
sb.append(accmltRecptnCo);
sb.append(indvdlzRequstBlnk);
// FIXME: 인코딩확인후 적용
return new String(sb.toString().getBytes(), StandardCharsets.UTF_8);
}
}
@Schema(name = "Response(Nice CI Status) DTO", description = "NICE CI 상태(이력) 응답 전문 DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class Response implements Serializable {
private static final long serialVersionUID = 1L;
//----------------------------------------------------------------------------------------------
// TR-CODE : 0 ~ 9 자리
//----------------------------------------------------------------------------------------------
/**
* <pre>
* TR-CODE
* - max: 9
* </pre>
*/
private String trnscId;
public void setTrnscId(String trnscId) {
this.trnscId = StringUtils.trim(trnscId);
}
/**
* nice sms ID - PK
*/
private String niceSmsSndngInqireId;
//----------------------------------------------------------------------------------------------
// 공통부 : 100 자리
//----------------------------------------------------------------------------------------------
NiceCiApiCommon niceCommon;
//----------------------------------------------------------------------------------------------
// 공통부 : 100 자리
//----------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------
// 개별응답부 : 30 자리
//----------------------------------------------------------------------------------------------
/**
* <pre>
* : 10
* </pre>
*/
private String totCo;
public void setTotCo(String totCo) {
this.totCo = StringUtils.trim(totCo);
}
/**
* <pre>
* : 10
* </pre>
*/
private String accmltCo;
public void setAccmltCo(String accmltCo) {
this.accmltCo = StringUtils.trim(accmltCo);
}
/**
* <pre>
* : 10
* 100
* </pre>
*/
private String rspnsCo;
public void setRspnsCo(String rspnsCo) {
this.rspnsCo = StringUtils.trim(rspnsCo);
}
//----------------------------------------------------------------------------------------------
// 개별응답부 : 30 자리
//----------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------
// 응답반복부 : 1150 자리
//----------------------------------------------------------------------------------------------
List<NiceCiApiResult> niceCiResults = new ArrayList<>();
//----------------------------------------------------------------------------------------------
// 응답반복부 : 1150 자리
//----------------------------------------------------------------------------------------------
public static Response parse(String tgtString) {
final int repeatLength = 1150;
final int[] parseLength = {
10, // tr-code
100, // 공통부
10, // 총건수
10, // 누적건수
10, // 응답건수
};
// FIXME: 인코딩확인후 필요시 사용
//String tgtString = new String(tgtStr.getBytes(), StandardCharsets.UTF_8);
if (StringUtils.isNotBlank(tgtString) && NiceCiUtils.lengthKr(tgtString) >= 140) {
Response nr = new Response();
int idx = 0;
nr.setTrnscId(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
nr.setNiceCommon(NiceCiApiCommon.parse(tgtString));
tgtString = tgtString.substring(parseLength[idx++]);
nr.setTotCo(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
nr.setAccmltCo(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
nr.setRspnsCo(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
if(NiceCiUtils.lengthKr(tgtString) > 0 && NiceCiUtils.lengthKr(tgtString) % repeatLength == 0){
int repeat = NiceCiUtils.lengthKr(tgtString) / repeatLength;
String finalTgtString = tgtString;
List<NiceCiApiResult> resResults = IntStream.range(0, repeat)
.mapToObj(i -> {
String currentString = NiceCiUtils.substringKr(finalTgtString, i * repeatLength);
return NiceCiApiResult.parseStatus(currentString);
})
.collect(Collectors.toList());
nr.setNiceCiResults(resResults);
}else{
if((NiceCiUtils.lengthKr(tgtString) != 0)){
throw new EnsException(EnsErrCd.INVALID_RESPONSE, "NICE CI 상태(이력) 조회 응답 반복부 전문 오류:: length - " + NiceCiUtils.lengthKr(tgtString));
}
}
return nr;
}
throw new EnsException(EnsErrCd.INVALID_RESPONSE, "NICE CI 상태(이력) 조회 응답 전문 오류:: length - " + NiceCiUtils.lengthKr(tgtString));
}
}
private static String nvl(String src){
return StringUtils.defaultIfEmpty(src, StringUtils.EMPTY);
}
}

@ -0,0 +1,491 @@
package cokr.xit.ens.modules.nice.model;
import java.time.*;
import java.util.*;
import cokr.xit.ens.biz.iup.code.*;
import cokr.xit.ens.modules.common.ctgy.intgrnbill.support.code.*;
import io.swagger.v3.oas.annotations.media.*;
import lombok.*;
/**
* <pre>
* description : NICE CI DTO
* packageName : cokr.xit.ens.modules.nice.model
* fileName : NiceCiDTO
* author : limju
* date : 2024 9 30
* ======================================================================
*
* ----------------------------------------------------------------------
* 2024 9 30 limju
*
* </pre>
*/
public class NiceCiDTO {
@Schema(name = "InputXit DTO", description = "InputXit DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public static class NiceCiParam {
/**
*
*/
private String sendType = IupSendTypeCd.NI.getCode();
/**
*
*/
private String prcsCd = IupPrcsCd.TGRG.getCode();
/**
*
*/
private Long lnkInputId;
/**
*
*/
private String reqStatusCd;
/**
*
*/
private String jobCd;
private String errorCode;
private String errorMessage;
private String resultCd;
private String resultDt;
private String url;
}
@Schema(name = "InputXit DTO", description = "InputXit DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public static class InputXit {
/**
*
*/
private Long lnkInputId;
/**
*
*/
private String orgCd;
/**
*
*/
private String jobCd;
/**
*
*/
private Long totCnt;
/**
*
*/
private String prcsCd;
/**
*
*/
private String errMsg;
/**
*
*/
private LocalDateTime runDt;
/**
*
*/
private LocalDateTime expiresDt;
/**
*
*/
private String sendType;
/**
*
*/
private String rcptDt;
/**
*
*/
private LocalDateTime payExpiresDt;
List<InputDataXit> inputDataXits = new ArrayList<>();
private String regId;
private LocalDateTime regDt;
private String updId;
private LocalDateTime updDt;
}
@Schema(name = "InputDataXit DTO", description = "InputDataXit DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public static class InputDataXit {
private String dataId;
private Long lnkInputId;
private String birthday;
private String callCenterNo;
private String carNo;
private String gender;
private String linkedUuid;
private String moblphonNo;
private String msgData;
private String msgDtlData;
private String name;
private String payStatusCd;
private String payUrl;
private String sid;
private String regId;
private LocalDateTime regDt;
private String updId;
private LocalDateTime updDt;
}
@Schema(name = "BillDTO DTO", description = "BillDTO DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public static class BillDTO {
private Long billId;
private String billUid;
private String billerUserKey;
/**
*
*/
//@Enumerated(EnumType.STRING)
private String billSeCd;
private String orgCd;
/**
*
*/
private Boolean paidAt;
/**
*
*/
//@Enumerated(EnumType.STRING)
private String paidType;
/**
* () - 14
*/
private String paidDt;
/**
* () - 14
*/
private String paidCancelDt;
private String docBillKko;
private String docBillNv;
}
@Schema(name = "BillKkoDTO DTO", description = "BillKkoDTO DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public static class BillKkoDTO {
private Long billId;
private String billUid;
private String billerUserKey;
/**
*
*/
private String billedYearMonth;
/**
*
*/
private String ordinal;
/**
*
*/
private String billerNoticeKey;
/**
* URL
*/
private String expireAt;
/**
* API JSON
*/
private String parameters;
/**
* <pre>
* // API Url JSON
* " "custom_url\": {\n" +
* " \"notice_url\" : \" https://test-api.dozn.co.kr/kakao/notice\",\n" +
* " \"prepay_url\": \"https://test-api.dozn.co.kr/kakao/prepay\",\n" +
* " \"pay_result_url\": \" https://test-api.dozn.co.kr/kakao/pay-result\"\n" +
* " }"
* </pre>
*/
private String customUrl;
/**
* URL
*/
private String url;
/* =====================================
* - PayNotice
===================================== */
/**
*
*/
private String title;
/**
*
*/
private Integer amount;
/**
*
*/
private Integer taxFreeAmount;
/**
*
*/
private Integer vatAmount;
/**
* : D1
*/
private String expireType;
/**
*
*/
private String payExpireDate;
/**
*
*/
private String secondPayExpireDate;
/**
*
*/
private String bankAccounts;
/**
*
*/
private String details;
/**
* (YYYYMMDDHH24MISS)
*/
private String lastPaidAt;
/**
*
*/
private Integer lastPayId;
private String errorCode;
private String errorMessage;
// @Embedded
// @Setter
// private FieldError error;
}
@Schema(name = "BillHistDTO DTO", description = "BillHistDTO DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public static class BillHistDTO {
private Long id;
/**
*
*/
private String billUid;
/**
* : - "bpKko"
*/
@Builder.Default
private String billSe = BillSeCd.bpKko.getCode();
/**
* : - "VD_URL"
*/
@Builder.Default
private String reqSe = BillReqSeCd.VD_URL.getCode();
/**
*
*/
private String orgCd;
/**
*
*/
private String linkedUuid;
private String requestData;
private String responseData;
private String errorCode;
private String errorMessage;
}
@Schema(name = "TmpltMngDTO DTO", description = "TmpltMngDTO DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public static class TmpltMngDTO {
private String dtype;
private String orgCd;
private String tmpltCd;
private String title;
private String message;
private String useYn;
private String ntcntalkTmplatCode;
private String orgNm;
private String registId;
private LocalDateTime registDt;
private String updId;
private LocalDateTime lastUpdtDt;
}
@Schema(name = "SendResult DTO", description = "SendResult DTO")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public static class SendResult {
/**
* - PK
*/
private Long lnkInputId;
/**
* - PK
*/
private String dataId;
/**
* - PK
*/
private String prcsOdr;
/**
*
*/
private String sendSttusCd;
/**
* : NI:, KP:
*/
private String sendType;
/**
*
*/
private LocalDateTime runDt;
/**
*
*/
private LocalDateTime bizSendDt;
/**
*
*/
private LocalDateTime bizRecvDt;
/**
*
*/
private LocalDateTime bizReadDt;
/**
*
*/
private String bizErrMsg;
/**
*
*/
private LocalDateTime expiresDt;
/**
* -
*/
private String prcsYn;
private String regId;
private LocalDateTime regDt;
private String ihidnum;
}
}

@ -0,0 +1,76 @@
package cokr.xit.ens.modules.nice.model;
import java.io.*;
import java.net.*;
import java.nio.charset.*;
public class TestSocketServer {
public static void main(String[] args) {
try (ServerSocket serverSocket = new ServerSocket(10002)) { // 포트 12345에서 서버 소켓 열기
System.out.println("서버가 시작되었습니다.");
while (true) {
Socket clientSocket = serverSocket.accept(); // 클라이언트 연결 수락
new Thread(() -> handleClient(clientSocket)).start(); // 새로운 스레드에서 클라이언트 처리
}
} catch (IOException e) {
e.printStackTrace();
}
}
private static void handleClient(Socket clientSocket) {
final String niceCiRes = "0000002310NICEIF 021031896N503P000Z755400 000000010320240919 466241822620240919160011 1013민자도로 관리지원센터에서 김해찬님께 발송한 미납통행료 고지서가 도착했습니다.\n"
+ "\n"
+ "민자도로 미납통행료 고지서\n"
+ "\n"
+ "□ 차량번호 : 19너0914\n"
+ "□ 미납발생 노선 : 서울-문산\n"
+ "□ 미납발생 기간 : 2021년 04월 12일~2023년 08월 30일\n"
+ "□ 납부금액 : 819,500원(42건)\n"
+ "□ 납부기한 : 2024년10월01일\n"
+ "□ 납부방법 : \n"
+ "① 하단의 (납부하기) 클릭\n"
+ "② 가상계좌 납부\n"
+ "-(가상계좌) : 농협은행 792000-36-986609\n"
+ "국민은행 731190-72-253083\n"
+ "우리은행 283752-73-918780\n"
+ "신한은행 562146-27-470101\n"
+ "\n"
+ "※ 알림톡 수신 시 종이고지서는 발송되지 않습니다.\n"
+ "\n"
+ "문의처 : 044-211-3377 0442113377 3 18912111020220김해찬 01084289916 0010108428991620240919160011 ";
try (BufferedReader in = new BufferedReader(
new InputStreamReader(clientSocket.getInputStream(), Charset.forName("EUC-KR")));
// new InputStreamReader(clientSocket.getInputStream(), Charset.forName("UTF-8")));
BufferedWriter out = new BufferedWriter(
new OutputStreamWriter(clientSocket.getOutputStream(), Charset.forName("EUC-KR")))) {
// 클라이언트로부터 메시지 읽기
String message;
StringBuffer sb = new StringBuffer();
while((message = in.readLine()) != null) {
if("EXIT".equals(message)) break;
sb.append(message).append("\n");
};
System.out.println("=============>>>클라이언트로부터 받은 메시지<<<====================================");
System.out.println(sb.toString());
System.out.println("=============>>>클라이언트로부터 받은 메시지<<<====================================");
// 응답 메시지 작성 및 전송
out.write(niceCiRes);
out.newLine();
out.flush();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
clientSocket.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}

@ -0,0 +1,74 @@
package cokr.xit.ens.modules.nice.presentation;
import org.springframework.http.*;
import org.springframework.web.bind.annotation.*;
import cokr.xit.ens.modules.nice.service.*;
import io.swagger.v3.oas.annotations.*;
import io.swagger.v3.oas.annotations.tags.*;
import lombok.*;
/**
* <pre>
* description :
* packageName : cokr.xit.ens.modules.nice.presentation
* fileName : NiceCiController
* author : limju
* date : 2024 9 27
* ======================================================================
*
* ----------------------------------------------------------------------
* 2024 9 27 limju
*
* </pre>
*/
@Tag(name = "NiceCiController", description = "NICE CI 인증톡")
@RestController
@RequiredArgsConstructor
@RequestMapping(value = "/nice/talk")
public class NiceCiController {
private final NiceCiAcceptService niceCiAcceptService;
private final NiceCiSendBulkService niceCiSendService;
private final NiceCiStatBulkService niceCiStatBulkService;
private final NiceCiCloseService niceCiCloseService;
/**
* NICE CI
* @return ResponseEntity
*/
@Operation(summary = "접수")
@PostMapping(value = "/accept/all", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> accept() {
return new ResponseEntity<>(niceCiAcceptService.accept(), HttpStatus.OK);
}
/**
* NICE CI
* @return ResponseEntity
*/
@Operation(summary = "(대량)전송요청")
@PostMapping(value = "/send/bulk/all", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> sendBulk() {
return new ResponseEntity<>(niceCiSendService.requestSendBulk(), HttpStatus.OK);
}
/**
* NICE CI
* @return ResponseEntity
*/
@Operation(summary = "(대량)상태조회")
@PostMapping(value = "/stat/bulk/all", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> findBulkStatus() {
return new ResponseEntity<>(niceCiStatBulkService.findBulkStatus(), HttpStatus.OK);
}
/**
* NICE CI
* @return ResponseEntity
*/
@Operation(summary = "마감(종료)")
@PostMapping(value = "/stat/closed", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> cloased() {
return new ResponseEntity<>(niceCiCloseService.close(), HttpStatus.OK);
}
}

@ -0,0 +1,270 @@
package cokr.xit.ens.modules.nice.service;
import java.time.*;
import java.util.*;
import org.apache.commons.lang3.*;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.*;
import org.springframework.stereotype.*;
import org.springframework.transaction.annotation.*;
import com.google.gson.*;
import com.google.gson.reflect.*;
import cokr.xit.ens.biz.iup.code.*;
import cokr.xit.ens.core.aop.*;
import cokr.xit.ens.core.exception.*;
import cokr.xit.ens.core.exception.code.*;
import cokr.xit.ens.core.utils.*;
import cokr.xit.ens.modules.common.code.*;
import cokr.xit.ens.modules.common.ctgy.intgrnbill.kko.api.*;
import cokr.xit.ens.modules.common.ctgy.intgrnbill.kko.service.process.model.*;
import cokr.xit.ens.modules.common.ctgy.intgrnbill.support.code.*;
import cokr.xit.ens.modules.common.ctgy.intgrnbill.support.model.*;
import cokr.xit.ens.modules.common.ctgy.sys.mng.domain.*;
import cokr.xit.ens.modules.common.ctgy.sys.mng.service.*;
import cokr.xit.ens.modules.nice.mapper.*;
import cokr.xit.ens.modules.nice.model.*;
import lombok.*;
import lombok.extern.slf4j.*;
/**
* <pre>
* description :
* packageName : cokr.xit.ens.modules.nice.service
* fileName : NiceCiService
* author : limju
* date : 2024 9 27
* ======================================================================
*
* ----------------------------------------------------------------------
* 2024 9 27 limju
*
* </pre>
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class NiceCiAcceptService {
@Value("${contract.kakao.pay.bill.dozn.api.validate.host}")
private String BILL_HOST;
@Value("${contract.kakao.pay.bill.dozn.api.validate.notice}")
private String BILL_NOTICE_URL;
@Value("${contract.kakao.pay.bill.dozn.api.validate.prepay}")
private String BILL_PREPAY_URL;
@Value("${contract.kakao.pay.bill.dozn.api.validate.payresult}")
private String BILL_PAYREUSLT_URL;
private final KeySequenceService keySequenceService;
private final NiceCiNewTransactionService billHistoryService;
private final INiceCiMapper niceCiMapper;
private final BillKkoPayApiSpec billKkoPayApi;
private Gson gson = new GsonBuilder().disableHtmlEscaping().create();
/**
* <pre>
* -- 1.
* SELECT *
* FROM tb_input_xit tix
* JOIN tb_input_data_xit tidx
* ON tix.lnk_input_id=tidx.lnk_input_id
* WHERE 1=1
* -- AND tix.send_type='NI'
* AND tix.prcs_cd='TGRG'
*
* -- 2. bill
* -- 3.
* -- 4. KkoPayUrlService.callApi() tb_input_data_xit pay_url URL UPDATE
* KkoPayUrlServiceTest
* -- 5. tb_input_xit prcs_cd='GRUC' / prcs_cd='TGRF'
*
* @return EnsResponseVO
* </pre>
*/
@Transactional(propagation = Propagation.REQUIRES_NEW)
public EnsResponseVO<?> accept(){
final NiceCiDTO.NiceCiParam niceCiParam = NiceCiDTO.NiceCiParam.builder()
.sendType(IupSendTypeCd.NI.getCode())
.prcsCd(IupPrcsCd.TGRG.getCode())
.reqStatusCd("ACCEPT")
.build();
final List<NiceCiDTO.InputXit> list = niceCiMapper.selectInputXits(niceCiParam);
if(list.isEmpty()){
return EnsResponseVO.errBuilder()
.errCode(EnsErrCd.ERR404)
.errMsg(EnsErrCd.ERR404.getCodeNm())
.build();
}
list.forEach(d -> {
niceCiParam.setLnkInputId(d.getLnkInputId());
d.setInputDataXits(niceCiMapper.selectInputDataXits(niceCiParam));
});
final String prefixBillUid = PostSeCd.intgrnNoti.getCode() + "-" + IdGenerator.getCurrentTimeSec();
for(NiceCiDTO.InputXit xit : list){
try {
processAccept(xit, prefixBillUid);
// FIXME: API 호출 에러
} catch (EnsException e) {
if(EnsErrCd.API_COMM_ERROR.equals(e.getErrCd())){
xit.setPrcsCd(IupPrcsCd.TGRF.getCode());
xit.setErrMsg(e.getMessage());
niceCiMapper.updatePrcsCdAndErrorOfInputXit(xit);
}
} catch (Exception e){
xit.setPrcsCd(IupPrcsCd.TGRF.getCode());
xit.setErrMsg(ObjectUtils.isNotEmpty(e.getCause())? e.getCause().getMessage() : e.getMessage());
niceCiMapper.updatePrcsCdAndErrorOfInputXit(xit);
}
}
return EnsResponseVO.okBuilder()
//.resultInfo(niceCiMapper.selectAcceptTgts(null))
.build();
}
private void processAccept(NiceCiDTO.InputXit xit, String prefixBillUid) throws Exception {
final KkoPayUrlRespData kkoPayUrlRespData = buildKkoPayUrlRespData(xit.getPayExpiresDt());
final OrgMng orgMng = niceCiMapper.selectKkoBpApiUrlFromEnsOrgMng(xit.getOrgCd())
.orElseThrow(() -> new EnsException(EnsErrCd.NO_DATA_FOUND, EnsErrCd.NO_DATA_FOUND.getCodeNm()));
//List<NiceCiDTO.InputDataXit> inputDataXits = xit.getInputDataXits();
for (NiceCiDTO.InputDataXit data : xit.getInputDataXits()) {
NiceCiDTO.BillHistDTO billHistDTO = new NiceCiDTO.BillHistDTO();
//----------------------------------------------------------
// pay Url API call & Get Result
//----------------------------------------------------------
PayApiRespDTO<Map<String, Object>> respDTO = getPayUrl(data, billHistDTO, orgMng, kkoPayUrlRespData);
//----------------------------------------------------------
// API Call 후처리 - response 반영 & 결제 이력 생성
//----------------------------------------------------------
// FIXME: API 호출 결과 SET - 연계 설정후 확인 필요
data.setPayUrl(String.valueOf(respDTO.getData()));
niceCiMapper.updatePayUrlOfDataInput(data);
final String billUid = IdGenerator.getShortUUID(prefixBillUid);
// FIXME: API 호출 결과 로그 저장
billHistDTO.setBillUid(billUid);
billHistDTO.setResponseData(String.valueOf(respDTO.getData()));
billHistoryService.updateBillHistory(billHistDTO);
// FIXME: bill_se_cd, org_cd 설정 및 확인 필요???
insertBillRecord(data, xit, billUid);
// FIXME: biller_notice_key, custom_url, expire_at 설정 및 확인 필요???
insertBillKkoRecord(data, kkoPayUrlRespData, billUid);
}
xit.setPrcsCd(IupPrcsCd.GRUC.getCode());
niceCiMapper.updatePrcsCdAndErrorOfInputXit(xit);
}
/**
* NICE CI payUrn Call
* @param dataXit NiceCiDTO.InputDataXit
* @param billHistDTO NiceCiDTO.BillHistDTO
* @param orgMng OrgMng
* @param kkoPayUrlRespData KkoPayUrlRespData
* @return KkoPayUrlRespData
*/
private PayApiRespDTO<Map<String, Object>> getPayUrl(final NiceCiDTO.InputDataXit dataXit, NiceCiDTO.BillHistDTO billHistDTO, final OrgMng orgMng, final KkoPayUrlRespData kkoPayUrlRespData){
// FIXME: 파라메터 확인 필요
Map<String, Object> requestParam = createRequestParam(dataXit, kkoPayUrlRespData);
// FIXME: API 호출 로그 저장
saveBillHistory(dataXit, billHistDTO, orgMng, requestParam);
ResponseEntity<String> resEntity = billKkoPayApi.url(orgMng.getKkoBpBillerCode(), orgMng.getKkoBpAuthorization(),
gson.toJson(requestParam));
// 마스터 상태 실패처리
String responseBody = resEntity.getBody();
if(resEntity.getStatusCode() != HttpStatus.OK){
handleApiError(billHistDTO, resEntity, responseBody);
}
return parseApiResponse(responseBody, billHistDTO);
}
private KkoPayUrlRespData buildKkoPayUrlRespData(LocalDateTime expiresDt) {
return KkoPayUrlRespData.builder()
.customUrl(CustomUrl.builder()
.noticeUrl(BILL_HOST + BILL_NOTICE_URL)
.prepayUrl(BILL_HOST + BILL_PREPAY_URL)
.payResultUrl(BILL_HOST + BILL_PAYREUSLT_URL)
.build())
.expireAt(DateUtil.getStringFromLocalDate(expiresDt, "yyyyMMddHHmmss"))
.build();
}
private void insertBillRecord(NiceCiDTO.InputDataXit data, NiceCiDTO.InputXit xit, String billUid) {
niceCiMapper.insertBill(
NiceCiDTO.BillDTO.builder()
.billId(keySequenceService.getKeySequence("Bill_id"))
.billUid(billUid)
.billerUserKey(data.getDataId())
.billSeCd(BillSeCd.privt.getCode())
.orgCd(xit.getOrgCd())
.build()
);
}
private void insertBillKkoRecord(NiceCiDTO.InputDataXit data, KkoPayUrlRespData kkoPayUrlRespData, String billUid) {
niceCiMapper.mergeBillKko(
NiceCiDTO.BillKkoDTO.builder()
.billId(keySequenceService.getKeySequence("BillKko_id"))
.billerUserKey(data.getDataId())
.billerNoticeKey(billUid)
.customUrl(gson.toJson(kkoPayUrlRespData.getCustomUrl()))
.expireAt(kkoPayUrlRespData.getExpireAt())
.billUid(billUid)
.build()
);
}
private Map<String, Object> createRequestParam(NiceCiDTO.InputDataXit dataXit, KkoPayUrlRespData kkoPayUrlRespData) {
Map<String, Object> map = new HashMap<>();
map.put("biller_user_key", dataXit.getDataId());
map.put("expire_at", kkoPayUrlRespData.getExpireAt());
map.put("custom_url", gson.toJsonTree(kkoPayUrlRespData.getCustomUrl()));
Map<String, Object> param = new HashMap<>();
param.put("data", map);
return param;
}
private void saveBillHistory(final NiceCiDTO.InputDataXit dataXit, NiceCiDTO.BillHistDTO billHistDTO, final OrgMng orgMng, Map<String, Object> requestParam) {
billHistDTO = NiceCiDTO.BillHistDTO.builder()
.linkedUuid(dataXit.getDataId())
.orgCd(orgMng.getOrgCd())
.requestData(gson.toJson(requestParam))
.build();
billHistoryService.insertBillHistory(billHistDTO);
}
private void handleApiError(NiceCiDTO.BillHistDTO billHistDTO, ResponseEntity<String> resEntity, String responseBody) {
String errorMessage = "[" + BillLogSeCd.VD + "] " + EnsErrCd.API_COMM_ERROR.getCodeNm() + " " + resEntity.getStatusCode().toString();
billHistDTO.setErrorCode(EnsErrCd.API_COMM_ERROR.getCode());
billHistDTO.setErrorMessage(errorMessage);
billHistoryService.updateBillHistory(billHistDTO);
throw new EnsException(EnsErrCd.API_COMM_ERROR, errorMessage, responseBody);
}
private PayApiRespDTO<Map<String, Object>> parseApiResponse(String responseBody, NiceCiDTO.BillHistDTO billHistDTO) {
try {
return gson.fromJson(responseBody, new TypeToken<PayApiRespDTO<Map<String, Object>>>() {}.getType());
} catch (Exception ex) {
String errorMessage = "[" + BillLogSeCd.VD + "] " + EnsErrCd.INVALID_RESPONSE.getCodeNm();
billHistDTO.setErrorCode(EnsErrCd.INVALID_RESPONSE.getCode());
billHistDTO.setErrorMessage(errorMessage);
billHistoryService.updateBillHistory(billHistDTO);
throw new EnsException(EnsErrCd.INVALID_RESPONSE, errorMessage, ex);
}
}
}

@ -0,0 +1,80 @@
package cokr.xit.ens.modules.nice.service;
import java.util.*;
import org.apache.commons.lang3.*;
import org.springframework.stereotype.*;
import cokr.xit.ens.biz.iup.code.*;
import cokr.xit.ens.core.aop.*;
import cokr.xit.ens.core.exception.code.*;
import cokr.xit.ens.modules.nice.mapper.*;
import cokr.xit.ens.modules.nice.model.*;
import lombok.*;
import lombok.extern.slf4j.*;
/**
* <pre>
* description :
* packageName : cokr.xit.ens.modules.nice.service
* fileName : NiceCiStatBulkService
* author : limju
* date : 2024 9 27
* ======================================================================
*
* ----------------------------------------------------------------------
* 2024 9 27 limju
*
* </pre>
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class NiceCiCloseService {
private final INiceCiMapper niceCiMapper;
/**
* <pre>
* -- 1.
* SELECT *
* FROM tb_input_xit tix
* WHERE tix.send_type='NI'
* AND tix.prcs_cd='IPCP';
* AND tix.expires_dt < SYSDATE - 1;
*
* -- tb_input_xit prcs_cd='CLOS' / (update error) prcs_cd='FAIL'
* @return EnsResponseVO
* </pre>
*/
public EnsResponseVO<?> close() {
final NiceCiDTO.NiceCiParam niceCiParam = NiceCiDTO.NiceCiParam.builder()
.sendType(IupSendTypeCd.NI.getCode())
.prcsCd(IupPrcsCd.IPCP.getCode())
.reqStatusCd("CLOS")
.build();
final List<NiceCiDTO.InputXit> list = niceCiMapper.selectInputXits(niceCiParam);
if(list.isEmpty()){
return EnsResponseVO.errBuilder()
.errCode(EnsErrCd.ERR404)
.errMsg(EnsErrCd.ERR404.getCodeNm())
.build();
}
for(NiceCiDTO.InputXit xit : list) {
try {
xit.setPrcsCd("CLOS");
niceCiMapper.updatePrcsCdAndErrorOfInputXit(xit);
} catch (Exception e) {
xit.setPrcsCd("FAIL");
xit.setErrMsg(ObjectUtils.isNotEmpty(e.getCause()) ? e.getCause().getMessage() : e.getMessage());
niceCiMapper.updatePrcsCdAndErrorOfInputXit(xit);
}
}
return EnsResponseVO.okBuilder()
//.resultInfo(niceCiMapper.selectAcceptTgts(null))
.build();
}
}

@ -0,0 +1,61 @@
package cokr.xit.ens.modules.nice.service;
import java.util.*;
import org.springframework.stereotype.*;
import org.springframework.transaction.annotation.*;
import cokr.xit.ens.modules.nice.mapper.*;
import cokr.xit.ens.modules.nice.model.*;
import lombok.*;
import lombok.extern.slf4j.*;
/**
* <pre>
* description : NICE CI
* packageName : cokr.xit.ens.modules.nice.service
* fileName : NiceCiNewTransactionService
* author : limju
* date : 2024 9 27
* ======================================================================
*
* ----------------------------------------------------------------------
* 2024 9 27 limju
*
* </pre>
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class NiceCiNewTransactionService {
private final INiceCiNewTransactionMapper mapper;
// accept /////////////////////////////////////////////////////
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void insertBillHistory(final NiceCiDTO.BillHistDTO histDTO){
mapper.insertBillHistory(histDTO);
}
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void updateBillHistory(final NiceCiDTO.BillHistDTO histDTO){
mapper.updateBillHistory(histDTO);
}
// accept /////////////////////////////////////////////////////
// status /////////////////////////////////////////////////////
@Transactional(readOnly = true)
public Optional<NiceCiDTO.SendResult> findDataIdFromSendResult(final NiceCiApiResult result){
return mapper.selectDataIdFromSendResult(result);
}
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void insertNiceSmsSndngInquireResponseRepeats(final List<NiceCiApiResult> resultList){
mapper.insertNiceSmsSndngInquireResponseRepeats(resultList);
}
@Transactional(propagation = Propagation.REQUIRES_NEW)
public void insertSendResults(final List<NiceCiDTO.SendResult> sendResults){
mapper.insertSendResults(sendResults);
}
// status /////////////////////////////////////////////////////
}

@ -0,0 +1,320 @@
package cokr.xit.ens.modules.nice.service;
import java.util.*;
import java.util.stream.*;
import javax.validation.*;
import org.apache.commons.lang3.*;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.*;
import com.google.gson.*;
import cokr.xit.ens.biz.iup.code.*;
import cokr.xit.ens.core.aop.*;
import cokr.xit.ens.core.exception.*;
import cokr.xit.ens.core.exception.code.*;
import cokr.xit.ens.core.utils.*;
import cokr.xit.ens.modules.nice.cmm.*;
import cokr.xit.ens.modules.nice.mapper.*;
import cokr.xit.ens.modules.nice.model.*;
import cokr.xit.ens.modules.nice.service.support.*;
import lombok.*;
import lombok.extern.slf4j.*;
/**
* <pre>
* description :
* packageName : cokr.xit.ens.modules.nice.service
* fileName : NiceCiSendBulkService
* author : limju
* date : 2024 9 27
* ======================================================================
*
* ----------------------------------------------------------------------
* 2024 9 27 limju
*
* </pre>
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class NiceCiSendBulkService {
@Value("${contract.niceCi.orgId}")
private String ORG_ID;
private final NiceCiApiService niceCiApiService;
private final INiceCiMapper niceCiMapper;
private static final Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
private Gson gson = new GsonBuilder().disableHtmlEscaping().create();
/**
* <pre>
* -- 1.
* SELECT *
* FROM tb_input_xit tix
* WHERE tix.send_type='NI'
* AND tix.prcs_cd='GRUC'
* AND tix.RUN_DT < SYSDATE;
*
* -- 2.
*
* -- 3. tb_input_xit prcs_cd='IPCP' / prcs_cd='FAIL'
* @return EnsResponseVO
* </pre>>
*/
public EnsResponseVO<?> requestSendBulk() {
final NiceCiDTO.NiceCiParam niceCiParam = NiceCiDTO.NiceCiParam.builder()
.sendType(IupSendTypeCd.NI.getCode())
.prcsCd(IupPrcsCd.GRUC.getCode())
.reqStatusCd("SEND")
.build();
final List<NiceCiDTO.InputXit> list = niceCiMapper.selectInputXits(niceCiParam);
if(list.isEmpty()){
return EnsResponseVO.errBuilder()
.errCode(EnsErrCd.ERR404)
.errMsg(EnsErrCd.ERR404.getCodeNm())
.build();
}
list.forEach(d -> {
niceCiParam.setLnkInputId(d.getLnkInputId());
d.setInputDataXits(niceCiMapper.selectInputDataXits(niceCiParam));
});
for(NiceCiDTO.InputXit xit : list) {
try {
processSendBulk(xit);
// FIXME: API 호출 에러
} catch (EnsException e) {
// FIXME : API 통신에러 인경우 skip - 재시도 되어야
handleEnsException(xit, e);
} catch (Exception e){
xit.setPrcsCd(IupPrcsCd.FAIL.getCode());
xit.setErrMsg(ObjectUtils.isNotEmpty(e.getCause())? e.getCause().getMessage() : e.getMessage());
niceCiMapper.updatePrcsCdAndErrorOfInputXit(xit);
}
}
return EnsResponseVO.okBuilder()
//.resultInfo(niceCiMapper.selectAcceptTgts(null))
.build();
}
private void processSendBulk(NiceCiDTO.InputXit xit) throws EnsException {
final NiceCiDTO.TmpltMngDTO tmpltMngDTO = niceCiMapper.selectTmpltMsg(xit.getJobCd())
.orElseThrow(() -> new EnsException(EnsErrCd.NO_DATA_FOUND, EnsErrCd.NO_DATA_FOUND.getCodeNm()));
for (NiceCiDTO.InputDataXit data : xit.getInputDataXits()) {
// 기관전문관리번호, TB_NICE_SMS_SNDNG_REQUEST - NICE_SMS_SNDNG_REQUST_ID
final String niceSmsReqId = niceCiMapper.selectNiceCiRequestId().orElseThrow(
() -> new EnsException(EnsErrCd.MAKE521, EnsErrCd.MAKE521.getCodeNm())
);
NiceCiApiSendDTO.Request ciRequest = createCiRequest(tmpltMngDTO, data, niceSmsReqId);
String ciTxt = ciRequest.ofString();
ciRequest.setTrnscId(String.valueOf(NiceCiUtils.lengthKr(ciTxt)));
validate(ciRequest);
niceCiMapper.insertNiceSmsSndngRequest(ciRequest);
//----------------------------------------------------------
// API Call 전처리 END - request 저장
//----------------------------------------------------------
//----------------------------------------------------------
// Status API call & Get Result START
//----------------------------------------------------------
// FIXME : 연계 이후 확인 필요
EnsResponseVO<?> responseVO = niceCiApiService.requestSendBulk(ciRequest.getTrnscId(), ciTxt);
if (!EnsErrCd.OK.equals(responseVO.getErrCode()))
throw new EnsException(responseVO.getErrCode(), responseVO.getErrMsg());
NiceCiApiSendDTO.Response resDTO = (NiceCiApiSendDTO.Response)responseVO.getResultInfo();
//----------------------------------------------------------
// Status API call & Get Result END
//----------------------------------------------------------
//----------------------------------------------------------
// API Call 후처리 START - response 저장
//----------------------------------------------------------
resDTO.setNiceSmsSndngRequstId(niceSmsReqId);
niceCiMapper.insertNiceSmsSndngResponse(resDTO);
//----------------------------------------------------------
// API Call 후처리 START - response 저장
//----------------------------------------------------------
log.info(responseVO.toString());
}
xit.setPrcsCd(IupPrcsCd.IPCP.getCode());
niceCiMapper.updatePrcsCdAndErrorOfInputXit(xit);
}
private NiceCiApiSendDTO.Request createCiRequest(NiceCiDTO.TmpltMngDTO tmpltMngDTO, NiceCiDTO.InputDataXit data, String niceSmsReqId) {
NiceCiApiSendDTO.Request ciRequest = new NiceCiApiSendDTO.Request();
NiceCiApiCommon nCommon = new NiceCiApiCommon();
NiceCiApiSendDTO.QueryRequest queryRequest = new NiceCiApiSendDTO.QueryRequest();
NiceCiApiSendDTO.ButtonRequest btnRequest = new NiceCiApiSendDTO.ButtonRequest();
// 공통부 set
setNiceCiApiRequestCommon(nCommon, niceSmsReqId);
// 개별부 set
setNiceCiApiPrivateReq(ciRequest, tmpltMngDTO, data);
// 조회요청반복부 set
setQueryRequest(queryRequest, data);
// 버튼요청반복부 set
setBtnRequest(btnRequest, data);
ciRequest.setNiceCommon(nCommon);
ciRequest.getQueryRequests().add(queryRequest);
ciRequest.getButtonRequests().add(btnRequest);
//----------------------------------------------------------
// API Call 전처리 START - request 저장
//----------------------------------------------------------
ciRequest.setNiceSmsSndngRequstId(niceSmsReqId);
ciRequest.setDataId(data.getDataId());
return ciRequest;
}
/**
* set
* @param nCommon NiceCiApiCommon
* @param niceSmsReqId - PK
*/
private void setNiceCiApiRequestCommon(final NiceCiApiCommon nCommon, final String niceSmsReqId) {
////////////////////////////////////////////////////////////
// 공통부 START
////////////////////////////////////////////////////////////
//---------------------------------------------------------
// 공통부 : default start
//---------------------------------------------------------
// nCommon.setSpcltyGroupcode("NICEIF "); // 전문그룹코드
// nCommon.setDelngAsortcode("0200"); // 거래종별코드
// nCommon.setDelngSecode("31896"); // 거래구분코드
// nCommon.setTrmnlSe("B"); // 송수신플래그
// nCommon.setTrmnlSe("503"); // 단말기구분
// nCommon.setRspnsCode(" "); // 응답코드
// nCommon.setNiceSpcltyManageno(""); // NICE 전문관리번호
// nCommon.setNiceSpcltyTrnsmistime(""); // NICE 전문 전송시간
// ciRequest.setInqireAgreResn("1"); // 조회동의사유
//----------------------------------------------------------
// 공통부 : default end
//----------------------------------------------------------
nCommon.setPartcptInsttId(ORG_ID); // 참가기관ID - property 에서
nCommon.setInsttSpcltyManageno(niceSmsReqId); // 기관전문관리번호 - LPAD(SEQ_NICE_SMS_SNDNG_REQUST_ID, 10, '0')
nCommon.setInsttSpcltyTrnsmistime(DateUtil.getTodayAndNowTime("yyyyMMdd")); // 기관전문전송시간
nCommon.setBlnk(StringUtils.rightPad(StringUtils.EMPTY, 16, StringUtils.SPACE)); // 공란 16자리
////////////////////////////////////////////////////////////
// 공통부 END
////////////////////////////////////////////////////////////
}
/**
* set
* @param ciRequest NiceCiApiSendDTO.Request
* @param tmpltMngDTO NiceCiDTO.TmpltMngDTO
* @param data NiceCiDTO.InputDataXit data
*/
private void setNiceCiApiPrivateReq(final NiceCiApiSendDTO.Request ciRequest, NiceCiDTO.TmpltMngDTO tmpltMngDTO, final NiceCiDTO.InputDataXit data){
////////////////////////////////////////////////////////////
// 개별요청부 START
////////////////////////////////////////////////////////////
//----------------------------------------------------------
// 개별요청부 : default start
//----------------------------------------------------------
// ciRequest.setInqireResn("17"); // 조회사유
// ciRequest.setSmsSndngRequstSe("3"); // SMS발송요청구분코드
// ciRequest.setDsptchNo("0442113377"); // 발신번호
// ciRequest.setCttpcInqireSe("3"); // 연락처 조회 구분
// ciRequest.setNtcntalkSndngRequstSe("1"); // 알림톡발송요청구분코드
// ciRequest.setBttonRequstCo(1); // 버튼요청건수
// ciRequest.setIndvdlzRequstBlnk(""); // 공란 - 880자리
//---------------------------------------------------------
// 개별요청부 : default end
//---------------------------------------------------------
ciRequest.setInqireRequstCo(1); // 조회요청건수
Map<String, String> map = gson.fromJson(data.getMsgData(), Map.class);
String sndMsg = tmpltMngDTO.getMessage();
for(Map.Entry<String, String> entry : map.entrySet()){
sndMsg = sndMsg.replace(entry.getKey(), entry.getValue());
}
sndMsg = sndMsg.replace("~~@@!!ORG_NM!!@@~~", tmpltMngDTO.getOrgNm());
sndMsg = sndMsg.replace("~~@@!!TARGET_NAME!!@@~~", data.getName());
ciRequest.setSndngMssage(sndMsg); // 발송메세지
ciRequest.setNtcntalkTmplatCode(tmpltMngDTO.getNtcntalkTmplatCode()); // 알림톡 템플릿 코드
////////////////////////////////////////////////////////////
// 개별요청부 END
////////////////////////////////////////////////////////////
}
/**
* set
* @param queryRequest NiceCiApiSendDTO.QueryRequest
* @param data NiceCiDTO.InputDataXit
*/
private void setQueryRequest(final NiceCiApiSendDTO.QueryRequest queryRequest, final NiceCiDTO.InputDataXit data) {
//---------------------------------------------------------
// 조회요청 반복부 : default START
//---------------------------------------------------------
// queryRequest.setIndvdlBsnmCprSe("1"); // 개인사업자법인구분 : "1"
// queryRequest.setInqireRequstBlnk(""); // 공란 - 36 자리
// //---------------------------------------------------------
// 조회요청 반복부 : default END
//---------------------------------------------------------
queryRequest.setIhidnum(data.getSid()); // 주민번호
}
/**
* set
* @param btnRequest NiceCiApiSendDTO.ButtonRequest
* @param data NiceCiDTO.InputDataXit
*/
private void setBtnRequest(final NiceCiApiSendDTO.ButtonRequest btnRequest, final NiceCiDTO.InputDataXit data) {
//---------------------------------------------------------
// 버튼요청 반복부 : default START
//---------------------------------------------------------
// btnRequest.setBttonTy("WL"); // 버튼타입
// btnRequest.setBttonNm("납부하기"); // 버튼이름
// btnRequest.setBttonUrlWebLink_2("");
// btnRequest.setBttonRequstBlnk(""); // 공란 : 942 자리
//---------------------------------------------------------
// 버튼요청 반복부 : default END
//---------------------------------------------------------
btnRequest.setBttonUrlWebLink_1(data.getPayUrl()); // 공란 - 36 자리
}
private void handleEnsException(NiceCiDTO.InputXit xit, EnsException e) {
if (EnsErrCd.API_COMM_ERROR.equals(e.getErrCd())) {
xit.setPrcsCd(IupPrcsCd.FAIL.getCode());
xit.setErrMsg(e.getMessage());
niceCiMapper.updatePrcsCdAndErrorOfInputXit(xit);
return;
}
xit.setErrMsg(e.getMessage());
xit.setPrcsCd(IupPrcsCd.FAIL.getCode());
niceCiMapper.updatePrcsCdAndErrorOfInputXit(xit);
}
private void validate(final NiceCiApiSendDTO.Request ciRequest) {
List<String> errors = new ArrayList<>();
final Set<ConstraintViolation<NiceCiApiSendDTO.Request>> list = validator.validate(ciRequest);
if (!list.isEmpty()) {
errors.addAll(list.stream()
.map(row -> String.format("%s=%s", row.getPropertyPath(), row.getMessageTemplate()))
.collect(Collectors.toList())
);
}
if(!errors.isEmpty()){
throw new EnsException(EnsErrCd.INVALID_DATA, errors.toString());
}
}
}

@ -0,0 +1,295 @@
package cokr.xit.ens.modules.nice.service;
import java.util.*;
import java.util.stream.*;
import javax.validation.*;
import org.apache.commons.lang3.*;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.*;
import cokr.xit.ens.biz.iup.code.*;
import cokr.xit.ens.core.aop.*;
import cokr.xit.ens.core.exception.*;
import cokr.xit.ens.core.exception.code.*;
import cokr.xit.ens.core.utils.*;
import cokr.xit.ens.modules.nice.cmm.*;
import cokr.xit.ens.modules.nice.mapper.*;
import cokr.xit.ens.modules.nice.model.*;
import cokr.xit.ens.modules.nice.service.support.*;
import lombok.*;
import lombok.extern.slf4j.*;
/**
* <pre>
* description :
* packageName : cokr.xit.ens.modules.nice.service
* fileName : NiceCiStatBulkService
* author : limju
* date : 2024 9 27
* ======================================================================
*
* ----------------------------------------------------------------------
* 2024 9 27 limju
*
* </pre>
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class NiceCiStatBulkService {
@Value("${contract.niceCi.orgId}")
private String ORG_ID;
private final NiceCiApiService niceCiApiService;
private final NiceCiNewTransactionService niceCiNewTransactionService;
private final INiceCiMapper niceCiMapper;
private static final Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
/**
* <pre>
* -- 1.
* SELECT *
* FROM tb_input_xit tix
* WHERE tix.send_type='NI'
* AND tix.prcs_cd='IPCP';
*
* -- 2. INSERT OR UPDATE tb_send_result
* SELECT * FROM tb_send_result;
* send_sttus_cd
* TALK_SEND
* SMS_SEND KT
* FAIL
* @return EnsResponseVO
* </pre>
*/
public EnsResponseVO<?> findBulkStatus() {
try {
// 기관전문관리번호, TB_NICE_SMS_SNDNG_REQUEST - NICE_SMS_SNDNG_REQUST_ID
final String niceSmsInqId = niceCiMapper.selectNiceCiInqireId().orElseThrow(
() -> new EnsException(EnsErrCd.MAKE521, EnsErrCd.MAKE521.getCodeNm())
);
// 검색기간 (from ~ to) 조회 및 SET
NiceCiApiStatusDTO.Request ciRequest = niceCiMapper.selectFromAndToOfStatusParam(
NiceCiDTO.NiceCiParam.builder()
.sendType(IupSendTypeCd.NI.getCode())
.prcsCd(IupPrcsCd.IPCP.getCode())
.reqStatusCd("STATUS")
.build()
)
.orElseThrow(() -> new EnsException(EnsErrCd.MAKE521, "검색기간 설정 조회 실패"));
NiceCiApiCommon nCommon = new NiceCiApiCommon();
// 공통부 set
setNiceCiApiRequestCommon(nCommon, niceSmsInqId);
ciRequest.setNiceCommon(nCommon);
// 개별요청부 set
setNiceCiApiPrivateReq(ciRequest);
int totCo = 0;
int repeat = 0;
do {
ciRequest.setAccmltRecptnCo(Integer.toString(repeat));
NiceCiApiStatusDTO.Response resDTO = repeatStatusBulk(
ciRequest
);
if (totCo == 0)
totCo = Integer.parseInt(resDTO.getTotCo());
repeat += 100;
} while (totCo > 100 && totCo > repeat);
} catch (EnsException e) {
// FIXME : API 통신에러 인경우 skip - 재시도 되어야
log.error("NICE CI Status 조회 ERROR::{}[{}]", e.getMessage(), e.getErrCd());
return EnsResponseVO.errBuilder()
.errCode(EnsErrCd.ERR999)
.errMsg(e.getMessage())
.build();
} catch (Exception e) {
log.error("NICE CI Status 조회 ERROR::{}", ObjectUtils.isNotEmpty(e.getCause())? e.getCause().getMessage() : e.getMessage());
return EnsResponseVO.errBuilder()
.errCode(EnsErrCd.ERR999)
.errMsg(ObjectUtils.isNotEmpty(e.getCause())? e.getCause().getMessage() : e.getMessage())
.build();
}
return EnsResponseVO.okBuilder()
//.resultInfo(niceCiMapper.selectAcceptTgts(null))
.build();
}
/**
* set
* @param nCommon NiceCiApiCommon
* @param niceSmsReqId - PK
*/
private void setNiceCiApiRequestCommon(final NiceCiApiCommon nCommon, final String niceSmsReqId) {
////////////////////////////////////////////////////////////
// 공통부 START
////////////////////////////////////////////////////////////
//---------------------------------------------------------
// 공통부 : default start
//---------------------------------------------------------
// nCommon.setGrpCode("NICEIF "); // 전문그룹코드
// nCommon.setTrType("0200"); // 거래종별코드
// nCommon.setSndAndRcvFlag("B"); // 송수신플래그
// nCommon.setDeviceClassification("503"); // 단말기구분
// nCommon.setRsltCode(" "); // 응답코드
// nCommon.setNiceMngNo(""); // NICE 전문관리번호
// nCommon.setNiceSndDt(""); // NICE 전문 전송시간
// ciRequest.setCommonEmptyField(""); // 공란 - 16자리
// ciRequest.setQueryConsentReason("1"); // 조회동의사유
//----------------------------------------------------------
// 공통부 : default end
//----------------------------------------------------------
nCommon.setDelngSecode("31893"); // 거래구분코드
nCommon.setPartcptInsttId(ORG_ID); // 참가기관ID - property 에서
nCommon.setInsttSpcltyManageno(
niceSmsReqId); // 기관전문관리번호 - LPAD(SEQ_NICE_SMS_SNDNG_REQUST_ID, 10, '0')
nCommon.setInsttSpcltyTrnsmistime(DateUtil.getTodayAndNowTime("yyyyMMddHHmmss")); // 기관전문전송시간
nCommon.setBlnk(StringUtils.rightPad(StringUtils.EMPTY, 17, StringUtils.SPACE)); // 공란 16자리
////////////////////////////////////////////////////////////
// 공통부 END
////////////////////////////////////////////////////////////
}
/**
* set
* @param ciRequest NiceCiApiDTO.Request
*/
private void setNiceCiApiPrivateReq(final NiceCiApiStatusDTO.Request ciRequest) {
////////////////////////////////////////////////////////////
// 개별요청부 START
////////////////////////////////////////////////////////////
//----------------------------------------------------------
// 개별요청부 : default start
//----------------------------------------------------------
// ciRequest.setIndvdlBsnmCprSe("1"); // 개인/사업자/법인구분
// ciRequest.setIhidnum(""); // 주민번호 : blank
// FIXME : 값 확인 필요
// 결과구분
// " "-전체, "00" - 정상((SMS미발송시 조회정상, SMS발송시 발송정상)
// 01 - 연락처조회 실패건(주민번호오류/데이터없음/기타오류 건)
// 10 - 진행중(연락처조회 정상건 중 SMS발송 이전)
// ciRequest.setResultSe(" ");
// FIXME : 값 확인 필요
// SMS발송요청구분
// 0 : 미요청,
// 1: 1순위연락처로 발송,
// 2: 1 ~ 2 순위중 최우선 순위로 1개 발송
// 3: 1 ~ 3 순위중 최우선 순위로 1개 발송
// 4: 1{1순위로 요청건} + 2{1~2순위로 요청건} + 3{1~3 순위로 요청건}
// ciRequest.setSmsSndngRequstSe("3"); // SMS발송요청구분코드
// FIXME : 값 확인 필요
// 누적수신건수 : 최초조회시 "0000000000"
// ciRequest.setAccmltRecptnCo("0000000000");
// ciRequest.setIndvdlzRequstBlnk(""); // 공란 - 23자리
//---------------------------------------------------------
// 개별요청부 : default end
//---------------------------------------------------------
// selectFromAndToOfStatusParam 에서 SET
// ciRequest.setSearchPdFrom(DateUtil.getNowTimeMicrosecond()); // 검색기간 - from
// ciRequest.setSearchPdTo(DateUtil.getNowTimeMicrosecond()); // 검색기간 - to
ciRequest.setRequstCo("100"); // 요청건수
ciRequest.setAccmltRecptnCo("0000000000"); // 누적수신건수
////////////////////////////////////////////////////////////
// 개별요청부 END
////////////////////////////////////////////////////////////
}
private NiceCiApiStatusDTO.Response repeatStatusBulk(
NiceCiApiStatusDTO.Request ciRequest) {
//NiceCiDTO.InputXit xit,
//NiceCiDTO.InputDataXit data){
// 기관전문관리번호, TB_NICE_SMS_SNDNG_REQUEST - NICE_SMS_SNDNG_REQUST_ID
final String niceSmsInqId = niceCiMapper.selectNiceCiInqireId()
.orElseThrow(() -> new EnsException(EnsErrCd.MAKE521, EnsErrCd.MAKE521.getCodeNm())
);
//----------------------------------------------------------
// API Call 전처리 START - request
//----------------------------------------------------------
ciRequest.setNiceSmsSndngInqireId(niceSmsInqId);
String ciTxt = ciRequest.ofString();
ciRequest.setTrnscId(String.valueOf(NiceCiUtils.lengthKr(ciTxt)));
validate(ciRequest);
niceCiMapper.insertNiceSmsSndngInquireRequest(ciRequest);
//----------------------------------------------------------
// API Call 전처리 END - request
//----------------------------------------------------------
//----------------------------------------------------------
// Status API call & Get Result START
//----------------------------------------------------------
EnsResponseVO<?> responseVO = niceCiApiService.findBulkStatus(ciRequest.getTrnscId(), ciTxt);
if (!EnsErrCd.OK.equals(responseVO.getErrCode()))
throw new EnsException(responseVO.getErrCode(), responseVO.getErrMsg());
NiceCiApiStatusDTO.Response resDTO = (NiceCiApiStatusDTO.Response)responseVO.getResultInfo();
//----------------------------------------------------------
// Status API call & Get Result END
//----------------------------------------------------------
//----------------------------------------------------------
// API Call 후처리 START - response & 결과테이블 저장
//----------------------------------------------------------
// API response 저장
resDTO.setNiceSmsSndngInqireId(niceSmsInqId);
niceCiMapper.insertNiceSmsSndngInquireResponse(resDTO);
// API response 반복부 저장
List<NiceCiApiResult> apiResults = resDTO.getNiceCiResults();
List<NiceCiDTO.SendResult> sendResults = new ArrayList<>();
for (NiceCiApiResult result : apiResults) {
result.setNiceSmsSndngInqireId(niceSmsInqId);
try {
NiceCiDTO.SendResult sendResult = niceCiNewTransactionService.findDataIdFromSendResult(result)
.orElseThrow(() -> new EnsException(EnsErrCd.SEND404, "상태조회 발송결과응답 데이타로 API 요청 데이타 조회 결과 데이타 미존재"));
// mssageSndngResultSe 1 -> TALK_SEND, 2 -> SMS_SEND, FAIL
sendResult.setSendSttusCd(
"1".equals(result.getMssageSndngResultSe()) ? "TALK_SEND" :
("2".equals(result.getMssageSndngResultSe()) ? "SMS_SEND"
: "FAIL"));
sendResults.add(sendResult);
// error 처리
} catch (Exception e) {
if (e instanceof EnsException) {
EnsException ens = (EnsException)e;
log.error("NICE CI Status 조회 ERROR::{}[{}]", ens.getMessage(), ens.getErrCd());
} else {
log.error("NICE CI Status 조회 ERROR::{}", ObjectUtils.isNotEmpty(e.getCause())? e.getCause().getMessage() : e.getMessage());
}
}
}
if(!apiResults.isEmpty()) niceCiNewTransactionService.insertNiceSmsSndngInquireResponseRepeats(apiResults);
if(!sendResults.isEmpty()) niceCiNewTransactionService.insertSendResults(sendResults);
//----------------------------------------------------------
// API Call 후처리 END - response & 결과테이블 저장
//----------------------------------------------------------
return resDTO;
}
private void validate(final NiceCiApiStatusDTO.Request ciRequest) {
List<String> errors = new ArrayList<>();
final Set<ConstraintViolation<NiceCiApiStatusDTO.Request>> list = validator.validate(ciRequest);
if (!list.isEmpty()) {
errors.addAll(list.stream()
.map(row -> String.format("%s=%s", row.getPropertyPath(), row.getMessageTemplate()))
.collect(Collectors.toList())
);
}
if(!errors.isEmpty()){
throw new EnsException(EnsErrCd.INVALID_DATA, errors.toString());
}
}
}

File diff suppressed because one or more lines are too long

@ -69,7 +69,8 @@ contract:
naver:
pay:
easy:
host: https://apis.naver.com #TODO 2023.03 네이버페이 검수를 위해 운영계로 설정
# //TODO 2023.03 네이버페이 검수를 위해 운영계로 설정
host: https://apis.naver.com
partner-id: np_mtbfw423545
client-id: eN8fbl2qw0tox78Z3D5C
client-secret: nvE6dSSnGf

@ -33,12 +33,12 @@ spring:
jpa:
database-platform: org.hibernate.dialect.Oracle10gDialect
# show-sql: true #하이버네이트SQL 콘솔 출력 여부
# properties:
# hibernate:
# format_sql: true
show-sql: true #하이버네이트SQL 콘솔 출력 여부
hibernate:
ddl-auto: none
properties:
hibernate:
format_sql: true
h2:
console:
@ -65,16 +65,39 @@ contract:
kakao:
talk:
host: https://test-edoc-gw.kakao.com
bulksend-batch-unit: 100
send: /v1/envelopes/{PRODUCT_CODE};POST
bulksend: /v1/bulk/envelopes/{PRODUCT_CODE};POST
validToken: /v1/envelopes/{ENVELOPE_ID}/tokens/{TOKEN}/verify;GET
modifyStatus: /v1/envelopes/{ENVELOPE_ID}/read;POST
bulkstatus: /v1/envelopes/status;POST
niceCi:
host: 127.0.0.1
port: 10001 #51253 10001
# //FIXME: NICE CI Socket 통신 timeout 시간 설정 - 단위 ms
# Nice secureconnetor system.prop의 전문호출후 대기시간 + 1초로 설정
timeout: 16000
orgId: Z755400
# //FIXME: Nice secureconnetor system.prop 에서 설정
# 개발
#clientId: 0027370001
# 운영
#clientId: 0027370002
xit:
mblpage:
payinf:
host: ${xit.app.url}${xit.app.ctx}
# // FIXME: JPA 쿼리 로그 출력 - AccessLogAspect::logJpaQuery
app:
jpa:
logging:
param: true
result: true
logging:
level:
cokr.xit.ens.biz: debug
cokr.xit.ens.modules: debug

@ -48,7 +48,7 @@ xit:
postse:
intgrn:
url: ${xit.middle.url}
# TODO feat.NaverPay - 오픈 시점에 mobile path "/intgrn/noti/page/prnt"로 변경 요함
# //TODO feat.NaverPay - 오픈 시점에 mobile path "/intgrn/noti/page/prnt"로 변경 요함
path: /intgrn/noti/page/prnt
# path: /kko/mydoc/page/prnt
@ -70,12 +70,13 @@ contract:
bulksend-batch-unit: 100
bulkstatus: /v1/documents/bulk/status
#TODO feat.ens-proxy 배포 시 아래 path 변경 할 것.
# //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
bill:
dozn:
host: ${xit.app.url}
@ -92,6 +93,16 @@ contract:
# prepay: /bill/kko/pay/able
# payresult: /bill/kko/pay/result
talk:
host: ${xit.app.url}
# host: https://edoc-gw.kakao.com
bulksend-batch-unit: 100
send: /v1/envelopes/{PRODUCT_CODE};POST
bulksend: /v1/bulk/envelopes/{PRODUCT_CODE};POST
validToken: /v1/envelopes/{ENVELOPE_ID}/tokens/{TOKEN}/verify;GET
modifyStatus: /v1/envelopes/{ENVELOPE_ID}/read;POST
bulkstatus: /v1/envelopes/status;POST
alimtalk:
biztalk:
# host: https://www.biztalk-api.com
@ -115,7 +126,7 @@ contract:
x-naver-client-secret: LvjpLruK_5
pay:
easy:
#TODO feat.NaverPay 운영전환 시 네이버 직접호출 불가할 경우 web서버 통해서 호출하도록 설정
# //TODO feat.NaverPay 운영전환 시 네이버 직접호출 불가할 경우 web서버 통해서 호출하도록 설정
# host: https://dev.apis.naver.com
host: https://apis.naver.com
# host: ${xit.app.url}
@ -137,8 +148,6 @@ contract:
host: ${xit.middle.url}
prepay: /bill/nv/ep/apply
biz:
iup:
api:
@ -166,3 +175,8 @@ decorator:
datasource:
p6spy:
enable-logging: false
logging:
level:
cokr.xit.ens.biz: info
cokr.xit.ens.modules: info

@ -1,4 +1,5 @@
server:
port: 18090
shutdown: graceful
servlet:
context-path:
@ -14,22 +15,21 @@ server:
spring:
profiles:
# active: local
active: '@spring.profiles.active@'
# include:
# prodDB
# group:
# local:
# - localDB
# prod:
# - prodDB
active: @spring.profiles.active@
config:
import: classpath:config/conf-app.yml, classpath:config/conf-contract.yml, classpath:config/conf-log.yml, classpath:config/conf-mybatis.yml, classpath:config/conf-policy.yml, classpath:config/conf-slack.yml
import:
- classpath:config/conf-app.yml
- classpath:config/conf-contract.yml
- classpath:config/conf-log.yml
- classpath:config/conf-mybatis.yml
- classpath:config/conf-policy.yml
- classpath:config/conf-slack.yml
# main:
# allow-bean-definition-overriding: true
pid:
file: mdpost.pid
file: mens-iup.pid
mvc:
view:
@ -92,29 +92,6 @@ spring:
repositories:
enabled: false
# kafka:
# producer:
# bootstrap-servers: localhost:49092
# key-serializer: org.apache.kafka.common.serialization.StringSerializer
# value-serializer: org.apache.kafka.common.serialization.StringSerializer
# consumer:
# bootstrap-servers: localhost: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
# max-poll-records: 1
xit:
app:
url: ${server.protocol:http}://${server.host:localhost}:${server.port}
@ -124,9 +101,8 @@ xit:
host: ${xit.app.url}${xit.app.ctx}
postse:
intgrn:
# url: ${xit.app.url}${xit.app.ctx}
url: https://xit.co.kr
path: /ens/kko/mydoc/noti/prnt
url: ${xit.app.url}${xit.app.ctx}
path: /intgrn/noti/page/prnt
kkomd:
url: ${xit.app.url}${xit.app.ctx}
path: /kko/mydoc/page/prnt
@ -168,12 +144,3 @@ springdoc:
display-query-params-without-oauth2: true
csrf:
enabled: false
# group-configs[0]:
# group: Examples...
# paths-to-match: /example/**, /kafka/sample/**
# group-configs[1]:
# group: 카카오페이-내문서함
# paths-to-match: /kko/mydoc/**
# group-configs[2]:
# group: 카카오페이-청구서
# paths-to-match: /kakao/**

@ -2,10 +2,16 @@ app:
access:
auth:
exclude:
uri: ${xit.app.ctx}/example/.*, ${xit.app.ctx}/kko/mydoc/.*, ${xit.app.ctx}/kko/talk/.*, ${xit.app.ctx}/kko/alimtalk/.*, ${xit.app.ctx}/nv/signtalk/.*, ${xit.app.ctx}/kt/signtalk/.*, ${xit.app.ctx}/kt/gibis/.*, ${xit.app.ctx}/api/msg/result, ${xit.app.ctx}/iup/.*, ${xit.app.ctx}/traffic/.*, ${xit.app.ctx}/sys/mng/.*, ${xit.app.ctx}/sys/util/.*, ${xit.app.ctx}/intgrn/noti/.*, ${xit.app.ctx}/cmft/.*, ${xit.app.ctx}/bill/.*
uri: ${xit.app.ctx}/example/.*, ${xit.app.ctx}/kko/mydoc/.*, ${xit.app.ctx}/kko/talk/.*, ${xit.app.ctx}/nice/talk/.*, ${xit.app.ctx}/kko/alimtalk/.*, ${xit.app.ctx}/nv/signtalk/.*, ${xit.app.ctx}/kt/signtalk/.*, ${xit.app.ctx}/kt/gibis/.*, ${xit.app.ctx}/api/msg/result, ${xit.app.ctx}/iup/.*, ${xit.app.ctx}/traffic/.*, ${xit.app.ctx}/sys/mng/.*, ${xit.app.ctx}/sys/util/.*, ${xit.app.ctx}/intgrn/noti/.*, ${xit.app.ctx}/cmft/.*, ${xit.app.ctx}/bill/.*
pallel:
thread:
basic:
cnt: 5
bill:
cnt: 2
# // FIXME: JPA 쿼리 로그 출력 - AccessLogAspect::logJpaQuery
jpa:
logging:
param: false
result: false

@ -16,7 +16,8 @@ contract:
bill:
dozn:
host: https://test-bill-pub.dozn.co.kr
# host: https://test-bill-pub.dozn.co.kr
host: https://test-apigates-pub.dozn.co.kr
biller-code: LIF378880088002
authorization: LG7upsMTsXbQiMGP4htZi/IXS7LJvEOmAx2HmY6X6Q8jh1dpv6vgNxbA4a4H2n3r
api:
@ -27,14 +28,6 @@ contract:
notice: /iup/kakao/notice
prepay: /iup/kakao/prepay
payresult: /iup/kakao/pay-result
talk:
host: https://edoc-gw.kakao.com
bulksend-batch-unit: 100
send: /v1/envelopes/{PRODUCT_CODE};POST
bulksend: /v1/bulk/envelopes/{PRODUCT_CODE};POST
validToken: /v1/envelopes/{ENVELOPE_ID}/tokens/{TOKEN}/verify;GET
modifyStatus: /v1/envelopes/{ENVELOPE_ID}/read;POST
bulkstatus: /v1/envelopes/status;POST
alimtalk:
biztalk:
@ -133,3 +126,15 @@ contract:
bulksend: /api/msg/send
bulksend-batch-unit: 100
read: /api/msg/read
niceCi:
host: 121.162.154.160
port: 10002
# //FIXME: NICE CI Socket 통신 timeout 시간 설정 - 단위 ms
# Nice secureconnetor system.prop의 전문호출후 대기시간 + 1초로 설정
timeout: 16000
orgId: Z755400
# //FIXME: Nice secureconnetor system.prop 에서 설정
#clientId: 0027370005
# 운영
#clientId: 0027370002

@ -15,10 +15,13 @@ logging:
file: utf-8
level:
root: info
cokr.xit.ens.biz: warn
cokr.xit.ens.modules: warn
# org.hibernate.SQL.logStatement 로그 제거
'[org.hibernate.SQL]': INFO
# org.hibernate.type.descriptor.sql.BasicBinder.bind 로그 제거
'[org.hibernate.type.descriptor.sql.BasicBinder]': INFO
#'[org.hibernate.type.descriptor.sql.BasicBinder]': TRACE
#'[org.hibernate.type.descriptor.sql]': off #jpa "?" 부분(binding 파라미터) 출력
# '[org.springframework.orm.jpa]': debug
# '[org.springframework.transaction]': debug

@ -2,7 +2,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cokr.xit.ens.modules.kkotalk.mapper.IKkoTalkMapper">
<!-- // FIXME: 카카오톡 신규 추가 -->
<!-- =================================================================================== -->
<!-- ================================ accept =========================================== -->
<!-- =================================================================================== -->

@ -0,0 +1,502 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cokr.xit.ens.modules.nice.mapper.INiceCiMapper">
<!-- =================================================================================== -->
<!-- ================================ 공통 =========================================== -->
<!-- =================================================================================== -->
<select id="selectInputXits" parameterType="cokr.xit.ens.modules.nice.model.NiceCiDTO$NiceCiParam" resultType="cokr.xit.ens.modules.nice.model.NiceCiDTO$InputXit">
/** iup-niceci-mapper|selectInputXits-NICE CI 대상 조회|julim */
SELECT lnk_input_id /* 연계 ID */
, '' AS err_msg /* 오류 메시지 */
, expires_dt /* 마감 일시 */
, org_cd /* 기관 코드 */
, pay_expires_dt /* 결제 만료 일시 */
, prcs_cd /* 처리 코드 */
, rcpt_dt /* 접수 일시 */
, run_dt /* 발송 일시 */
, send_type /* 발송구분 : NI-알림톡, KP:인증톡 */
, tot_cnt /* 총 개수 */
, job_cd /* 작업 코드 */
, reg_dt
, reg_id
, upd_dt
, upd_id
FROM tb_input_xit
WHERE send_type = #{sendType}
AND prcs_cd = #{prcsCd}
<if test="reqStatusCd eq 'GRUC'">
AND run_dt &lt; sysdate
</if>
<if test="reqStatusCd eq 'CLOS'">
AND expires_dt &lt; SYSDATE - 1
</if>
</select>
<select id="selectInputDataXits" parameterType="cokr.xit.ens.modules.nice.model.NiceCiDTO$NiceCiParam" resultType="cokr.xit.ens.modules.nice.model.NiceCiDTO$InputDataXit">
/** iup-niceci-mapper|selectInputDataXits-NICE CI 발송 대상 조회|julim */
SELECT lnk_input_id /* 연계 ID */
, data_id /* 데이터 ID (Primary Key) */
, birthday /* 생년월일 */
, call_center_no /* 콜 센터 번호 */
, car_no /* 차량 번호 */
, gender /* 성별 */
, linked_uuid /* 연계 UUID */
, moblphon_no /* 휴대전화 번호 */
, msg_data /* 메시지 데이터 */
, msg_dtl_data /* 메시지 상세 데이터 */
, name /* 이름 */
, pay_status_cd /* 결제 상태 코드 */
, pay_url /* 결제 URL */
, sid /* 세션 ID(주민번호|CI) */
, reg_dt
, reg_id
, upd_dt
, upd_id
FROM tb_input_data_xit
WHERE lnk_input_id = #{lnkInputId}
</select>
<update id="updatePrcsCdAndErrorOfInputXit" parameterType="cokr.xit.ens.modules.nice.model.NiceCiDTO$InputXit">
/** iup-niceci-mapper|updatePrcsCdAndErrorOfInputXit-prcsCd and errorupdate|julim */
UPDATE tb_input_xit
SET prcs_cd = #{prcsCd}
, err_msg = SUBSTR(#{errMsg}, 0, 1000)
, upd_dt = sysdate
, upd_id = 'ENS_SYS'
WHERE lnk_input_id = #{lnkInputId}
</update>
<!-- =================================================================================== -->
<!-- ================================ 공통 =========================================== -->
<!-- =================================================================================== -->
<!-- =================================================================================== -->
<!-- ================================ accept =========================================== -->
<!-- =================================================================================== -->
<insert id="insertBill" parameterType="cokr.xit.ens.modules.nice.model.NiceCiDTO$BillDTO">
/** iup-niceci-mapper|insertBill-NICE CI 청구서 생성|julim */
INSERT INTO ens_bill (
bill_id, /* 청구 ID (Primary Key) */
bill_uid, /* 청구 UID */
biller_user_key, /* 청구 사용자 키 */
bill_se_cd, /* 청구 구분 코드 */
org_cd, /* 기관 코드 */
regist_dt
) VALUES (
#{billId},
#{billUid},
#{billerUserKey},
#{billSeCd},
#{orgCd},
sysdate
)
</insert>
<update id="updateBill" parameterType="cokr.xit.ens.modules.nice.model.NiceCiDTO$BillDTO">
UPDATE ens_bill
SET doc_bill_kko = #{docBillKko}
, paid_at = #{paidAt}
, paid_cancel_dt = #{paidCancelDt}
, paid_dt = #{paidDt}
, paid_type = #{paidType}
, last_updt_dt = sysdate
WHERE bill_id = #{billId}
</update>
<insert id="mergeBillKko" parameterType="cokr.xit.ens.modules.nice.model.NiceCiDTO$BillKkoDTO">
<!-- //FIXME: NICE CI INSERT UPDATE 항목 확인 적용 필요 -->
/** iup-niceci-mapper|mergeBill-NICE CI 청구서 생성|julim */
MERGE
INTO ens_bill_kko
USING DUAL
ON (bill_id = #{billId})
WHEN MATCHED THEN
UPDATE
SET amount = #{amount}
, details = #{details}
, url = #{url}
, title = #{title}
, expire_type = #{expireType}
, pay_expire_date = #{payExpireDate}
, second_pay_expire_date = #{secondPayExpireDate}
, billed_year_month = #{billedYearMonth}
, ordinal = #{ordinal}
, parameters = #{parameters}
, bank_accounts = #{bankAccounts}
, tax_free_amount = #{taxFreeAmount}
, vat_amount = #{vatAmount}
, last_paid_at = TO_CHAR(sysdate, 'YYYYMMDDHH24MISS')
, last_pay_id = #{lastPayId}
, error_code = #{errorCode}
, error_message = #{errorMessage}
, last_updt_dt = sysdate
WHEN NOT MATCHED THEN
INSERT (
bill_id,
bill_uid,
biller_user_key,
biller_notice_key,
custom_url,
expire_at,
regist_dt
) VALUES (
#{billId}
, #{billUid}
, #{billerUserKey}
, #{billerNoticeKey}
, #{customUrl}
, #{expireAt}
, sysdate
)
</insert>
<!--
amount,
details,
url,
title,
expire_type,
pay_expire_date,
second_pay_expire_date,
billed_year_month,
ordinal,
parameters,
bank_accounts,
tax_free_amount,
vat_amount,
last_paid_at,
last_pay_id,
error_code,
error_message,
last_updt_dt
-->
<update id="updatePayUrlOfDataInput" parameterType="cokr.xit.ens.modules.nice.model.NiceCiDTO$InputDataXit">
/** iup-niceci-mapper|updatePayUrlOfDataInput-payUrl update|julim */
UPDATE tb_input_data_xit
SET pay_url = #{payUrl}
WHERE lnk_input_id = #{lnkInputId}
</update>
<select id="selectKkoBpApiUrlFromEnsOrgMng" parameterType="string" resultType="cokr.xit.ens.modules.common.ctgy.sys.mng.domain.OrgMng">
/** iup-niceci-mapper|selectKkoBpApiUrlFromEnsOrgMng-API url 조회|julim */
SELECT kko_bp_url_api AS kkoBpUrlApi
, kko_bp_biller_code AS kkoBpBillerCode
, kko_bp_authorization AS kkoBpAuthorization
FROM ens_org_mng
WHERE org_cd = #{orgCd}
</select>
<!-- =================================================================================== -->
<!-- ================================ accept =========================================== -->
<!-- =================================================================================== -->
<!-- =================================================================================== -->
<!-- ================================ send =========================================== -->
<!-- =================================================================================== -->
<select id="selectNiceCiRequestId" resultType="string">
/** iup-niceci-mapper|selectNiceCiRequestId-select nice ci request Id|julim */
SELECT LPAD(SEQ_NICE_SMS_SNDNG_REQUST_ID.nextval, 10, '0')
FROM DUAL
</select>
<select id="selectTmpltMsg" parameterType="string" resultType="cokr.xit.ens.modules.nice.model.NiceCiDTO$TmpltMngDTO">
/** iup-niceci-mapper|selectTmpltMsg-selest nice ci template message|julim */
SELECT etm.dtype
, etm.org_cd
, etm.tmplt_cd
, etm.message
, etm.title
, etm.ntcntalk_tmplat_code
, eom.org_nm
FROM ens_org_mng eom
JOIN ens_tmplt_mng etm
ON eom.org_cd = etm.org_cd
WHERE etm.tmplt_cd = #{tmpltCd}
</select>
<insert id="insertNiceSmsSndngRequest" parameterType="cokr.xit.ens.modules.nice.model.NiceCiApiSendDTO$Request">
/** iup-niceci-mapper|insertNiceSmsSndngRequest-nice ci Send request data 생성|julim */
INSERT INTO tb_nice_sms_sndng_requst (
nice_sms_sndng_requst_id, /* NICE SMS 발송 요청 ID */
data_id, /* DATA ID */
trnsc_id, /* 트랜잭션 ID - 전문 길이(한글2, 그외 1자리 계산)*/
spclty_groupcode, /* 전문 그룹 코드 */
delng_asortcode, /* 거래 종별 코드 */
delng_secode, /* 거래 구분 코드 */
trsmrcv_at, /* 송수신 플래그 */
trmnl_se, /* 단말기 구분 */
rspns_code, /* 응답코드 */
partcpt_instt_id, /* 참가기관 ID */
instt_spclty_manageno, /* 기관 전문 관리번호 */
instt_spclty_trnsmistime, /* 기관 전문 전송 시간 */
nice_spclty_manageno, /* NICE 전문 관리 번호 */
nice_spclty_trnsmistime, /* NICE 전문 전송 시간 */
blnk, /* 공란 */
inqire_agre_resn, /* 조회 동의 사유 */
inqire_resn, /* 조회 사유 */
inqire_requst_co, /* 조회 요청 건수 */
sms_sndng_requst_se, /* SMS 발송 요청 구분 */
sndng_mssage, /* 발송 메세지 */
dsptch_no, /* 발신 번호 */
cttpc_inqire_se, /* 연락처 조회 구분 */
ntcntalk_sndng_requst_se, /* 알림톡 발송 요청 구분 */
ntcntalk_tmplat_code, /* 알림톡 템플릿 코드 */
btton_requst_co, /* 버튼 요청 건수 */
indvdlz_requst_blnk, /* 개별 요청 공란 */
indvdl_bsnm_cpr_se, /* 개인 사업자 법인 구분 */
ihidnum, /* 주민 번호 */
inqire_requst_blnk, /* 조회 요청 공란 */
btton_ty, /* 버튼 타입 */
btton_nm, /* 버튼 이름 */
btton_url_web_link_1, /* 버튼 URL 웹 링크 1 */
btton_url_web_link_2, /* 버튼 URL 웹 링크 2 */
btton_requst_blnk, /* 버튼 요청 공란 */
creat_dt,
crtr
) VALUES (
#{niceSmsSndngRequstId},
#{dataId},
#{trnscId},
#{niceCommon.spcltyGroupcode},
#{niceCommon.delngAsortcode},
#{niceCommon.delngSecode},
#{niceCommon.trsmrcvAt},
#{niceCommon.trmnlSe},
#{niceCommon.rspnsCode},
#{niceCommon.partcptInsttId},
#{niceCommon.insttSpcltyManageno},
#{niceCommon.insttSpcltyTrnsmistime},
#{niceCommon.niceSpcltyManageno},
#{niceCommon.niceSpcltyTrnsmistime},
#{niceCommon.blnk},
#{niceCommon.inqireAgreResn},
#{inqireResn},
#{inqireRequstCo},
#{smsSndngRequstSe},
#{sndngMssage},
#{dsptchNo},
#{cttpcInqireSe},
#{ntcntalkSndngRequstSe},
#{ntcntalkTmplatCode},
#{bttonRequstCo},
#{indvdlzRequstBlnk},
<foreach collection="queryRequests" item="queryRequest" separator=",">
#{queryRequest.indvdlBsnmCprSe},
#{queryRequest.ihidnum},
#{queryRequest.inqireRequstBlnk},
</foreach>
<foreach collection="buttonRequests" item="buttonRequest" separator=",">
#{buttonRequest.bttonTy},
#{buttonRequest.bttonNm},
#{buttonRequest.bttonUrlWebLink_1},
#{buttonRequest.bttonUrlWebLink_2},
#{buttonRequest.bttonRequstBlnk},
</foreach>
sysdate,
'ENS_SYS'
)
</insert>
<insert id="insertNiceSmsSndngResponse" parameterType="cokr.xit.ens.modules.nice.model.NiceCiApiSendDTO$Response">
/** iup-niceci-mapper|insertNiceSmsSndngResponse-nice ci Send response 생성|julim */
INSERT INTO tb_nice_sms_sndng_rspns (
nice_sms_sndng_requst_id, /* NICE SMS 발송 요청 ID */
trnsc_id, /* 트랜잭션 ID - 전문 길이(한글2, 그외 1자리 계산)*/
spclty_groupcode, /* 전문 그룹 코드 */
delng_asortcode, /* 거래 종별 코드 */
delng_secode, /* 거래 구분 코드 */
trsmrcv_at, /* 송수신 플래그 */
trmnl_se, /* 단말기 구분 */
rspns_code, /* 응답코드 */
partcpt_instt_id, /* 참가기관 ID */
instt_spclty_manageno, /* 기관 전문 관리번호 */
instt_spclty_trnsmistime, /* 기관 전문 전송 시간 */
nice_spclty_manageno, /* NICE 전문 관리 번호 */
nice_spclty_trnsmistime, /* NICE 전문 전송 시간 */
blnk, /* 공란 */
rspns_co, /* 응답 건수 */
sms_sndng_requst_se, /* SMS 발송 요청 구분 */
sndng_mssage, /* 발송 메세지 */
dsptch_no, /* 발신 번호 */
cttpc_inqire_se, /* 연락처 조회 구분 */
indvdlz_rspns_blnk, /* 개별 응답 공란 */
indvdl_bsnm_cpr_se, /* 개인 사업자 법인 구분 */
ihidnum, /* 주민번호 */
nm, /* 성명 */
rank_cttpc_1, /* 1순위 연락처 */
rank_cttpc_2, /* 2순위 연락처 */
rank_cttpc_3, /* 3순위 연락처 */
result_se, /* 결과 구분 */
sms_sndng_cttpc_rank, /* SMS 발송 연락처 순위 */
sms_sndng_cttpc_no, /* SMS 반송 연락처 번호 */
sms_sndng_dt, /* SMS 발송 일시 */
rspns_reptit_blnk, /* 응답 반복 공란 */
creat_dt,
crtr
) VALUES (
#{niceSmsSndngRequstId},
#{trnscId},
#{niceCommon.spcltyGroupcode},
#{niceCommon.delngAsortcode},
#{niceCommon.delngSecode},
#{niceCommon.trsmrcvAt},
#{niceCommon.trmnlSe},
#{niceCommon.rspnsCode},
#{niceCommon.partcptInsttId},
#{niceCommon.insttSpcltyManageno},
#{niceCommon.insttSpcltyTrnsmistime},
#{niceCommon.niceSpcltyManageno},
#{niceCommon.niceSpcltyTrnsmistime},
#{niceCommon.blnk},
#{rspnsCo},
#{smsSndngRequstSe},
#{sndngMssage},
#{dsptchNo},
#{cttpcInqireSe},
#{indvdlzRspnsBlnk},
<foreach collection="niceCiResults" item="niceCiResult" separator=",">
#{niceCiResult.indvdlBsnmCprSe},
#{niceCiResult.ihidnum},
#{niceCiResult.nm},
#{niceCiResult.rankCttpc_1},
#{niceCiResult.rankCttpc_2},
#{niceCiResult.rankCttpc_3},
#{niceCiResult.resultSe},
#{niceCiResult.smsSndngCttpcRank},
#{niceCiResult.smsSndngCttpcNo},
#{niceCiResult.smsSndngDt},
#{niceCiResult.rspnsReptitBlnk},
</foreach>
sysdate,
'ENS_SYS'
)
</insert>
<!-- =================================================================================== -->
<!-- ================================ send =========================================== -->
<!-- =================================================================================== -->
<!-- =================================================================================== -->
<!-- ================================ status =========================================== -->
<!-- =================================================================================== -->
<select id="selectFromAndToOfStatusParam" parameterType="cokr.xit.ens.modules.nice.model.NiceCiDTO$NiceCiParam" resultType="cokr.xit.ens.modules.nice.model.NiceCiApiStatusDTO$Request">
/** iup-niceci-mapper|selectFromAndToOfStatusParam-상태조회 조회시작일과 종료일 조회|julim */
SELECT TO_CHAR(MIN(run_dt), 'YYYYMMDD')||'000000000000' AS searchPdFrom
, TO_CHAR(MAX(run_dt+1), 'YYYYMMDD')||'000000000000' AS searchPdTo
FROM tb_input_xit
WHERE send_type = #{sendType}
AND prcs_cd = #{prcsCd}
</select>
<select id="selectNiceCiInqireId" resultType="string">
/** iup-niceci-mapper|selectNiceCiInqireId-select nice ci Inquire Id|julim */
SELECT LPAD(SEQ_NICE_SMS_SNDNG_INQIRE_ID.nextval, 10, '0')
FROM DUAL
</select>
<insert id="insertNiceSmsSndngInquireRequest" parameterType="cokr.xit.ens.modules.nice.model.NiceCiApiStatusDTO$Request">
/** iup-niceci-mapper|insertNiceSmsSndngInquireRequest-nice ci Status request data 생성|julim */
INSERT INTO tb_nice_sms_sndng_inqire_requs (
nice_sms_sndng_inqire_id, /* NICE SMS 발송 조회 ID */
trnsc_id, /* 트랜잭션 ID - 전문 길이(한글2, 그외 1자리 계산)*/
spclty_groupcode, /* 전문 그룹 코드 */
delng_asortcode, /* 거래 종별 코드 */
delng_secode, /* 거래 구분 코드 */
trsmrcv_at, /* 송수신 플래그 */
trmnl_se, /* 단말기 구분 */
rspns_code, /* 응답코드 */
partcpt_instt_id, /* 참가기관 ID */
instt_spclty_manageno, /* 기관 전문 관리번호 */
instt_spclty_trnsmistime, /* 기관 전문 전송 시간 */
nice_spclty_manageno, /* NICE 전문 관리 번호 */
nice_spclty_trnsmistime, /* NICE 전문 전송 시간 */
blnk, /* 공란 */
search_pd_from, /* 검색기간 from */
search_pd_to, /* 검색기간 to */
indvdl_bsnm_cpr_se, /* 개인 사업자 법인 구분 */
ihidnum, /* 주민번호 */
result_se, /* 결과구분 */
sms_sndng_requst_se, /* SMS 발송 요청 구분 */
requst_co, /* 요청 건수 */
accmlt_recptn_co, /* 누적 수신 건수 */
indvdlz_requst_blnk, /* 개별 요청 공란 */
creat_dt,
crtr
) VALUES (
#{niceSmsSndngInqireId},
#{trnscId},
#{niceCommon.spcltyGroupcode},
#{niceCommon.delngAsortcode},
#{niceCommon.delngSecode},
#{niceCommon.trsmrcvAt},
#{niceCommon.trmnlSe},
#{niceCommon.rspnsCode},
#{niceCommon.partcptInsttId},
#{niceCommon.insttSpcltyManageno},
#{niceCommon.insttSpcltyTrnsmistime},
#{niceCommon.niceSpcltyManageno},
#{niceCommon.niceSpcltyTrnsmistime},
#{niceCommon.blnk},
#{searchPdFrom},
#{searchPdTo},
#{indvdlBsnmCprSe},
#{ihidnum},
#{resultSe},
#{smsSndngRequstSe},
#{requstCo},
#{accmltRecptnCo},
#{indvdlzRequstBlnk},
sysdate,
'ENS_SYS'
)
</insert>
<insert id="insertNiceSmsSndngInquireResponse" parameterType="cokr.xit.ens.modules.nice.model.NiceCiApiStatusDTO$Response">
/** iup-niceci-mapper|insertNiceSmsSndngInquireResponse-nice ci Send response 생성|julim */
INSERT INTO tb_nice_sms_sndng_inqire_rspns (
nice_sms_sndng_inqire_id, /* NICE SMS 발송 조회 ID */
trnsc_id, /* 트랜잭션 ID - 전문 길이(한글2, 그외 1자리 계산)*/
spclty_groupcode, /* 전문 그룹 코드 */
delng_asortcode, /* 거래 종별 코드 */
delng_secode, /* 거래 구분 코드 */
trsmrcv_at, /* 송수신 플래그 */
trmnl_se, /* 단말기 구분 */
rspns_code, /* 응답코드 */
partcpt_instt_id, /* 참가기관 ID */
instt_spclty_manageno, /* 기관 전문 관리번호 */
instt_spclty_trnsmistime, /* 기관 전문 전송 시간 */
nice_spclty_manageno, /* NICE 전문 관리 번호 */
nice_spclty_trnsmistime, /* NICE 전문 전송 시간 */
blnk, /* 공란 */
tot_co, /* 총 건수 */
accmlt_co, /* 누적 건수 */
rspns_co, /* 응답 건수 */
creat_dt,
crtr
) VALUES (
#{niceSmsSndngInqireId},
#{trnscId},
#{niceCommon.spcltyGroupcode},
#{niceCommon.delngAsortcode},
#{niceCommon.delngSecode},
#{niceCommon.trsmrcvAt},
#{niceCommon.trmnlSe},
#{niceCommon.rspnsCode},
#{niceCommon.partcptInsttId},
#{niceCommon.insttSpcltyManageno},
#{niceCommon.insttSpcltyTrnsmistime},
#{niceCommon.niceSpcltyManageno},
#{niceCommon.niceSpcltyTrnsmistime},
#{niceCommon.blnk},
#{totCo},
#{accmltCo},
#{rspnsCo},
sysdate,
'ENS_SYS'
)
</insert>
<!-- =================================================================================== -->
<!-- ================================ status =========================================== -->
<!-- =================================================================================== -->
</mapper>

@ -0,0 +1,155 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cokr.xit.ens.modules.nice.mapper.INiceCiNewTransactionMapper">
<!-- =================================================================================== -->
<!-- ================================ accept =========================================== -->
<!-- =================================================================================== -->
<insert id="insertBillHistory" parameterType="cokr.xit.ens.modules.nice.model.NiceCiDTO$BillHistDTO">
/** iup-niceci-new-transaction-mapper|insertBillHistory-Bill API(NICE CI) call history save|julim */
<selectKey keyProperty="id" resultType="long" order="BEFORE">
SELECT NVL(MAX(id), 0) + 1
FROM ens_bill_his
</selectKey>
INSERT INTO ens_bill_his (
id, /* Primary Key */
linked_uuid, /* 연계 UUID */
org_cd, /* 기관 코드 */
req_se, /* 요청 구분 */
bill_se, /* 청구 구분 */
request_data, /* 요청 데이터 */
regist_dt /* 등록 일시 */
) VALUES (
#{id},
#{linkedUuid},
#{orgCd},
#{reqSe},
#{billSe},
#{requestData},
sysdate
)
</insert>
<update id="updateBillHistory" parameterType="cokr.xit.ens.modules.nice.model.NiceCiDTO$BillHistDTO">
/** iup-niceci-new-transaction-mapper|updateBillHistory-Bill API(NICE CI) call history save|julim */
UPDATE ens_bill_his
SET bill_uid = #{billUid}
, response_data = #{responseData}
, error_code = #{errorCode}
, error_message = #{errorMessage}
, last_updt_dt = sysdate
WHERE id = #{id}
</update>
<!-- =================================================================================== -->
<!-- ================================ accept =========================================== -->
<!-- =================================================================================== -->
<!-- =================================================================================== -->
<!-- ================================ status =========================================== -->
<!-- =================================================================================== -->
<insert id="insertNiceSmsSndngInquireResponseRepeats" parameterType="list">
/** iup-new-transaction-mapper|insertNiceSmsSndngInquireResponseRepeats-nice ci Send response 반복부 생성|julim */
<!-- //FIXME: oracle인 경우 Insert ALL SELECT ... DUAL 사용해야 함 -->
<foreach collection="list" item="item" index="index" open="INSERT ALL" close="SELECT 1 FROM DUAL">
INTO tb_nice_sms_sndng_inqire_repti (
nice_sms_sndng_inqire_id, /* NICE SMS 발송 조회 ID */
sn, /* 순번 */
inqire_dt, /* 조회 일시 */
indvdl_bsnm_cpr_se, /* 개인 사업자 법인 구분 */
ihidnum, /* 주민 번호 */
nm, /* 성명 */
rank_cttpc_1, /* 1순위 연락처 */
rank_cttpc_2, /* 2순위 연락처 */
rank_cttpc_3, /* 3순위 연락처 */
result_se, /* 결과 구분 */
sms_sndng_requst_se, /* SMS 발송요청 구분*/
sndng_mssage, /* 전송 메세지 */
dsptch_no, /* 발송 번호 */
sms_sndng_cttpc_rank, /* SMS 발송 연락처 순위 */
sms_sndng_cttpc_no, /* SMS 발송 연락처 번호 */
sms_sndng_dt, /* SMS 발송 일시 */
opetr_id, /* 처리자 ID */
cttpc_inqire_se, /* 연락처 조회 구분 */
mssage_sndng_result_se, /* 메세지 발송 결과 구분 */
rspns_reptit_blnk, /* 응답 반복 공란 */
creat_dt,
crtr
) VALUES (
#{item.niceSmsSndngInqireId},
(#{index} + 1),
#{item.inqireDt},
#{item.indvdlBsnmCprSe},
#{item.ihidnum},
#{item.nm},
#{item.rankCttpc_1},
#{item.rankCttpc_2},
#{item.rankCttpc_3},
#{item.resultSe},
#{item.smsSndngRequstSe},
#{item.sndngMssage},
#{item.dsptchNo},
#{item.smsSndngCttpcRank},
#{item.smsSndngCttpcNo},
#{item.smsSndngDt},
#{item.opetrId},
#{item.cttpcInqireSe},
#{item.mssageSndngResultSe},
#{item.rspnsReptitBlnk},
sysdate,
'ENS_SYS'
)
</foreach>
</insert>
<select id="selectDataIdFromSendResult" parameterType="cokr.xit.ens.modules.nice.model.NiceCiApiResult" resultType="cokr.xit.ens.modules.nice.model.NiceCiDTO$SendResult">
/** iup-new-transaction-mapper|selectDataIdFromSendResult-상태조회 발송결과응답 데이타로 API 요청 데이타 조회|julim */
SELECT tix.lnk_input_id
, tidx.data_id
, tix.send_type
, tix.run_dt
, tix.expires_dt
, 'N' AS prcsYn
, tnssr.ihidnum
FROM tb_nice_sms_sndng_requst tnssr
JOIN tb_input_data_xit tidx
ON tnssr.data_id = tidx.data_id
JOIN tb_input_xit tix
ON tidx.lnk_input_id = tix.lnk_input_id
WHERE tnssr.ihidnum = #{ihidnum} -- 응답받은 주민번호
AND REGEXP_REPLACE(tnssr.sndng_mssage, '[[:space:]]+', '') = REGEXP_REPLACE(#{sndngMssage}, '[[:space:]]+', '') -- 응답받은 발송메시지
</select>
<insert id="insertSendResults" parameterType="list">
/** iup-new-transaction-mapper|insertSendResults-nice ci 전송 상태 조회 결과 생성|julim */
<!-- //FIXME: oracle인 경우 Insert ALL SELECT ... DUAL 사용해야 함 -->
<foreach collection="list" item="item" index="index" open="INSERT ALL" close="SELECT 1 FROM DUAL">
INTO tb_send_result (
lnk_input_id, /* 연계 ID */
data_id, /* data id */
run_dt, /* 발송일시 */
send_type, /* 발송구분 : NI-알림톡, KP:인증톡 */
expires_dt, /* 마감일시 */
biz_err_msg, /* 사업자 오류 내용 */
prcs_yn, /* 처리여부 */
reg_dt,
reg_id
) VALUES (
#{lnkInputId}
, #{dataId}
, #{runDt}
, #{sendType}
, #{expiresDt}
, #{bizErrMsg}
, #{prcsYn}
, sysdate
, 'ENS_SYS'
)
</foreach>
</insert>
<!-- =================================================================================== -->
<!-- ================================ status =========================================== -->
<!-- =================================================================================== -->
</mapper>

@ -46,11 +46,4 @@
<setting name="aggressiveLazyLoading" value="true" />
</settings>
<!-- Type Aliases 설정-->
<!-- <typeAliases>-->
<!-- <typeAlias alias="egovMap" type="org.egovframe.rte.psl.dataaccess.util.EgovMap" />-->
<!-- <typeAlias alias="ComDefaultCodeVO" type="egovframework.com.cmm.model.ComDefaultCodeVO" />-->
<!-- <typeAlias alias="comDefaultVO" type="egovframework.com.cmm.model.ComDefaultVO" />-->
<!-- </typeAliases>-->
</configuration>

Loading…
Cancel
Save