From bc295a7ff3731e30f8d3fd7c72bd322d4cf461c8 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Thu, 26 Dec 2024 13:58:17 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=B8=80=E7=B1=BB=E4=BA=A4=E8=B0=83=E7=AB=99?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E4=BC=98=E5=8C=96=E5=B9=B3=E5=9D=87=E8=BD=A6?= =?UTF-8?q?=E9=80=9F=202.=E6=95=B0=E6=8D=AE=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DcTrafficSurveyDataController.java | 28 ++++++++--- .../business/DcTrafficSurveyDataMapper.xml | 46 ++++++++++++++----- 2 files changed, 56 insertions(+), 18 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcTrafficSurveyDataController.java b/zc-business/src/main/java/com/zc/business/controller/DcTrafficSurveyDataController.java index 2f32dd61..f2137da0 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcTrafficSurveyDataController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcTrafficSurveyDataController.java @@ -449,19 +449,35 @@ public class DcTrafficSurveyDataController extends BaseController public AjaxResult selectComprehensiveData(@RequestBody DcTrafficSurveyDataQueryParams dcTrafficSurveyDataQueryParams){ return dcTrafficSurveyDataService.selectComprehensiveData(dcTrafficSurveyDataQueryParams); } + + /** + * 导出综合查询 + */ @PostMapping("/exportComprehensiveData") public void exportComprehensiveData(HttpServletResponse response,@RequestBody DcTrafficSurveyDataQueryParams dcTrafficSurveyDataQueryParams) { AjaxResult ajaxResult = dcTrafficSurveyDataService.selectComprehensiveData(dcTrafficSurveyDataQueryParams); if (ajaxResult.get("code").equals(UniversalEnum.TWO_HUNDRED.getNumber())) { if (dcTrafficSurveyDataQueryParams.getDataType().equals("1")){ - List dcTrafficVolumeData = (List) ajaxResult.get("data"); - ExcelUtil util = new ExcelUtil<>(DcTrafficVolumeData.class); - util.exportExcel(response, dcTrafficVolumeData, "综合查询"); + if (dcTrafficSurveyDataQueryParams.getDirection().equals("2")) { + List dcTrafficVolumeData = (List) ajaxResult.get("data"); + ExcelUtil util = new ExcelUtil<>(DcTrafficVolumeData.class); + util.exportExcel(response, dcTrafficVolumeData, "综合查询"); + } else if (dcTrafficSurveyDataQueryParams.getDirection().equals("1")) { + List dcTrafficVolumeData = (List) ajaxResult.get("data"); + ExcelUtil util = new ExcelUtil<>(DcTrafficVolumeDirectionData.class); + util.exportExcel(response, dcTrafficVolumeData, "综合查询"); + } } else { - List dcTrafficSpeedData = (List) ajaxResult.get("data"); - ExcelUtil util = new ExcelUtil<>(DcTrafficSpeedData.class); - util.exportExcel(response, dcTrafficSpeedData, "综合查询"); + if (dcTrafficSurveyDataQueryParams.getDirection().equals("2")) { + List dcTrafficSpeedData = (List) ajaxResult.get("data"); + ExcelUtil util = new ExcelUtil<>(DcTrafficSpeedData.class); + util.exportExcel(response, dcTrafficSpeedData, "综合查询"); + } else if (dcTrafficSurveyDataQueryParams.getDirection().equals("1")) { + List dcTrafficSpeedData = (List) ajaxResult.get("data"); + ExcelUtil util = new ExcelUtil<>(DcTrafficSpeedDirectionData.class); + util.exportExcel(response, dcTrafficSpeedData, "综合查询"); + } } } } diff --git a/zc-business/src/main/resources/mapper/business/DcTrafficSurveyDataMapper.xml b/zc-business/src/main/resources/mapper/business/DcTrafficSurveyDataMapper.xml index 1cf7a673..58cfa08b 100644 --- a/zc-business/src/main/resources/mapper/business/DcTrafficSurveyDataMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcTrafficSurveyDataMapper.xml @@ -107,9 +107,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"