diff --git a/db/mens-iup-query.sql b/db/mens-iup-query.sql index 6850ecc..df8dfe1 100644 --- a/db/mens-iup-query.sql +++ b/db/mens-iup-query.sql @@ -293,3 +293,20 @@ SELECT WHERE send_type = 'NI' AND prcs_cd = 'IPCP'; + + + +SELECT tidx.data_id + , tix.SEND_TYPE + , tix.RUN_DT + , tix.EXPIRES_DT + , '' 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 1=1 + AND tnssr.ihidnum = '8312181111111' -- #{ihidnum} -- 응답받은 주민번호 + -- AND REGEXP_REPLACE(tnssr.sndng_mssage, '[[:space:]]+', '') = REGEXP_REPLACE(#{sndngMssage}, '[[:space:]]+', '') -- 응답받은 발송메시지 diff --git a/src/main/java/cokr/xit/ens/modules/nice/mapper/INiceCiMapper.java b/src/main/java/cokr/xit/ens/modules/nice/mapper/INiceCiMapper.java index cb2b381..0217d2d 100644 --- a/src/main/java/cokr/xit/ens/modules/nice/mapper/INiceCiMapper.java +++ b/src/main/java/cokr/xit/ens/modules/nice/mapper/INiceCiMapper.java @@ -26,6 +26,8 @@ public interface INiceCiMapper { List selectInputXits(final NiceCiDTO.NiceCiParam niceCiParam); List selectInputDataXits(final NiceCiDTO.NiceCiParam niceCiParam); + + // accept ////////////////////////////////////////////////////////// int insertBill(final NiceCiDTO.BillDTO billDTO); int updateBill(final NiceCiDTO.BillDTO billDTO); @@ -34,16 +36,17 @@ public interface INiceCiMapper { int updatePrcsCdAndErrorOfInputXit(final NiceCiDTO.InputXit inputXit); Optional selectKkoBpApiUrlFromEnsOrgMng(final String orgCd); + + // send /////////////////////////////////////////////////////// Optional selectNiceCiRequestId(); Optional selectTmpltMsg(final String tmpltId); int insertNiceSmsSndngRequest(final NiceCiApiSendDTO.Request requestDTO); int insertNiceSmsSndngResponse(final NiceCiApiSendDTO.Response responseDTO); + // status ///////////////////////////////////////////////////////////////////////////// Optional selectFromAndToOfStatusParam(final NiceCiDTO.NiceCiParam niceCiParam); Optional selectNiceCiInqireId(); int insertNiceSmsSndngInquireRequest(final NiceCiApiStatusDTO.Request requestDTO); int insertNiceSmsSndngInquireResponse(final NiceCiApiStatusDTO.Response responseDTO); - int insertNiceSmsSndngInquireResponseRepeat(final List resultList); - int mergeSendResult(final NiceCiDTO.SendResult sendResult); } diff --git a/src/main/java/cokr/xit/ens/modules/nice/mapper/INiceCiBillHistoryMapper.java b/src/main/java/cokr/xit/ens/modules/nice/mapper/INiceCiNewTransactionMapper.java similarity index 60% rename from src/main/java/cokr/xit/ens/modules/nice/mapper/INiceCiBillHistoryMapper.java rename to src/main/java/cokr/xit/ens/modules/nice/mapper/INiceCiNewTransactionMapper.java index 38fdd65..4844539 100644 --- a/src/main/java/cokr/xit/ens/modules/nice/mapper/INiceCiBillHistoryMapper.java +++ b/src/main/java/cokr/xit/ens/modules/nice/mapper/INiceCiNewTransactionMapper.java @@ -1,12 +1,14 @@ package cokr.xit.ens.modules.nice.mapper; +import java.util.*; + import org.apache.ibatis.annotations.*; import cokr.xit.ens.modules.nice.model.*; /** *
- * description :
+ * description : NICE CI 에서 트랜잭션 분리 처리가 필요한 서비스의 mapper
  * packageName : cokr.xit.ens.modules.nice.mapper
  * fileName    : INiceMapper
  * author      : limju
@@ -19,7 +21,13 @@ import cokr.xit.ens.modules.nice.model.*;
  * 
*/ @Mapper -public interface INiceCiBillHistoryMapper { +public interface INiceCiNewTransactionMapper { + // accept int insertBillHistory(final NiceCiDTO.BillHistDTO billHistDTO); int updateBillHistory(final NiceCiDTO.BillHistDTO billHistDTO); + + // status + int insertNiceSmsSndngInquireResponseRepeats(final List resultList); + Optional selectDataIdFromSendResult(final NiceCiApiResult result); + int insertSendResults(final List sendResults); } diff --git a/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiDTO.java b/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiDTO.java index 1e9bcb6..47e85c5 100644 --- a/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiDTO.java +++ b/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiDTO.java @@ -529,5 +529,7 @@ public class NiceCiDTO { private String regId; private LocalDateTime regDt; + + private String ihidnum; } } diff --git a/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiAcceptService.java b/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiAcceptService.java index 8a79e8e..dc1f7f3 100644 --- a/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiAcceptService.java +++ b/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiAcceptService.java @@ -55,7 +55,7 @@ public class NiceCiAcceptService { private String BILL_PAYREUSLT_URL; private final KeySequenceService keySequenceService; - private final NiceCiBillHistoryService billHistoryService; + private final NiceCiNewTransactionService billHistoryService; private final INiceCiMapper niceCiMapper; private final BillKkoPayApiSpec billKkoPayApi; diff --git a/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiBillHistoryService.java b/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiBillHistoryService.java deleted file mode 100644 index 4e91432..0000000 --- a/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiBillHistoryService.java +++ /dev/null @@ -1,40 +0,0 @@ -package cokr.xit.ens.modules.nice.service; - -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.*; - -/** - *
- * description :
- * packageName : cokr.xit.ens.modules.nice.service
- * fileName    : NiceCiBillHistoryService
- * author      : limju
- * date        : 2024 9월 27
- * ======================================================================
- * 변경일         변경자        변경 내용
- * ----------------------------------------------------------------------
- * 2024 9월 27   limju       최초 생성
- *
- * 
- */ -@Slf4j -@Service -@RequiredArgsConstructor -public class NiceCiBillHistoryService { - private final INiceCiBillHistoryMapper mapper; - - @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); - } -} diff --git a/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiNewTransactionService.java b/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiNewTransactionService.java new file mode 100644 index 0000000..5a6b555 --- /dev/null +++ b/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiNewTransactionService.java @@ -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.*; + +/** + *
+ * description : NICE CI 에서 트랜잭션 분리 처리가 필요한 서비스
+ * packageName : cokr.xit.ens.modules.nice.service
+ * fileName    : NiceCiNewTransactionService
+ * author      : limju
+ * date        : 2024 9월 27
+ * ======================================================================
+ * 변경일         변경자        변경 내용
+ * ----------------------------------------------------------------------
+ * 2024 9월 27   limju       최초 생성
+ *
+ * 
+ */ +@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 findDataIdFromSendResult(final NiceCiApiResult result){ + return mapper.selectDataIdFromSendResult(result); + } + + @Transactional(propagation = Propagation.REQUIRES_NEW) + public int insertNiceSmsSndngInquireResponseRepeats(final List resultList){ + return mapper.insertNiceSmsSndngInquireResponseRepeats(resultList); + } + + @Transactional(propagation = Propagation.REQUIRES_NEW) + public int insertSendResults(final List sendResults){ + return mapper.insertSendResults(sendResults); + } + // status ///////////////////////////////////////////////////// +} diff --git a/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiStatBulkService.java b/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiStatBulkService.java index df3a653..32f32b1 100644 --- a/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiStatBulkService.java +++ b/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiStatBulkService.java @@ -1,7 +1,6 @@ package cokr.xit.ens.modules.nice.service; import java.util.*; -import java.util.stream.*; import org.apache.commons.lang3.*; import org.springframework.beans.factory.annotation.Value; @@ -43,6 +42,7 @@ public class NiceCiStatBulkService { private boolean IS_STATUS_FAIL; private final NiceCiApiService niceCiApiService; + private final NiceCiNewTransactionService niceCiNewTransactionService; private final INiceCiMapper niceCiMapper; @@ -63,91 +63,60 @@ public class NiceCiStatBulkService { * @return EnsResponseVO * */ - public EnsResponseVO findBulkStatus() { - final NiceCiDTO.NiceCiParam niceCiParam = NiceCiDTO.NiceCiParam.builder() - .sendType(IupSendTypeCd.NI.getCode()) - .prcsCd(IupPrcsCd.IPCP.getCode()) - .build(); - - final List list = niceCiMapper.selectInputXits(niceCiParam); - if(list.isEmpty()){ + 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()) + .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.ERR404) - .errMsg(EnsErrCd.ERR404.getCodeNm()) + .errCode(EnsErrCd.ERR999) + .errMsg(e.getMessage()) .build(); - } - - list.forEach(d -> { - niceCiParam.setLnkInputId(d.getLnkInputId()); - d.setInputDataXits(niceCiMapper.selectInputDataXits(niceCiParam)); - }); - - for(NiceCiDTO.InputXit xit : list) { - - - try { - List inputDataXits = xit.getInputDataXits(); - NiceCiDTO.SendResult sendResult = null; - - for (NiceCiDTO.InputDataXit data : inputDataXits) { - - // 기관전문관리번호, 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(niceCiParam) - .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, - xit, - data - //sendResult - ); - if(totCo == 0) totCo = Integer.parseInt(resDTO.getTotCo()); - repeat += 100; - } while(totCo > 100 && totCo > repeat); - - - } - } 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); - } + } catch (Exception e) { + log.error("NICE CI Status 조회 ERROR::{}", e.getMessage()); + return EnsResponseVO.errBuilder() + .errCode(EnsErrCd.ERR999) + .errMsg(e.getMessage()) + .build(); } - return EnsResponseVO.okBuilder() - //.resultInfo(niceCiMapper.selectAcceptTgts(null)) - .build(); + return EnsResponseVO.okBuilder() + //.resultInfo(niceCiMapper.selectAcceptTgts(null)) + .build(); } /** @@ -176,7 +145,8 @@ public class NiceCiStatBulkService { //---------------------------------------------------------- nCommon.setDelngSecode("31893"); // 거래구분코드 nCommon.setPartcptInsttId(ORG_ID); // 참가기관ID - property 에서 - nCommon.setInsttSpcltyManageno(niceSmsReqId); // 기관전문관리번호 - LPAD(SEQ_NICE_SMS_SNDNG_REQUST_ID, 10, '0') + 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자리 //////////////////////////////////////////////////////////// @@ -184,12 +154,11 @@ public class NiceCiStatBulkService { //////////////////////////////////////////////////////////// } - /** * 개별요청부 set * @param ciRequest NiceCiApiDTO.Request */ - private void setNiceCiApiPrivateReq(final NiceCiApiStatusDTO.Request ciRequest){ + private void setNiceCiApiPrivateReq(final NiceCiApiStatusDTO.Request ciRequest) { //////////////////////////////////////////////////////////// // 개별요청부 START //////////////////////////////////////////////////////////// @@ -231,34 +200,21 @@ public class NiceCiStatBulkService { } private NiceCiApiStatusDTO.Response repeatStatusBulk( - NiceCiApiStatusDTO.Request ciRequest, - NiceCiDTO.InputXit xit, - NiceCiDTO.InputDataXit data){ + 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()) - ); + final String niceSmsInqId = niceCiMapper.selectNiceCiInqireId() + .orElseThrow(() -> new EnsException(EnsErrCd.MAKE521, EnsErrCd.MAKE521.getCodeNm()) + ); //---------------------------------------------------------- - // API Call 전처리 START - request & 결과테이블 저장 + // API Call 전처리 START - request //---------------------------------------------------------- ciRequest.setNiceSmsSndngInqireId(niceSmsInqId); niceCiMapper.insertNiceSmsSndngInquireRequest(ciRequest); - - NiceCiDTO.SendResult sendResult = NiceCiDTO.SendResult.builder() - .lnkInputId(xit.getLnkInputId()) - .dataId(data.getDataId()) - .prcsOdr("1") - .sendType(xit.getSendType()) - .runDt(xit.getRunDt()) - .expiresDt(xit.getExpiresDt()) - .prcsYn("N") - .build(); - - // 결과 테이블 데이타 생성 or update - niceCiMapper.mergeSendResult(sendResult); //---------------------------------------------------------- - // API Call 전처리 END - request & 결과테이블 저장 + // API Call 전처리 END - request //---------------------------------------------------------- //---------------------------------------------------------- @@ -281,17 +237,33 @@ public class NiceCiStatBulkService { niceCiMapper.insertNiceSmsSndngInquireResponse(resDTO); // API response 반복부 저장 - niceCiMapper.insertNiceSmsSndngInquireResponseRepeat( - resDTO.getNiceCiResults() - .stream().peek(d -> d.setNiceSmsSndngInqireId(niceSmsInqId)) - .collect(Collectors.toList())); - - - // FIXME: 아래 값으로 set - //mssageSndngResultSe 1 -> TALK_SEND, 2 -> SMS_SEND, FAIL - // 결과 테이블 데이타 update - sendResult.setSendSttusCd(""); - niceCiMapper.mergeSendResult(sendResult); + List results = resDTO.getNiceCiResults(); + List sendResults = new ArrayList<>(); + for (NiceCiApiResult result : results) { + 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::{}", e.getMessage()); + } + } + } + niceCiNewTransactionService.insertNiceSmsSndngInquireResponseRepeats(results); + if(!sendResults.isEmpty()) niceCiNewTransactionService.insertSendResults(sendResults); //---------------------------------------------------------- // API Call 후처리 END - response & 결과테이블 저장 //---------------------------------------------------------- diff --git a/src/main/java/cokr/xit/ens/modules/nice/service/support/NiceCiApiService.java b/src/main/java/cokr/xit/ens/modules/nice/service/support/NiceCiApiService.java index ddb12b0..23516af 100644 --- a/src/main/java/cokr/xit/ens/modules/nice/service/support/NiceCiApiService.java +++ b/src/main/java/cokr/xit/ens/modules/nice/service/support/NiceCiApiService.java @@ -162,6 +162,7 @@ public class NiceCiApiService { throw new EnsException(EnsErrCd.API_COMM_ERROR, "NICE CI Socket 서버 응답 시간 초과"); } catch (IOException e) { + log.error("NICE CI Socket 서버 응답 시간 초과: " + e.getMessage()); throw new EnsException(EnsErrCd.API_COMM_ERROR, e.getMessage()); } return rtnMsg; diff --git a/src/main/resources/mybatis-mapper/modules/iup-niceci-bill-history-mapper.xml b/src/main/resources/mybatis-mapper/modules/iup-niceci-bill-history-mapper.xml deleted file mode 100644 index bdc05c8..0000000 --- a/src/main/resources/mybatis-mapper/modules/iup-niceci-bill-history-mapper.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - /** iup-niceci-bill-history-mapper|insertBillHistory-Bill API(NICE CI) call history save|julim */ - - SELECT NVL(MAX(id), 0) + 1 - FROM ens_bill_his - - INSERT INTO ens_bill_his ( - id, - linked_uuid, - org_cd, - req_se, - bill_se, - request_data, - regist_dt - ) VALUES ( - #{id}, - #{linkedUuid}, - #{orgCd}, - #{reqSe}, - #{billSe}, - #{requestData}, - sysdate - ) - - - - /** iup-niceci-bill-history-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} - - diff --git a/src/main/resources/mybatis-mapper/modules/iup-niceci-mapper.xml b/src/main/resources/mybatis-mapper/modules/iup-niceci-mapper.xml index 6add527..f09df7f 100644 --- a/src/main/resources/mybatis-mapper/modules/iup-niceci-mapper.xml +++ b/src/main/resources/mybatis-mapper/modules/iup-niceci-mapper.xml @@ -377,6 +377,7 @@ WHERE send_type = #{sendType} AND prcs_cd = #{prcsCd} + + /** 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:]]+', '') -- 응답받은 발송메시지 + + + + /** iup-new-transaction-mapper|insertSendResults-nice ci 전송 상태 조회 결과 생성|julim */ + + + INTO tb_send_result ( + lnk_input_id, + data_id, + run_dt, + send_type, + expires_dt, + biz_err_msg, + prcs_yn, + reg_dt, + reg_id + ) VALUES ( + #{lnkInputId} + , #{dataId} + , #{runDt} + , #{sendType} + , #{expiresDt} + , #{bizErrMsg} + , #{prcsYn} + , sysdate + , 'ENS_SYS' + ) + + + + + + +