feat: NICE CI 인증톡 진행

send, status 반영
dev
Jonguk. Lim 1 month ago
parent b30edafbfa
commit acf7794a75

@ -201,7 +201,7 @@ ALTER TABLE TB_NICE_SMS_SNDNG_INQIRE_REPTI
CREATE TABLE TB_NICE_SMS_SNDNG_INQIRE_REQUS CREATE TABLE TB_NICE_SMS_SNDNG_INQIRE_REQUS
( (
NICE_SMS_SNDNG_INQIRE_ID CHAR(10) NOT NULL , NICE_SMS_SNDNG_INQIRE_ID CHAR(10) NOT NULL ,
TRNSC_ID VARCHAR2(9) NULL , TRNSC_ID VARCHAR2(10) NULL ,
SPCLTY_GROUPCODE VARCHAR2(9) NULL , SPCLTY_GROUPCODE VARCHAR2(9) NULL ,
DELNG_ASORTCODE NUMBER(4) NULL , DELNG_ASORTCODE NUMBER(4) NULL ,
DELNG_SECODE NUMBER(5) NULL , DELNG_SECODE NUMBER(5) NULL ,
@ -236,7 +236,7 @@ ALTER TABLE TB_NICE_SMS_SNDNG_INQIRE_REQUS
CREATE TABLE TB_NICE_SMS_SNDNG_INQIRE_RSPNS CREATE TABLE TB_NICE_SMS_SNDNG_INQIRE_RSPNS
( (
NICE_SMS_SNDNG_INQIRE_ID CHAR(10) NOT NULL , NICE_SMS_SNDNG_INQIRE_ID CHAR(10) NOT NULL ,
TRNSC_ID VARCHAR2(9) NULL , TRNSC_ID VARCHAR2(10) NULL ,
SPCLTY_GROUPCODE VARCHAR2(9) NULL , SPCLTY_GROUPCODE VARCHAR2(9) NULL ,
DELNG_ASORTCODE NUMBER(4) NULL , DELNG_ASORTCODE NUMBER(4) NULL ,
DELNG_SECODE NUMBER(5) NULL , DELNG_SECODE NUMBER(5) NULL ,
@ -266,7 +266,7 @@ CREATE TABLE TB_NICE_SMS_SNDNG_REQUST
( (
NICE_SMS_SNDNG_REQUST_ID CHAR(10) NOT NULL , NICE_SMS_SNDNG_REQUST_ID CHAR(10) NOT NULL ,
DATA_ID VARCHAR2(30) NULL , DATA_ID VARCHAR2(30) NULL ,
TRNSC_ID VARCHAR2(9) NULL , TRNSC_ID VARCHAR2(10) NULL ,
SPCLTY_GROUPCODE VARCHAR2(9) NULL , SPCLTY_GROUPCODE VARCHAR2(9) NULL ,
DELNG_ASORTCODE NUMBER(4) NULL , DELNG_ASORTCODE NUMBER(4) NULL ,
DELNG_SECODE NUMBER(5) NULL , DELNG_SECODE NUMBER(5) NULL ,
@ -311,7 +311,7 @@ ALTER TABLE TB_NICE_SMS_SNDNG_REQUST
CREATE TABLE TB_NICE_SMS_SNDNG_RSPNS CREATE TABLE TB_NICE_SMS_SNDNG_RSPNS
( (
NICE_SMS_SNDNG_REQUST_ID CHAR(10) NOT NULL , NICE_SMS_SNDNG_REQUST_ID CHAR(10) NOT NULL ,
TRNSC_ID VARCHAR2(9) NULL , TRNSC_ID VARCHAR2(10) NULL ,
SPCLTY_GROUPCODE VARCHAR2(9) NULL , SPCLTY_GROUPCODE VARCHAR2(9) NULL ,
DELNG_ASORTCODE NUMBER(4) NULL , DELNG_ASORTCODE NUMBER(4) NULL ,
DELNG_SECODE NUMBER(5) NULL , DELNG_SECODE NUMBER(5) NULL ,

@ -241,18 +241,6 @@ WHERE tix.send_type='NI'
-- 2. tb_input_xit 테이블 prcs_cd='CLOS' / 실패 시 prcs_cd='FAIL' -- 2. tb_input_xit 테이블 prcs_cd='CLOS' / 실패 시 prcs_cd='FAIL'
INSERT
INTO
ens_bill
( bill_id, bill_uid, biller_user_key, BILL_SE_CD, org_cd, regist_dt )
VALUES
( 7, 'billUid', 'billerUserKey', 'kkk', '0002', sysdate );
commit;
-- 요청 전문 : {"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"}}} -- 요청 전문 : {"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"}} -- 응답 전문 : {"res_code":"OK","message":"정상응답","data":{"url":"https://billgates-web.kakao.com/r/platform/pages/paynow/search/1832/11/0b7bc3fa-4845-40eb-9b23-62b0eb806655"}}
@ -288,8 +276,10 @@ where id = 99999999999999999999;;
-- eom.org_nm, etm.message, etm.ntcntalk_tmplat_code -- eom.org_nm, etm.message, etm.ntcntalk_tmplat_code
SELECT * SELECT etm.*
FROM ens_org_mng eom FROM ens_org_mng eom
JOIN ens_tmplt_mng etm JOIN ens_tmplt_mng etm
ON eom.ORG_CD = etm.ORG_CD ON eom.ORG_CD = etm.ORG_CD
WHERE etm.tmplt_cd='A0001'; WHERE etm.tmplt_cd='A0001';

@ -530,7 +530,7 @@ public class DateUtil {
public static String getNowTimeMicrosecond() { public static String getNowTimeMicrosecond() {
ZonedDateTime now = ZonedDateTime.now(ZoneId.of("Asia/Seoul")); ZonedDateTime now = ZonedDateTime.now(ZoneId.of("Asia/Seoul"));
// 6자리 나노초까지 포함된 포맷 지정 // 6자리 나노초까지 포함된 포맷 지정
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSSSSSS"); DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmssSSSSSS");
return now.format(formatter); return now.format(formatter);
} }

@ -31,12 +31,18 @@ public interface INiceCiMapper {
//int saveBill(final NiceCiDTO.BillDTO billDTO); //int saveBill(final NiceCiDTO.BillDTO billDTO);
int saveBillKko(final NiceCiDTO.BillKkoDTO billKkoDTO); int saveBillKko(final NiceCiDTO.BillKkoDTO billKkoDTO);
int updatePayUrlOfDataInput(final NiceCiDTO.InputDataXit inputDataXit); int updatePayUrlOfDataInput(final NiceCiDTO.InputDataXit inputDataXit);
int updatePrcsCdOfInputXit(final NiceCiDTO.InputXit inputXit); int updatePrcsCdAndErrorOfInputXit(final NiceCiDTO.InputXit inputXit);
Optional<OrgMng> selectKkoBpApiUrlFromEnsOrgMng(final String orgCd); Optional<OrgMng> selectKkoBpApiUrlFromEnsOrgMng(final String orgCd);
Optional<String> selectNiceCiRequestId(); Optional<String> selectNiceCiRequestId();
Optional<NiceCiDTO.TmpltMngDTO> selectTmpltMsg(final String tmpltId); Optional<NiceCiDTO.TmpltMngDTO> selectTmpltMsg(final String tmpltId);
int insertNiceSmsSndngRequest(final NiceCiApiDTO.Request requestDTO); int insertNiceSmsSndngRequest(final NiceCiApiSendDTO.Request requestDTO);
int insertNiceSmsSndngResponse(final NiceCiApiDTO.Response responseDTO); int insertNiceSmsSndngResponse(final NiceCiApiSendDTO.Response responseDTO);
Optional<String> selectNiceCiInqireId();
int insertNiceSmsSndngInquireRequest(final NiceCiApiStatusDTO.Request requestDTO);
int insertNiceSmsSndngInquireResponse(final NiceCiApiStatusDTO.Response responseDTO);
int insertNiceSmsSndngInquireResponseRepeat(final List<NiceCiApiResult> resultList);
} }

@ -199,7 +199,7 @@ public class NiceCiApiCommon {
@Size(min = 1, max = 1, message = "조회동의사유는 1자리 입니다") @Size(min = 1, max = 1, message = "조회동의사유는 1자리 입니다")
private String inqireAgreResn = "4"; private String inqireAgreResn = "4";
public String ofString() { public String ofString(boolean isSend) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(spcltyGroupcode); sb.append(spcltyGroupcode);
sb.append(delngAsortcode); sb.append(delngAsortcode);
@ -213,7 +213,7 @@ public class NiceCiApiCommon {
sb.append(niceSpcltyManageno); sb.append(niceSpcltyManageno);
sb.append(niceSpcltyTrnsmistime); sb.append(niceSpcltyTrnsmistime);
sb.append(blnk); sb.append(blnk);
sb.append(inqireAgreResn); if(isSend) sb.append(inqireAgreResn);
return sb.toString(); return sb.toString();
} }

@ -10,7 +10,7 @@ import lombok.*;
* <pre> * <pre>
* description : * description :
* packageName : cokr.xit.ens.modules.nice.model * packageName : cokr.xit.ens.modules.nice.model
* fileName : NiceCiResult * fileName : NiceCiApiResult
* author : limju * author : limju
* date : 2024 9 25 * date : 2024 9 25
* ====================================================================== * ======================================================================
@ -29,15 +29,20 @@ public class NiceCiApiResult {
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
// 연락처 이력 조회시만 // 연락처 이력 조회시만
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
/**
* nice sms ID - PK
*/
private String niceSmsSndngInqireId;
/** /**
* <pre> * <pre>
* - - 20 * - - 20
* YYYYMMDDHHMMSS(14)+microSecond(6) * YYYYMMDDHHMMSS(14)+microSecond(6)
* </pre> * </pre>
*/ */
private String queryDt; private String inqireDt;
public void setQueryDt(String queryDt) { public void setInqireDt(String inqireDt) {
this.queryDt = StringUtils.trim(queryDt); this.inqireDt = StringUtils.trim(inqireDt);
} }
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
// 연락처 이력 조회시만 // 연락처 이력 조회시만
@ -49,7 +54,7 @@ public class NiceCiApiResult {
* 1() * 1()
* </pre> * </pre>
*/ */
private String indvdlBsnmCprSe = "1"; private String indvdlBsnmCprSe;
/** /**
* <pre> * <pre>
@ -128,9 +133,9 @@ public class NiceCiApiResult {
* 4: (31894) * 4: (31894)
* </pre> * </pre>
*/ */
private String smsSndReqCode; private String smsSndngRequstSe;
public void setSmsSndReq(String smsSndReqCode) { public void setSmsSndReq(String smsSndReqCode) {
this.smsSndReqCode = StringUtils.trim(smsSndReqCode); this.smsSndngRequstSe = StringUtils.trim(smsSndReqCode);
} }
/** /**
@ -140,9 +145,9 @@ public class NiceCiApiResult {
* NiceCiUtils.leftKr, substringKr * NiceCiUtils.leftKr, substringKr
* </pre> * </pre>
*/ */
private String sndMessage; private String sndngMssage;
public void setSndMessage(String sndMessage) { public void setSndngMssage(String sndngMssage) {
this.sndMessage = StringUtils.trim(sndMessage); this.sndngMssage = StringUtils.trim(sndngMssage);
} }
/** /**
@ -151,9 +156,9 @@ public class NiceCiApiResult {
* (smsSndReqCode) 1, 2, 3 * (smsSndReqCode) 1, 2, 3
* </pre> * </pre>
*/ */
private String sndPhoneNo; private String dsptchNo;
public void setSndPhoneNo(String sndPhoneNo) { public void setDsptchNo(String dsptchNo) {
this.sndPhoneNo = StringUtils.trim(sndPhoneNo); this.dsptchNo = StringUtils.trim(dsptchNo);
} }
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
// 연락처 이력 조회시만 // 연락처 이력 조회시만
@ -168,7 +173,7 @@ public class NiceCiApiResult {
* 3: 3 * 3: 3
* </pre> * </pre>
*/ */
private String smsSndngCttpcRank = "1"; private String smsSndngCttpcRank;
/** /**
* <pre> * <pre>
@ -198,9 +203,9 @@ public class NiceCiApiResult {
* - ID : 9 * - ID : 9
* </pre> * </pre>
*/ */
private String procId; private String opetrId;
public void setProcId(String procId) { public void setOpetrId(String opetrId) {
this.procId = StringUtils.trim(procId); this.opetrId = StringUtils.trim(opetrId);
} }
/** /**
@ -212,7 +217,7 @@ public class NiceCiApiResult {
* 3: 3 * 3: 3
* </pre> * </pre>
*/ */
private String contactSearchCode = "3"; private String cttpcInqireSe;
/** /**
* <pre> * <pre>
@ -221,7 +226,7 @@ public class NiceCiApiResult {
* , 0 * , 0
* </pre> * </pre>
*/ */
private String msgSndRsltDivCode; private String mssageSndngResultSe;
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
// 연락처 이력 조회시만 // 연락처 이력 조회시만
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
@ -292,7 +297,7 @@ public class NiceCiApiResult {
return null; return null;
} }
public static NiceCiApiResult parseHistory(String tgtString) { public static NiceCiApiResult parseStatus(String tgtString) {
// 1150 // 1150
final int[] parseLength = { final int[] parseLength = {
20, // 조회일시 - 이력조회시만 사용 20, // 조회일시 - 이력조회시만 사용
@ -320,7 +325,7 @@ public class NiceCiApiResult {
int idx = 0; int idx = 0;
// 이력조회시만 사용 //////////////////////////////////////////////////////// // 이력조회시만 사용 ////////////////////////////////////////////////////////
result.setQueryDt(StringUtils.left(tgtString, parseLength[idx])); result.setInqireDt(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]); tgtString = tgtString.substring(parseLength[idx++]);
// 이력조회시만 사용 //////////////////////////////////////////////////////// // 이력조회시만 사용 ////////////////////////////////////////////////////////
@ -346,9 +351,9 @@ public class NiceCiApiResult {
tgtString = tgtString.substring(parseLength[idx++]); tgtString = tgtString.substring(parseLength[idx++]);
// 이력조회시만 사용 //////////////////////////////////////////////////////// // 이력조회시만 사용 ////////////////////////////////////////////////////////
result.setSmsSndReqCode(StringUtils.left(tgtString, parseLength[idx])); result.setSmsSndngRequstSe(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]); tgtString = tgtString.substring(parseLength[idx++]);
result.setSndMessage(NiceCiUtils.leftKr(tgtString, parseLength[idx])); result.setSndngMssage(NiceCiUtils.leftKr(tgtString, parseLength[idx]));
tgtString = NiceCiUtils.substringKr(tgtString, parseLength[idx++]); tgtString = NiceCiUtils.substringKr(tgtString, parseLength[idx++]);
result.setSmsSndngCttpcNo(StringUtils.left(tgtString, parseLength[idx])); result.setSmsSndngCttpcNo(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]); tgtString = tgtString.substring(parseLength[idx++]);
@ -364,9 +369,9 @@ public class NiceCiApiResult {
tgtString = tgtString.substring(parseLength[idx++]); tgtString = tgtString.substring(parseLength[idx++]);
// 이력조회시만 사용 //////////////////////////////////////////////////////// // 이력조회시만 사용 ////////////////////////////////////////////////////////
result.setProcId(StringUtils.left(tgtString, parseLength[idx])); result.setOpetrId(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]); tgtString = tgtString.substring(parseLength[idx++]);
result.setContactSearchCode(StringUtils.left(tgtString, parseLength[idx])); result.setCttpcInqireSe(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]); tgtString = tgtString.substring(parseLength[idx++]);
result.setResultSe(StringUtils.left(tgtString, parseLength[idx])); result.setResultSe(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]); tgtString = tgtString.substring(parseLength[idx++]);

@ -19,7 +19,7 @@ import lombok.*;
* Builder X * Builder X
* -> setter * -> setter
* packageName : cokr.xit.ens.modules.nice.model * packageName : cokr.xit.ens.modules.nice.model
* fileName : NiceDTO * fileName : NiceCiApiSendDTO
* author : limju * author : limju
* date : 2024 9 23 * date : 2024 9 23
* ====================================================================== * ======================================================================
@ -29,9 +29,9 @@ import lombok.*;
* *
* </pre> * </pre>
*/ */
public class NiceCiApiDTO { public class NiceCiApiSendDTO {
@Schema(name = "Request(Nice CI) API DTO", description = "NICE CI API 요청 전문 DTO") @Schema(name = "Request(Nice CI Send) API DTO", description = "NICE CI API Send 요청 전문 DTO")
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@ -224,7 +224,7 @@ public class NiceCiApiDTO {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
//sb.append(trCode); //sb.append(trCode);
// 공통부 // 공통부
sb.append(niceCommon.ofString()); sb.append(niceCommon.ofString(true));
// 개별요청부 // 개별요청부
sb.append(inqireResn); sb.append(inqireResn);

@ -20,7 +20,7 @@ import lombok.*;
* Builder X * Builder X
* -> setter * -> setter
* packageName : cokr.xit.ens.modules.nice.model * packageName : cokr.xit.ens.modules.nice.model
* fileName : NiceDTO * fileName : NiceCiApiStatusDTO
* author : limju * author : limju
* date : 2024 9 23 * date : 2024 9 23
* ====================================================================== * ======================================================================
@ -30,7 +30,7 @@ import lombok.*;
* *
* </pre> * </pre>
*/ */
public class NiceCiApiHistoryDTO { public class NiceCiApiStatusDTO {
@Schema(name = "Request(Nice CI History) API DTO", description = "NICE CI API 이력 요청 전문 DTO") @Schema(name = "Request(Nice CI History) API DTO", description = "NICE CI API 이력 요청 전문 DTO")
@Data @Data
@ -51,10 +51,15 @@ public class NiceCiApiHistoryDTO {
*/ */
//@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "TR Code", example = " ") //@Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "TR Code", example = " ")
//@Size(min = 10, max = 10, message = "트랜잭션 코드는 10자리 입니다.") //@Size(min = 10, max = 10, message = "트랜잭션 코드는 10자리 입니다.")
private String trCode = StringUtils.EMPTY; private String trnscId = StringUtils.EMPTY;
public void setTrCode(String trCode) { public void setTrnscId(String trnscId) {
this.trCode = StringUtils.leftPad(nvl(trCode), 10, StringUtils.SPACE); this.trnscId = StringUtils.leftPad(nvl(trnscId), 10, StringUtils.SPACE);
} }
/**
* nice sms ID - PK
*/
private String niceSmsSndngInqireId;
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
@ -63,15 +68,6 @@ public class NiceCiApiHistoryDTO {
@Schema(requiredMode = Schema.RequiredMode.REQUIRED) @Schema(requiredMode = Schema.RequiredMode.REQUIRED)
@Valid @Valid
NiceCiApiCommon niceCommon; NiceCiApiCommon niceCommon;
/**
* <pre>
* - 17
* </pre>
*/
@Schema(title = "공란", example = " ")
@Size(min = 17, max = 17, message = "공란(16자리)")
private String commonEmptyField = StringUtils.rightPad(StringUtils.EMPTY, 17, StringUtils.SPACE);
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
// 공통부 : 100 자리 // 공통부 : 100 자리
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
@ -88,9 +84,9 @@ public class NiceCiApiHistoryDTO {
*/ */
@Schema(title = "검색기간 from", example = " ") @Schema(title = "검색기간 from", example = " ")
@Size(min = 20, max = 20, message = "검색기간 from") @Size(min = 20, max = 20, message = "검색기간 from")
private String fromDt = StringUtils.rightPad(StringUtils.EMPTY, 20, StringUtils.SPACE); private String searchPdFrom = StringUtils.rightPad(StringUtils.EMPTY, 20, StringUtils.SPACE);
public void setFromDt(String fromDt) { public void setSearchPdFrom(String searchPdFrom) {
this.fromDt = StringUtils.rightPad(nvl(fromDt), 20, StringUtils.SPACE); this.searchPdFrom = StringUtils.rightPad(nvl(searchPdFrom), 20, StringUtils.SPACE);
} }
/** /**
@ -101,9 +97,9 @@ public class NiceCiApiHistoryDTO {
*/ */
@Schema(title = "검색기간 to", example = " ") @Schema(title = "검색기간 to", example = " ")
@Size(min = 20, max = 20, message = "검색기간 to") @Size(min = 20, max = 20, message = "검색기간 to")
private String toDt = StringUtils.rightPad(StringUtils.EMPTY, 20, StringUtils.SPACE); private String searchPdTo = StringUtils.rightPad(StringUtils.EMPTY, 20, StringUtils.SPACE);
public void setToDt(String toDt) { public void setSearchPdTo(String searchPdTo) {
this.toDt = StringUtils.rightPad(nvl(toDt), 20, StringUtils.SPACE); this.searchPdTo = StringUtils.rightPad(nvl(searchPdTo), 20, StringUtils.SPACE);
} }
/** /**
@ -114,7 +110,7 @@ public class NiceCiApiHistoryDTO {
*/ */
@Schema(title = "개인/사업자/법인구분", example = "1") @Schema(title = "개인/사업자/법인구분", example = "1")
@Size(min = 1, max = 1, message = "개인/사업자/법인구분은 1자리 입니다.") @Size(min = 1, max = 1, message = "개인/사업자/법인구분은 1자리 입니다.")
private String idDiv = "1"; private String indvdlBsnmCprSe = "1";
/** /**
* <pre> * <pre>
@ -122,10 +118,10 @@ public class NiceCiApiHistoryDTO {
* </pre> * </pre>
*/ */
@Schema(title = "주민번호", example = " ") @Schema(title = "주민번호", example = " ")
@Size(min = 13, max = 13, message = "주민번호는 13자리 입니다.") //@Size(min = 13, max = 13, message = "주민번호는 13자리 입니다.")
private String jumin = StringUtils.rightPad(StringUtils.EMPTY, 13, StringUtils.SPACE); private String ihidnum = StringUtils.rightPad(StringUtils.EMPTY, 13, StringUtils.SPACE);
public void setJumin(String jumin) { public void setIhidnum(String ihidnum) {
this.jumin = StringUtils.rightPad(nvl(jumin), 13, StringUtils.SPACE); this.ihidnum = StringUtils.rightPad(nvl(ihidnum), 13, StringUtils.SPACE);
} }
/** /**
@ -139,9 +135,9 @@ public class NiceCiApiHistoryDTO {
*/ */
@Schema(title = "결과구분코드", example = " ", allowableValues = {" ", "00", "01", "10"}) @Schema(title = "결과구분코드", example = " ", allowableValues = {" ", "00", "01", "10"})
@Size(min = 2, max = 2, message = "결과구분코드는 2자리 입니다.") @Size(min = 2, max = 2, message = "결과구분코드는 2자리 입니다.")
private String rsltDivCode = " "; private String resultSe = " ";
public void setRsltDivCode(String rsltDivCode) { public void setResultSe(String resultSe) {
this.rsltDivCode = StringUtils.rightPad(nvl(rsltDivCode), 2, StringUtils.SPACE); this.resultSe = StringUtils.rightPad(nvl(resultSe), 2, StringUtils.SPACE);
} }
/** /**
@ -156,7 +152,7 @@ public class NiceCiApiHistoryDTO {
*/ */
@Schema(title = "SMS발송요청구분", example = " ", allowableValues = {"0", "1", "2", "3", "4"}) @Schema(title = "SMS발송요청구분", example = " ", allowableValues = {"0", "1", "2", "3", "4"})
@Size(min = 1, max = 1, message = "SMS발송요청구분은 1자리 입니다.") @Size(min = 1, max = 1, message = "SMS발송요청구분은 1자리 입니다.")
private String smsSndReqCode = "0"; private String smsSndngRequstSe = "0";
/** /**
* <pre> * <pre>
@ -165,10 +161,10 @@ public class NiceCiApiHistoryDTO {
* </pre> * </pre>
*/ */
@Schema(title = "요청건수", example = " ") @Schema(title = "요청건수", example = " ")
@Pattern(regexp = "^\\s{10}$|\\d{10}", message = "요청건수는 10자리(max 100)입니다") @Pattern(regexp = "^[\\s\\S]{10}$", message = "요청건수는 10자리(max 100)입니다")
private String reqCnt = StringUtils.rightPad(StringUtils.EMPTY, 10, StringUtils.SPACE); private String requstCo = StringUtils.rightPad(StringUtils.EMPTY, 10, StringUtils.SPACE);
public void setReqCnt(String reqCnt){ public void setRequstCo(String requstCo){
this.reqCnt = StringUtils.rightPad(nvl(reqCnt), 10, StringUtils.SPACE); this.requstCo = StringUtils.rightPad(nvl(requstCo), 10, StringUtils.SPACE);
} }
/** /**
@ -178,10 +174,11 @@ public class NiceCiApiHistoryDTO {
* </pre> * </pre>
*/ */
@Schema(title = "누적수신건수", example = " ") @Schema(title = "누적수신건수", example = " ")
@Max(value = 100, message = "누적수신건수는 최대 10자리 입니다.") @Size(min = 10, max = 10, message = "누적수신건수는 10자리 입니다.")
private String accRecvCnt = "0000000000"; @Pattern(regexp = "^\\d{10}$", message = "요청건수는 10자리(max 100)입니다")
public void setAccRecvCnt(String accRecvCnt) { private String accmltRecptnCo = "0000000000";
this.accRecvCnt = StringUtils.rightPad(nvl(accRecvCnt), 10, StringUtils.SPACE); public void setAccmltRecptnCo(String accmltRecptnCo) {
this.accmltRecptnCo = StringUtils.rightPad(nvl(accmltRecptnCo), 10, StringUtils.SPACE);
} }
/** /**
@ -191,35 +188,38 @@ public class NiceCiApiHistoryDTO {
*/ */
@Schema(title = "공란", example = " ") @Schema(title = "공란", example = " ")
@Size(min = 23, max = 23, message = "공란(23자리)") @Size(min = 23, max = 23, message = "공란(23자리)")
private String privateEmptyField = StringUtils.rightPad(StringUtils.EMPTY, 23, StringUtils.SPACE); 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 자리 // 개별요청부 : 100 자리
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
public String ofString() { public String ofString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(trCode); sb.append(trnscId);
// 공통부 // 공통부
sb.append(niceCommon.ofString()); sb.append(niceCommon.ofString(false));
sb.append(commonEmptyField);
// 개별요청부 // 개별요청부
sb.append(fromDt); sb.append(searchPdFrom);
sb.append(toDt); sb.append(searchPdTo);
sb.append(idDiv); sb.append(indvdlBsnmCprSe);
sb.append(jumin); sb.append(ihidnum);
sb.append(rsltDivCode); sb.append(resultSe);
sb.append(smsSndReqCode); sb.append(smsSndngRequstSe);
sb.append(reqCnt); sb.append(requstCo);
sb.append(accRecvCnt); sb.append(accmltRecptnCo);
sb.append(privateEmptyField); sb.append(indvdlzRequstBlnk);
// FIXME: 인코딩확인후 적용 // FIXME: 인코딩확인후 적용
return new String(sb.toString().getBytes(), StandardCharsets.UTF_8); return new String(sb.toString().getBytes(), StandardCharsets.UTF_8);
} }
} }
@Schema(name = "Response(Nice CI History) DTO", description = "NICE CI 이력 응답 전문 DTO") @Schema(name = "Response(Nice CI Status) DTO", description = "NICE CI 상태(이력) 응답 전문 DTO")
@Data @Data
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@ -235,25 +235,20 @@ public class NiceCiApiHistoryDTO {
* - max: 9 * - max: 9
* </pre> * </pre>
*/ */
private String trCode; private String trnscId;
public void setTrCode(String trCode) { public void setTrnscId(String trnscId) {
this.trCode = StringUtils.trim(trCode); this.trnscId = StringUtils.trim(trnscId);
} }
/**
* nice sms ID - PK
*/
private String niceSmsSndngInqireId;
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
// 공통부 : 100 자리 // 공통부 : 100 자리
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
NiceCiApiCommon niceCommon; NiceCiApiCommon niceCommon;
/**
* <pre>
* - 16
* </pre>
*/
private String commonEmptyField;
public void setCommonEmptyField(String commonEmptyField) {
this.commonEmptyField = StringUtils.trim(commonEmptyField);
}
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
// 공통부 : 100 자리 // 공통부 : 100 자리
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
@ -266,9 +261,9 @@ public class NiceCiApiHistoryDTO {
* : 10 * : 10
* </pre> * </pre>
*/ */
private String totalCnt; private String totCo;
public void setTotalCnt(String totalCnt) { public void setTotCo(String totCo) {
this.totalCnt = StringUtils.trim(totalCnt); this.totCo = StringUtils.trim(totCo);
} }
/** /**
@ -276,9 +271,9 @@ public class NiceCiApiHistoryDTO {
* : 10 * : 10
* </pre> * </pre>
*/ */
private String accCnt; private String accmltCo;
public void setAccCnt(String accCnt) { public void setAccmltCo(String accmltCo) {
this.accCnt = StringUtils.trim(accCnt); this.accmltCo = StringUtils.trim(accmltCo);
} }
/** /**
@ -287,9 +282,9 @@ public class NiceCiApiHistoryDTO {
* 100 * 100
* </pre> * </pre>
*/ */
private String resCnt; private String rspnsCo;
public void setResCnt(String resCnt) { public void setRspnsCo(String rspnsCo) {
this.resCnt = StringUtils.trim(resCnt); this.rspnsCo = StringUtils.trim(rspnsCo);
} }
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
// 개별응답부 : 30 자리 // 개별응답부 : 30 자리
@ -307,8 +302,7 @@ public class NiceCiApiHistoryDTO {
final int repeatLength = 1150; final int repeatLength = 1150;
final int[] parseLength = { final int[] parseLength = {
10, // tr-code 10, // tr-code
83, // 공통부 100, // 공통부
17, // 공란
10, // 총건수 10, // 총건수
10, // 누적건수 10, // 누적건수
10, // 응답건수 10, // 응답건수
@ -319,22 +313,19 @@ public class NiceCiApiHistoryDTO {
if (StringUtils.isNotBlank(tgtString) && NiceCiUtils.lengthKr(tgtString) >= 1290) { if (StringUtils.isNotBlank(tgtString) && NiceCiUtils.lengthKr(tgtString) >= 1290) {
Response nr = new Response(); Response nr = new Response();
int idx = 0; int idx = 0;
nr.setTrCode(StringUtils.left(tgtString, parseLength[idx])); nr.setTrnscId(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]); tgtString = tgtString.substring(parseLength[idx++]);
nr.setNiceCommon(NiceCiApiCommon.parse(tgtString)); nr.setNiceCommon(NiceCiApiCommon.parse(tgtString));
tgtString = tgtString.substring(parseLength[idx++]); tgtString = tgtString.substring(parseLength[idx++]);
nr.setCommonEmptyField(StringUtils.left(tgtString, parseLength[idx])); nr.setTotCo(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]);
nr.setTotalCnt(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]); tgtString = tgtString.substring(parseLength[idx++]);
nr.setAccCnt(StringUtils.left(tgtString, parseLength[idx])); nr.setAccmltCo(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]); tgtString = tgtString.substring(parseLength[idx++]);
nr.setResCnt(StringUtils.left(tgtString, parseLength[idx])); nr.setRspnsCo(StringUtils.left(tgtString, parseLength[idx]));
tgtString = tgtString.substring(parseLength[idx++]); tgtString = tgtString.substring(parseLength[idx++]);
if(NiceCiUtils.lengthKr(tgtString) % repeatLength == 0){ if(NiceCiUtils.lengthKr(tgtString) % repeatLength == 0){
@ -343,7 +334,7 @@ public class NiceCiApiHistoryDTO {
List<NiceCiApiResult> resResults = IntStream.range(0, repeat) List<NiceCiApiResult> resResults = IntStream.range(0, repeat)
.mapToObj(i -> { .mapToObj(i -> {
String currentString = NiceCiUtils.substringKr(finalTgtString, i * repeatLength); String currentString = NiceCiUtils.substringKr(finalTgtString, i * repeatLength);
return NiceCiApiResult.parseHistory(currentString); return NiceCiApiResult.parseStatus(currentString);
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());
nr.setNiceCiResults(resResults); nr.setNiceCiResults(resResults);

@ -448,6 +448,8 @@ public class NiceCiDTO {
private String ntcntalkTmplatCode; private String ntcntalkTmplatCode;
private String orgNm;
private String registId; private String registId;
private LocalDateTime registDt; private LocalDateTime registDt;

@ -158,19 +158,21 @@ public class NiceCiAcceptService {
} }
xit.setPrcsCd(IupPrcsCd.GRUC.getCode()); xit.setPrcsCd(IupPrcsCd.GRUC.getCode());
niceCiMapper.updatePrcsCdOfInputXit(xit); niceCiMapper.updatePrcsCdAndErrorOfInputXit(xit);
// FIXME: API 호출 에러 // FIXME: API 호출 에러
} catch (EnsException e) { } catch (EnsException e) {
if(EnsErrCd.API_COMM_ERROR.equals(e.getErrCd())){ if(EnsErrCd.API_COMM_ERROR.equals(e.getErrCd())){
xit.setPrcsCd(IupPrcsCd.TGRF.getCode()); xit.setPrcsCd(IupPrcsCd.TGRF.getCode());
niceCiMapper.updatePrcsCdOfInputXit(xit); xit.setErrMsg(e.getMessage());
niceCiMapper.updatePrcsCdAndErrorOfInputXit(xit);
} }
} catch (Exception e){ } catch (Exception e){
xit.setPrcsCd(IupPrcsCd.TGRF.getCode()); xit.setPrcsCd(IupPrcsCd.TGRF.getCode());
niceCiMapper.updatePrcsCdOfInputXit(xit); xit.setErrMsg(e.getMessage());
niceCiMapper.updatePrcsCdAndErrorOfInputXit(xit);
} }
} }

@ -13,7 +13,6 @@ import cokr.xit.ens.core.aop.*;
import cokr.xit.ens.core.exception.*; import cokr.xit.ens.core.exception.*;
import cokr.xit.ens.core.exception.code.*; import cokr.xit.ens.core.exception.code.*;
import cokr.xit.ens.core.utils.*; import cokr.xit.ens.core.utils.*;
import cokr.xit.ens.modules.common.ctgy.sys.mng.domain.*;
import cokr.xit.ens.modules.nice.mapper.*; import cokr.xit.ens.modules.nice.mapper.*;
import cokr.xit.ens.modules.nice.model.*; import cokr.xit.ens.modules.nice.model.*;
import cokr.xit.ens.modules.nice.service.support.*; import cokr.xit.ens.modules.nice.service.support.*;
@ -68,13 +67,8 @@ public class NiceCiSendBulkService {
for(NiceCiDTO.InputXit xit : list) { for(NiceCiDTO.InputXit xit : list) {
final NiceCiDTO.TmpltMngDTO tmpltMngDTO = niceCiMapper.selectTmpltMsg(xit.getJobCd()) final NiceCiDTO.TmpltMngDTO tmpltMngDTO = niceCiMapper.selectTmpltMsg(xit.getJobCd())
.orElseThrow(() -> new EnsException(EnsErrCd.NO_DATA_FOUND, EnsErrCd.NO_DATA_FOUND.getCodeNm())); .orElseThrow(() -> new EnsException(EnsErrCd.NO_DATA_FOUND, EnsErrCd.NO_DATA_FOUND.getCodeNm()));
final String sndMsg = tmpltMngDTO.getMessage();//.replace("~~@@!!", "#{").replace("!!@@~~", "}");
final String ntcntalkTmplatCode = tmpltMngDTO.getNtcntalkTmplatCode();
final OrgMng orgMng = niceCiMapper.selectKkoBpApiUrlFromEnsOrgMng(xit.getOrgCd())
.orElseThrow(() -> new EnsException(EnsErrCd.NO_DATA_FOUND, EnsErrCd.NO_DATA_FOUND.getCodeNm()));
NiceCiDTO.BillHistDTO billHistDTO = null; NiceCiDTO.BillHistDTO billHistDTO = null;
try { try {
List<NiceCiDTO.InputDataXit> inputDataXits = xit.getInputDataXits(); List<NiceCiDTO.InputDataXit> inputDataXits = xit.getInputDataXits();
for (NiceCiDTO.InputDataXit data : inputDataXits) { for (NiceCiDTO.InputDataXit data : inputDataXits) {
@ -84,16 +78,15 @@ public class NiceCiSendBulkService {
() -> new EnsException(EnsErrCd.MAKE521, EnsErrCd.MAKE521.getCodeNm()) () -> new EnsException(EnsErrCd.MAKE521, EnsErrCd.MAKE521.getCodeNm())
); );
NiceCiApiSendDTO.Request ciRequest = new NiceCiApiSendDTO.Request();
NiceCiApiDTO.Request ciRequest = new NiceCiApiDTO.Request();
NiceCiApiCommon nCommon = new NiceCiApiCommon(); NiceCiApiCommon nCommon = new NiceCiApiCommon();
NiceCiApiDTO.QueryRequest queryRequest = new NiceCiApiDTO.QueryRequest(); NiceCiApiSendDTO.QueryRequest queryRequest = new NiceCiApiSendDTO.QueryRequest();
NiceCiApiDTO.ButtonRequest btnRequest = new NiceCiApiDTO.ButtonRequest(); NiceCiApiSendDTO.ButtonRequest btnRequest = new NiceCiApiSendDTO.ButtonRequest();
// 공통부 set // 공통부 set
setNiceCiApiRequestCommon(nCommon, niceSmsReqId); setNiceCiApiRequestCommon(nCommon, niceSmsReqId);
// 개별부 set // 개별부 set
setNiceCiApiPrivateReq(ciRequest, ntcntalkTmplatCode, sndMsg, data); setNiceCiApiPrivateReq(ciRequest, tmpltMngDTO, data);
// 조회요청반복부 set // 조회요청반복부 set
setQueryRequest(queryRequest, data); setQueryRequest(queryRequest, data);
// 버튼요청반복부 set // 버튼요청반복부 set
@ -103,35 +96,44 @@ public class NiceCiSendBulkService {
ciRequest.getQueryRequests().add(queryRequest); ciRequest.getQueryRequests().add(queryRequest);
ciRequest.getButtonRequests().add(btnRequest); ciRequest.getButtonRequests().add(btnRequest);
ciRequest.setNiceSmsSndngRequstId(niceSmsReqId); ciRequest.setNiceSmsSndngRequstId(niceSmsReqId);
ciRequest.setDataId(data.getDataId()); ciRequest.setDataId(data.getDataId());
niceCiMapper.insertNiceSmsSndngRequest(ciRequest); niceCiMapper.insertNiceSmsSndngRequest(ciRequest);
// FIXME : 연계 이후 확인 필요 // FIXME : 연계 이후 확인 필요
EnsResponseVO<?> responseVO = niceCiApiService.requestSendBulk(ciRequest); EnsResponseVO<?> responseVO = niceCiApiService.requestSendBulk(ciRequest);
NiceCiApiDTO.Response resDTO = (NiceCiApiDTO.Response)responseVO.getResultInfo(); if (!EnsErrCd.OK.equals(responseVO.getErrCode()))
//NiceCiApiDTO.Response resDTO = new NiceCiApiDTO.Response(); throw new EnsException(responseVO.getErrCode(), responseVO.getErrMsg());
NiceCiApiSendDTO.Response resDTO = (NiceCiApiSendDTO.Response)responseVO.getResultInfo();
resDTO.setNiceSmsSndngRequstId(niceSmsReqId); resDTO.setNiceSmsSndngRequstId(niceSmsReqId);
niceCiMapper.insertNiceSmsSndngResponse(resDTO); niceCiMapper.insertNiceSmsSndngResponse(resDTO);
log.info(responseVO.toString()); log.info(responseVO.toString());
return responseVO;
} }
xit.setPrcsCd(IupPrcsCd.IPCP.getCode()); xit.setPrcsCd(IupPrcsCd.IPCP.getCode());
niceCiMapper.updatePrcsCdOfInputXit(xit); niceCiMapper.updatePrcsCdAndErrorOfInputXit(xit);
// FIXME: API 호출 에러 // FIXME: API 호출 에러
} catch (EnsException e) { } catch (EnsException e) {
// FIXME : API 통신에러 인경우 skip - 재시도 되어야
if(EnsErrCd.API_COMM_ERROR.equals(e.getErrCd())){ if(EnsErrCd.API_COMM_ERROR.equals(e.getErrCd())){
xit.setPrcsCd(IupPrcsCd.FAIL.getCode()); xit.setPrcsCd(IupPrcsCd.FAIL.getCode());
niceCiMapper.updatePrcsCdOfInputXit(xit); xit.setErrMsg(e.getMessage());
niceCiMapper.updatePrcsCdAndErrorOfInputXit(xit);
return EnsResponseVO.errBuilder()
.errCode(e.getErrCd())
.errMsg(e.getMessage())
.build();
} }
xit.setPrcsCd(IupPrcsCd.FAIL.getCode());
xit.setErrMsg(e.getMessage());
niceCiMapper.updatePrcsCdAndErrorOfInputXit(xit);
} catch (Exception e){ } catch (Exception e){
xit.setPrcsCd(IupPrcsCd.FAIL.getCode()); xit.setPrcsCd(IupPrcsCd.FAIL.getCode());
niceCiMapper.updatePrcsCdOfInputXit(xit); xit.setErrMsg(e.getMessage());
niceCiMapper.updatePrcsCdAndErrorOfInputXit(xit);
} }
} }
return EnsResponseVO.okBuilder() return EnsResponseVO.okBuilder()
@ -175,12 +177,11 @@ public class NiceCiSendBulkService {
/** /**
* set * set
* @param ciRequest NiceCiApiDTO.Request * @param ciRequest NiceCiApiSendDTO.Request
* @param ntcntalkTmplatCode template ID * @param tmpltMngDTO NiceCiDTO.TmpltMngDTO
* @param sndMsg 릿
* @param data NiceCiDTO.InputDataXit data * @param data NiceCiDTO.InputDataXit data
*/ */
private void setNiceCiApiPrivateReq(final NiceCiApiDTO.Request ciRequest, final String ntcntalkTmplatCode, String sndMsg, final NiceCiDTO.InputDataXit data){ private void setNiceCiApiPrivateReq(final NiceCiApiSendDTO.Request ciRequest, NiceCiDTO.TmpltMngDTO tmpltMngDTO, final NiceCiDTO.InputDataXit data){
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// 개별요청부 START // 개별요청부 START
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@ -200,11 +201,14 @@ public class NiceCiSendBulkService {
ciRequest.setInqireRequstCo(1); // 조회요청건수 ciRequest.setInqireRequstCo(1); // 조회요청건수
Map<String, String> map = gson.fromJson(data.getMsgData(), Map.class); Map<String, String> map = gson.fromJson(data.getMsgData(), Map.class);
String sndMsg = tmpltMngDTO.getMessage();
for(Map.Entry<String, String> entry : map.entrySet()){ for(Map.Entry<String, String> entry : map.entrySet()){
sndMsg = sndMsg.replace(entry.getKey(), entry.getValue()); 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.setSndngMssage(sndMsg); // 발송메세지
ciRequest.setNtcntalkTmplatCode(ntcntalkTmplatCode); // 알림톡 템플릿 코드 ciRequest.setNtcntalkTmplatCode(tmpltMngDTO.getNtcntalkTmplatCode()); // 알림톡 템플릿 코드
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
// 개별요청부 END // 개별요청부 END
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
@ -212,10 +216,10 @@ public class NiceCiSendBulkService {
/** /**
* set * set
* @param queryRequest NiceCiApiDTO.QueryRequest * @param queryRequest NiceCiApiSendDTO.QueryRequest
* @param data NiceCiDTO.InputDataXit * @param data NiceCiDTO.InputDataXit
*/ */
private void setQueryRequest(final NiceCiApiDTO.QueryRequest queryRequest, final NiceCiDTO.InputDataXit data) { private void setQueryRequest(final NiceCiApiSendDTO.QueryRequest queryRequest, final NiceCiDTO.InputDataXit data) {
//--------------------------------------------------------- //---------------------------------------------------------
// 조회요청 반복부 : default START // 조회요청 반복부 : default START
//--------------------------------------------------------- //---------------------------------------------------------
@ -229,10 +233,10 @@ public class NiceCiSendBulkService {
/** /**
* set * set
* @param btnRequest NiceCiApiDTO.ButtonRequest * @param btnRequest NiceCiApiSendDTO.ButtonRequest
* @param data NiceCiDTO.InputDataXit * @param data NiceCiDTO.InputDataXit
*/ */
private void setBtnRequest(final NiceCiApiDTO.ButtonRequest btnRequest, final NiceCiDTO.InputDataXit data) { private void setBtnRequest(final NiceCiApiSendDTO.ButtonRequest btnRequest, final NiceCiDTO.InputDataXit data) {
//--------------------------------------------------------- //---------------------------------------------------------
// 버튼요청 반복부 : default START // 버튼요청 반복부 : default START
//--------------------------------------------------------- //---------------------------------------------------------

@ -1,6 +1,7 @@
package cokr.xit.ens.modules.nice.service; package cokr.xit.ens.modules.nice.service;
import java.util.*; import java.util.*;
import java.util.stream.*;
import org.apache.commons.lang3.*; import org.apache.commons.lang3.*;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -8,8 +9,9 @@ import org.springframework.stereotype.*;
import cokr.xit.ens.biz.iup.code.*; import cokr.xit.ens.biz.iup.code.*;
import cokr.xit.ens.core.aop.*; import cokr.xit.ens.core.aop.*;
import cokr.xit.ens.core.exception.*;
import cokr.xit.ens.core.exception.code.*; import cokr.xit.ens.core.exception.code.*;
import cokr.xit.ens.modules.nice.cmm.*; import cokr.xit.ens.core.utils.*;
import cokr.xit.ens.modules.nice.mapper.*; import cokr.xit.ens.modules.nice.mapper.*;
import cokr.xit.ens.modules.nice.model.*; import cokr.xit.ens.modules.nice.model.*;
import cokr.xit.ens.modules.nice.service.support.*; import cokr.xit.ens.modules.nice.service.support.*;
@ -37,34 +39,13 @@ public class NiceCiStatBulkService {
@Value("${contract.niceCi.orgId}") @Value("${contract.niceCi.orgId}")
private String ORG_ID; private String ORG_ID;
@Value("${contract.niceCi.clientId}") @Value("${contract.niceCi.isStatusFail}")
private String CLIENT_ID; private boolean IS_STATUS_FAIL;
private final NiceCiApiService niceCiApiService; private final NiceCiApiService niceCiApiService;
private final INiceCiMapper niceCiMapper; private final INiceCiMapper niceCiMapper;
final String msg = "민자도로 관리지원센터에서 김해찬님께 발송한 미납통행료 고지서가 도착했습니다.\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";
public EnsResponseVO<?> findBulkStatus() { public EnsResponseVO<?> findBulkStatus() {
final NiceCiDTO.NiceCiParam niceCiParam = NiceCiDTO.NiceCiParam.builder() final NiceCiDTO.NiceCiParam niceCiParam = NiceCiDTO.NiceCiParam.builder()
.sendType(IupSendTypeCd.NI.getCode()) .sendType(IupSendTypeCd.NI.getCode())
@ -79,46 +60,157 @@ public class NiceCiStatBulkService {
.build(); .build();
} }
NiceCiApiHistoryDTO.Request ciRequest = new NiceCiApiHistoryDTO.Request(); list.forEach(d -> {
//ciRequest.setTrCode("0000006150"); niceCiParam.setLnkInputId(d.getLnkInputId());
// // 공통부 d.setInputDataXits(niceCiMapper.selectNiceCiAcceptDatas(niceCiParam));
// });
// // 개별요청부
// nr.setQueryReason(StringUtils.EMPTY); for(NiceCiDTO.InputXit xit : list) {
// nr.setQueryReqCnt(46);
// nr.setSmsSndReqCode("1");
String tmp = NiceCiUtils.rightPadKr(msg, 2000, StringUtils.SPACE); try {
System.out.println( List<NiceCiDTO.InputDataXit> inputDataXits = xit.getInputDataXits();
String.format("[%s] kr length - %d, utf-8 length - %d", tmp, NiceCiUtils.lengthKr(tmp), tmp.length())); for (NiceCiDTO.InputDataXit data : inputDataXits) {
// nr.setSndPhoneNo("010");
// nr.setContactSearchCode("1"); // 기관전문관리번호, TB_NICE_SMS_SNDNG_REQUEST - NICE_SMS_SNDNG_REQUST_ID
final String niceSmsInqId = niceCiMapper.selectNiceCiInqireId().orElseThrow(
// 공통부 () -> new EnsException(EnsErrCd.MAKE521, EnsErrCd.MAKE521.getCodeNm())
NiceCiApiCommon nc = new NiceCiApiCommon(); );
// nc.setGrpCode("grpCode");
//nc.setTrType("Type"); NiceCiApiStatusDTO.Request ciRequest = new NiceCiApiStatusDTO.Request();
nc.setTrClassification("31895"); // 거래구분 NiceCiApiCommon nCommon = new NiceCiApiCommon();
nc.setOrgId(ORG_ID); // 참가기관Id - property 에서
nc.setOrgMngNo("0000000103"); // 기관관리번호 // 공통부 set
nc.setOrgSndDt("20240919"); setNiceCiApiRequestCommon(nCommon, niceSmsInqId);
ciRequest.setNiceCommon(nCommon);
NiceCiApiDTO.QueryRequest qr = new NiceCiApiDTO.QueryRequest();
NiceCiApiDTO.ButtonRequest br = new NiceCiApiDTO.ButtonRequest(); // 개별요청부 set
setNiceCiApiPrivateReq(ciRequest);
ciRequest.setNiceCommon(nc);
// API request 저장
// nc.setNiceMngNo(StringUtils.EMPTY); ciRequest.setNiceSmsSndngInqireId(niceSmsInqId);
// nc.setNiceSndDt(StringUtils.EMPTY); niceCiMapper.insertNiceSmsSndngInquireRequest(ciRequest);
String ciTxt = ciRequest.ofString();
String ft = String.format("%s%s", StringUtils.leftPad(String.valueOf(NiceCiUtils.lengthKr(ciTxt)), 10, "0"),
ciTxt);
System.out.println(
String.format("[%s] kr length - %d, utf-8 length - %d", ft, NiceCiUtils.lengthKr(ft), ft.length()));
// String rtnMsg = niceCiApiService.requestSendBulk(ciRequest);
// NiceCiDTO.Response resDTO = NiceCiDTO.Response.parse(rtnMsg);
EnsResponseVO<?> responseVO = niceCiApiService.findBulkStatus(ciRequest); EnsResponseVO<?> responseVO = niceCiApiService.findBulkStatus(ciRequest);
if (!EnsErrCd.OK.equals(responseVO.getErrCode()))
throw new EnsException(responseVO.getErrCode(), responseVO.getErrMsg());
NiceCiApiStatusDTO.Response resDTO = (NiceCiApiStatusDTO.Response)responseVO.getResultInfo();
resDTO.setNiceSmsSndngInqireId(niceSmsInqId);
// API response 저장
niceCiMapper.insertNiceSmsSndngInquireResponse(resDTO);
// API response 반복부 저장
niceCiMapper.insertNiceSmsSndngInquireResponseRepeat(
resDTO.getNiceCiResults()
.stream().peek(d -> d.setNiceSmsSndngInqireId(niceSmsInqId))
.collect(Collectors.toList()));
log.info(responseVO.toString()); log.info(responseVO.toString());
return responseVO; }
} catch (EnsException e) {
// FIXME : API 통신에러 인경우 skip - 재시도 되어야
if(EnsErrCd.API_COMM_ERROR.equals(e.getErrCd())){
xit.setErrMsg(e.getMessage());
niceCiMapper.updatePrcsCdAndErrorOfInputXit(xit);
return EnsResponseVO.errBuilder()
.errCode(e.getErrCd())
.errMsg(e.getMessage())
.build();
}
if(IS_STATUS_FAIL) xit.setPrcsCd(IupPrcsCd.FAIL.getCode());
xit.setErrMsg(e.getMessage());
niceCiMapper.updatePrcsCdAndErrorOfInputXit(xit);
} catch (Exception e){
if(IS_STATUS_FAIL) 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();
}
/**
* 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
//---------------------------------------------------------
ciRequest.setSearchPdFrom(DateUtil.getNowTimeMicrosecond()); // 검색기간 - from
ciRequest.setSearchPdTo(DateUtil.getNowTimeMicrosecond()); // 검색기간 - to
ciRequest.setRequstCo("?"); // 요청건수
//ciRequest.setAccmltRecptnCo(); // 누적수신건수
////////////////////////////////////////////////////////////
// 개별요청부 END
////////////////////////////////////////////////////////////
} }
} }

@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.*; import org.springframework.stereotype.*;
import cokr.xit.ens.core.aop.*; import cokr.xit.ens.core.aop.*;
import cokr.xit.ens.core.exception.*;
import cokr.xit.ens.core.exception.code.*; import cokr.xit.ens.core.exception.code.*;
import cokr.xit.ens.modules.nice.cmm.*; import cokr.xit.ens.modules.nice.cmm.*;
import cokr.xit.ens.modules.nice.model.*; import cokr.xit.ens.modules.nice.model.*;
@ -49,9 +50,9 @@ public class NiceCiApiService {
private static final Validator validator = Validation.buildDefaultValidatorFactory().getValidator(); private static final Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
public EnsResponseVO<?> requestSendBulk(final NiceCiApiDTO.Request reqDTO) { public EnsResponseVO<?> requestSendBulk(final NiceCiApiSendDTO.Request reqDTO) {
List<String> errors = new ArrayList<>(); List<String> errors = new ArrayList<>();
final Set<ConstraintViolation<NiceCiApiDTO.Request>> list = validator.validate(reqDTO); final Set<ConstraintViolation<NiceCiApiSendDTO.Request>> list = validator.validate(reqDTO);
if (!list.isEmpty()) { if (!list.isEmpty()) {
errors.addAll(list.stream() errors.addAll(list.stream()
.map(row -> String.format("%s=%s", row.getPropertyPath(), row.getMessageTemplate())) .map(row -> String.format("%s=%s", row.getPropertyPath(), row.getMessageTemplate()))
@ -65,29 +66,33 @@ public class NiceCiApiService {
.errMsg(errors.toString()) .errMsg(errors.toString())
.build(); .build();
} }
log.info("API call parameter :: {}", reqDTO);
String ciTxt = reqDTO.ofString(); String ciTxt = reqDTO.ofString();
String ft = String.format("%s%s", StringUtils.leftPad(String.valueOf(NiceCiUtils.lengthKr(ciTxt)), 10, "0"), String ft = String.format("%s%s", StringUtils.leftPad(String.valueOf(NiceCiUtils.lengthKr(ciTxt)), 10, "0"),
ciTxt); ciTxt);
log.info("[{}] kr length - {}, utf-8 length - {}", ft, NiceCiUtils.lengthKr(ft), ft.length()); log.info("kr length - {}, utf-8 length - {}", NiceCiUtils.lengthKr(ft), ft.length());
final String rtnMsg; final String rtnMsg;
try { try {
rtnMsg = sendNiceCiSocket(ft, 0); //rtnMsg = sendNiceCiSocket(ft);
// FIXME: test를 위해 임시 사용 - return msg get
rtnMsg = getTestData( 0);
} catch (Exception e) { } catch (Exception e) {
return EnsResponseVO.errBuilder() return EnsResponseVO.errBuilder()
.errCode(EnsErrCd.API_COMM_ERROR) .errCode(EnsErrCd.API_COMM_ERROR)
.errMsg(e.getMessage()) .errMsg(e.getMessage())
.build(); .build();
} }
NiceCiApiDTO.Response resDTO = NiceCiApiDTO.Response.parse(rtnMsg); NiceCiApiSendDTO.Response resDTO = NiceCiApiSendDTO.Response.parse(rtnMsg);
return EnsResponseVO.okBuilder() return EnsResponseVO.okBuilder()
.resultInfo(resDTO) .resultInfo(resDTO)
.build(); .build();
} }
public EnsResponseVO<?> findBulkStatus(final NiceCiApiHistoryDTO.Request reqDTO) { public EnsResponseVO<?> findBulkStatus(final NiceCiApiStatusDTO.Request reqDTO) {
List<String> errors = new ArrayList<>(); List<String> errors = new ArrayList<>();
final Set<ConstraintViolation<NiceCiApiHistoryDTO.Request>> list = validator.validate(reqDTO); final Set<ConstraintViolation<NiceCiApiStatusDTO.Request>> list = validator.validate(reqDTO);
if (!list.isEmpty()) { if (!list.isEmpty()) {
errors.addAll(list.stream() errors.addAll(list.stream()
.map(row -> String.format("%s=%s", row.getPropertyPath(), row.getMessageTemplate())) .map(row -> String.format("%s=%s", row.getPropertyPath(), row.getMessageTemplate()))
@ -101,28 +106,31 @@ public class NiceCiApiService {
.errMsg(errors.toString()) .errMsg(errors.toString())
.build(); .build();
} }
log.info("API call parameter :: {}", reqDTO);
String ciTxt = reqDTO.ofString(); String ciTxt = reqDTO.ofString();
String ft = String.format("%s%s", StringUtils.leftPad(String.valueOf(NiceCiUtils.lengthKr(ciTxt)), 10, "0"), String ft = String.format("%s%s", StringUtils.leftPad(String.valueOf(NiceCiUtils.lengthKr(ciTxt)), 10, "0"),
ciTxt); ciTxt);
log.info("[{}] kr length - {}, utf-8 length - {}", ft, NiceCiUtils.lengthKr(ft), ft.length()); log.info("kr length - {}, utf-8 length - {}", NiceCiUtils.lengthKr(ft), ft.length());
final String rtnMsg; final String rtnMsg;
try { try {
rtnMsg = sendNiceCiSocket(ft, 1); //rtnMsg = sendNiceCiSocket(ft);
} catch (Exception e) { // FIXME: test를 위해 임시 사용 - return msg get
rtnMsg = getTestData( 1);
} catch (EnsException e) {
return EnsResponseVO.errBuilder() return EnsResponseVO.errBuilder()
.errCode(EnsErrCd.API_COMM_ERROR) .errCode(e.getErrCd())
.errMsg(e.getMessage()) .errMsg(e.getMessage())
.build(); .build();
} }
NiceCiApiHistoryDTO.Response resDTO = NiceCiApiHistoryDTO.Response.parse(rtnMsg); NiceCiApiStatusDTO.Response resDTO = NiceCiApiStatusDTO.Response.parse(rtnMsg);
return EnsResponseVO.okBuilder() return EnsResponseVO.okBuilder()
.resultInfo(resDTO) .resultInfo(resDTO)
.build(); .build();
} }
// FIXME: test를 위해 idx 사용 - return msg get private String sendNiceCiSocket(final String binTxt) {
private String sendNiceCiSocket(final String binTxt, final int idx) {
String rtnMsg = ""; String rtnMsg = "";
try (Socket socket = new Socket(HOST, PORT); // 서버에 연결 try (Socket socket = new Socket(HOST, PORT); // 서버에 연결
@ -131,7 +139,7 @@ public class NiceCiApiService {
//new OutputStreamWriter(socket.getOutputStream())); //new OutputStreamWriter(socket.getOutputStream()));
BufferedReader in = new BufferedReader( BufferedReader in = new BufferedReader(
new InputStreamReader(socket.getInputStream(), Charset.forName("EUC-KR")))) { new InputStreamReader(socket.getInputStream(), Charset.forName("EUC-KR")))) {
try {
socket.setSoTimeout(TIMEOUT); // 읽기 타임아웃 설정 socket.setSoTimeout(TIMEOUT); // 읽기 타임아웃 설정
out.write(binTxt); out.write(binTxt);
@ -143,23 +151,18 @@ public class NiceCiApiService {
out.flush(); out.flush();
//StringBuffer sb = new StringBuffer(); rtnMsg = in.readLine();
//String rtnMsg = in.readLine();
rtnMsg = getTestData(idx);
System.out.println("=============>>>서버 응답(EUC-KR로 읽어온 값)<<<===================================="); System.out.println("=============>>>서버 응답(EUC-KR로 읽어온 값)<<<====================================");
System.out.println(rtnMsg); System.out.println(rtnMsg);
System.out.println("=============>>>서버 응답(EUC-KR로 읽어온 값)<<<===================================="); System.out.println("=============>>>서버 응답(EUC-KR로 읽어온 값)<<<====================================");
in.close();
} catch (Exception e) {
throw new RuntimeException(e);
}
} catch (SocketTimeoutException e) { } catch (SocketTimeoutException e) {
// 타임아웃 발생 시 처리 // 타임아웃 발생 시 처리
log.error("NICE CI Socket 서버 응답 시간 초과: " + e.getMessage()); log.error("NICE CI Socket 서버 응답 시간 초과: " + e.getMessage());
// throw BizRuntimeException.create("NICE CI Socket 서버 응답 시간 초과로 인해 통신이 종료되었습니다."); throw new EnsException(EnsErrCd.API_COMM_ERROR, "NICE CI Socket 서버 응답 시간 초과");
} catch (IOException e) { } catch (IOException e) {
// throw BizRuntimeException.create(e.getMessage()); throw new EnsException(EnsErrCd.API_COMM_ERROR, e.getMessage());
} }
return rtnMsg; return rtnMsg;
} }

@ -145,3 +145,5 @@ contract:
clientId: 0027370001 clientId: 0027370001
# 운영 # 운영
#clientId: 0027370002 #clientId: 0027370002
# 상태조회중 에러 발생시 FAIL 처리 여부
isStatusFail: false

@ -159,10 +159,11 @@
WHERE lnk_input_id = #{lnkInputId} WHERE lnk_input_id = #{lnkInputId}
</update> </update>
<update id="updatePrcsCdOfInputXit" parameterType="cokr.xit.ens.modules.nice.model.NiceCiDTO$InputXit"> <update id="updatePrcsCdAndErrorOfInputXit" parameterType="cokr.xit.ens.modules.nice.model.NiceCiDTO$InputXit">
/** iup-niceci-mapper|updatePrcsCdOfInputXit-prcsCd update|julim */ /** iup-niceci-mapper|updatePrcsCdAndErrorOfInputXit-prcsCd and errorupdate|julim */
UPDATE tb_input_xit UPDATE tb_input_xit
SET prcs_cd = #{prcsCd} SET prcs_cd = #{prcsCd}
, err_msg = SUBSTR(#{errMsg}, 0, 1000)
WHERE lnk_input_id = #{lnkInputId} WHERE lnk_input_id = #{lnkInputId}
</update> </update>
@ -184,20 +185,23 @@
<select id="selectTmpltMsg" parameterType="string" resultType="cokr.xit.ens.modules.nice.model.NiceCiDTO$TmpltMngDTO"> <select id="selectTmpltMsg" parameterType="string" resultType="cokr.xit.ens.modules.nice.model.NiceCiDTO$TmpltMngDTO">
/** iup-niceci-mapper|selectTmpltMsg-selest nice ci template message|julim */ /** iup-niceci-mapper|selectTmpltMsg-selest nice ci template message|julim */
SELECT dtype SELECT etm.dtype
, org_cd , etm.org_cd
, tmplt_cd , etm.tmplt_cd
, message , etm.message
, title , etm.title
, ntcntalk_tmplat_code , etm.ntcntalk_tmplat_code
FROM ens_tmplt_mng , eom.org_nm
WHERE tmplt_cd = #{tmpltCd} FROM ens_org_mng eom
JOIN ens_tmplt_mng etm
ON eom.org_cd = etm.org_cd
WHERE etm.tmplt_cd = #{tmpltCd}
</select> </select>
<insert id="insertNiceSmsSndngRequest" parameterType="cokr.xit.ens.modules.nice.model.NiceCiApiDTO$Request"> <insert id="insertNiceSmsSndngRequest" parameterType="cokr.xit.ens.modules.nice.model.NiceCiApiSendDTO$Request">
/** iup-niceci-mapper|insertNiceSmsSndngRequest-selest nice ci Send request 생성|julim */ /** iup-niceci-mapper|insertNiceSmsSndngRequest-nice ci Send request data 생성|julim */
INSERT INTO tb_nice_sms_sndng_requst ( INSERT INTO tb_nice_sms_sndng_requst (
NIce_sms_sndng_requst_id, nice_sms_sndng_requst_id,
data_id, data_id,
trnsc_id, trnsc_id,
spclty_groupcode, spclty_groupcode,
@ -277,8 +281,8 @@
) )
</insert> </insert>
<insert id="insertNiceSmsSndngResponse" parameterType="cokr.xit.ens.modules.nice.model.NiceCiApiDTO$Response"> <insert id="insertNiceSmsSndngResponse" parameterType="cokr.xit.ens.modules.nice.model.NiceCiApiSendDTO$Response">
/** iup-niceci-mapper|insertNiceSmsSndngResponse-selest nice ci Send response 생성|julim */ /** iup-niceci-mapper|insertNiceSmsSndngResponse-nice ci Send response 생성|julim */
INSERT INTO tb_nice_sms_sndng_rspns ( INSERT INTO tb_nice_sms_sndng_rspns (
nice_sms_sndng_requst_id, nice_sms_sndng_requst_id,
trnsc_id, trnsc_id,
@ -299,7 +303,7 @@
sndng_mssage, sndng_mssage,
dsptch_no, dsptch_no,
cttpc_inqire_se, cttpc_inqire_se,
indvdlz_requst_blnk, indvdlz_rspns_blnk,
indvdl_bsnm_cpr_se, indvdl_bsnm_cpr_se,
ihidnum, ihidnum,
nm, nm,
@ -351,4 +355,168 @@
'ENS_SYS' 'ENS_SYS'
) )
</insert> </insert>
<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,
trnsc_id,
spclty_groupcode,
delng_asortcode,
delng_secode,
trsmrcv_at,
trmnl_se,
rspns_code,
partcpt_instt_id,
instt_spclty_manageno,
instt_spclty_trnsmistime,
nice_spclty_manageno,
nice_spclty_trnsmistime,
blnk,
search_pd_from,
search_pd_to,
indvdl_bsnm_cpr_se,
ihidnum,
result_se,
sms_sndng_requst_se,
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,
trnsc_id,
spclty_groupcode,
delng_asortcode,
delng_secode,
trsmrcv_at,
trmnl_se,
rspns_code,
partcpt_instt_id,
instt_spclty_manageno,
instt_spclty_trnsmistime,
nice_spclty_manageno,
nice_spclty_trnsmistime,
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>
<!-- FIXME: oracle인 경우 Insert ALL -->
<insert id="insertNiceSmsSndngInquireResponseRepeat" parameterType="java.util.List">
/** iup-niceci-mapper|insertNiceSmsSndngInquireResponseRepeat-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,
sn,
inqire_dt,
indvdl_bsnm_cpr_se,
ihidnum,
nm,
rank_cttpc_1,
rank_cttpc_2,
rank_cttpc_3,
result_se,
sms_sndng_requst_se,
sndng_mssage,
dsptch_no,
sms_sndng_cttpc_rank,
sms_sndng_cttpc_no,
sms_sndng_dt,
opetr_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>
</mapper> </mapper>

Loading…
Cancel
Save