From 12d44c78aa03c277f2143c614716880a7fcab3a1 Mon Sep 17 00:00:00 2001 From: lau572 <1010031226@qq.com> Date: Thu, 2 Jan 2025 14:12:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=A4=E8=B0=83=E7=BB=BC=E5=90=88=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/DcTrafficVolumeDirectionData.java | 13 +++++++++++++ .../impl/DcTrafficSurveyDataServiceImpl.java | 6 +++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/zc-business/src/main/java/com/zc/business/domain/DcTrafficVolumeDirectionData.java b/zc-business/src/main/java/com/zc/business/domain/DcTrafficVolumeDirectionData.java index 0e825ad0..728222e9 100644 --- a/zc-business/src/main/java/com/zc/business/domain/DcTrafficVolumeDirectionData.java +++ b/zc-business/src/main/java/com/zc/business/domain/DcTrafficVolumeDirectionData.java @@ -106,6 +106,10 @@ public class DcTrafficVolumeDirectionData extends BaseEntity @Excel(name = "合计-济南") private Integer trafficVolumeJN; + /** 总计车流量 */ + @Excel(name = "总计车流量") + private Integer allTrafficVolume; + public Long getId() { return id; } @@ -298,6 +302,14 @@ public class DcTrafficVolumeDirectionData extends BaseEntity this.trafficVolumeHZ = trafficVolumeHZ; } + public Integer getAllTrafficVolume() { + return allTrafficVolume; + } + + public void setAllTrafficVolume(Integer allTrafficVolume) { + this.allTrafficVolume = allTrafficVolume; + } + public DcTrafficVolumeDirectionData(){} public DcTrafficVolumeDirectionData(Integer initData){ @@ -321,5 +333,6 @@ public class DcTrafficVolumeDirectionData extends BaseEntity this.tractorTrafficVolumeHZ = initData; this.trafficVolumeJN = initData; this.trafficVolumeHZ = initData; + this.allTrafficVolume = initData; } } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcTrafficSurveyDataServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcTrafficSurveyDataServiceImpl.java index c6f1ba1b..db8d9bc1 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcTrafficSurveyDataServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcTrafficSurveyDataServiceImpl.java @@ -280,7 +280,7 @@ public class DcTrafficSurveyDataServiceImpl implements IDcTrafficSurveyDataServi if (dcTrafficSurveyDataQueryParams.getDataType().equals("1")){ //车流量 - List dcTrafficVolumeData = dcTrafficSurveyDataMapper.selectTrafficVolume(dcTrafficSurveyDataQueryParams); + List dcTrafficVolumeData = dcTrafficSurveyDataMapper.selectTrafficVolume(dcTrafficSurveyDataQueryParams); if (dcTrafficVolumeData.size() > 0){ //判断是否区分方向 @@ -318,6 +318,7 @@ public class DcTrafficSurveyDataServiceImpl implements IDcTrafficSurveyDataServi dcTrafficVolumeDirectionData.setTrafficVolumeJN(trafficVolumeData.getTrafficVolume()); } } + dcTrafficVolumeDirectionData.setAllTrafficVolume(dcTrafficVolumeDirectionData.getTrafficVolumeHZ()+dcTrafficVolumeDirectionData.getTrafficVolumeJN()); result.add(dcTrafficVolumeDirectionData); } @@ -346,6 +347,7 @@ public class DcTrafficSurveyDataServiceImpl implements IDcTrafficSurveyDataServi naturalTotal.setTractorTrafficVolumeJN(naturalTotal.getTractorTrafficVolumeJN() + dcTrafficVolumeDirectionDatum.getTractorTrafficVolumeJN()); naturalTotal.setTrafficVolumeHZ(naturalTotal.getTrafficVolumeHZ() + dcTrafficVolumeDirectionDatum.getTrafficVolumeHZ()); naturalTotal.setTrafficVolumeJN(naturalTotal.getTrafficVolumeJN() + dcTrafficVolumeDirectionDatum.getTrafficVolumeJN()); + naturalTotal.setAllTrafficVolume(naturalTotal.getTrafficVolumeJN() + naturalTotal.getTrafficVolumeHZ()); } //折算值 DcTrafficVolumeDirectionData conversionValue = new DcTrafficVolumeDirectionData(0); @@ -382,6 +384,7 @@ public class DcTrafficSurveyDataServiceImpl implements IDcTrafficSurveyDataServi conversionValue.getContainerTruckTrafficVolumeJN() + conversionValue.getMotorcycleTrafficVolumeJN() + conversionValue.getTractorTrafficVolumeJN(); conversionValue.setTrafficVolumeJN(trafficVolumeJN); + conversionValue.setAllTrafficVolume(trafficVolumeHZ + trafficVolumeJN); //自然平均值 DcTrafficVolumeDirectionData naturalAvg = new DcTrafficVolumeDirectionData(0); @@ -416,6 +419,7 @@ public class DcTrafficSurveyDataServiceImpl implements IDcTrafficSurveyDataServi naturalAvg.getContainerTruckTrafficVolumeJN() + naturalAvg.getMotorcycleTrafficVolumeJN() + naturalAvg.getTractorTrafficVolumeJN(); naturalAvg.setTrafficVolumeJN(naturalAvgTrafficVolumeJN); + naturalAvg.setAllTrafficVolume(naturalAvgTrafficVolumeHZ + naturalAvgTrafficVolumeJN); result = result.stream().sorted(Comparator.comparing(DcTrafficVolumeDirectionData::getTime)).collect(Collectors.toList()); result.add(naturalTotal);