From 9c86df06c83dffc854f58e34e4fca78428d40a8c Mon Sep 17 00:00:00 2001
From: lau572 <1010031226@qq.com>
Date: Mon, 5 Feb 2024 18:16:23 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E4=B8=AD=E9=97=B4=E5=BA=93=E6=B0=94?=
=?UTF-8?q?=E8=B1=A1=E6=A3=80=E6=B5=8B=E5=99=A8=E6=95=B0=E6=8D=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../DcMeteorologicalDetectorDataMapper.java | 16 ++++++++
.../DevicePropertyReportListener.java | 8 +++-
.../IDcMeteorologicalDetectorDataService.java | 8 ++++
...MeteorologicalDetectorDataServiceImpl.java | 20 ++++++++++
.../DcMeteorologicalDetectorDataMapper.xml | 40 ++++++++++++++++++-
5 files changed, 89 insertions(+), 3 deletions(-)
diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcMeteorologicalDetectorDataMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcMeteorologicalDetectorDataMapper.java
index 3a0868cb..b98086ce 100644
--- a/zc-business/src/main/java/com/zc/business/mapper/DcMeteorologicalDetectorDataMapper.java
+++ b/zc-business/src/main/java/com/zc/business/mapper/DcMeteorologicalDetectorDataMapper.java
@@ -43,6 +43,22 @@ public interface DcMeteorologicalDetectorDataMapper
*/
int updateDcMeteorologicalDetectorData(DcMeteorologicalDetectorData dcMeteorologicalDetectorData);
+ /**
+ * 中间库新增气象检测器数据
+ *
+ * @param dcMeteorologicalDetectorData 气象检测器数据
+ * @return 结果
+ */
+ Boolean insertIntermediateWarehouseData(DcMeteorologicalDetectorData dcMeteorologicalDetectorData);
+
+ /**
+ * 中间库修改气象检测器数据
+ *
+ * @param dcMeteorologicalDetectorData 气象检测器数据
+ * @return 结果
+ */
+ Boolean updateIntermediateWarehouseData(DcMeteorologicalDetectorData dcMeteorologicalDetectorData);
+
/**
* 删除气象检测器数据
*
diff --git a/zc-business/src/main/java/com/zc/business/message/device/listener/DevicePropertyReportListener.java b/zc-business/src/main/java/com/zc/business/message/device/listener/DevicePropertyReportListener.java
index d7370696..561c79e6 100644
--- a/zc-business/src/main/java/com/zc/business/message/device/listener/DevicePropertyReportListener.java
+++ b/zc-business/src/main/java/com/zc/business/message/device/listener/DevicePropertyReportListener.java
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.google.gson.JsonObject;
import com.zc.business.domain.DcDevice;
import com.zc.business.domain.DcMeteorologicalDetectorData;
+import com.zc.business.enums.IotProductEnum;
import com.zc.business.service.IDcMeteorologicalDetectorDataService;
import com.zc.common.core.redis.stream.RedisStream;
import org.slf4j.Logger;
@@ -46,11 +47,14 @@ public class DevicePropertyReportListener implements StreamListener
where id = #{id}
-
+
insert into dc_meteorological_detector_data
@@ -146,6 +146,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
+
+ insert into meteorological_detector_data
+
+ device_id,
+ temperature,
+ humidity,
+ precipitation_type,
+ rainfall,
+ road_surface_status,
+ water_film_thickness,
+ update_time
+
+
+ #{iotDeviceId},
+ #{temperature},
+ #{humidity},
+ #{precipitationType},
+ #{rainfall},
+ #{roadSurfaceStatus},
+ #{waterFilmThickness},
+ current_date
+
+
+
+
+ update meteorological_detector_data
+
+ temperature = #{temperature},
+ humidity = #{humidity},
+ precipitation_type = #{precipitationType},
+ rainfall = #{rainfall},
+ road_surface_status = #{roadSurfaceStatus},
+ water_film_thickness = #{waterFilmThickness},
+ update_time = current_date
+
+ where device_id = #{iotDeviceId}
+
+
delete from dc_meteorological_detector_data where id = #{id}
From bc96cbd19e7631deec138f24828f5a807aa3a24f Mon Sep 17 00:00:00 2001
From: lau572 <1010031226@qq.com>
Date: Tue, 6 Feb 2024 17:12:29 +0800
Subject: [PATCH 2/4] =?UTF-8?q?=E6=94=B6=E8=B4=B9=E7=AB=99=E7=AE=A1?=
=?UTF-8?q?=E5=88=B6=E5=88=86=E6=9E=90=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../DcTrafficIncidentsController.java | 8 +-
.../mapper/DcTrafficIncidentsMapper.java | 15 +-
.../service/IDcTrafficIncidentsService.java | 4 +-
.../impl/DcTrafficIncidentsServiceImpl.java | 186 ++++++++++--------
.../business/DcTrafficIncidentsMapper.xml | 35 +++-
5 files changed, 159 insertions(+), 89 deletions(-)
diff --git a/zc-business/src/main/java/com/zc/business/controller/DcTrafficIncidentsController.java b/zc-business/src/main/java/com/zc/business/controller/DcTrafficIncidentsController.java
index 4c2f2547..4fd32ec0 100644
--- a/zc-business/src/main/java/com/zc/business/controller/DcTrafficIncidentsController.java
+++ b/zc-business/src/main/java/com/zc/business/controller/DcTrafficIncidentsController.java
@@ -162,6 +162,8 @@ public class DcTrafficIncidentsController {
*
* @author liuwenge
* @date 2024/1/15 17:31
+ * @param searchType 查询条件(1:站点,2:原因)
+ * @param facilityIdList 站点id
* @param controlType 类型(1:封闭,2:限行)
* @param startTime 开始时间
* @param endTime 结束时间
@@ -169,10 +171,12 @@ public class DcTrafficIncidentsController {
*/
@ApiOperation("收费站统计分析table")
@PostMapping("/selectTollStationAnalysis")
- public AjaxResult selectTollStationAnalysis(@ApiParam(value="类型(1:封闭,2:限行)", name="controlType", required=true) @RequestParam ("controlType") String controlType,
+ public AjaxResult selectTollStationAnalysis(@ApiParam(value="查询条件(1:站点,2:原因)", name="searchType", required=true) @RequestParam ("searchType") String searchType,
+ @ApiParam(value="站点id", name="facilityId", required=false) @RequestParam (name="facilityId",required = false) String[] facilityIdList,
+ @ApiParam(value="类型(1:封闭,2:限行)", name="controlType", required=false) @RequestParam (name="controlType",required = false) String controlType,
@ApiParam(value="开始时间", name="startTime", required=true) @RequestParam ("startTime") String startTime,
@ApiParam(value="结束时间", name="endTime", required=true) @RequestParam ("endTime") String endTime){
- return trafficIncidentsService.selectTollStationAnalysis(controlType,startTime,endTime);
+ return trafficIncidentsService.selectTollStationAnalysis(searchType,facilityIdList,controlType,startTime,endTime);
}
/**
diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcTrafficIncidentsMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcTrafficIncidentsMapper.java
index 601d1176..d0cfeb9b 100644
--- a/zc-business/src/main/java/com/zc/business/mapper/DcTrafficIncidentsMapper.java
+++ b/zc-business/src/main/java/com/zc/business/mapper/DcTrafficIncidentsMapper.java
@@ -181,12 +181,25 @@ public interface DcTrafficIncidentsMapper {
*
* @author liuwenge
* @date 2024/1/16 14:18
+ * @param facilityIdList 站点id
* @param controlType 类型(1:封闭,2:限行)
* @param startTime 开始时间
* @param endTime 结束时间
* @return java.util.List>
*/
- List