From f75b826a556fca2df5c180cadccd8095a036a877 Mon Sep 17 00:00:00 2001 From: XinWei <2718030729@qq.com> Date: Fri, 16 Aug 2024 13:46:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=95=B0=E6=8D=AE-=E5=81=9C?= =?UTF-8?q?=E8=BD=A6=E5=9C=BA=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/bootstrap-local.yaml | 4 +- .../transitionflight/TransitionFlightApi.java | 129 ++++++- .../admin/transitionflight/vo/FerryData.java | 16 + .../admin/vehicleaccess/VehicleAccessApi.java | 339 ++++++++++++++++++ .../vo/AppearanceRecordCarInfoVo.java | 12 + .../vo/AppearanceRecordChargeListVo.java | 13 + .../AppearanceRecordChargeStatisticsVo.java | 19 + .../vo/AppearanceRecordPassInfoVo.java | 15 + .../vo/AppearanceRecordPlaceInfoVo.java | 11 + .../vo/AppearanceRecordProfitListVo.java | 13 + .../vo/AppearanceRecordUserInfoVo.java | 8 + .../vehicleaccess/vo/AppearanceRecordVo.java | 27 ++ .../admin/vehicleaccess/vo/AreaDataVO.java | 19 + .../vehicleaccess/vo/BlueCardHeartbeatVo.java | 13 + .../vo/EntryRecordPlaceInfoVo.java | 11 + .../vo/EntryRecordUserInfoVo.java | 11 + .../admin/vehicleaccess/vo/EntryRecordVo.java | 26 ++ .../vehicleaccess/vo/ParkingLotDataVO.java | 47 +++ .../admin/vehicleaccess/vo/RevenueVO.java | 30 ++ .../controller/admin/weather/WeatherApi.java | 7 +- .../vehicleaccess/AccessRecordPicture.java | 28 ++ .../vehicleaccess/AppearanceRecord.java | 20 ++ .../vehicleaccess/BlueCardHeartbeat.java | 24 ++ .../dataobject/vehicleaccess/EntryRecord.java | 20 ++ .../dal/dataobject/vehicleaccess/Revenue.java | 22 ++ .../vehicleaccess/VehicleRecord.java | 31 ++ .../AccessRecordPictureRepository.java | 16 + .../AppearanceRecordRepository.java | 15 + .../BlueCardHeartbeatRepository.java | 14 + .../vehicleaccess/EntryRecordRepository.java | 16 + .../vehicleaccess/RevenueRepository.java | 16 + .../VehicleRecordRepository.java | 22 ++ .../module/datacenter/utlis/ResponseVO.java | 68 ++++ 33 files changed, 1076 insertions(+), 6 deletions(-) create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/transitionflight/vo/FerryData.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/VehicleAccessApi.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordCarInfoVo.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordChargeListVo.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordChargeStatisticsVo.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordPassInfoVo.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordPlaceInfoVo.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordProfitListVo.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordUserInfoVo.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordVo.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AreaDataVO.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/BlueCardHeartbeatVo.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/EntryRecordPlaceInfoVo.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/EntryRecordUserInfoVo.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/EntryRecordVo.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/ParkingLotDataVO.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/RevenueVO.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/AccessRecordPicture.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/AppearanceRecord.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/BlueCardHeartbeat.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/EntryRecord.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/Revenue.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/VehicleRecord.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/AccessRecordPictureRepository.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/AppearanceRecordRepository.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/BlueCardHeartbeatRepository.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/EntryRecordRepository.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/RevenueRepository.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/VehicleRecordRepository.java create mode 100644 ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/utlis/ResponseVO.java diff --git a/ludu-job-admin/ludu-job-admin-biz/src/main/resources/bootstrap-local.yaml b/ludu-job-admin/ludu-job-admin-biz/src/main/resources/bootstrap-local.yaml index 12c520cd9..2de0efbf7 100644 --- a/ludu-job-admin/ludu-job-admin-biz/src/main/resources/bootstrap-local.yaml +++ b/ludu-job-admin/ludu-job-admin-biz/src/main/resources/bootstrap-local.yaml @@ -3,7 +3,7 @@ spring: cloud: nacos: - server-addr: crm.fjptzykj.com:8849 + server-addr: 127.0.0.1:8848 discovery: namespace: dev # 命名空间。这里使用 dev 开发环境 metadata: @@ -16,7 +16,7 @@ spring: nacos: # Nacos Config 配置项,对应 NacosConfigProperties 配置属性类 config: - server-addr: crm.fjptzykj.com:8849 # Nacos 服务器地址 + server-addr: 127.0.0.1:8848 # Nacos 服务器地址 namespace: dev # 命名空间 dev 的ID,不能直接使用 dev 名称。创建命名空间的时候需要指定ID为 dev,这里使用 dev 开发环境 group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP name: ${spring.application.name} # 使用的 Nacos 配置集的 dataId,默认为 spring.application.name diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/transitionflight/TransitionFlightApi.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/transitionflight/TransitionFlightApi.java index 496b95046..993f357d8 100644 --- a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/transitionflight/TransitionFlightApi.java +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/transitionflight/TransitionFlightApi.java @@ -1,16 +1,143 @@ package cn.iocoder.yudao.module.datacenter.controller.admin.transitionflight; +import cn.iocoder.yudao.module.datacenter.controller.admin.transitionflight.vo.FerryData; +import cn.iocoder.yudao.module.datacenter.utlis.ResponseVO; +import com.alibaba.nacos.shaded.com.google.gson.Gson; +import com.alibaba.nacos.shaded.com.google.gson.JsonObject; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.URL; + /** * @Description 车辆过渡情况 */ @Tag(name = "大屏服务 - 车辆过渡情况") @RestController -@RequestMapping("/h5/transitionFlight") +@RequestMapping("/datacenter/h5/transitionFlight") @Validated public class TransitionFlightApi { + //智慧票务,检票系统:车辆过渡情况(南日) + @GetMapping("/getPageInfo") + public ResponseVO getPageInfo(){ + + try { + // 定义接口地址 + String apiUrl = "http://scld.ptzyKjgs.com/camera/vehicleInOutRecord/getPageInfo"; + // 创建 URL 对象 + URL url = new URL(apiUrl); + // 创建 HttpURLConnection 对象 + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + // 设置请求方法 + connection.setRequestMethod("POST"); + // 获取响应码 + int responseCode = connection.getResponseCode(); + // 如果响应码为 200,表示请求成功 + if (responseCode == HttpURLConnection.HTTP_OK) { + // 创建 BufferedReader 读取响应内容 + BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); + StringBuilder response = new StringBuilder(); + String line; + // 读取响应内容 + while ((line = reader.readLine()) != null) { + response.append(line); + } + // 关闭 BufferedReader + reader.close(); + String responseData = response.toString(); + // 使用 Gson 解析 JSON 数据 + Gson gson = new Gson(); + JsonObject jsonObject = gson.fromJson(responseData, JsonObject.class); + // 提取 data 字段 + JsonObject dataObject = jsonObject.getAsJsonObject("data"); + FerryData ferryData = new FerryData(); + ferryData.setOtherLotsNR(dataObject.get("otherLots").getAsInt()); + ferryData.setTotalLotsNR(dataObject.get("totalLots").getAsInt()); + ferryData.setCurrentLotsNR(dataObject.get("currentLots").getAsInt()); + + return ResponseVO.success(200,"请求成功",ferryData,0); + } else { + System.out.println("请求失败,响应码:" + responseCode); + } + // 断开连接 + connection.disconnect(); + } catch (IOException e) { + e.printStackTrace(); + } + return ResponseVO.error(500,"请求失败"); + } + + + //智慧票务,检票系统:车辆过渡情况(石城) + @GetMapping("/getCurrent") + public ResponseVO getCurrent(){ + + try { + // 定义接口地址 + String apiUrl = "http://scld.ptzyKjgs.com/camera/vehicleInOutRecord/getCurrent"; + + // 创建 URL 对象 + URL url = new URL(apiUrl); + + // 创建 HttpURLConnection 对象 + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + + // 设置请求方法 + connection.setRequestMethod("POST"); + + // 获取响应码 + int responseCode = connection.getResponseCode(); + + // 如果响应码为 200,表示请求成功 + if (responseCode == HttpURLConnection.HTTP_OK) { + // 创建 BufferedReader 读取响应内容 + BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); + StringBuilder response = new StringBuilder(); + String line; + + // 读取响应内容 + while ((line = reader.readLine()) != null) { + response.append(line); + } + + // 关闭 BufferedReader + reader.close(); + + String responseData = response.toString(); + + // 使用 Gson 解析 JSON 数据 + Gson gson = new Gson(); + JsonObject jsonObject = gson.fromJson(responseData, JsonObject.class); + + // 提取 data 字段 + JsonObject dataObject = jsonObject.getAsJsonObject("data"); + + FerryData ferryData = new FerryData(); + ferryData.setOtherLotsSC(dataObject.get("otherLots").getAsInt()); + ferryData.setTotalLotsSC(dataObject.get("totalLots").getAsInt()); + ferryData.setCurrentLotsSC(dataObject.get("currentLots").getAsInt()); + + return ResponseVO.success(200,"请求成功",ferryData,0); + + } else { + System.out.println("请求失败,响应码:" + responseCode); + + } + + // 断开连接 + connection.disconnect(); + + } catch (IOException e) { + e.printStackTrace(); + } + + return ResponseVO.error(500,"请求失败"); + } } diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/transitionflight/vo/FerryData.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/transitionflight/vo/FerryData.java new file mode 100644 index 000000000..343f47e4a --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/transitionflight/vo/FerryData.java @@ -0,0 +1,16 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.transitionflight.vo; + +import lombok.Data; + +/** + * 轮渡车辆过度数据 + */ +@Data +public class FerryData { + private int otherLotsSC;//已进岛数 + private int totalLotsSC;//计划进岛数 + private int currentLotsSC;//剩余进岛数 + private int otherLotsNR; + private int totalLotsNR; + private int currentLotsNR; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/VehicleAccessApi.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/VehicleAccessApi.java new file mode 100644 index 000000000..6e90e292f --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/VehicleAccessApi.java @@ -0,0 +1,339 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess; + +import cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo.AreaDataVO; +import cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo.ParkingLotDataVO; +import cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo.RevenueVO; +import cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess.*; +import cn.iocoder.yudao.module.datacenter.dal.mongodb.vehicleaccess.*; +import cn.iocoder.yudao.module.datacenter.utlis.ResponseVO; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.util.List; +import java.util.Optional; +@Tag(name = "大屏服务 - 停车场接口") +@RestController +@RequestMapping("/datacenter/h5/vehicleAccess") +public class VehicleAccessApi { + + @Autowired + private BlueCardHeartbeatRepository blueCardHeartbeatRepository; + + @Autowired + AppearanceRecordRepository appearanceRecordRepository; + + @Autowired + EntryRecordRepository entryRecordRepository; + + @Autowired + AccessRecordPictureRepository accessRecordPictureRepository; + + @Autowired + VehicleRecordRepository vehicleRecordRepository; + + @Autowired + RevenueRepository revenueRepository; + + @GetMapping("/list") + public ResponseVO list(){ + // 获取今天的日期 + LocalDate today = LocalDate.now(); + LocalDateTime startOfDay = LocalDateTime.of(today, LocalTime.MIN); + LocalDateTime endOfDay = LocalDateTime.of(today, LocalTime.MAX); + + Revenue revenue = new Revenue(); + revenue.setAreaName("中关村软件园一号院"); + revenue.setCreateTime(LocalDateTime.now()); + revenue.setGetTime("2024.05.14 12:15:36"); + revenue.setMemo(""); + revenue.setPayCharge("30"); + revenue.setPayKind("微信"); + revenue.setPlate("京A 88888"); + revenueRepository.insert(revenue); + + return ResponseVO.success(200,"添加成功",null,0); + } + + + //获取实时车辆进出数据和今日车位统计 + @GetMapping("/parkingLotData") + public ResponseVO parkAndVacancy(){ + + + //时间最新的一条数据 + Optional latestHeartbeat = blueCardHeartbeatRepository.findTopByOrderByCreateTimeDesc(); + + if (latestHeartbeat.isPresent()) { + BlueCardHeartbeat heartbeat = latestHeartbeat.get(); + + ParkingLotDataVO parkingLotDataVO = new ParkingLotDataVO(); + + int parkingNum = heartbeat.getSpaceCount() - heartbeat.getFreeSpaceCount(); + int residualStopNum = heartbeat.getSpaceCount() - parkingNum ; + + //车辆进出实时数据 + parkingLotDataVO.setParkingNum(parkingNum);//实时停车数 + parkingLotDataVO.setResidualStopNum(residualStopNum);//剩余车位数 + + // 获取今天的日期 + LocalDate today = LocalDate.now(); + // 计算今天的起始时间和结束时间 + LocalDateTime startOfDay = LocalDateTime.of(today, LocalTime.MIN); + LocalDateTime endOfDay = LocalDateTime.of(today, LocalTime.MAX); + List entryRecords = entryRecordRepository.findByCreateTimeBetween(startOfDay, endOfDay); + parkingLotDataVO.setIntoNum(entryRecords.size());//车辆进入数 + List appearanceRecords = appearanceRecordRepository.findByCreateTimeBetween(startOfDay, endOfDay); + parkingLotDataVO.setOutNum(appearanceRecords.size());//车辆出入数 + + //今日车位统计 + parkingLotDataVO.setTotalParkingSpace(heartbeat.getSpaceCount());//车位总数 + parkingLotDataVO.setResidualTotal(residualStopNum);//余位总数 + // 计算利用率 + int useRatio = (parkingNum / residualStopNum) * 100; + parkingLotDataVO.setUseRatio(useRatio);//总利用率 + + //设置区域停车场数据 + for (int i = 0; i < heartbeat.getAreaList().size(); i++) { + AreaDataVO areaDataVO = new AreaDataVO(); + areaDataVO.setAreaName(heartbeat.getAreaList().get(i).getAreaName()); + areaDataVO.setParkingCount(heartbeat.getAreaList().get(i).getSpaceCount()); + areaDataVO.setLastSpaceCount(heartbeat.getAreaList().get(i).getLastSpaceCount()); + areaDataVO.setUseRatio((heartbeat.getAreaList().get(i).getLastSpaceCount() / heartbeat.getAreaList().get(i).getSpaceCount()) * 100); + parkingLotDataVO.getAreaDataVOList().add(areaDataVO); + } + + return ResponseVO.success(200,"",parkingLotDataVO,0); + } + return ResponseVO.error(500,""); + } + + + //车辆进出趋势数据 + @GetMapping("/tendencyChart") + public ResponseVO tendencyChart(){ + + ParkingLotDataVO parkingLotDataVO = new ParkingLotDataVO(); + + LocalDate today = LocalDate.now(); + LocalDateTime startOfDay = LocalDateTime.of(today, LocalTime.MIN); + LocalDateTime endOfDay = LocalDateTime.of(today, LocalTime.MAX); + //进入数据 + List entryRecordList = entryRecordRepository.findByCreateTimeBetween(startOfDay, endOfDay); + //出入数据 + List appearanceRecordList = appearanceRecordRepository.findByCreateTimeBetween(startOfDay, endOfDay); + + + int count = 0; + int count1 = 0; + int count2 = 0; + int count3 = 0; + int count4 = 0; + int count5 = 0; + int count6 = 0; + LocalDateTime startTime1 = LocalDateTime.now().withHour(0).withMinute(0).withSecond(0).withNano(0); + LocalDateTime endTime1 = LocalDateTime.now().withHour(3).withMinute(59).withSecond(59).withNano(999999999); + LocalDateTime startTime2 = LocalDateTime.now().withHour(4).withMinute(0).withSecond(0).withNano(0); + LocalDateTime endTime2 = LocalDateTime.now().withHour(7).withMinute(59).withSecond(59).withNano(999999999); + LocalDateTime startTime3 = LocalDateTime.now().withHour(8).withMinute(0).withSecond(0).withNano(0); + LocalDateTime endTime3 = LocalDateTime.now().withHour(11).withMinute(59).withSecond(59).withNano(999999999); + LocalDateTime startTime4 = LocalDateTime.now().withHour(12).withMinute(0).withSecond(0).withNano(0); + LocalDateTime endTime4 = LocalDateTime.now().withHour(15).withMinute(59).withSecond(59).withNano(999999999); + LocalDateTime startTime5 = LocalDateTime.now().withHour(16).withMinute(0).withSecond(0).withNano(0); + LocalDateTime endTime5 = LocalDateTime.now().withHour(19).withMinute(59).withSecond(59).withNano(999999999); + LocalDateTime startTime6 = LocalDateTime.now().withHour(20).withMinute(0).withSecond(0).withNano(0); + LocalDateTime endTime6 = LocalDateTime.now().withHour(23).withMinute(59).withSecond(59).withNano(999999999); + + for (int i = 0; i < entryRecordList.size(); i++) { + EntryRecord entryRecord = entryRecordList.get(i); + + if (entryRecord.getCreateTime().isAfter(startTime1) && entryRecord.getCreateTime().isBefore(endTime1)){ + count1++; + continue; + } + if (entryRecord.getCreateTime().isAfter(startTime2) && entryRecord.getCreateTime().isBefore(endTime2)){ + count2++; + continue; + } + if (entryRecord.getCreateTime().isAfter(startTime3) && entryRecord.getCreateTime().isBefore(endTime3)){ + count3++; + continue; + } + if (entryRecord.getCreateTime().isAfter(startTime4) && entryRecord.getCreateTime().isBefore(endTime4)){ + count4++; + continue; + } + if (entryRecord.getCreateTime().isAfter(startTime5) && entryRecord.getCreateTime().isBefore(endTime5)){ + count5++; + continue; + } + if (entryRecord.getCreateTime().isAfter(startTime6) && entryRecord.getCreateTime().isBefore(endTime6)){ + count6++; + } + } + parkingLotDataVO.getIntoCount().add(count); + parkingLotDataVO.getIntoCount().add(count1); + parkingLotDataVO.getIntoCount().add(count2); + parkingLotDataVO.getIntoCount().add(count3); + parkingLotDataVO.getIntoCount().add(count4); + parkingLotDataVO.getIntoCount().add(count5); + parkingLotDataVO.getIntoCount().add(count6); + count1 = 0; + count2 = 0; + count3 = 0; + count4 = 0; + count5 = 0; + count6 = 0; + + + for (int i = 0; i < appearanceRecordList.size(); i++) { + AppearanceRecord appearanceRecord = appearanceRecordList.get(i); + + if (appearanceRecord.getCreateTime().isAfter(startTime1) && appearanceRecord.getCreateTime().isBefore(endTime1)){ + count1++; + continue; + } + if (appearanceRecord.getCreateTime().isAfter(startTime2) && appearanceRecord.getCreateTime().isBefore(endTime2)){ + count2++; + continue; + } + if (appearanceRecord.getCreateTime().isAfter(startTime3) && appearanceRecord.getCreateTime().isBefore(endTime3)){ + count3++; + continue; + } + if (appearanceRecord.getCreateTime().isAfter(startTime4) && appearanceRecord.getCreateTime().isBefore(endTime4)){ + count4++; + continue; + } + if (appearanceRecord.getCreateTime().isAfter(startTime5) && appearanceRecord.getCreateTime().isBefore(endTime5)){ + count5++; + continue; + } + if (appearanceRecord.getCreateTime().isAfter(startTime6) && appearanceRecord.getCreateTime().isBefore(endTime6)){ + count6++; + } + } + parkingLotDataVO.getOutCount().add(count); + parkingLotDataVO.getOutCount().add(count1); + parkingLotDataVO.getOutCount().add(count2); + parkingLotDataVO.getOutCount().add(count3); + parkingLotDataVO.getOutCount().add(count4); + parkingLotDataVO.getOutCount().add(count5); + parkingLotDataVO.getOutCount().add(count6); + + return ResponseVO.success(200,"",parkingLotDataVO,0); + } + + + //车辆出入实时记录图 + @GetMapping("/recordOfAccess") + public ResponseVO recordOfAccess(int page){ + + // 获取今天的日期 + LocalDate today = LocalDate.now(); + LocalDateTime startOfDay = LocalDateTime.of(today, LocalTime.MIN); + LocalDateTime endOfDay = LocalDateTime.of(today, LocalTime.MAX); + + long total = vehicleRecordRepository.countByCreateTimeBetween(startOfDay, endOfDay); + + // 创建分页请求 + Pageable pageable = PageRequest.of(page, 4); + Page recordOfAccessList = vehicleRecordRepository.findByCreateTimeBetweenOrderByCreateTimeAsc(startOfDay, endOfDay, pageable); + + return ResponseVO.success(200,"",recordOfAccessList,total); + } + + + //车辆营收统计 + @GetMapping("/revenue") + public ResponseVO revenue(String date,String areaName){ + + List revenueList; + + LocalDateTime startOfDay = null; + LocalDateTime endOfDay = null; + + + if (date.equals("今日")){ + // 获取今天的日期 + LocalDate today = LocalDate.now(); + startOfDay = LocalDateTime.of(today, LocalTime.MIN); + endOfDay = LocalDateTime.of(today, LocalTime.MAX); + } + if (date.equals("近一周")){ + endOfDay = LocalDateTime.now(); // 结束时间为当前时间 + startOfDay = endOfDay.minusDays(7); // 开始时间为当前时间的前7天 + + } + if (date.equals("近一月")){ + endOfDay = LocalDateTime.now(); // 结束时间为当前时间 + startOfDay = endOfDay.minusMonths(1); // 开始时间为当前时间的前一个月 + } + + if (areaName.equals("全部")){ + revenueList = revenueRepository.findByCreateTimeBetween(startOfDay, endOfDay); + }else { + revenueList = revenueRepository.findByCreateTimeAndAreaName(startOfDay, endOfDay, areaName); + } + + // 声明 BigDecimal 对象来保存金额 + BigDecimal sum = BigDecimal.ZERO; + BigDecimal zfb = BigDecimal.ZERO; + BigDecimal wx = BigDecimal.ZERO; + BigDecimal yl = BigDecimal.ZERO; + BigDecimal xj = BigDecimal.ZERO; + BigDecimal gjk = BigDecimal.ZERO; + + // 循环计算金额 + for (int i = 0; i < revenueList.size(); i++) { + Revenue revenue = revenueList.get(i); + BigDecimal charge = new BigDecimal(revenue.getPayCharge()); + if (revenue.getPayKind().equals("现金")){ + xj = xj.add(charge); + } else if (revenue.getPayKind().equals("微信")){ + wx = wx.add(charge); + } else if (revenue.getPayKind().equals("支付宝")){ + zfb = zfb.add(charge); + } else if (revenue.getPayKind().equals("银联")){ + yl = yl.add(charge); + } else if (revenue.getPayKind().equals("公交卡")){ + gjk = gjk.add(charge); + } + } + + // 计算总和 + sum = sum.add(xj).add(wx).add(zfb).add(yl).add(gjk); + + RevenueVO revenueVO = new RevenueVO(); + revenueVO.setSum(sum); + revenueVO.setGjk(gjk); + revenueVO.setWx(wx); + revenueVO.setXj(xj); + revenueVO.setYl(yl); + revenueVO.setZfb(zfb); + + + + return ResponseVO.success(200,"",revenueVO ,0); + } + + + //预警信息栏 + @GetMapping("/warning_information_bar") + public ResponseVO warningInformation(){ + return ResponseVO.success(200,"今日实时客流人数125,同比上月实时人数提升12%。今日车辆数量135,同比上月实时人数提升13%。今日沿海阵风3级.....",null ,0); + } + + + + +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordCarInfoVo.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordCarInfoVo.java new file mode 100644 index 000000000..d01551da0 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordCarInfoVo.java @@ -0,0 +1,12 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +@Data +public class AppearanceRecordCarInfoVo { + private String plate; + private String plateColor; + private String ticketCode; + private String carType; + private Integer confidence; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordChargeListVo.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordChargeListVo.java new file mode 100644 index 000000000..a451afb26 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordChargeListVo.java @@ -0,0 +1,13 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +@Data +public class AppearanceRecordChargeListVo { + private String payNo; + private String getTime; + private String payCharge; + private String payKind; + private String payChannel; + private String memo; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordChargeStatisticsVo.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordChargeStatisticsVo.java new file mode 100644 index 000000000..e752e6391 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordChargeStatisticsVo.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +@Data +public class AppearanceRecordChargeStatisticsVo { + private String charge; + private String onLineCharge; + private String offLineCharge; + private String profitChargeTotal; + private String onLineProfitChargeNum; + private String onLineProfitChargeValue; + private String offLineProfitChargeNum; + private String offLineProfitChargeValue; + private String onLineProfitTimeNum; + private String onLineProfitTimeValue; + private String offLineProfitTimeNum; + private String offLineProfitTimeValue; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordPassInfoVo.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordPassInfoVo.java new file mode 100644 index 000000000..e22d1c7a8 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordPassInfoVo.java @@ -0,0 +1,15 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +@Data +public class AppearanceRecordPassInfoVo { + private String inTime; + private String outTime;//出场时间 + private String inImage; + private String outImage; + private String inChannel; + private String outChannel; + private String openGateMode; + private String matchMode; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordPlaceInfoVo.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordPlaceInfoVo.java new file mode 100644 index 000000000..66b21c3ec --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordPlaceInfoVo.java @@ -0,0 +1,11 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +@Data +public class AppearanceRecordPlaceInfoVo { + private String areaId; + private String areaName; + private String placeNumber; + private String memo; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordProfitListVo.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordProfitListVo.java new file mode 100644 index 000000000..cccc43e47 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordProfitListVo.java @@ -0,0 +1,13 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +@Data +public class AppearanceRecordProfitListVo { + private String profitCode; + private String getTime; + private String profitTime; + private String profitCharge; + private String profitChargeValue; + private String memo; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordUserInfoVo.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordUserInfoVo.java new file mode 100644 index 000000000..52018478d --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordUserInfoVo.java @@ -0,0 +1,8 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +@Data +public class AppearanceRecordUserInfoVo { + private String idCard; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordVo.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordVo.java new file mode 100644 index 000000000..7297bafcb --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AppearanceRecordVo.java @@ -0,0 +1,27 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +import java.util.ArrayList; + +@Data +public class AppearanceRecordVo { + private String orderId; + private String operatorId; + private String operatorName; + private String invoiceNo; + private AppearanceRecordCarInfoVo carInfo; + private AppearanceRecordUserInfoVo userInfo; + private AppearanceRecordPassInfoVo passInfo; + private AppearanceRecordChargeStatisticsVo chargeStatistics; + private ArrayList chargeList; + private ArrayList profitList; + private ArrayList placeInfo; + private String costTime; + private String plate; + private String plateColor; + private String ticketCode; + private String carType; + private Integer confidence; +} + diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AreaDataVO.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AreaDataVO.java new file mode 100644 index 000000000..ccc93005a --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/AreaDataVO.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +@Data +public class AreaDataVO { + + //区域停车场名称 + private String areaName; + + //区域停车总数 + private int parkingCount; + + //区域余位总数 + private int lastSpaceCount; + + //区域利用率 + private int useRatio; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/BlueCardHeartbeatVo.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/BlueCardHeartbeatVo.java new file mode 100644 index 000000000..09fb9594b --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/BlueCardHeartbeatVo.java @@ -0,0 +1,13 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +@Data +public class BlueCardHeartbeatVo { + private String areaName; + private Integer spaceCount; + private Integer lastSpaceCount; + private Integer bookSpaceCount; + private Integer bookInParkCount; + private Integer areaId; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/EntryRecordPlaceInfoVo.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/EntryRecordPlaceInfoVo.java new file mode 100644 index 000000000..b9a8f7121 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/EntryRecordPlaceInfoVo.java @@ -0,0 +1,11 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +@Data +public class EntryRecordPlaceInfoVo { + private String areaId; + private String areaName; + private String placeNumber; + private String memo; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/EntryRecordUserInfoVo.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/EntryRecordUserInfoVo.java new file mode 100644 index 000000000..ee5e13e8a --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/EntryRecordUserInfoVo.java @@ -0,0 +1,11 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +@Data +public class EntryRecordUserInfoVo { + private String idCard; + private String userName; + private String phone; + private String address; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/EntryRecordVo.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/EntryRecordVo.java new file mode 100644 index 000000000..3125e0531 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/EntryRecordVo.java @@ -0,0 +1,26 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +import java.util.ArrayList; + +@Data +public class EntryRecordVo { + private String plate; + private String ticketCode; + private String plateColor; + private String inTime;//入场时间 + private String inChannel; + private String inImage; + private String orderId; + private String visitReason; + private String openGateMode; + private String matchMode; + private String idCard; + private Integer confidence; + private String carType; + private EntryRecordUserInfoVo userInfo; + private ArrayList placeInfo; + private String barriorOpen; + private String costTime; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/ParkingLotDataVO.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/ParkingLotDataVO.java new file mode 100644 index 000000000..39765355a --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/ParkingLotDataVO.java @@ -0,0 +1,47 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +/** + * 停车场数据 + */ +public class ParkingLotDataVO { + + //实时停车数 + private int parkingNum; + + //剩余停车位 + private int residualStopNum; + + //车辆进入数 + private int intoNum; + + //车辆出入数 + private int outNum; + + //车位总数 + private int totalParkingSpace; + + //余位总数 + private int residualTotal; + + //总利用率 + private int useRatio; + + //区域停车场数据集合 + private List areaDataVOList = new ArrayList<>(); + + //车辆进出趋势时间 + private String[] timeList; + + //车辆进出趋势进入车辆数量集合 + private List intoCount = new ArrayList<>(); + + //车辆进出趋势出入车辆数量集合 + private List outCount = new ArrayList<>(); + +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/RevenueVO.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/RevenueVO.java new file mode 100644 index 000000000..ebf414630 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/vehicleaccess/vo/RevenueVO.java @@ -0,0 +1,30 @@ +package cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 车辆营收统计数据 + */ +@Data +public class RevenueVO { + + //支付宝 + private BigDecimal zfb; + + //微信 + private BigDecimal wx; + + //银联 + private BigDecimal yl; + + //现金 + private BigDecimal xj; + + //公交卡 + private BigDecimal gjk; + + //总金额 + private BigDecimal sum; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/weather/WeatherApi.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/weather/WeatherApi.java index 56a70e176..4ab12caab 100644 --- a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/weather/WeatherApi.java +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/weather/WeatherApi.java @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.datacenter.controller.admin.weather; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.module.datacenter.controller.admin.weather.vo.WeatherInfoVO; import cn.iocoder.yudao.module.datacenter.utlis.GoodWeatherUtil; +import cn.iocoder.yudao.module.datacenter.utlis.ResponseVO; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.validation.annotation.Validated; @@ -15,14 +16,14 @@ import org.springframework.web.bind.annotation.RestController; */ @Tag(name = "大屏服务 - 天气接口") @RestController -@RequestMapping("/h5/weather") +@RequestMapping("/datacenter/h5/weather") @Validated public class WeatherApi { @GetMapping(value = "/getWeather") @Operation(summary = "获得输入城市的天气") - public CommonResult getWeather(String cityCode) { + public ResponseVO getWeather(String cityCode) { String weatherData = GoodWeatherUtil.getWeatherData(cityCode); WeatherInfoVO weatherInfo = GoodWeatherUtil.GetWeather(weatherData); - return CommonResult.success(weatherInfo); + return new ResponseVO(200,"",weatherInfo,0); } } diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/AccessRecordPicture.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/AccessRecordPicture.java new file mode 100644 index 000000000..18f7d160e --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/AccessRecordPicture.java @@ -0,0 +1,28 @@ +package cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess; + +import lombok.Data; +import org.springframework.data.mongodb.core.mapping.Document; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + +@Document("access_record_picture") +@Data +@XmlRootElement(name = "root") +@XmlAccessorType(XmlAccessType.FIELD) +public class AccessRecordPicture { + @XmlElement + private String id; + @XmlElement + private String parkNumber; + @XmlElement + private String imageName; + @XmlElement + private String image; + @XmlElement + private String imgAddress; + @XmlElement + private byte[] resource; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/AppearanceRecord.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/AppearanceRecord.java new file mode 100644 index 000000000..dae5ddc93 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/AppearanceRecord.java @@ -0,0 +1,20 @@ +package cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess; + +import cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo.AppearanceRecordVo; +import lombok.Data; +import org.springframework.data.mongodb.core.index.Indexed; +import org.springframework.data.mongodb.core.mapping.Document; + +import java.time.LocalDateTime; +import java.util.ArrayList; + +@Document("appearance_record") +@Data +public class AppearanceRecord { + private String id; + private String parkNumber; + private Integer size; + @Indexed + private LocalDateTime createTime; + private ArrayList datas; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/BlueCardHeartbeat.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/BlueCardHeartbeat.java new file mode 100644 index 000000000..04524ead7 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/BlueCardHeartbeat.java @@ -0,0 +1,24 @@ +package cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess; + +import cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo.BlueCardHeartbeatVo; +import lombok.Data; +import org.springframework.data.mongodb.core.index.Indexed; +import org.springframework.data.mongodb.core.mapping.Document; + +import java.time.LocalDateTime; +import java.util.ArrayList; + +@Document("blue_card_heartbeat") +@Data +public class BlueCardHeartbeat { + private String id; + private String parkNumber; + private String parkName; + private Integer spaceCount;//场库总车位数 + private Integer freeSpaceCount;//场库空车位数 + private Integer bookSpaceCount; + private Integer bookInParkCount; + @Indexed + private LocalDateTime createTime; + private ArrayList areaList; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/EntryRecord.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/EntryRecord.java new file mode 100644 index 000000000..12b4463d5 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/EntryRecord.java @@ -0,0 +1,20 @@ +package cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess; + +import cn.iocoder.yudao.module.datacenter.controller.admin.vehicleaccess.vo.EntryRecordVo; +import lombok.Data; +import org.springframework.data.mongodb.core.index.Indexed; +import org.springframework.data.mongodb.core.mapping.Document; + +import java.time.LocalDateTime; +import java.util.ArrayList; + +@Document("entry_record") +@Data +public class EntryRecord { + private String id; + private String parkNumber; + private Integer size; + @Indexed + private LocalDateTime createTime; + private ArrayList datas; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/Revenue.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/Revenue.java new file mode 100644 index 000000000..985469171 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/Revenue.java @@ -0,0 +1,22 @@ +package cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess; + +import lombok.Data; +import org.springframework.data.mongodb.core.mapping.Document; + +import java.time.LocalDateTime; + +/** + * 车辆营收数据 + */ +@Data +@Document("revenue") +public class Revenue { + private String id; + private String plate;//车牌 + private String getTime;//结算时间 + private String payCharge;//支付金额 + private String PayKind;//支付类型 + private String areaName;//停车所在区域 + private String memo;//备注 + private LocalDateTime createTime; +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/VehicleRecord.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/VehicleRecord.java new file mode 100644 index 000000000..99f8f14b7 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/dataobject/vehicleaccess/VehicleRecord.java @@ -0,0 +1,31 @@ +package cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess; + +import lombok.Data; +import org.springframework.data.mongodb.core.mapping.Document; + +import java.time.LocalDateTime; + +/** + *车辆进出记录数据 + */ +@Data +@Document("vehicle_record") +public class VehicleRecord { + + private String id; + + //进出 + private String intoOrOut; + + //车牌号 + private String licenseNumber; + + //时间 + private String time; + + //图片 + private String picture; + + private LocalDateTime createTime; + +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/AccessRecordPictureRepository.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/AccessRecordPictureRepository.java new file mode 100644 index 000000000..cf84cd04a --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/AccessRecordPictureRepository.java @@ -0,0 +1,16 @@ +package cn.iocoder.yudao.module.datacenter.dal.mongodb.vehicleaccess; + + +import cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess.AccessRecordPicture; +import org.springframework.data.mongodb.repository.MongoRepository; + +import java.util.List; + +public interface AccessRecordPictureRepository extends MongoRepository { + + // 根据给定的 imageName 数组查询记录 + List findByImageNameIn(List imageNames); + + AccessRecordPicture findByImageName(String imageName); + +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/AppearanceRecordRepository.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/AppearanceRecordRepository.java new file mode 100644 index 000000000..eabb3af6f --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/AppearanceRecordRepository.java @@ -0,0 +1,15 @@ +package cn.iocoder.yudao.module.datacenter.dal.mongodb.vehicleaccess; + +import cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess.AppearanceRecord; +import org.springframework.data.mongodb.repository.MongoRepository; +import org.springframework.data.mongodb.repository.Query; + +import java.time.LocalDateTime; +import java.util.List; + +public interface AppearanceRecordRepository extends MongoRepository { + + @Query("{'createTime': {$gte: ?0, $lte: ?1}}") + List findByCreateTimeBetween (LocalDateTime startOfDay, LocalDateTime endOfDay); + +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/BlueCardHeartbeatRepository.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/BlueCardHeartbeatRepository.java new file mode 100644 index 000000000..7a93b3fa5 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/BlueCardHeartbeatRepository.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.datacenter.dal.mongodb.vehicleaccess; + +import cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess.BlueCardHeartbeat; +import org.springframework.data.mongodb.repository.MongoRepository; + +import java.util.Optional; + +public interface BlueCardHeartbeatRepository extends MongoRepository { + + + Optional findTopByOrderByCreateTimeDesc(); + + +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/EntryRecordRepository.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/EntryRecordRepository.java new file mode 100644 index 000000000..f6fb5d538 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/EntryRecordRepository.java @@ -0,0 +1,16 @@ +package cn.iocoder.yudao.module.datacenter.dal.mongodb.vehicleaccess; + +import cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess.EntryRecord; +import org.springframework.data.mongodb.repository.MongoRepository; +import org.springframework.data.mongodb.repository.Query; + +import java.time.LocalDateTime; +import java.util.List; + +public interface EntryRecordRepository extends MongoRepository { + + @Query("{ 'createTime' : { $gte: ?0, $lt: ?1 } }") + List findByCreateTimeBetween(LocalDateTime startDate, LocalDateTime endDate); + + +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/RevenueRepository.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/RevenueRepository.java new file mode 100644 index 000000000..3f55b1d81 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/RevenueRepository.java @@ -0,0 +1,16 @@ +package cn.iocoder.yudao.module.datacenter.dal.mongodb.vehicleaccess; + +import cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess.Revenue; +import org.springframework.data.mongodb.repository.MongoRepository; +import org.springframework.data.mongodb.repository.Query; + +import java.time.LocalDateTime; +import java.util.List; + +public interface RevenueRepository extends MongoRepository { + @Query("{'createTime': {$gte: ?0, $lte: ?1}}") + List findByCreateTimeBetween (LocalDateTime startOfDay, LocalDateTime endOfDay); + + @Query(value = "{ 'areaName': { $regex: ?2, $options: 'i' }, 'createTime': { $gte: ?0, $lte: ?1 } }") + List findByCreateTimeAndAreaName(LocalDateTime startTime, LocalDateTime endTime, String areaName); +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/VehicleRecordRepository.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/VehicleRecordRepository.java new file mode 100644 index 000000000..2bb78e84c --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/dal/mongodb/vehicleaccess/VehicleRecordRepository.java @@ -0,0 +1,22 @@ +package cn.iocoder.yudao.module.datacenter.dal.mongodb.vehicleaccess; + +import cn.iocoder.yudao.module.datacenter.dal.dataobject.vehicleaccess.VehicleRecord; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.mongodb.repository.MongoRepository; +import org.springframework.data.mongodb.repository.Query; + +import java.time.LocalDateTime; +import java.util.List; + +public interface VehicleRecordRepository extends MongoRepository { + + @Query("{ 'createTime' : { $gte: ?0, $lt: ?1 } }") + List findByCreateTimeBetween(LocalDateTime startDate, LocalDateTime endDate); + + // 根据时间字段查询今天的数据,并根据时间排序并分页 + Page findByCreateTimeBetweenOrderByCreateTimeAsc(LocalDateTime startOfDay, LocalDateTime endOfDay, Pageable pageable); + + // 根据 createTime 字段查询今天的数据条数 + long countByCreateTimeBetween(LocalDateTime startOfDay, LocalDateTime endOfDay); +} diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/utlis/ResponseVO.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/utlis/ResponseVO.java new file mode 100644 index 000000000..57b9edda3 --- /dev/null +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/utlis/ResponseVO.java @@ -0,0 +1,68 @@ +package cn.iocoder.yudao.module.datacenter.utlis; + +import lombok.Data; + +@Data +public class ResponseVO { + + int code;// 返回编码 + String msg;// 返回消息 + Object data;// 返回数据 + long total; + + + public ResponseVO(int code, String msg, Object data, long total) { + this.code = code; + this.msg = msg; + this.data = data; + this.total = total; + } + + public ResponseVO(int code, String msg) { + this.code = code; + this.msg = msg; + } + + public static ResponseVO success(int code,String msg, Object data,long total) { + + return new ResponseVO(code,msg,data,total); + } + + public static ResponseVO error(int code,String msg) { + ResponseVO serverRsp = new ResponseVO(code,msg); + serverRsp.setMsg(msg); + return serverRsp; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public Object getData() { + return data; + } + + public void setData(Object data) { + this.data = data; + } + + public long getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } +}