添加日志;
This commit is contained in:
+1
@@ -73,6 +73,7 @@ public class ScheduledTaskServiceImpl extends ServiceImpl<ScheduledTaskMapper, S
|
||||
} else if ("散租".equals(leaseType)) {
|
||||
ScatteredRentalSynchronization(busId);
|
||||
}
|
||||
log.info("结束执行出账业务");
|
||||
} catch (Exception e) {
|
||||
log.error("出账业务异常", e);
|
||||
}
|
||||
|
||||
+15
-9
@@ -64,13 +64,18 @@ public class BillingScheduler {
|
||||
}
|
||||
|
||||
private void executeTask(ScheduledTask task) {
|
||||
String status = "";
|
||||
String status = "SUCCESS";
|
||||
try {
|
||||
// 执行具体的出账逻辑
|
||||
scheduledTaskService.executeBilling(task.getBusId());
|
||||
|
||||
ScheduledTaskLog log = new ScheduledTaskLog();
|
||||
log.setTaskId(task.getId());
|
||||
log.setBusId(task.getBusId());
|
||||
log.setTaskStatus(status);
|
||||
log.setExecuteTime(new Date());
|
||||
scheduledTaskLogMapper.insert(log);
|
||||
//scheduledTaskMapper.updateStatus(task.getId(), "SUCCESS");
|
||||
status = "SUCCESS";
|
||||
//status = "SUCCESS";
|
||||
} catch (Exception e) {
|
||||
// 重试机制
|
||||
scheduledTaskMapper.incrementRetryCount(task.getId());
|
||||
@@ -78,14 +83,15 @@ public class BillingScheduler {
|
||||
//scheduledTaskMapper.updateStatus(task.getId(), "PENDING");
|
||||
} else {
|
||||
status = "FAILED";
|
||||
ScheduledTaskLog log = new ScheduledTaskLog();
|
||||
log.setTaskId(task.getId());
|
||||
log.setBusId(task.getBusId());
|
||||
log.setTaskStatus(status);
|
||||
log.setExecuteTime(new Date());
|
||||
scheduledTaskLogMapper.insert(log);
|
||||
//scheduledTaskMapper.updateStatus(task.getId(), "FAILED");
|
||||
}
|
||||
}
|
||||
ScheduledTaskLog log = new ScheduledTaskLog();
|
||||
log.setTaskId(task.getId());
|
||||
log.setBusId(task.getBusId());
|
||||
log.setTaskStatus(status);
|
||||
log.setExecuteTime(new Date());
|
||||
scheduledTaskLogMapper.insert(log);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user