|
|
|
@ -32,19 +32,19 @@ public class PeopleVehicleFlowController extends BaseController {
|
|
|
|
|
@ApiOperation("查询人车记录表")
|
|
|
|
|
public AjaxResult list(PeopleVehicleFlow peopleVehicleFlow) {
|
|
|
|
|
try {
|
|
|
|
|
// 创建一个 TreeMap 用于存储每天的数据量
|
|
|
|
|
Map<LocalDate, Long> dailyCountsMap = new TreeMap<>();
|
|
|
|
|
List<PeopleVehicleFlow> list = peopleVehicleFlowService.list(new QueryWrapper<>(peopleVehicleFlow));
|
|
|
|
|
for (PeopleVehicleFlow flow : list) {
|
|
|
|
|
String countString = flow.getStatisticCount();
|
|
|
|
|
String timeString = flow.getStatisticTime();
|
|
|
|
|
// 将时间字符串转换为 LocalDate
|
|
|
|
|
LocalDate time = LocalDate.parse(timeString, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
|
|
|
|
// 创建一个 TreeMap 用于存储每天的数据量
|
|
|
|
|
Map<LocalDate, Long> dailyCountsMap = new TreeMap<>();
|
|
|
|
|
List<PeopleVehicleFlow> list = peopleVehicleFlowService.list(new QueryWrapper<>(peopleVehicleFlow));
|
|
|
|
|
for (PeopleVehicleFlow flow : list) {
|
|
|
|
|
String countString = flow.getStatisticCount();
|
|
|
|
|
String timeString = flow.getStatisticTime();
|
|
|
|
|
// 将时间字符串转换为 LocalDate
|
|
|
|
|
LocalDate time = LocalDate.parse(timeString, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
|
|
|
|
|
|
|
|
|
// 将计数字符串转换为 Long
|
|
|
|
|
Long count = Long.parseLong(countString);
|
|
|
|
|
dailyCountsMap.put(time, count);
|
|
|
|
|
}
|
|
|
|
|
// 将计数字符串转换为 Long
|
|
|
|
|
Long count = Long.parseLong(countString);
|
|
|
|
|
dailyCountsMap.put(time, count);
|
|
|
|
|
}
|
|
|
|
|
return AjaxResult.success(dailyCountsMap);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.info(StringKit.toString(e));
|
|
|
|
|