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 947f0ea..18e0efd 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 @@ -256,34 +256,4 @@ public class NiceCiApiCommon { private static String nvl(String src){ return StringUtils.defaultIfEmpty(src, StringUtils.EMPTY); } - - public static void main(String[] args) { - NiceCiHistoryApiDTO.Request nr = new NiceCiHistoryApiDTO.Request(); - nr.setTrCode("0000006150"); - // // 공통부 - // - // // 개별요청부 - // nr.setQueryReason(StringUtils.EMPTY); - // nr.setQueryReqCnt(46); - // nr.setSmsSndReqCode("1"); - - // nr.setSndPhoneNo("010"); - // nr.setContactSearchCode("1"); - - - // 공통부 - NiceCiApiCommon nc = new NiceCiApiCommon(); - // nc.setGrpCode("grpCode"); - //nc.setTrType("Type"); - nc.setTrClassification("31895"); // 거래구분 - nc.setOrgId("Z755400"); // 참가기관Id - property 에서 - nc.setOrgMngNo("0000000103"); // 기관관리번호 - nc.setOrgSndDt("20240919"); - - System.out.println(NiceCiApiCommon.parse(nc.ofString())); - //sendNiceSocket(); - //serverSocket(); - } - - } 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 a201c74..ac9e60e 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 @@ -450,21 +450,6 @@ public class NiceCiApiDTO { // 응답반복부 : 110 자리 //---------------------------------------------------------------------------------------------- - // public String ofString() { - // StringBuilder sb = new StringBuilder(); - // sb.append(trCode); - // sb.append(niceCommon.ofString()); - // sb.append(commonEmptyField); - // sb.append(resCnt); - // sb.append(smsSndReqCode); - // sb.append(sndMessage); - // sb.append(sndPhoneNo); - // sb.append(contactSearchCode); - // sb.append(privateEmptyField); - // sb.append(resResults.stream().map(ResResult::ofString).collect(Collectors.joining())); - // return sb.toString(); - // } - public static Response parse(String tgtString) { final int repeatLength = 110; final int[] parseLength = { @@ -650,78 +635,6 @@ public class NiceCiApiDTO { } } - public static void main(String[] args) { - NiceCiApiDTO.Request ciRequest = new NiceCiApiDTO.Request(); - //ciRequest.setTrCode("0000006150"); - // // 공통부 - // - // // 개별요청부 - // nr.setQueryReason(StringUtils.EMPTY); - // nr.setQueryReqCnt(46); - // nr.setSmsSndReqCode("1"); - ciRequest.setSndMessage("민자도로 관리지원센터에서 김해찬님께 발송한 미납통행료 고지서가 도착했습니다.\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"); - // nr.setSndPhoneNo("010"); - // nr.setContactSearchCode("1"); - - - // 공통부 - NiceCiApiCommon nc = new NiceCiApiCommon(); - // nc.setGrpCode("grpCode"); - //nc.setTrType("Type"); - nc.setTrClassification("31895"); // 거래구분 - nc.setOrgId("Z755400"); // 참가기관Id - property 에서 - nc.setOrgMngNo("0000000103"); // 기관관리번호 - nc.setOrgSndDt("20240919"); - - QueryRequest qr = new QueryRequest(); - ButtonRequest br = new 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 resStr = "trCode " + - // NiceCommon - "NICEIF 020031895B503rsltorgId orgMngNo orgSndDt niceMngNo niceSndDt" + - " "+ - // 개별응답부 - "241~~~~~~~~~~~~~~~~~~~~~~~ 010 1 "+ - // 응답반복부 - "18401011449211name2 001 "+ - "19412341234567이름2 1 "; - NiceCiApiDTO.Response niceResponse = NiceCiApiDTO.Response.parse(resStr); - System.out.println(niceResponse); - //sendNiceSocket(); - //serverSocket(); - } - private static String nvl(String src){ return StringUtils.defaultIfEmpty(src, StringUtils.EMPTY); } diff --git a/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiHistoryApiDTO.java b/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiApiHistoryDTO.java similarity index 76% rename from src/main/java/cokr/xit/ens/modules/nice/model/NiceCiHistoryApiDTO.java rename to src/main/java/cokr/xit/ens/modules/nice/model/NiceCiApiHistoryDTO.java index 627c438..6e4bba7 100644 --- a/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiHistoryApiDTO.java +++ b/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiApiHistoryDTO.java @@ -30,7 +30,7 @@ import lombok.*; * * */ -public class NiceCiHistoryApiDTO { +public class NiceCiApiHistoryDTO { @Schema(name = "Request(Nice CI History) API DTO", description = "NICE CI API 이력 요청 전문 DTO") @Data @@ -303,21 +303,6 @@ public class NiceCiHistoryApiDTO { // 응답반복부 : 1150 자리 //---------------------------------------------------------------------------------------------- - // public String ofString() { - // StringBuilder sb = new StringBuilder(); - // sb.append(trCode); - // sb.append(niceCommon.ofString()); - // sb.append(commonEmptyField); - // sb.append(resCnt); - // sb.append(smsSndReqCode); - // sb.append(sndMessage); - // sb.append(sndPhoneNo); - // sb.append(contactSearchCode); - // sb.append(privateEmptyField); - // sb.append(resResults.stream().map(ResResult::ofString).collect(Collectors.joining())); - // return sb.toString(); - // } - public static Response parse(String tgtString) { final int repeatLength = 1150; final int[] parseLength = { @@ -372,45 +357,4 @@ public class NiceCiHistoryApiDTO { private static String nvl(String src){ return StringUtils.defaultIfEmpty(src, StringUtils.EMPTY); } - - public static void main(String[] args) { - NiceCiHistoryApiDTO.Request ciHisRequest = new NiceCiHistoryApiDTO.Request(); - ciHisRequest.setTrCode("0000006150"); - // // 공통부 - // - // // 개별요청부 - // ciHisRequest.setQueryReason(StringUtils.EMPTY); - // ciHisRequest.setQueryReqCnt(46); - // ciHisRequest.setSmsSndReqCode("1"); - // ciHisRequest.setSndPhoneNo("010"); - // ciHisRequest.setContactSearchCode("1"); - - - // 공통부 - NiceCiApiCommon nc = new NiceCiApiCommon(); - // nc.setGrpCode("grpCode"); - //nc.setTrType("Type"); - nc.setTrClassification("31895"); // 거래구분 - nc.setOrgId("Z755400"); // 참가기관Id - property 에서 - nc.setOrgMngNo("0000000103"); // 기관관리번호 - nc.setOrgSndDt("20240919"); - - String fullText = ciHisRequest.ofString(); - System.out.println(String.format("[%s] %d", fullText, fullText.length())); - - - String resStr = "trCode " + - // NiceCommon - "NICEIF 020031895B503rsltorgId orgMngNo orgSndDt niceMngNo niceSndDt" + - " "+ - // 개별응답부 - "241~~~~~~~~~~~~~~~~~~~~~~~ 010 1 "+ - // 응답반복부 - "18401011449211name2 001 "+ - "19412341234567이름2 1 "; - NiceCiHistoryApiDTO.Response niceResponse = NiceCiHistoryApiDTO.Response.parse(resStr); - System.out.println(niceResponse); - //sendNiceSocket(); - //serverSocket(); - } } diff --git a/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiApiResult.java b/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiApiResult.java index f6b4c7a..00a357e 100644 --- a/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiApiResult.java +++ b/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiApiResult.java @@ -236,22 +236,6 @@ public class NiceCiApiResult { this.emptyField = StringUtils.trim(emptyField); } - // public String ofString() { - // StringBuilder sb = new StringBuilder(); - // sb.append(idDiv); - // sb.append(jumin); - // sb.append(name); - // sb.append(contractOf1st); - // sb.append(contractOf2nd); - // sb.append(contractOf3rd); - // sb.append(rsltDivCode); - // sb.append(smsSndContractOrder); - // sb.append(smsSndContractNo); - // sb.append(smsSndWillDt); - // sb.append(emptyField); - // return sb.toString(); - // } - public static NiceCiApiResult parse(String tgtString) { // 110 자리 final int[] parseLength = { diff --git a/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiService.java b/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiService.java index 39b63c2..6269fd8 100644 --- a/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiService.java +++ b/src/main/java/cokr/xit/ens/modules/nice/service/NiceCiService.java @@ -111,7 +111,7 @@ public class NiceCiService { } public EnsResponseVO findBulkStatus() { - NiceCiHistoryApiDTO.Request ciRequest = new NiceCiHistoryApiDTO.Request(); + NiceCiApiHistoryDTO.Request ciRequest = new NiceCiApiHistoryDTO.Request(); //ciRequest.setTrCode("0000006150"); // // 공통부 // 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 4e539ef..34d1f6f 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 @@ -86,9 +86,9 @@ public class NiceCiApiService { .build(); } - public EnsResponseVO findBulkStatus(final NiceCiHistoryApiDTO.Request reqDTO) { + public EnsResponseVO findBulkStatus(final NiceCiApiHistoryDTO.Request reqDTO) { List errors = new ArrayList<>(); - final Set> list = validator.validate(reqDTO); + final Set> list = validator.validate(reqDTO); if (!list.isEmpty()) { errors.addAll(list.stream() .map(row -> String.format("%s=%s", row.getPropertyPath(), row.getMessageTemplate())) @@ -116,7 +116,7 @@ public class NiceCiApiService { .errMsg(e.getMessage()) .build(); } - NiceCiHistoryApiDTO.Response resDTO = NiceCiHistoryApiDTO.Response.parse(rtnMsg); + NiceCiApiHistoryDTO.Response resDTO = NiceCiApiHistoryDTO.Response.parse(rtnMsg); return EnsResponseVO.okBuilder() .resultInfo(resDTO) .build();