From 576a2ecd953e93342e60e470ebd2f94bc4d42705 Mon Sep 17 00:00:00 2001 From: Angel <1050374295@qq.com> Date: Fri, 5 Jan 2024 10:47:31 +0800 Subject: [PATCH] =?UTF-8?q?ServiceImpl=E5=88=A0=E9=99=A4=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PeopleVehicleFlowController.java | 24 +++++++++---------- .../PeopleVehicleHourFlowController.java | 2 +- .../PeopleVehicleHourFlowServiceImpl.java | 1 - 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/PeopleVehicleFlowController.java b/gather-app/src/main/java/com/ruoyi/database/controller/PeopleVehicleFlowController.java index afa19e4..1ddb1eb 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/PeopleVehicleFlowController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/PeopleVehicleFlowController.java @@ -32,19 +32,19 @@ public class PeopleVehicleFlowController extends BaseController { @ApiOperation("查询人车记录表") public AjaxResult list(PeopleVehicleFlow peopleVehicleFlow) { try { - // 创建一个 TreeMap 用于存储每天的数据量 - Map dailyCountsMap = new TreeMap<>(); - List 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 dailyCountsMap = new TreeMap<>(); + List 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)); diff --git a/gather-app/src/main/java/com/ruoyi/database/controller/PeopleVehicleHourFlowController.java b/gather-app/src/main/java/com/ruoyi/database/controller/PeopleVehicleHourFlowController.java index d7a87d8..d9e2625 100644 --- a/gather-app/src/main/java/com/ruoyi/database/controller/PeopleVehicleHourFlowController.java +++ b/gather-app/src/main/java/com/ruoyi/database/controller/PeopleVehicleHourFlowController.java @@ -35,7 +35,7 @@ public class PeopleVehicleHourFlowController extends BaseController { try { // 创建一个 TreeMap 用于存储每天的数据量 Map dailyCountsMap = new TreeMap<>(); - List list = peopleVehicleHourFlowService.list(new QueryWrapper<>(peopleVehicleHFlow)); + List list = peopleVehicleHourFlowService.list(new QueryWrapper<>(peopleVehicleHFlow)); for (PeopleVehicleHourFlow flow : list) { String countString = flow.getStatisticCount(); String timeString = flow.getStatisticTime(); diff --git a/gather-app/src/main/java/com/ruoyi/database/service/impl/PeopleVehicleHourFlowServiceImpl.java b/gather-app/src/main/java/com/ruoyi/database/service/impl/PeopleVehicleHourFlowServiceImpl.java index 06cf322..e0c240a 100644 --- a/gather-app/src/main/java/com/ruoyi/database/service/impl/PeopleVehicleHourFlowServiceImpl.java +++ b/gather-app/src/main/java/com/ruoyi/database/service/impl/PeopleVehicleHourFlowServiceImpl.java @@ -9,6 +9,5 @@ import com.ruoyi.database.service.PeopleVehicleHourFlowService; import org.springframework.stereotype.Service; @Service -@DS("mysql") public class PeopleVehicleHourFlowServiceImpl extends ServiceImpl implements PeopleVehicleHourFlowService { } \ No newline at end of file