diff --git a/db/mens-iup-query.sql b/db/mens-iup-query.sql index 7113b7c..298c13f 100644 --- a/db/mens-iup-query.sql +++ b/db/mens-iup-query.sql @@ -182,4 +182,7 @@ Values select nvl(max(id), 0) + 1 from IUP.ENS_BILL_HIS -where id = 99999999999999999999 +where id = 99999999999999999999;; + +SELECT * FROM ens_tmplt_mng +where tmplt_cd='A0001'; 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 080aee7..64eedb3 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 @@ -23,7 +23,7 @@ import cokr.xit.ens.modules.nice.model.*; */ @Mapper public interface INiceCiMapper { - List selectNiceCiAcceptTgts(final NiceCiDTO.NiceCiParam niceCiParam); + List selectNiceCiTgts(final NiceCiDTO.NiceCiParam niceCiParam); List selectNiceCiAcceptDatas(final NiceCiDTO.NiceCiParam niceCiParam); int insertBill(final NiceCiDTO.BillDTO billDTO); @@ -32,5 +32,8 @@ public interface INiceCiMapper { int saveBillKko(final NiceCiDTO.BillKkoDTO billKkoDTO); int updatePayUrlOfDataInput(final NiceCiDTO.InputDataXit inputDataXit); int updatePrcsCdOfInputXit(final NiceCiDTO.InputXit inputXit); - Optional selectKkoBpApiUrlFromEnsOrgMng(String orgCd); + Optional selectKkoBpApiUrlFromEnsOrgMng(final String orgCd); + + Optional selectNiceCiRequestId(); + Optional selectTmpltMsg(final String tmpltId); } diff --git a/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiApiCommon.java b/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiApiCommon.java index 18e0efd..6982658 100644 --- a/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiApiCommon.java +++ b/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiApiCommon.java @@ -60,12 +60,12 @@ public class NiceCiApiCommon { /** *
      * 거래구분코드 - 필수 5자리
-     * 단위업무구분코드 "31895" set
+     * 단위업무구분코드 "31896" set
      * 
*/ @Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "거래구분코드(5자리)", example = "31895") @Size(min = 5, max = 5, message = "거래 구분 코드는 5자리 입니다.") - private String trClassification = "31895"; + private String trClassification = "31896"; public void setTrClassification(String trClassification) { this.trClassification = StringUtils.rightPad(nvl(trClassification), 5, StringUtils.SPACE); } @@ -124,7 +124,7 @@ public class NiceCiApiCommon { * */ @Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "참가기관ID(9자리)", example = "503") - @Size(min = 9, max = 9, message = "참가기관ID는 3자리 입니다.") + @Size(min = 9, max = 9, message = "참가기관ID는 9자리 입니다.") private String orgId = StringUtils.rightPad(StringUtils.EMPTY, 9, StringUtils.SPACE); public void setOrgId(String orgId) { this.orgId = StringUtils.rightPad(nvl(orgId), 9, StringUtils.SPACE); diff --git a/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiApiDTO.java b/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiApiDTO.java index ac9e60e..26307c1 100644 --- a/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiApiDTO.java +++ b/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiApiDTO.java @@ -94,8 +94,7 @@ public class NiceCiApiDTO { */ @Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "조회사유", example = " ") @Size(min = 2, max = 2, message = "조회사유는 2자리 입니다") - //@Pattern(regexp = "^\\s{2}$|s{1,2}", message = "조회사유는 2자리 입니다") - private String queryReason = StringUtils.rightPad(StringUtils.EMPTY, 2, StringUtils.SPACE); + private String queryReason = "17"; public void setQueryReason(String queryReason) { this.queryReason = StringUtils.rightPad(nvl(queryReason), 2, StringUtils.SPACE); } @@ -108,9 +107,9 @@ public class NiceCiApiDTO { */ @Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "조회요청건수", example = " ") @Pattern(regexp = "^\\s{2}$|\\d{1,2}", message = "조회요청 최대건수는 48입니다(2자리)") - private String queryReqCnt = StringUtils.rightPad(StringUtils.EMPTY, 2, StringUtils.SPACE); + private String queryReqCnt = "01"; public void setQueryReqCnt(Integer queryReqCnt) { - this.queryReqCnt = StringUtils.rightPad(nvl(queryReqCnt == null? "": queryReqCnt.toString()), 2, StringUtils.SPACE); + this.queryReqCnt = StringUtils.leftPad(nvl(queryReqCnt == null? "": queryReqCnt.toString()), 2, "0"); } /** @@ -125,7 +124,7 @@ public class NiceCiApiDTO { */ @Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "SMS발송요청구분코드", example = " ", allowableValues = {"0", "1", "2", "3"}) @Pattern(regexp = "[0-3]", message = "SMS발송요청구분코드 0 ~ 3 입니다(1자리)") - private String smsSndReqCode = "1"; + private String smsSndReqCode = "3"; /** *
@@ -148,7 +147,7 @@ public class NiceCiApiDTO {
          */
         @Schema(title = "SMS 발신번호", example = " ")
         @Pattern(regexp = "^\\s{12}$|[\\d]{3,12}", message = "SMS 발신번호는 3 ~ 12자리 입니다")
-        private String sndPhoneNo = StringUtils.rightPad(StringUtils.EMPTY, 12, StringUtils.SPACE);
+        private String sndPhoneNo = StringUtils.rightPad("0442113377", 12, StringUtils.SPACE);
         public void setSndPhoneNo(String sndPhoneNo) {
             this.sndPhoneNo = StringUtils.rightPad(nvl(sndPhoneNo), 12, StringUtils.SPACE);
         }
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 6b15986..64dbba2 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
@@ -426,6 +426,33 @@ public class NiceCiDTO {
 
         private String errorCode;
         private String errorMessage;
+    }
+
+    @Schema(name = "TmpltMng DTO", description = "TmpltMng DTO")
+    @Data
+    @NoArgsConstructor
+    @AllArgsConstructor
+    @Builder
+    public static class TmpltMng {
+        private String dtype;
+
+        private String orgCd;
+
+        private String tmpltCd;
+
+        private String title;
+
+        private String message;
+
+        private String useYn;
+
+        private String registId;
+
+        private LocalDateTime registDt;
+
+
+        private String updId;
 
+        private LocalDateTime lastUpdtDt;
     }
 }
diff --git a/src/main/java/cokr/xit/ens/modules/nice/presentation/NiceCiController.java b/src/main/java/cokr/xit/ens/modules/nice/presentation/NiceCiController.java
index 5555914..75c646b 100644
--- a/src/main/java/cokr/xit/ens/modules/nice/presentation/NiceCiController.java
+++ b/src/main/java/cokr/xit/ens/modules/nice/presentation/NiceCiController.java
@@ -27,8 +27,9 @@ import lombok.*;
 @RequiredArgsConstructor
 @RequestMapping(value = "/nice/talk")
 public class NiceCiController {
-    private final NiceCiService niceCiService;
     private final NiceCiAcceptService niceCiAcceptService;
+    private final NiceCiSendBulkService niceCiSendService;
+    private final NiceCiStatBulkService niceCiStatBulkService;
 
     @Operation(summary = "접수")
     @PostMapping(value = "/accept/all", produces = MediaType.APPLICATION_JSON_VALUE)
@@ -39,12 +40,12 @@ public class NiceCiController {
     @Operation(summary = "(대량)전송요청")
     @PostMapping(value = "/send/bulk/all", produces = MediaType.APPLICATION_JSON_VALUE)
     public ResponseEntity sendBulk() {
-        return new ResponseEntity<>(niceCiService.requestSendBulk(), HttpStatus.OK);
+        return new ResponseEntity<>(niceCiSendService.requestSendBulk(), HttpStatus.OK);
     }
 
     @Operation(summary = "(대량)상태조회")
     @PostMapping(value = "/stat/bulk/all", produces = MediaType.APPLICATION_JSON_VALUE)
     public ResponseEntity findBulkStatus() {
-        return new ResponseEntity<>(niceCiService.findBulkStatus(), HttpStatus.OK);
+        return new ResponseEntity<>(niceCiStatBulkService.findBulkStatus(), HttpStatus.OK);
     }
 }
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 14af269..5971c04 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
@@ -88,7 +88,7 @@ public class NiceCiAcceptService {
             .prcsCd(IupPrcsCd.TGRG.getCode())
             .build();
 
-        final List list = niceCiMapper.selectNiceCiAcceptTgts(niceCiParam);
+        final List list = niceCiMapper.selectNiceCiTgts(niceCiParam);
         if(list.isEmpty()){
             return EnsResponseVO.errBuilder()
                 .errCode(EnsErrCd.ERR404)
@@ -112,10 +112,10 @@ public class NiceCiAcceptService {
             .expireAt(DateUtil.getStringFromLocalDate(list.get(0).getExpiresDt(), "yyyyMMddHHmmss"))
             .build();
 
-        final OrgMng orgMng = niceCiMapper.selectKkoBpApiUrlFromEnsOrgMng(list.get(0).getOrgCd())
-            .orElseThrow(() -> new EnsException(EnsErrCd.NO_DATA_FOUND, EnsErrCd.NO_DATA_FOUND.getCodeNm()));
 
         for(NiceCiDTO.InputXit xit : list){
+            final OrgMng orgMng = niceCiMapper.selectKkoBpApiUrlFromEnsOrgMng(xit.getOrgCd())
+                .orElseThrow(() -> new EnsException(EnsErrCd.NO_DATA_FOUND, EnsErrCd.NO_DATA_FOUND.getCodeNm()));
             NiceCiDTO.BillHistDTO billHistDTO = null;
             try {
                 List inputDataXits = xit.getInputDataXits();
diff --git a/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiSendBulkService.java b/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiSendBulkService.java
new file mode 100644
index 0000000..0b89caf
--- /dev/null
+++ b/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiSendBulkService.java
@@ -0,0 +1,203 @@
+package cokr.xit.ens.modules.nice.service;
+
+import java.util.*;
+
+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.common.ctgy.sys.mng.domain.*;
+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.*;
+
+/**
+ * 
+ * description :
+ * packageName : cokr.xit.ens.modules.nice.service
+ * fileName    : NiceCiSendBulkService
+ * author      : limju
+ * date        : 2024 9월 27
+ * ======================================================================
+ * 변경일         변경자        변경 내용
+ * ----------------------------------------------------------------------
+ * 2024 9월 27   limju       최초 생성
+ *
+ * 
+ */ +@Slf4j +@Service +@RequiredArgsConstructor +public class NiceCiSendBulkService { + @Value("${contract.niceCi.orgId}") + private String ORG_ID; + + @Value("${contract.niceCi.clientId}") + private String CLIENT_ID; + + private final NiceCiApiService niceCiApiService; + + 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 requestSendBulk() { + final NiceCiDTO.NiceCiParam niceCiParam = NiceCiDTO.NiceCiParam.builder() + .sendType(IupSendTypeCd.NI.getCode()) + .prcsCd(IupPrcsCd.GRUC.getCode()) + .build(); + + final List list = niceCiMapper.selectNiceCiTgts(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.selectNiceCiAcceptDatas(niceCiParam)); + }); + + for(NiceCiDTO.InputXit xit : list) { + final String tmpltId = xit.getJobCd(); + final NiceCiDTO.TmpltMng tmpltMng = niceCiMapper.selectTmpltMsg(tmpltId) + .orElseThrow(() -> new EnsException(EnsErrCd.NO_DATA_FOUND, EnsErrCd.NO_DATA_FOUND.getCodeNm())); + final String sndMsg = tmpltMng.getMessage().replace("~~@@!!", "#{").replace("!!@@~~", "}"); + + final OrgMng orgMng = niceCiMapper.selectKkoBpApiUrlFromEnsOrgMng(xit.getOrgCd()) + .orElseThrow(() -> new EnsException(EnsErrCd.NO_DATA_FOUND, EnsErrCd.NO_DATA_FOUND.getCodeNm())); + NiceCiDTO.BillHistDTO billHistDTO = null; + + try { + List inputDataXits = xit.getInputDataXits(); + for (NiceCiDTO.InputDataXit data : inputDataXits) { + + // 기관전문관리번호, TB_NICE_SMS_SNDNG_REQUEST + final String niceSmsReqId = niceCiMapper.selectNiceCiRequestId().orElseThrow( + () -> new EnsException(EnsErrCd.MAKE521, EnsErrCd.MAKE521.getCodeNm()) + ); + + + NiceCiApiDTO.Request ciRequest = new NiceCiApiDTO.Request(); + NiceCiApiCommon nc = new NiceCiApiCommon(); + + // 공통부 set + setNiceCiApiRequestCommon(nc, niceSmsReqId); + // 개별부 set + setNiceCiApiPrivateReq(ciRequest, tmpltId, sndMsg); + + NiceCiApiDTO.QueryRequest qr = new NiceCiApiDTO.QueryRequest(); + NiceCiApiDTO.ButtonRequest br = new NiceCiApiDTO.ButtonRequest(); + + ciRequest.setNiceCommon(nc); + ciRequest.getQueryRequests().add(qr); + ciRequest.getButtonRequests().add(br); + + + + + 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.requestSendBulk(ciRequest); + log.info(responseVO.toString()); + return responseVO; + } + } catch (Exception e) { + } + } + return null; + } + + private void setNiceCiApiRequestCommon(final NiceCiApiCommon nc, final String niceSmsReqId) { + //////////////////////////////////////////////////////////// + // 공통부 START + //////////////////////////////////////////////////////////// + //--------------------------------------------------------- + // 공통부 : default start + //--------------------------------------------------------- + // nc.setGrpCode("NICEIF "); // 전문그룹코드 + // nc.setTrType("0200"); // 거래종별코드 + // nc.setTrClassification("31896"); // 거래구분코드 + // nc.setSndAndRcvFlag("B"); // 송수신플래그 + // nc.setDeviceClassification("503"); // 단말기구분 + // nc.setRsltCode(" "); // 응답코드 + // nc.setNiceMngNo(""); // NICE 전문관리번호 + // nc.setNiceSndDt(""); // NICE 전문 전송시간 + // ciRequest.setCommonEmptyField(""); // 공란 - 16자리 + // ciRequest.setQueryConsentReason("1"); // 조회동의사유 + //---------------------------------------------------------- + // 공통부 : default end + //---------------------------------------------------------- + + nc.setOrgId(ORG_ID); // 참가기관ID - property 에서 + nc.setOrgMngNo(niceSmsReqId); // 기관전문관리번호 - LPAD(SEQ_NICE_SMS_SNDNG_REQUST_ID, 10, '0') + nc.setOrgSndDt(DateUtil.getTodayAndNowTime("yyyyMMdd")); // 기관전문전송시간 + //////////////////////////////////////////////////////////// + // 공통부 END + //////////////////////////////////////////////////////////// + } + + private void setNiceCiApiPrivateReq(final NiceCiApiDTO.Request ciRequest, final String tmpltId, final String sndMsg){ + //////////////////////////////////////////////////////////// + // 개별요청부 START + //////////////////////////////////////////////////////////// + //---------------------------------------------------------- + // 개별요청부 : default start + //---------------------------------------------------------- + // ciRequest.setQueryReason("17"); // 조회사유 + // ciRequest.setSmsSndReqCode("3"); // SMS발송요청구분코드 + // ciRequest.setSndPhoneNo("0442113377"); // 발신번호 + // ciRequest.setContactSearchCode("3"); // 연락처 조회 구분 + // ciRequest.setAlimtalkSndReqDiv("1"); // 알림톡발송요청구분코드 + // ciRequest.setBtnReqCnt(1); // 버튼요청건수 + // ciRequest.setPrivateEmptyField(""); // 공란 - 880자리 + //--------------------------------------------------------- + // 개별요청부 : default end + //--------------------------------------------------------- + + ciRequest.setQueryReqCnt(1); // 조회요청건수 + ciRequest.setSndMessage(sndMsg); // 발송메세지 + ciRequest.setAlimtalkTmpltCode(tmpltId); // 알림톡 템플릿 코드 + //////////////////////////////////////////////////////////// + // 개별요청부 END + //////////////////////////////////////////////////////////// + } +} diff --git a/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiService.java b/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiStatBulkService.java similarity index 65% rename from src/main/java/cokr/xit/ens/modules/nice/service/NiceCiService.java rename to src/main/java/cokr/xit/ens/modules/nice/service/NiceCiStatBulkService.java index 3ccc02a..7869fc1 100644 --- a/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiService.java +++ b/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiStatBulkService.java @@ -1,10 +1,14 @@ package cokr.xit.ens.modules.nice.service; +import java.util.*; + 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.code.*; import cokr.xit.ens.modules.nice.cmm.*; import cokr.xit.ens.modules.nice.mapper.*; import cokr.xit.ens.modules.nice.model.*; @@ -16,7 +20,7 @@ import lombok.extern.slf4j.*; *
  * description :
  * packageName : cokr.xit.ens.modules.nice.service
- * fileName    : NiceCiService
+ * fileName    : NiceCiStatBulkService
  * author      : limju
  * date        : 2024 9월 27
  * ======================================================================
@@ -29,7 +33,7 @@ import lombok.extern.slf4j.*;
 @Slf4j
 @Service
 @RequiredArgsConstructor
-public class NiceCiService {
+public class NiceCiStatBulkService {
     @Value("${contract.niceCi.orgId}")
     private String ORG_ID;
 
@@ -61,54 +65,20 @@ public class NiceCiService {
         + "\n"
         + "문의처 : 044-211-3377";
 
-
-    public EnsResponseVO requestSendBulk() {
-        NiceCiApiDTO.Request ciRequest = new NiceCiApiDTO.Request();
-        //ciRequest.setTrCode("0000006150");
-        // // 공통부
-        //
-        // // 개별요청부
-        // nr.setQueryReason(StringUtils.EMPTY);
-        // nr.setQueryReqCnt(46);
-        // nr.setSmsSndReqCode("1");
-        String tmp = NiceCiUtils.rightPadKr(msg, 2000, StringUtils.SPACE);
-        System.out.println(
-            String.format("[%s] kr length - %d, utf-8 length - %d", tmp, NiceCiUtils.lengthKr(tmp), tmp.length()));
-        ciRequest.setSndMessage(msg);
-        // nr.setSndPhoneNo("010");
-        // nr.setContactSearchCode("1");
-
-        // 공통부
-        NiceCiApiCommon nc = new NiceCiApiCommon();
-        // nc.setGrpCode("grpCode");
-        //nc.setTrType("Type");
-        nc.setTrClassification("31895");    // 거래구분
-        nc.setOrgId(ORG_ID);             // 참가기관Id - property 에서
-        nc.setOrgMngNo("0000000103");       // 기관관리번호
-        nc.setOrgSndDt("20240919");
-
-        NiceCiApiDTO.QueryRequest qr = new NiceCiApiDTO.QueryRequest();
-        NiceCiApiDTO.ButtonRequest br = new NiceCiApiDTO.ButtonRequest();
-
-        ciRequest.setNiceCommon(nc);
-        ciRequest.getQueryRequests().add(qr);
-        ciRequest.getButtonRequests().add(br);
-        // nc.setNiceMngNo(StringUtils.EMPTY);
-        // nc.setNiceSndDt(StringUtils.EMPTY);
-        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.requestSendBulk(ciRequest);
-        log.info(responseVO.toString());
-        return responseVO;
-    }
-
     public EnsResponseVO findBulkStatus() {
+        final NiceCiDTO.NiceCiParam niceCiParam = NiceCiDTO.NiceCiParam.builder()
+            .sendType(IupSendTypeCd.NI.getCode())
+            .prcsCd(IupPrcsCd.IPCP.getCode())
+            .build();
+
+        final List list = niceCiMapper.selectNiceCiTgts(niceCiParam);
+        if(list.isEmpty()){
+            return EnsResponseVO.errBuilder()
+                .errCode(EnsErrCd.ERR404)
+                .errMsg(EnsErrCd.ERR404.getCodeNm())
+                .build();
+        }
+
         NiceCiApiHistoryDTO.Request ciRequest = new NiceCiApiHistoryDTO.Request();
         //ciRequest.setTrCode("0000006150");
         // // 공통부
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 f0a1672..0b27a11 100644
--- a/src/main/resources/mybatis-mapper/modules/iup-niceci-mapper.xml
+++ b/src/main/resources/mybatis-mapper/modules/iup-niceci-mapper.xml
@@ -6,8 +6,8 @@
     
     
 
-    
+        /** iup-niceci-mapper|selectNiceCiTgts-NICE CI 대상 조회|julim  */
         SELECT lnk_input_id
              , err_msg
              , expires_dt
@@ -26,6 +26,9 @@
           FROM tb_input_xit
          WHERE send_type = #{sendType}
            AND prcs_cd = #{prcsCd}
+        
+           AND run_dt < sysdate
+        
     
 
     
 
+    
+
+