From 54d63e87890e5c8f78e2ab545aec425e2501f4d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E7=90=B3?= <1911390090@qq.com> Date: Fri, 14 Jun 2024 13:35:34 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=BC=E5=90=88=E6=8C=87=E6=A0=87=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DcTrafficStatisticsController.java | 23 ++++++- .../domain/ComprehensiveIndexQuery.java | 36 ++++++++++ .../DcGantryMetricsStatisticsDataMapper.java | 2 + ...IDcGantryMetricsStatisticsDataService.java | 3 + .../DcGantryMetricsStatisticsDataMapper.xml | 69 +++++++++++++++++++ 5 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 zc-business/src/main/java/com/zc/business/domain/ComprehensiveIndexQuery.java diff --git a/zc-business/src/main/java/com/zc/business/controller/DcTrafficStatisticsController.java b/zc-business/src/main/java/com/zc/business/controller/DcTrafficStatisticsController.java index e610e068..38c7f610 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcTrafficStatisticsController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcTrafficStatisticsController.java @@ -1,9 +1,12 @@ package com.zc.business.controller; import com.alibaba.fastjson.JSONArray; +import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.common.utils.poi.ExcelUtil; import com.zc.business.domain.*; import com.zc.business.request.DcTrafficMetricsDataRequest; import com.zc.business.request.DcTrafficSectionDataRequest; @@ -14,6 +17,7 @@ import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.List; import java.util.Map; @@ -248,8 +252,25 @@ public AjaxResult realTimeTrafficFlow(String startDate, String direction,String // 将查询结果封装为成功响应并返回 return AjaxResult.success(map); } + @ApiOperation("综合指标查询") + @GetMapping("/history/comprehensiveIndexQuery") + public TableDataInfo comprehensiveIndexQuery(ComprehensiveIndexQuery comprehensiveIndexQuery){ + startPage(); + List mapList = dcGantryMetricsStatisticsDataService.comprehensiveIndexQuery(comprehensiveIndexQuery); + // 将查询结果封装为成功响应并返回 + return getDataTable(mapList); + } - + @ApiOperation("导出综合指标") + //@PreAuthorize("@ss.hasPermi('system:event:export')") + @Log(title = "导出综合指标", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, @RequestBody ComprehensiveIndexQuery comprehensiveIndexQuery) + { + List list = dcGantryMetricsStatisticsDataService.comprehensiveIndexQuery(comprehensiveIndexQuery); + ExcelUtil util = new ExcelUtil(ComprehensiveIndexQuery.class); + util.exportExcel(response, list, "事件信息数据"); + } /** * 获取门架指标统计数据 diff --git a/zc-business/src/main/java/com/zc/business/domain/ComprehensiveIndexQuery.java b/zc-business/src/main/java/com/zc/business/domain/ComprehensiveIndexQuery.java new file mode 100644 index 00000000..b3aaffca --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/domain/ComprehensiveIndexQuery.java @@ -0,0 +1,36 @@ +package com.zc.business.domain; + +import com.ruoyi.common.annotation.Excel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ComprehensiveIndexQuery { + @Excel(name = "路段名称") + private String intervalName; + private String stakeMake; + private String endMake; + private String facilityCode; + private String facilityName; + + private String direction; + @Excel(name = "饱和度") + private Float saturationRate; + @Excel(name = "交通组成特征指数(大车占比", readConverterExp = "1=低,2=中,3=高") + + private Integer trafficCompositionRate; + @Excel(name = "统计时间", dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date statisticalDate; + @Excel(name = "拥堵度", readConverterExp = "1=畅通,2=基本畅通,3=轻度拥堵 ,4=中度拥堵,5=重度拥堵") + private Integer crowdingRate; + private Integer periodType; + private String startDate; +} diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcGantryMetricsStatisticsDataMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcGantryMetricsStatisticsDataMapper.java index b60b9613..9565b0f4 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/DcGantryMetricsStatisticsDataMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/DcGantryMetricsStatisticsDataMapper.java @@ -1,6 +1,7 @@ package com.zc.business.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.zc.business.domain.ComprehensiveIndexQuery; import com.zc.business.domain.DcGantryMetricsStatisticsData; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -35,4 +36,5 @@ public interface DcGantryMetricsStatisticsDataMapper extends BaseMapper> sectionTrafficIndexAnalysis(@Param("startDate") String startDate, @Param("direction") String direction,@Param("periodType") String periodType); List> radarMapOfTrafficIndicators(@Param("startDate") String startDate, @Param("direction") String direction,@Param("periodType") String periodType); + List comprehensiveIndexQuery(ComprehensiveIndexQuery comprehensiveIndexQuery); } diff --git a/zc-business/src/main/java/com/zc/business/service/IDcGantryMetricsStatisticsDataService.java b/zc-business/src/main/java/com/zc/business/service/IDcGantryMetricsStatisticsDataService.java index 2ed8f0ef..fb94a4c9 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcGantryMetricsStatisticsDataService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcGantryMetricsStatisticsDataService.java @@ -1,6 +1,7 @@ package com.zc.business.service; import com.baomidou.mybatisplus.extension.service.IService; +import com.zc.business.domain.ComprehensiveIndexQuery; import com.zc.business.domain.DcGantryMetricsStatisticsData; import com.zc.business.domain.DcGantryMetricsStatisticsData; import com.zc.business.domain.DcGantryMetricsStatisticsData; @@ -46,4 +47,6 @@ public interface IDcGantryMetricsStatisticsDataService extends IService> passIndicatorTimeDistribution(String startDate, String direction, String periodType); Map radarMapOfTrafficIndicators(String startDate, String direction, String periodType); + + List comprehensiveIndexQuery(ComprehensiveIndexQuery comprehensiveIndexQuery); } diff --git a/zc-business/src/main/resources/mapper/business/DcGantryMetricsStatisticsDataMapper.xml b/zc-business/src/main/resources/mapper/business/DcGantryMetricsStatisticsDataMapper.xml index daf2f8d5..985a7ce4 100644 --- a/zc-business/src/main/resources/mapper/business/DcGantryMetricsStatisticsDataMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcGantryMetricsStatisticsDataMapper.xml @@ -14,6 +14,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + + + + + + + INSERT INTO @@ -145,5 +157,62 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND fa.direction = #{direction} AND dg.period_type = #{periodType} +