|
|
@ -30,9 +30,9 @@ import lombok.*;
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* </pre>
|
|
|
|
* </pre>
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public class NiceCiHistoryDTO {
|
|
|
|
public class NiceCiHistoryApiDTO {
|
|
|
|
|
|
|
|
|
|
|
|
@Schema(name = "Request(Nice CI History) DTO", description = "NICE CI 이력 요청 전문 DTO")
|
|
|
|
@Schema(name = "Request(Nice CI History) API DTO", description = "NICE CI API 이력 요청 전문 DTO")
|
|
|
|
@Data
|
|
|
|
@Data
|
|
|
|
@NoArgsConstructor
|
|
|
|
@NoArgsConstructor
|
|
|
|
@AllArgsConstructor
|
|
|
|
@AllArgsConstructor
|
|
|
@ -62,7 +62,7 @@ public class NiceCiHistoryDTO {
|
|
|
|
//----------------------------------------------------------------------------------------------
|
|
|
|
//----------------------------------------------------------------------------------------------
|
|
|
|
@Schema(requiredMode = Schema.RequiredMode.REQUIRED)
|
|
|
|
@Schema(requiredMode = Schema.RequiredMode.REQUIRED)
|
|
|
|
@Valid
|
|
|
|
@Valid
|
|
|
|
NiceCiCommon niceCommon;
|
|
|
|
NiceCiApiCommon niceCommon;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* <pre>
|
|
|
|
* <pre>
|
|
|
@ -243,7 +243,7 @@ public class NiceCiHistoryDTO {
|
|
|
|
//----------------------------------------------------------------------------------------------
|
|
|
|
//----------------------------------------------------------------------------------------------
|
|
|
|
// 공통부 : 100 자리
|
|
|
|
// 공통부 : 100 자리
|
|
|
|
//----------------------------------------------------------------------------------------------
|
|
|
|
//----------------------------------------------------------------------------------------------
|
|
|
|
NiceCiCommon niceCommon;
|
|
|
|
NiceCiApiCommon niceCommon;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* <pre>
|
|
|
|
* <pre>
|
|
|
@ -298,7 +298,7 @@ public class NiceCiHistoryDTO {
|
|
|
|
//----------------------------------------------------------------------------------------------
|
|
|
|
//----------------------------------------------------------------------------------------------
|
|
|
|
// 응답반복부 : 1150 자리
|
|
|
|
// 응답반복부 : 1150 자리
|
|
|
|
//----------------------------------------------------------------------------------------------
|
|
|
|
//----------------------------------------------------------------------------------------------
|
|
|
|
List<NiceCiResult> niceCiResults = new ArrayList<>();
|
|
|
|
List<NiceCiApiResult> niceCiResults = new ArrayList<>();
|
|
|
|
//----------------------------------------------------------------------------------------------
|
|
|
|
//----------------------------------------------------------------------------------------------
|
|
|
|
// 응답반복부 : 1150 자리
|
|
|
|
// 응답반복부 : 1150 자리
|
|
|
|
//----------------------------------------------------------------------------------------------
|
|
|
|
//----------------------------------------------------------------------------------------------
|
|
|
@ -337,7 +337,7 @@ public class NiceCiHistoryDTO {
|
|
|
|
nr.setTrCode(StringUtils.left(tgtString, parseLength[idx]));
|
|
|
|
nr.setTrCode(StringUtils.left(tgtString, parseLength[idx]));
|
|
|
|
tgtString = tgtString.substring(parseLength[idx++]);
|
|
|
|
tgtString = tgtString.substring(parseLength[idx++]);
|
|
|
|
|
|
|
|
|
|
|
|
nr.setNiceCommon(NiceCiCommon.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.setCommonEmptyField(StringUtils.left(tgtString, parseLength[idx]));
|
|
|
@ -355,10 +355,10 @@ public class NiceCiHistoryDTO {
|
|
|
|
if(NiceCiUtils.lengthKr(tgtString) % repeatLength == 0){
|
|
|
|
if(NiceCiUtils.lengthKr(tgtString) % repeatLength == 0){
|
|
|
|
int repeat = NiceCiUtils.lengthKr(tgtString) / repeatLength;
|
|
|
|
int repeat = NiceCiUtils.lengthKr(tgtString) / repeatLength;
|
|
|
|
String finalTgtString = tgtString;
|
|
|
|
String finalTgtString = tgtString;
|
|
|
|
List<NiceCiResult> 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 NiceCiResult.parseHistory(currentString);
|
|
|
|
return NiceCiApiResult.parseHistory(currentString);
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
nr.setNiceCiResults(resResults);
|
|
|
|
nr.setNiceCiResults(resResults);
|
|
|
@ -374,7 +374,7 @@ public class NiceCiHistoryDTO {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
public static void main(String[] args) {
|
|
|
|
NiceCiHistoryDTO.Request ciHisRequest = new NiceCiHistoryDTO.Request();
|
|
|
|
NiceCiHistoryApiDTO.Request ciHisRequest = new NiceCiHistoryApiDTO.Request();
|
|
|
|
ciHisRequest.setTrCode("0000006150");
|
|
|
|
ciHisRequest.setTrCode("0000006150");
|
|
|
|
// // 공통부
|
|
|
|
// // 공통부
|
|
|
|
//
|
|
|
|
//
|
|
|
@ -387,7 +387,7 @@ public class NiceCiHistoryDTO {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 공통부
|
|
|
|
// 공통부
|
|
|
|
NiceCiCommon nc = new NiceCiCommon();
|
|
|
|
NiceCiApiCommon nc = new NiceCiApiCommon();
|
|
|
|
// nc.setGrpCode("grpCode");
|
|
|
|
// nc.setGrpCode("grpCode");
|
|
|
|
//nc.setTrType("Type");
|
|
|
|
//nc.setTrType("Type");
|
|
|
|
nc.setTrClassification("31895"); // 거래구분
|
|
|
|
nc.setTrClassification("31895"); // 거래구분
|
|
|
@ -408,7 +408,7 @@ public class NiceCiHistoryDTO {
|
|
|
|
// 응답반복부
|
|
|
|
// 응답반복부
|
|
|
|
"18401011449211name2 001 "+
|
|
|
|
"18401011449211name2 001 "+
|
|
|
|
"19412341234567이름2 1 ";
|
|
|
|
"19412341234567이름2 1 ";
|
|
|
|
NiceCiHistoryDTO.Response niceResponse = NiceCiHistoryDTO.Response.parse(resStr);
|
|
|
|
NiceCiHistoryApiDTO.Response niceResponse = NiceCiHistoryApiDTO.Response.parse(resStr);
|
|
|
|
System.out.println(niceResponse);
|
|
|
|
System.out.println(niceResponse);
|
|
|
|
//sendNiceSocket();
|
|
|
|
//sendNiceSocket();
|
|
|
|
//serverSocket();
|
|
|
|
//serverSocket();
|