명의이전 상품용 적용

main
박성영 2 weeks ago
parent f5c924ce86
commit c4e5f0419a

@ -0,0 +1,19 @@
유효기간경과 과태료부과대상 리스트
------------------------------------
* 최종등록일이 검사일자보다 늦는 경우는 소유자 및 사용본거지 주소를 재확인하여 주시기 바랍니다. (재검여부 = *일수)
* 전출차량( *차번호)인 경우 전출 전의 주소입니다. 소유자 및 사용본거지 주소를 재확인하여 주시기 바랍니다.
-------------------------------------------------------------------------------------------------------------------------------------------------
검사소 검사일자 자동차번호 소유자명 주민등록번호 차 명 차 종 용 도 종료일 일수 과태료
최종등록일 주 소 유효기간만료일 매매상품용
-------------------------------------------------------------------------------------------------------------------------------------------------
H494 2025-09-01 162고6489 (주)지앤티테크 1244110241315 엠뱅크언더리프 특수차구난형소영업용 2025-08-25 7 4만원
2025-07-14 경기도 용인시 기흥구 강남로 9, 111-111호(신행동, 진주만프라자) 2020-12-05
H494 2025-09-01 271구5475 (주)케이비캐피탈 1301110013499 엠뱅크언더리프 특수차구난형소영업용 2024-09-24 303 60만원
2025-07-14 경기도 용인시 기흥구 강남로 9, 111-111호(신행동, 진주만프라자) 2020-12-05
H494 2025-09-14 142러3779 서찬규 1101110037998 엠뱅크언더리프 특수차구난형소영업용 2025-05-26 109 56만원
2025-07-14 경기도 용인시 기흥구 강남로 9, 111-111호(신행동, 진주만프라자) 2020-12-05

@ -228,6 +228,29 @@ public class DateUtil {
}
}
/**
* (YYYYMMDD -> YY.M.D)
* : 20250903 -> 25.9.3
*
* @param dateStr (yyyyMMdd )
* @return YY.M.D ,
*/
public static String formatToShortDate(String dateStr) {
if (dateStr == null || dateStr.length() != 8) {
return dateStr;
}
try {
String year = dateStr.substring(2, 4); // YY
int month = Integer.parseInt(dateStr.substring(4, 6)); // M (앞의 0 제거)
int day = Integer.parseInt(dateStr.substring(6, 8)); // D (앞의 0 제거)
return year + "." + month + "." + day;
} catch (Exception e) {
return dateStr;
}
}
/**
* LocalDate
* @param date LocalDate

@ -59,14 +59,21 @@ public class ComparisonServiceImpl extends EgovAbstractServiceImpl implements Co
return transferResult;
}
// ========== 2. 상품용 체크 - api-1번호출.소유자명.contains("상품용") ==========
String productUseResult = checkProductUseCase1(existingData);
if (productUseResult != null) {
log.info("========== 비교 로직 종료 (상품용): {} ==========", vhclno);
return productUseResult;
// ========== 2. 상품용 체크 Case1 - api-1번호출.소유자명.contains("상품용") ==========
String productUseResult1 = checkProductUseCase1(existingData);
if (productUseResult1 != null) {
log.info("========== 비교 로직 종료 (상품용-Case1): {} ==========", vhclno);
return productUseResult1;
}
// ========== 3. 향후 추가될 비교 로직들 ==========
// ========== 3. 상품용 체크 Case2 - 명의이전 후 상품용인 경우 ==========
String productUseResult2 = checkProductUseCase2(existingData);
if (productUseResult2 != null) {
log.info("========== 비교 로직 종료 (상품용-Case2): {} ==========", vhclno);
return productUseResult2;
}
// ========== 4. 향후 추가될 비교 로직들 ==========
// String investigationClosedResult = checkInvestigationClosed(existingData);
// if (investigationClosedResult != null) {
// return investigationClosedResult;
@ -268,7 +275,7 @@ public class ComparisonServiceImpl extends EgovAbstractServiceImpl implements Co
log.info("[상품용] 모든 조건 충족! 차량번호: {}, 변경일자: {}", vhclno, targetChgYmd);
// ========== 비고 생성 ==========
String rmrk = buildProductUseRemark(
String rmrk = buildProductUseRemarkCase1(
step1Record, step4Record, targetRecord,
vldPrdExpryYmd, inspEndYmd
);
@ -313,7 +320,8 @@ public class ComparisonServiceImpl extends EgovAbstractServiceImpl implements Co
* CHG_YMD <=
* CHG_YMD
* CHG_TASK_SE_CD == "11" ()
* - 3: 4 API == .contains("상품용")
* 30
* - 3: 4 API .contains("상품용")
*
* @param existingData
* @return 02 () null ()
@ -420,11 +428,6 @@ public class ComparisonServiceImpl extends EgovAbstractServiceImpl implements Co
continue;
}
if (chgDate.isAfter(inspDate)) {
log.debug("[상품용] CHG_YMD > 검사일 - 변경일자: {}, 검사일: {}", chgYmd, inspYmd);
continue;
}
// 가장 마지막 일자 찾기
if (latestChgDate == null || chgDate.isAfter(latestChgDate)) {
latestChgDate = chgDate;
@ -438,6 +441,16 @@ public class ComparisonServiceImpl extends EgovAbstractServiceImpl implements Co
return null;
}
// 조건: 가장 마지막 명의이전일자가 검사일의 30일 이내인지 확인
long daysBetween = java.time.temporal.ChronoUnit.DAYS.between(latestChgDate, inspDate);
if (daysBetween < 0 || daysBetween > 30) {
log.debug("[상품용] 명의이전일자가 검사일의 30일 이내가 아님 - 변경일자: {}, 검사일: {}, 일수차이: {}일",
targetRecord.getChgYmd(), inspYmd, daysBetween);
return null;
}
log.info("[상품용] 명의이전일자가 검사일의 30일 이내 확인 - 변경일자: {}, 검사일: {}, 일수차이: {}일",
targetRecord.getChgYmd(), inspYmd, daysBetween);
String targetChgYmd = targetRecord.getChgYmd();
log.info("[상품용] 조건 충족 레코드 선택! 변경일자: {}, 변경업무: {}", targetChgYmd, targetRecord.getChgTaskSeNm());
@ -458,20 +471,20 @@ public class ComparisonServiceImpl extends EgovAbstractServiceImpl implements Co
log.info("[상품용] Step 4 결과 - 소유자명: {}", step4OwnerName);
// ========== 소유자명 비교 ==========
if (step4OwnerName == null || !step4OwnerName.equals("상품용")) {
log.debug("[상품용] 소유자명 상품용 아님 - Step4 소유자명: {}", step4OwnerName);
// ========== 소유자명 비교 - 상품용 포함 여부 확인 ==========
if (step4OwnerName == null || !step4OwnerName.contains("상품용")) {
log.debug("[상품용] 소유자명에 '상품용' 미포함 - Step4 소유자명: {}", step4OwnerName);
return null;
}
log.info("[상품용] 소유자명 상품용 확인! - 소유자명: {}", step1OwnerName);
log.info("[상품용] 명의이전 시점 소유자명 '상품용' 확인! - 소유자명: {}", step4OwnerName);
log.info("[상품용] 모든 조건 충족! 차량번호: {}, 변경일자: {}", vhclno, targetChgYmd);
// ========== 비고 생성 ==========
String rmrk = buildProductUseRemark(
String rmrk = buildProductUseRemarkCase2(
step1Record, step4Record, targetRecord,
vldPrdExpryYmd, inspEndYmd
vhclno, inspYmd, vldPrdExpryYmd, inspEndYmd
);
// ========== DB 업데이트 ==========
@ -707,7 +720,7 @@ public class ComparisonServiceImpl extends EgovAbstractServiceImpl implements Co
* @param inspEndYmd
* @return
*/
private String buildProductUseRemark(
private String buildProductUseRemarkCase1(
NewBasicResponse.Record step1Record,
NewBasicResponse.Record step4Record,
NewLedgerResponse.Record ledgerRecord,
@ -745,6 +758,63 @@ public class ComparisonServiceImpl extends EgovAbstractServiceImpl implements Co
return sb.toString();
}
/**
* - Case 2 ( , )
*
* :
* (25.9.3.)
* 222283
* -
*
*
*
*
* @param step1Record Step 1 API ( )
* @param step4Record Step 4 API ( = )
* @param ledgerRecord ( )
* @param vhclno
* @param inspYmd
* @param vldPrdExpryYmd
* @param inspEndYmd
* @return
*/
private String buildProductUseRemarkCase2(
NewBasicResponse.Record step1Record,
NewBasicResponse.Record step4Record,
NewLedgerResponse.Record ledgerRecord,
String vhclno,
String inspYmd,
String vldPrdExpryYmd,
String inspEndYmd) {
// 날짜 포맷 변환 (YYYYMMDD -> YY.M.D)
String chgYmdFormatted = DateUtil.formatToShortDate(ledgerRecord.getChgYmd());
String step1OwnerName = nvl(step1Record.getRprsOwnrNm());
StringBuilder sb = new StringBuilder();
// 첫 줄: 명의이전(25.9.3.) 이전소유자 상품용
sb.append("명의이전(").append(chgYmdFormatted).append(") 이전소유자 상품용").append("\n");
// 둘째 줄: 차량번호
sb.append(nvl(vhclno)).append("\n");
// 셋째 줄: 검사기간 시작일자 - 종료일자
sb.append(" - 검사기간: ").append(DateUtil.formatDateString(vldPrdExpryYmd))
.append(" - ").append(DateUtil.formatDateString(inspEndYmd)).append("\n");
// 넷째 줄: 검사일 일자
sb.append(" - 검사일: ").append(DateUtil.formatDateString(inspYmd)).append("\n");
// 다섯째 줄: 명의이전 일자
sb.append(" - 명의이전: ").append(DateUtil.formatDateString(ledgerRecord.getChgYmd())).append("\n");
// 여섯째 줄: 상품용 일자 (명의이전 일자와 동일)
sb.append(" - 상품용: ").append(DateUtil.formatDateString(ledgerRecord.getChgYmd()));
return sb.toString();
}
/**
* null
*/

Loading…
Cancel
Save