3. 날짜 수정 후 부과 체크 - 명의이전 후 상품용인 경우 (31일 초과) 로직 추가

main
박성영 2 weeks ago
parent 83b49b5a9d
commit 65200c68c4

@ -79,6 +79,7 @@ public class ComparisonRemarkBuilder {
* @param inspYmd * @param inspYmd
* @param vldPrdExpryYmd * @param vldPrdExpryYmd
* @param inspEndYmd * @param inspEndYmd
* @param daysBetween
* @return * @return
*/ */
public static String buildCloseProductUseRemark( public static String buildCloseProductUseRemark(
@ -88,7 +89,8 @@ public class ComparisonRemarkBuilder {
String vhclno, String vhclno,
String inspYmd, String inspYmd,
String vldPrdExpryYmd, String vldPrdExpryYmd,
String inspEndYmd) { String inspEndYmd,
long daysBetween) {
// 날짜 포맷 변환 (YYYYMMDD -> YY.M.D) // 날짜 포맷 변환 (YYYYMMDD -> YY.M.D)
String chgYmdFormatted = DateUtil.formatToShortDate(ledgerRecord.getChgYmd()); String chgYmdFormatted = DateUtil.formatToShortDate(ledgerRecord.getChgYmd());
@ -115,37 +117,13 @@ public class ComparisonRemarkBuilder {
// 여섯째 줄: 상품용 일자 (명의이전 일자와 동일) // 여섯째 줄: 상품용 일자 (명의이전 일자와 동일)
sb.append(" - 상품용: ").append(DateUtil.formatDateString(ledgerRecord.getChgYmd())); sb.append(" - 상품용: ").append(DateUtil.formatDateString(ledgerRecord.getChgYmd()));
return sb.toString(); // 일곱째 줄: 일수차이
}
/**
*
*
* :
* : YYYY-MM-DD
* : YYYY-MM-DD
* : N
*
* @param targetChgYmd
* @param inspYmd
* @param daysBetween
* @return
*/
public static String buildDateModifiedLevyRemark(String targetChgYmd, String inspYmd, long daysBetween) {
StringBuilder sb = new StringBuilder();
// 첫 줄: 명의이전일자
sb.append("명의이전일자: ").append(DateUtil.formatDateString(targetChgYmd)).append("\n");
// 둘째 줄: 검사일
sb.append("검사일: ").append(DateUtil.formatDateString(inspYmd)).append("\n");
// 셋째 줄: 일수차이
sb.append("일수차이: ").append(daysBetween).append("일"); sb.append("일수차이: ").append(daysBetween).append("일");
return sb.toString(); return sb.toString();
} }
/** /**
* *
* *

@ -53,40 +53,48 @@ public class ComparisonServiceImpl extends EgovAbstractServiceImpl implements Co
String vhclno = existingData.getVhclno(); String vhclno = existingData.getVhclno();
log.info("========== 비교 로직 시작: {} ==========", vhclno); log.info("========== 비교 로직 시작: {} ==========", vhclno);
// ========== 1. 상품용 체크 Case1 - api-1번호출.소유자명.contains("상품용") ========== // ========== 1. 상품용 체크 - api-1번호출.소유자명.contains("상품용") ==========
String productUseResult1 = checkProductUseCase1(existingData); String productUseResult = checkProductUse(existingData);
if (productUseResult1 != null) { if (productUseResult != null) {
log.info("========== 비교 로직 종료 (상품용-Case1): {} ==========", vhclno); log.info("========== 비교 로직 종료 (상품용): {} ==========", vhclno);
return productUseResult1; return productUseResult;
} }
// ========== 2. 내사종결 상품용 체크명의이전 후 상품용인 경우, 31일 이내 ========== // ========== 2. 내사종결 체크 - 명의이전 이전소유자 상품용, 31일 이내 ==========
String closeUseResult = checkCloseProductUse(existingData); String investigationClosedByProductResult = checkInvestigationClosedByProductUseWithin31Days(existingData);
if (closeUseResult != null) { if (investigationClosedByProductResult != null) {
log.info("========== 비교 로직 종료 (내사종결 : 상품용인데 기간 지나서 검사 받았을 경우): {} ==========", vhclno); log.info("========== 비교 로직 종료 (내사종결 - 명의이전 이전소유자 상품용, 31일 이내): {} ==========", vhclno);
return closeUseResult; return investigationClosedByProductResult;
} }
// ========== 3. 날짜 수정 후 부과 체크 - 명의이전 후 상품용인 경우 (31일 초과) ========== // ========== 3. 내사종결 체크 - 명의이전, 31일 이내 ==========
String dateModifiedLevyResult = checkDateModifiedLevy(existingData); String investigationClosedByOwnerChangeResult = checkInvestigationClosedByOwnerChangeWithin31Days(existingData);
if (dateModifiedLevyResult != null) { if (investigationClosedByOwnerChangeResult != null) {
log.info("========== 비교 로직 종료 (날짜 수정 후 부과 : 상품용인데 기간 많이 지나서 검사 받았을 경우): {} ==========", vhclno); log.info("========== 비교 로직 종료 (내사종결 - 명의이전, 31일 이내): {} ==========", vhclno);
return dateModifiedLevyResult; return investigationClosedByOwnerChangeResult;
} }
// ========== 4. 이첩 체크 ========== // ========== 4. 날짜 수정 후 부과 체크 - 명의이전 이전소유자 상품용, 31일 초과 ==========
String dateModifiedLevyByProductResult = checkDateModifiedLevyByProductUseOver31Days(existingData);
if (dateModifiedLevyByProductResult != null) {
log.info("========== 비교 로직 종료 (날짜 수정 후 부과 - 명의이전 이전소유자, 31일 초과): {} ==========", vhclno);
return dateModifiedLevyByProductResult;
}
// ========== 5. 날짜 수정 후 부과 체크 - 명의이전, 31일 초과 ==========
String dateModifiedLevyByOwnerChangeOverResult = checkDateModifiedLevyByOwnerChangeOver31Days(existingData);
if (dateModifiedLevyByOwnerChangeOverResult != null) {
log.info("========== 비교 로직 종료 (날짜 수정 후 부과 - 명의이전, 31일 초과): {} ==========", vhclno);
return dateModifiedLevyByOwnerChangeOverResult;
}
// ========== 6. 이첩 체크 ==========
String transferResult = checkTransferCase115Day(existingData); String transferResult = checkTransferCase115Day(existingData);
if (transferResult != null) { if (transferResult != null) {
log.info("========== 비교 로직 종료 (이첩): {} ==========", vhclno); log.info("========== 비교 로직 종료 (이첩): {} ==========", vhclno);
return transferResult; return transferResult;
} }
// ========== 5. 향후 추가될 비교 로직들 ==========
// String investigationClosedResult = checkInvestigationClosed(existingData);
// if (investigationClosedResult != null) {
// return investigationClosedResult;
// }
// 모든 비교 로직에 해당하지 않음 // 모든 비교 로직에 해당하지 않음
log.info("========== 비교 로직 종료 (정상): {} ==========", vhclno); log.info("========== 비교 로직 종료 (정상): {} ==========", vhclno);
return null; return null;
@ -96,7 +104,7 @@ public class ComparisonServiceImpl extends EgovAbstractServiceImpl implements Co
// 비교 로직 메서드들 // 비교 로직 메서드들
// ======================================== // ========================================
/** 4 /**
* 1. api-1..contains("상품용") * 1. api-1..contains("상품용")
* *
* API 4: * API 4:
@ -118,7 +126,7 @@ public class ComparisonServiceImpl extends EgovAbstractServiceImpl implements Co
* @param existingData * @param existingData
* @return 02 () null () * @return 02 () null ()
*/ */
private String checkProductUseCase1(CarFfnlgTrgtVO existingData) { private String checkProductUse(CarFfnlgTrgtVO existingData) {
String vhclno = existingData.getVhclno(); String vhclno = existingData.getVhclno();
String inspYmd = existingData.getInspYmd(); String inspYmd = existingData.getInspYmd();
String vldPrdExpryYmd = existingData.getVldPrdExpryYmd(); String vldPrdExpryYmd = existingData.getVldPrdExpryYmd();
@ -315,7 +323,7 @@ public class ComparisonServiceImpl extends EgovAbstractServiceImpl implements Co
} }
/** /**
* 2. not( api-1..contains("상품용") ) * 2. - , 31
* *
* API 4: * API 4:
* 1) (, =) , * 1) (, =) ,
@ -335,7 +343,7 @@ public class ComparisonServiceImpl extends EgovAbstractServiceImpl implements Co
* @param existingData * @param existingData
* @return 04 () null () * @return 04 () null ()
*/ */
private String checkCloseProductUse(CarFfnlgTrgtVO existingData) { private String checkInvestigationClosedByProductUseWithin31Days(CarFfnlgTrgtVO existingData) {
String vhclno = existingData.getVhclno(); String vhclno = existingData.getVhclno();
String inspYmd = existingData.getInspYmd(); String inspYmd = existingData.getInspYmd();
String vldPrdExpryYmd = existingData.getVldPrdExpryYmd(); String vldPrdExpryYmd = existingData.getVldPrdExpryYmd();
@ -495,7 +503,7 @@ public class ComparisonServiceImpl extends EgovAbstractServiceImpl implements Co
// ========== 비고 생성 ========== // ========== 비고 생성 ==========
String rmrk = ComparisonRemarkBuilder.buildCloseProductUseRemark( String rmrk = ComparisonRemarkBuilder.buildCloseProductUseRemark(
step1Record, step4Record, targetRecord, step1Record, step4Record, targetRecord,
vhclno, inspYmd, vldPrdExpryYmd, inspEndYmd vhclno, inspYmd, vldPrdExpryYmd, inspEndYmd, daysBetween
); );
// ========== DB 업데이트 ========== // ========== DB 업데이트 ==========
@ -525,7 +533,7 @@ public class ComparisonServiceImpl extends EgovAbstractServiceImpl implements Co
} }
/** /**
* 3. not( api-1..contains("상품용") ) * 3. - , 31
* *
* API 4: * API 4:
* 1) (, =) , * 1) (, =) ,
@ -545,7 +553,7 @@ public class ComparisonServiceImpl extends EgovAbstractServiceImpl implements Co
* @param existingData * @param existingData
* @return 05 ( ) null () * @return 05 ( ) null ()
*/ */
private String checkDateModifiedLevy(CarFfnlgTrgtVO existingData) { private String checkDateModifiedLevyByProductUseOver31Days(CarFfnlgTrgtVO existingData) {
String vhclno = existingData.getVhclno(); String vhclno = existingData.getVhclno();
String inspYmd = existingData.getInspYmd(); String inspYmd = existingData.getInspYmd();
String vldPrdExpryYmd = existingData.getVldPrdExpryYmd(); String vldPrdExpryYmd = existingData.getVldPrdExpryYmd();
@ -703,8 +711,9 @@ public class ComparisonServiceImpl extends EgovAbstractServiceImpl implements Co
log.info("[날짜수정후부과] 모든 조건 충족! 차량번호: {}, 변경일자: {}", vhclno, targetChgYmd); log.info("[날짜수정후부과] 모든 조건 충족! 차량번호: {}, 변경일자: {}", vhclno, targetChgYmd);
// ========== 비고 생성 ========== // ========== 비고 생성 ==========
String rmrk = ComparisonRemarkBuilder.buildDateModifiedLevyRemark( String rmrk = ComparisonRemarkBuilder.buildCloseProductUseRemark(
targetChgYmd, inspYmd, daysBetween step1Record, step4Record, targetRecord,
vhclno, inspYmd, vldPrdExpryYmd, inspEndYmd, daysBetween
); );
// ========== DB 업데이트 ========== // ========== DB 업데이트 ==========
@ -735,7 +744,7 @@ public class ComparisonServiceImpl extends EgovAbstractServiceImpl implements Co
/** /**
* 2. * 4.
* *
* DAYCNT : * DAYCNT :
* - DAYCNT > 115: -2 ( = + 115) * - DAYCNT > 115: -2 ( = + 115)

Loading…
Cancel
Save