Commit c15e634f by zhouhaibao

fix(sop): 解决客户行为时间为空时的异常处理

- 添加客户行为时间为空的检查和日志记录
- 避免空指针异常导致程序崩溃
- 增加触发时间的日志输出便于调试
- 确保只有有效数据才继续执行任务创建流程
1 parent f08d4135
......@@ -83,6 +83,12 @@ public class SopStrategyTriggerService {
}
Date customerBehaviorDate = getCustomerBehaviorDate(customerInstanceId, strategy);
if (customerBehaviorDate == null) {
log.info("无法获取客户行为时间, strategyId:{}, customerInstanceId:{}", strategy.getId(),
customerInstanceId);
continue;
}
Date triggerTime = triggerTimeCalculator.calculateTriggerTime(strategy, customerInstanceId,
customerBehaviorDate);
......@@ -92,6 +98,8 @@ public class SopStrategyTriggerService {
continue;
}
log.info("触发时间: {}, strategyId:{}, customerInstanceId:{}", triggerTime, strategy.getId(),
customerInstanceId);
// 如果是当天的任务,才下发
if (triggerTimeCalculator.isTriggerTimeReached(triggerTime)) {
Integer taskId = createPendingTask(strategy, customerInstanceId, triggerTime);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!