|
@@ -31,6 +31,8 @@ public class FinanceTimedTask {
|
|
|
@Autowired
|
|
|
private IZcFinanceProductService iZcFinanceProductService;
|
|
|
@Autowired
|
|
|
+ private IZcFinanceRecordService zcFinanceRecordService;
|
|
|
+ @Autowired
|
|
|
private FinanceTimedTaskService financeTimedTaskService;
|
|
|
@Autowired
|
|
|
private RemoteSystemService remoteSystemService;
|
|
@@ -280,6 +282,37 @@ public class FinanceTimedTask {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ /**
|
|
|
+ * 融资还款逾期定时跑批
|
|
|
+ */
|
|
|
+ //每十分钟
|
|
|
+// @Scheduled(cron = "0 */10 * * * ?")
|
|
|
+ //每天凌晨一点
|
|
|
+ @Scheduled(cron = "0 0 1 * * ?")
|
|
|
+ private void recordStatus() throws Exception{
|
|
|
+ Map map = new HashMap();
|
|
|
+ List<Map> list = financeTimedTaskService.selectFinanceInfRecord(map);
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
+ //融资纪录id
|
|
|
+ String zfrId = CommonUtil.objToString(list.get(i).get("zfrId"));
|
|
|
+ //承诺还款时间
|
|
|
+ String zfrRepaymentDate = CommonUtil.objToString(list.get(i).get("zfrRepaymentDate"));
|
|
|
+ //String 转 Date
|
|
|
+ SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");//注意月份是MM
|
|
|
+ Date date = simpleDateFormat.parse(zfrRepaymentDate);
|
|
|
+ //取得指定时间间隔后的系统时间
|
|
|
+ GregorianCalendar calendar = (GregorianCalendar) Calendar.getInstance();
|
|
|
+ calendar.add( Calendar.DAY_OF_MONTH, 0);
|
|
|
+ System.out.println("比较时间"+simpleDateFormat.format(calendar.getTime()));
|
|
|
+ System.out.println("还款时间"+simpleDateFormat.format(date));
|
|
|
+ if(simpleDateFormat.format(calendar.getTime()).compareTo(simpleDateFormat.format(date))>0){
|
|
|
+ ZcFinanceRecord zcFinanceRecord = new ZcFinanceRecord();
|
|
|
+ zcFinanceRecord.setZfrId(zfrId);
|
|
|
+ //还款状态(00:待还款, 01: 已还款, 02: 已逾期)
|
|
|
+ zcFinanceRecord.setZfrApplyStatus("02");
|
|
|
+ zcFinanceRecordService.updateZcFinanceRecord(zcFinanceRecord);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|