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 6a272fc..7896660 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 @@ -50,9 +50,9 @@ public class NiceCiDTO { */ @Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "TR Code", example = " ") @Size(min = 10, max = 10, message = "트랜잭션 코드는 10자리 입니다.") - private String trCode = StringUtils.rightPad(StringUtils.EMPTY, 10, StringUtils.SPACE); + private String trCode = StringUtils.EMPTY; public void setTrCode(String trCode) { - this.trCode = StringUtils.rightPad(nvl(trCode), 10, StringUtils.SPACE); + this.trCode = StringUtils.leftPad(nvl(trCode), 10, StringUtils.SPACE); } //---------------------------------------------------------------------------------------------- @@ -232,7 +232,7 @@ public class NiceCiDTO { public String ofString() { StringBuilder sb = new StringBuilder(); - sb.append(trCode); + //sb.append(trCode); // 공통부 sb.append(niceCommon.ofString()); sb.append(commonEmptyField); @@ -252,7 +252,8 @@ public class NiceCiDTO { sb.append(queryRequests.stream().map(QueryRequest::ofString).collect(Collectors.joining())); sb.append(buttonRequests.stream().map(ButtonRequest::ofString).collect(Collectors.joining())); // FIXME: 인코딩확인후 적용 - return NiceCiUtils.covertCharset(sb.toString(), "EUC-KR"); + //return NiceCiUtils.covertCharset(sb.toString(), "EUC-KR"); + return sb.toString(); } // public Request parse(String tgtStr) { @@ -649,7 +650,7 @@ public class NiceCiDTO { public static void main(String[] args) { NiceCiDTO.Request ciRequest = new NiceCiDTO.Request(); - ciRequest.setTrCode("0000006150"); + //ciRequest.setTrCode("0000006150"); // // 공통부 // // // 개별요청부 @@ -698,8 +699,9 @@ public class NiceCiDTO { ciRequest.getButtonRequests().add(br); // nc.setNiceMngNo(StringUtils.EMPTY); // nc.setNiceSndDt(StringUtils.EMPTY); - String fullText = ciRequest.ofString(); - System.out.println(String.format("[%s] %d", fullText, fullText.length())); + 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())); diff --git a/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiHistoryDTO.java b/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiHistoryDTO.java index 6c08b18..f709ec0 100644 --- a/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiHistoryDTO.java +++ b/src/main/java/cokr/xit/ens/modules/nice/model/NiceCiHistoryDTO.java @@ -50,9 +50,9 @@ public class NiceCiHistoryDTO { */ @Schema(requiredMode = Schema.RequiredMode.REQUIRED, title = "TR Code", example = " ") @Size(min = 10, max = 10, message = "트랜잭션 코드는 10자리 입니다.") - private String trCode = StringUtils.rightPad(StringUtils.EMPTY, 10, StringUtils.SPACE); + private String trCode = StringUtils.EMPTY; public void setTrCode(String trCode) { - this.trCode = StringUtils.rightPad(nvl(trCode), 10, StringUtils.SPACE); + this.trCode = StringUtils.leftPad(nvl(trCode), 10, StringUtils.SPACE); } //----------------------------------------------------------------------------------------------