提交 67c2cb3e authored 作者: Phyday's avatar Phyday

增加路网监测所需的拥堵指数、技术等级接口

上级 90d69940
...@@ -185,11 +185,7 @@ public class RoadConditionEventServiceImpl ...@@ -185,11 +185,7 @@ public class RoadConditionEventServiceImpl
} }
/** /**
* @description : 根据事件类型查询 * 根据事件类型查询
* @author : Xingyuyang
* @date : 2019/4/23 0023 17:54
* @param :
* @return : null
*/ */
// @Cacheable(value = "staticByEventType") // @Cacheable(value = "staticByEventType")
public List<staticByEventTypeDto> staticByEventType() { public List<staticByEventTypeDto> staticByEventType() {
...@@ -197,11 +193,7 @@ public class RoadConditionEventServiceImpl ...@@ -197,11 +193,7 @@ public class RoadConditionEventServiceImpl
} }
/** /**
* @description : 根据影响程度查询 * 根据影响程度查询
* @author : Xingyuyang
* @date : 2019/4/23 0023 17:54
* @param :
* @return : null
*/ */
// @Cacheable(value = "staticByInfluence") // @Cacheable(value = "staticByInfluence")
public List<staticByInfluenceDto> staticByInfluence() { public List<staticByInfluenceDto> staticByInfluence() {
...@@ -209,11 +201,7 @@ public class RoadConditionEventServiceImpl ...@@ -209,11 +201,7 @@ public class RoadConditionEventServiceImpl
} }
/** /**
* @description : 根据月份查询 * 根据月份查询
* @author : Xingyuyang
* @date : 2019-4-24 10:27:35
* @param :
* @return : null
*/ */
// @Cacheable(value = "staticByMonth") // @Cacheable(value = "staticByMonth")
public List<staticByMonthDto> staticByMonth() { public List<staticByMonthDto> staticByMonth() {
...@@ -221,11 +209,7 @@ public class RoadConditionEventServiceImpl ...@@ -221,11 +209,7 @@ public class RoadConditionEventServiceImpl
} }
/** /**
* @description : 根据月份查询 * 根据月份查询
* @author : Xingyuyang
* @date : 2019-4-24 10:27:35
* @param :
* @return : null
*/ */
// @Cacheable(value = "staticByRoadCode") // @Cacheable(value = "staticByRoadCode")
public List<staticByRoadCodeDto> staticByRoadCode() { public List<staticByRoadCodeDto> staticByRoadCode() {
...@@ -233,11 +217,7 @@ public class RoadConditionEventServiceImpl ...@@ -233,11 +217,7 @@ public class RoadConditionEventServiceImpl
} }
/** /**
* @description : 根据城市查询 * 根据城市查询
* @author : Xingyuyang
* @date : 2019/4/24 0024 14:27
* @return :
* java.util.List<com.elephant.framework.galaxy.aroad.module.roadcondition.dto.staticByCityDto>
*/ */
public List<staticByCityDto> staticByCity() { public List<staticByCityDto> staticByCity() {
return baseMapper.staticByCity(); return baseMapper.staticByCity();
...@@ -277,7 +257,7 @@ public class RoadConditionEventServiceImpl ...@@ -277,7 +257,7 @@ public class RoadConditionEventServiceImpl
return baseMapper.getTQCoordinates(); return baseMapper.getTQCoordinates();
} }
@Cacheable(value = "yhCoordinates") // @Cacheable(value = "yhCoordinates")
public List<CoordinateDto> getYHCoordinates() { public List<CoordinateDto> getYHCoordinates() {
return baseMapper.getYHCoordinates(); return baseMapper.getYHCoordinates();
} }
...@@ -306,22 +286,21 @@ public class RoadConditionEventServiceImpl ...@@ -306,22 +286,21 @@ public class RoadConditionEventServiceImpl
/** /**
* @description : 根据城市查询 * 根据城市查询
* @author : Xingyuyang
* @date : 2019/4/24 0024 14:27
* @return :
* java.util.List<com.elephant.framework.galaxy.aroad.module.roadcondition.dto.staticByCityDto>
*/ */
public List<staticByYHCityDto> staticByYHCity() { public List<staticByYHCityDto> staticByYHCity() {
return baseMapper.staticByYHCity(); return baseMapper.staticByYHCity();
} }
/** /**
* @Description: 查询所有服务区所属路线名称和编码的树形结构 @Param: [] * @Description: 查询所有服务区所属路线名称和编码的树形结构
* @Param: []
* *
* @return: * @return:
* java.util.List<com.elephant.framework.galaxy.travel.module.basic_resources.entity.BaseServiceArea> @Author: * java.util.List<com.elephant.framework.galaxy.travel.module.basic_resources.entity.BaseServiceArea>
* songwenjie @Date: 2019/4/10 * @Author:
* songwenjie
* @Date: 2019/4/10
*/ */
// @Cacheable(value="cityTree") // @Cacheable(value="cityTree")
public BaseTreeDto getTree() { public BaseTreeDto getTree() {
......
package com.elephant.framework.galaxy.aroad.module.zhjc.controller; package com.elephant.framework.galaxy.aroad.module.zhjc.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.elephant.framework.galaxy.aroad.bigdata.Basehighwayalldata; import com.elephant.framework.galaxy.aroad.module.common.controller.BaseController;
import com.elephant.framework.galaxy.aroad.bigdata.EsUtil_fanshe;
import com.elephant.framework.galaxy.aroad.response.R;
import com.elephant.framework.galaxy.aroad.module.zhjc.entity.ZhjcPtgsdLwzs; import com.elephant.framework.galaxy.aroad.module.zhjc.entity.ZhjcPtgsdLwzs;
import com.elephant.framework.galaxy.aroad.module.zhjc.service.ZhjcPtgsdLwzsService; import com.elephant.framework.galaxy.aroad.module.zhjc.service.ZhjcPtgsdLwzsService;
import com.elephant.framework.galaxy.aroad.response.R;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.GetMapping;
import com.elephant.framework.galaxy.aroad.module.common.controller.BaseController; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.ArrayList; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/** /**
...@@ -36,12 +33,19 @@ public class ZhjcPtgsdLwzsController extends BaseController { ...@@ -36,12 +33,19 @@ public class ZhjcPtgsdLwzsController extends BaseController {
*/ */
@GetMapping("/list") @GetMapping("/list")
public R getLwzsList(Page page, ZhjcPtgsdLwzs lwjcPtgdlxpjxscs) { public R getLwzsList(Page page, ZhjcPtgsdLwzs lwjcPtgdlxpjxscs) {
return new R<>(zhjcPtgsdLwzsService.selectLwzs(lwjcPtgdlxpjxscs)); return new R<>(zhjcPtgsdLwzsService.selectLwzs(lwjcPtgdlxpjxscs));
} }
/**
* 路网监测--综合监测路网指数top6
* @author : Xingyuyang
* @date : 2019/05/29 16:11
*/
@GetMapping("/getlwzstop")
public R roadNetZhjcTop(Page page, ZhjcPtgsdLwzs lwjcPtgdlxpjxscs){
return new R<>(zhjcPtgsdLwzsService.roadNetZhjcTop(lwjcPtgdlxpjxscs));
}
/** /**
* 按路线编号查询 * 按路线编号查询
......
...@@ -18,4 +18,6 @@ public interface ZhjcPtgsdLwzsService extends IService<ZhjcPtgsdLwzs> { ...@@ -18,4 +18,6 @@ public interface ZhjcPtgsdLwzsService extends IService<ZhjcPtgsdLwzs> {
Map<String, List<ZhjcPtgsdLwzs>> selectLwzs(ZhjcPtgsdLwzs lwjcPtgdlxpjxscs); Map<String, List<ZhjcPtgsdLwzs>> selectLwzs(ZhjcPtgsdLwzs lwjcPtgdlxpjxscs);
List<Basehighwayalldata> getLinesByLxbh(String lxbh); List<Basehighwayalldata> getLinesByLxbh(String lxbh);
Map<String,List<ZhjcPtgsdLwzs>> roadNetZhjcTop(ZhjcPtgsdLwzs lwjcPtgdlxpjxscs);
} }
...@@ -10,7 +10,6 @@ import lombok.AllArgsConstructor; ...@@ -10,7 +10,6 @@ import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* 普通国道路线平均行程车速 * 普通国道路线平均行程车速
...@@ -66,4 +65,32 @@ public class ZhjcPtgsdLwzsServiceImpl extends ServiceImpl<ZhjcPtgsdLwzsMapper, c ...@@ -66,4 +65,32 @@ public class ZhjcPtgsdLwzsServiceImpl extends ServiceImpl<ZhjcPtgsdLwzsMapper, c
System.out.println(Arrays.toString(lukehighways.toArray())); System.out.println(Arrays.toString(lukehighways.toArray()));
return lukehighways; return lukehighways;
} }
/**
* 路网监测--综合监测路网指数top6
* @author : Xingyuyang
* @date : 2019/05/29 16:08
*/
public Map<String, List<ZhjcPtgsdLwzs>> roadNetZhjcTop(ZhjcPtgsdLwzs lwzs) {
Map<String,List<ZhjcPtgsdLwzs>> map = new HashMap<>();
List<ZhjcPtgsdLwzs> GdList = zhjcPtgsdLwzsMapper.selectGdlwzs(lwzs.getYear());
List<ZhjcPtgsdLwzs> SdList = zhjcPtgsdLwzsMapper.selectSdlwzs(lwzs.getYear());
List<ZhjcPtgsdLwzs> GSdList = new ArrayList<>();
GSdList.addAll(GdList);
GSdList.addAll(SdList);
// 定义一个比较器,用于排序
Comparator<ZhjcPtgsdLwzs> comparator = Comparator.comparingDouble(ZhjcPtgsdLwzs::getYjd);
GSdList.sort(comparator.reversed());
GSdList = GSdList.subList(0,6);
// map.put("gdList",GdList);
// map.put("sdList",SdList);
map.put("gsdList",GSdList);
return map;
}
} }
...@@ -2,14 +2,13 @@ package com.elephant.framework.galaxy.aroad.module.zhtj.controller; ...@@ -2,14 +2,13 @@ package com.elephant.framework.galaxy.aroad.module.zhtj.controller;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.elephant.framework.galaxy.aroad.module.common.annotation.SysLog;
import com.elephant.framework.galaxy.aroad.module.common.controller.BaseController;
import com.elephant.framework.galaxy.aroad.module.zhtj.entity.ZhtjGljsdjqk; import com.elephant.framework.galaxy.aroad.module.zhtj.entity.ZhtjGljsdjqk;
import com.elephant.framework.galaxy.aroad.module.zhtj.entity.ZhyhZhzsGlData;
import com.elephant.framework.galaxy.aroad.module.zhtj.service.ZhtjGljsdjqkService; import com.elephant.framework.galaxy.aroad.module.zhtj.service.ZhtjGljsdjqkService;
import com.elephant.framework.galaxy.aroad.response.R; import com.elephant.framework.galaxy.aroad.response.R;
import com.elephant.framework.galaxy.aroad.module.common.annotation.SysLog;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.elephant.framework.galaxy.aroad.module.common.controller.BaseController;
/** /**
...@@ -52,6 +51,16 @@ public class ZhtjGljsdjqkController extends BaseController { ...@@ -52,6 +51,16 @@ public class ZhtjGljsdjqkController extends BaseController {
return new R<>(zhtjGljsdjqkService.getZhyhZhzsGlData(year)); return new R<>(zhtjGljsdjqkService.getZhyhZhzsGlData(year));
} }
/**
* 路网监测--综合监测获取图表统计数据
* @author : Xingyuyang
* @date : 2019/05/29 15:26
*/
@GetMapping("/getroadnetzhjcdata")
public R getRoadNetZhjcData(String year){
return new R<>(zhtjGljsdjqkService.getRoadNetZhjcData(year));
}
/** /**
* 通过id查询综合统计_公路技术等级情况 * 通过id查询综合统计_公路技术等级情况
* @param id id * @param id id
......
...@@ -40,11 +40,18 @@ public interface ZhtjGljsdjqkService extends IService<ZhtjGljsdjqk> { ...@@ -40,11 +40,18 @@ public interface ZhtjGljsdjqkService extends IService<ZhtjGljsdjqk> {
* @return * @return
*/ */
ZhyhZhzsGlData getZhyhZhzsGlData(String year); ZhyhZhzsGlData getZhyhZhzsGlData(String year);
/**********************************************************/
/** /**
* *
* @param zhtjGljsdjqk * @param zhtjGljsdjqk
* @return * @return
*/ */
Map<String,Object> getGljsdj(ZhtjGljsdjqk zhtjGljsdjqk); Map<String,Object> getGljsdj(ZhtjGljsdjqk zhtjGljsdjqk);
/**
* 路网监测--综合监测获取图表统计数据
* @author : Xingyuyang
* @date : 2019/5/29 15:11
*/
ZhyhZhzsGlData getRoadNetZhjcData(String year);
} }
package com.elephant.framework.galaxy.aroad.module.zhtj.service.impl; package com.elephant.framework.galaxy.aroad.module.zhtj.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -188,8 +187,6 @@ public class ZhtjGljsdjqkServiceImpl extends ServiceImpl<ZhtjGljsdjqkMapper, Zht ...@@ -188,8 +187,6 @@ public class ZhtjGljsdjqkServiceImpl extends ServiceImpl<ZhtjGljsdjqkMapper, Zht
return zhyhZhzsGlData; return zhyhZhzsGlData;
} }
public List<ZhyhZhzsKeyValue> getZhyhZhzsGlOne(String year) { public List<ZhyhZhzsKeyValue> getZhyhZhzsGlOne(String year) {
return zgtjgljsdjqkMapper.getZhyhZhzsGlOne(year); return zgtjgljsdjqkMapper.getZhyhZhzsGlOne(year);
} }
...@@ -240,4 +237,51 @@ public class ZhtjGljsdjqkServiceImpl extends ServiceImpl<ZhtjGljsdjqkMapper, Zht ...@@ -240,4 +237,51 @@ public class ZhtjGljsdjqkServiceImpl extends ServiceImpl<ZhtjGljsdjqkMapper, Zht
} }
return zhyhZhzsKeyValues; return zhyhZhzsKeyValues;
} }
/**
*
* @description : 路网监测--综合监测获取图表统计数据
* @author : Xingyuyang
* @date : 2019/5/29 14:57
*
*/
public ZhyhZhzsGlData getRoadNetZhjcData(String year) {
ZhyhZhzsGlData zhyhZhzsGlData = new ZhyhZhzsGlData();
zhyhZhzsGlData.setZhyhZhzsGlTwo(getRoadNetZhjcInfo(year));
return zhyhZhzsGlData;
}
/**
* @description : 路网监测--综合监测获取图表统计数据
* @author : Xingyuyang
* @date : 2019/5/29 15:09
*/
public List<ZhyhZhzsKeyValue> getRoadNetZhjcInfo(String year) {
List<ZhyhZhzsKeyValue> zhyhZhzsKeyValues = new ArrayList<>();
ZhtjGljsdjqk zhtjGljsdjqk = zgtjgljsdjqkMapper.selectOne(Wrappers.<ZhtjGljsdjqk>query().lambda().eq(ZhtjGljsdjqk::getType,"国省道合计").
eq(ZhtjGljsdjqk::getArea,"合计").eq(ZhtjGljsdjqk::getYear,year));
ZhyhZhzsKeyValue zhyhZhzsKeyValue1 = new ZhyhZhzsKeyValue();
zhyhZhzsKeyValue1.setKey("一级");
zhyhZhzsKeyValue1.setValue(zhtjGljsdjqk.getFirstRoad().toString());
zhyhZhzsKeyValues.add(zhyhZhzsKeyValue1);
ZhyhZhzsKeyValue zhyhZhzsKeyValue2 = new ZhyhZhzsKeyValue();
zhyhZhzsKeyValue2.setKey("二级");
zhyhZhzsKeyValue2.setValue(zhtjGljsdjqk.getSecondRoad().toString());
zhyhZhzsKeyValues.add(zhyhZhzsKeyValue2);
ZhyhZhzsKeyValue zhyhZhzsKeyValue3 = new ZhyhZhzsKeyValue();
zhyhZhzsKeyValue3.setKey("三级");
zhyhZhzsKeyValue3.setValue(zhtjGljsdjqk.getThreeRoad().toString());
zhyhZhzsKeyValues.add(zhyhZhzsKeyValue3);
ZhyhZhzsKeyValue zhyhZhzsKeyValue4 = new ZhyhZhzsKeyValue();
zhyhZhzsKeyValue4.setKey("四级");
zhyhZhzsKeyValue4.setValue(zhtjGljsdjqk.getFourRoad().toString());
zhyhZhzsKeyValues.add(zhyhZhzsKeyValue4);
return zhyhZhzsKeyValues;
}
} }
...@@ -14,7 +14,7 @@ spring: ...@@ -14,7 +14,7 @@ spring:
driver-class-name: com.mysql.jdbc.Driver driver-class-name: com.mysql.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/aroad?useUnicode=true&characterEncoding=utf-8&useSSL=false url: jdbc:mysql://127.0.0.1:3306/aroad?useUnicode=true&characterEncoding=utf-8&useSSL=false
username: root username: root
password: root password: 123456
cache: cache:
type: redis type: redis
redis: redis:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论