Commit bd40315f by chenxi

展业助手查询近七天已执行客户,查询最近一次任务时间空指针修复

1 parent 4b1bc8b9
......@@ -156,12 +156,14 @@ public class SopTaskCustomerService {
return;
}
List<Map<String, Object>> rows = sopTaskCustomerMapper.selectLastExecuteTimeByCustomerIds(customerIds);
Map<Long, Date> lastExecuteTimeMap = rows.stream()
.collect(Collectors.toMap(
row -> (Long) row.get("customer_instance_id"),
row -> (Date) row.get("last_execute_time"),
(v1, v2) -> v2
));
Map<Long, Date> lastExecuteTimeMap = new HashMap<>();
for (Map<String, Object> row : rows) {
Long customerId = (Long) row.get("customer_instance_id");
Date executeTime = (Date) row.get("last_execute_time");
if (customerId != null && executeTime != null) {
lastExecuteTimeMap.put(customerId, executeTime);
}
}
for (CustomerSopTaskRespDTO dto : list) {
dto.setLastExecuteTime(lastExecuteTimeMap.get(dto.getCustomerInstanceId()));
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!