diff --git a/docs/미필-샘플용-utf-8-0.prn b/docs/미필-샘플용-utf-8-0.prn index f2fb940..2e3aa9a 100644 --- a/docs/미필-샘플용-utf-8-0.prn +++ b/docs/미필-샘플용-utf-8-0.prn @@ -13,7 +13,7 @@ 670406-1777778 5층(죽전동) 4 33고3355 주식회사 올놀카(상품용) C220 d 4Matic 경기도 용인시 기흥구 중부대로 255 2023-07-12~2025-07-11 134511-0327770 A동 3층 S367호(영덕동, 오토허브) - 5 65조4444 정문치 레이 경기도 용인시 기흥구 흥덕4로15번길 23-55 2021-07-12~2025-07-11 + 5 65조4444 정문치 레이 경기도 용인시 기흥구 흥덕4로15번길 23-55 2021-07-12~2025-07-11 791203-1067771 304호(영덕동) 6 88조8888 고영유 그랜저(GRANDEUR) 경기도 용인시 수지구 성복2로 555 2023-07-12~2025-07-11 900426-1087772 2층 204호(성복동) diff --git a/src/main/java/go/kr/project/carInspectionPenalty/registrationOm/service/impl/CarFfnlgTrgtIncmpServiceImpl.java b/src/main/java/go/kr/project/carInspectionPenalty/registrationOm/service/impl/CarFfnlgTrgtIncmpServiceImpl.java index da90dad..b7c5834 100644 --- a/src/main/java/go/kr/project/carInspectionPenalty/registrationOm/service/impl/CarFfnlgTrgtIncmpServiceImpl.java +++ b/src/main/java/go/kr/project/carInspectionPenalty/registrationOm/service/impl/CarFfnlgTrgtIncmpServiceImpl.java @@ -570,17 +570,38 @@ public class CarFfnlgTrgtIncmpServiceImpl extends EgovAbstractServiceImpl implem byte[] firstBytes = firstLine.getBytes(encoding); int pos = 0; + // 디버깅: 첫 30바이트 출력 + log.debug("=== 바이트 디버깅 ==="); + log.debug("firstLine 원본: [{}]", firstLine); + log.debug("firstBytes 길이: {}", firstBytes.length); + int debugLen = Math.min(30, firstBytes.length); + byte[] debugBytes = new byte[debugLen]; + System.arraycopy(firstBytes, 0, debugBytes, 0, debugLen); + log.debug("첫 30바이트: [{}]", new String(debugBytes, encoding)); + for (int k = 0; k < debugLen; k++) { + log.debug(" [{}] byte={}, char=[{}]", k, firstBytes[k], new String(new byte[]{firstBytes[k]}, encoding)); + } + // 번호 + log.debug("parseConfig 정보: encoding={}, hangulByteSize={}", parseConfig.getEncoding(), parseConfig.getHangulByteSize()); + log.debug("byteSize2={}, byteSize3={}", parseConfig.getByteSize2(), parseConfig.getByteSize3()); + if (parseConfig.getByteSize2() != null) { + log.debug("byteSize2.firstLine={}", parseConfig.getByteSize2().getFirstLine()); + } int len = parseConfig.getFirstLineLength("no"); + log.debug("번호 읽기: pos={}, len={}", pos, len); String no = extractByteLength(firstBytes, pos, len, encoding).trim(); + log.debug("번호 결과: [{}] (trim 전: [{}])", no, extractByteLength(firstBytes, pos, len, encoding)); pos += len; // 차량번호 len = parseConfig.getFirstLineLength("vhclno"); + log.debug("차량번호 읽기: pos={}, len={}", pos, len); String vhclno = extractByteLength(firstBytes, pos, len, encoding).trim(); + log.debug("차량번호 결과: [{}] (trim 전: [{}])", vhclno, extractByteLength(firstBytes, pos, len, encoding)); pos += len; - // 소유자명 (주민번호 빈칸 포함 32바이트) + // 소유자명 (주민번호 빈칸 포함 35바이트) len = parseConfig.getFirstLineLength("ownr-nm"); String ownrNm = extractByteLength(firstBytes, pos, len, encoding).trim(); pos += len; diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index d5be76b..abb3bbf 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -159,26 +159,26 @@ car-ffnlg-prn-parse: # ===== 2바이트 환경 설정 (EUC-KR, MS949) ===== byte-size-2: first-line: # 첫째줄 필드별 바이트 길이 (2바이트 기준) - no: 6 # 번호 - vhclno: 14 # 차량번호 + "no": 6 # 번호 (따옴표 필수: YAML에서 no는 false로 해석됨) + vhclno: 16 # 차량번호 ownr-nm: 32 # 소유자명 (주민번호 빈칸 포함) car-nm: 22 # 자동차명 - use-strhld-addr: 62 # 사용본거지주소 - insp-vld-prd: 23 # 검사유효기간 + use-strhld-addr: 61 # 사용본거지주소 + insp-vld-prd: 21 # 검사유효기간 second-line: # 둘째줄 필드별 바이트 길이 (2바이트 기준) skip: 38 # 공백 (스킵) rrno: 16 # 주민등록번호 use-strhld-addr: -1 # 사용본거지주소 (나머지 전체) - + # ===== 3바이트 환경 설정 (UTF-8) ===== byte-size-3: first-line: # 첫째줄 필드별 바이트 길이 (3바이트 기준) - no: 6 # 번호 - vhclno: 14 # 차량번호 + "no": 6 # 번호 (따옴표 필수: YAML에서 no는 false로 해석됨) + vhclno: 16 # 차량번호 ownr-nm: 32 # 소유자명 (주민번호 빈칸 포함) car-nm: 22 # 자동차명 - use-strhld-addr: 62 # 사용본거지주소 - insp-vld-prd: 23 # 검사유효기간 + use-strhld-addr: 61 # 사용본거지주소 + insp-vld-prd: 21 # 검사유효기간 second-line: # 둘째줄 필드별 바이트 길이 (3바이트 기준) skip: 38 # 공백 (스킵) rrno: 16 # 주민등록번호 diff --git a/src/main/webapp/WEB-INF/views/carInspectionPenalty/registrationOm/list.jsp b/src/main/webapp/WEB-INF/views/carInspectionPenalty/registrationOm/list.jsp index b0f775a..1b1dfa5 100644 --- a/src/main/webapp/WEB-INF/views/carInspectionPenalty/registrationOm/list.jsp +++ b/src/main/webapp/WEB-INF/views/carInspectionPenalty/registrationOm/list.jsp @@ -28,11 +28,6 @@ ~ -