添加日志;

This commit is contained in:
王奎兴
2026-04-21 16:15:35 +08:00
parent 69dc0581c2
commit 9a39d329e6
3 changed files with 17 additions and 9 deletions
@@ -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);
}
@@ -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);
}
}
@@ -953,6 +953,7 @@ public class BusinessDocumentApplicationService {
@Transactional(rollbackFor = Exception.class)
public Boolean wholeRentSynchronization(BusinessDocumentDO businessDocumentDO) {
log.info("定时任务进入BMS业务单据保存--开始");
log.error("定时任务进入BMS业务单据保存--开始");
//根据结算主题id查询 结算对象编码
Long settlementEntityId = businessDocumentDO.getSettlementEntityId();
List<SettlementCustomers> settlementCustomersList = settlementCustomersService.list(new LambdaQueryWrapper<SettlementCustomers>()