添加日志;

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)) { } else if ("散租".equals(leaseType)) {
ScatteredRentalSynchronization(busId); ScatteredRentalSynchronization(busId);
} }
log.info("结束执行出账业务");
} catch (Exception e) { } catch (Exception e) {
log.error("出账业务异常", e); log.error("出账业务异常", e);
} }
@@ -64,13 +64,18 @@ public class BillingScheduler {
} }
private void executeTask(ScheduledTask task) { private void executeTask(ScheduledTask task) {
String status = ""; String status = "SUCCESS";
try { try {
// 执行具体的出账逻辑 // 执行具体的出账逻辑
scheduledTaskService.executeBilling(task.getBusId()); 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"); //scheduledTaskMapper.updateStatus(task.getId(), "SUCCESS");
status = "SUCCESS"; //status = "SUCCESS";
} catch (Exception e) { } catch (Exception e) {
// 重试机制 // 重试机制
scheduledTaskMapper.incrementRetryCount(task.getId()); scheduledTaskMapper.incrementRetryCount(task.getId());
@@ -78,14 +83,15 @@ public class BillingScheduler {
//scheduledTaskMapper.updateStatus(task.getId(), "PENDING"); //scheduledTaskMapper.updateStatus(task.getId(), "PENDING");
} else { } else {
status = "FAILED"; 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"); //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) @Transactional(rollbackFor = Exception.class)
public Boolean wholeRentSynchronization(BusinessDocumentDO businessDocumentDO) { public Boolean wholeRentSynchronization(BusinessDocumentDO businessDocumentDO) {
log.info("定时任务进入BMS业务单据保存--开始"); log.info("定时任务进入BMS业务单据保存--开始");
log.error("定时任务进入BMS业务单据保存--开始");
//根据结算主题id查询 结算对象编码 //根据结算主题id查询 结算对象编码
Long settlementEntityId = businessDocumentDO.getSettlementEntityId(); Long settlementEntityId = businessDocumentDO.getSettlementEntityId();
List<SettlementCustomers> settlementCustomersList = settlementCustomersService.list(new LambdaQueryWrapper<SettlementCustomers>() List<SettlementCustomers> settlementCustomersList = settlementCustomersService.list(new LambdaQueryWrapper<SettlementCustomers>()