Commit bd40315f by chenxi

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

1 parent 4b1bc8b9
...@@ -156,12 +156,14 @@ public class SopTaskCustomerService { ...@@ -156,12 +156,14 @@ public class SopTaskCustomerService {
return; return;
} }
List<Map<String, Object>> rows = sopTaskCustomerMapper.selectLastExecuteTimeByCustomerIds(customerIds); List<Map<String, Object>> rows = sopTaskCustomerMapper.selectLastExecuteTimeByCustomerIds(customerIds);
Map<Long, Date> lastExecuteTimeMap = rows.stream() Map<Long, Date> lastExecuteTimeMap = new HashMap<>();
.collect(Collectors.toMap( for (Map<String, Object> row : rows) {
row -> (Long) row.get("customer_instance_id"), Long customerId = (Long) row.get("customer_instance_id");
row -> (Date) row.get("last_execute_time"), Date executeTime = (Date) row.get("last_execute_time");
(v1, v2) -> v2 if (customerId != null && executeTime != null) {
)); lastExecuteTimeMap.put(customerId, executeTime);
}
}
for (CustomerSopTaskRespDTO dto : list) { for (CustomerSopTaskRespDTO dto : list) {
dto.setLastExecuteTime(lastExecuteTimeMap.get(dto.getCustomerInstanceId())); 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!