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