Commit c31b4bfe authored by duanruiming's avatar duanruiming

Merge remote-tracking branch 'origin/master'

parents 3b17cc5f 18d7ebf6
utc.service.url=http://172.17.0.1:32000/utc
utc.dt.service.url=http://172.17.0.1:39002/utc-dt
utc.hisense.service.url=http://127.0.0.1:39003/utc-hisense
control.url=http://172.17.0.1:42001/web
...@@ -422,15 +422,30 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH ...@@ -422,15 +422,30 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
} }
//存放时段 //存放时段
List<String> sortedSet = EsDateIndexUtil.getTimeGranularityAxisAll(groupType, startTime, endTime); List<String> sortedSet = EsDateIndexUtil.getTimeGranularityAxisAll(groupType, startTime, endTime);
if (sortedSet.size() > 2) {
//方案评价-趋势图起点时间轴落到0点问题排除
params.put("startDate", sortedSet.get(0));
}
//======================================================================================================// //======================================================================================================//
//存放所有数据 //存放所有数据
List<Map<String, Object>> allList = new ArrayList<>(); List<Map<String, Object>> allList = new ArrayList<>();
long st1 = System.currentTimeMillis(); long st1 = System.currentTimeMillis();
List<CrossLaneDataHistPoExtend> list = greenwaveHistoryMapper.findCrossObjectIndex(params); List<CrossLaneDataHistPoExtend> list = greenwaveHistoryMapper.findCrossObjectIndex(params);
long et1 = System.currentTimeMillis(); long et1 = System.currentTimeMillis();
log.info("findCrossObjectIndex查耗时:{}ms,params:{}",et1-st1,params); log.info("findCrossObjectIndex查耗时:{}ms,params:{}", et1 - st1, params);
list = list.stream().sorted(Comparator.comparing(o -> o.getStartTime())).collect(Collectors.toList()); list = list.stream().sorted(Comparator.comparing(o -> o.getStartTime())).collect(Collectors.toList());
try {
//startTime、endTime传参非整5分情况导致的起终点落到0点情况
//最后一个时段
Date date = DateUtil.parse(sortedSet.get(sortedSet.size() - 1), "yyyy-MM-dd HH:mm:ss");
//方案评价-趋势图 终点时间轴落到0点问题排除
if (date.after(list.get(list.size() - 1).getStartTime())) {
sortedSet.remove(sortedSet.size() - 1);
}
} catch (ParseException e) {
e.printStackTrace();
}
//按时间分组分组 //按时间分组分组
Map<String, List<CrossLaneDataHistPoExtend>> groupByDir = list.stream().collect(Collectors.groupingBy(o -> o.getCrossId() + "_" + o.getLaneNo() + "_" + o.getDirType() + "_" + o.getTurnType(), TreeMap::new, Collectors.toList())); Map<String, List<CrossLaneDataHistPoExtend>> groupByDir = list.stream().collect(Collectors.groupingBy(o -> o.getCrossId() + "_" + o.getLaneNo() + "_" + o.getDirType() + "_" + o.getTurnType(), TreeMap::new, Collectors.toList()));
...@@ -482,7 +497,7 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH ...@@ -482,7 +497,7 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
} else if (Objects.equals(3, objectType)) { } else if (Objects.equals(3, objectType)) {
value = value.stream().sorted(Comparator.comparing(o -> o.getLaneNo())).collect(Collectors.toList()); value = value.stream().sorted(Comparator.comparing(o -> o.getLaneNo())).collect(Collectors.toList());
} }
if (Objects.equals(3, objectType)){ if (Objects.equals(3, objectType)) {
//车道指标mock数据 //车道指标mock数据
this.mockData(value); this.mockData(value);
} }
...@@ -517,7 +532,7 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH ...@@ -517,7 +532,7 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
po.setTimeAxis(time); po.setTimeAxis(time);
tmpList.add(po); tmpList.add(po);
} }
if (Objects.equals(3, objectType)){ if (Objects.equals(3, objectType)) {
//车道指标mock数据 //车道指标mock数据
this.mockData(tmpList); this.mockData(tmpList);
} }
...@@ -530,13 +545,13 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH ...@@ -530,13 +545,13 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
if (params.get("dir") != null) { if (params.get("dir") != null) {
allList = allList.stream().filter(o -> Objects.equals(params.get("dir").toString(), o.get("dirType").toString())).collect(Collectors.toList()); allList = allList.stream().filter(o -> Objects.equals(params.get("dir").toString(), o.get("dirType").toString())).collect(Collectors.toList());
} }
List<String> timeList = this.getTimeAxisList(groupType,sortedSet); List<String> timeList = this.getTimeAxisList(groupType, sortedSet);
BottomMenuBO bo = new BottomMenuBO(); BottomMenuBO bo = new BottomMenuBO();
bo.setCrossId(crossId); bo.setCrossId(crossId);
bo.setScope(objectType); bo.setScope(objectType);
List<String> scopeListAll = mainlineEvaluateService.bottomMenu(bo); List<String> scopeListAll = mainlineEvaluateService.bottomMenu(bo);
if (Objects.equals(4,objectType)){ if (Objects.equals(4, objectType)) {
scopeListAll = scopeList; scopeListAll = scopeList;
} }
...@@ -546,7 +561,7 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH ...@@ -546,7 +561,7 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
jsonObject.put("dataList", allList); jsonObject.put("dataList", allList);
jsonObject.put("scopeList", scopeListAll); jsonObject.put("scopeList", scopeListAll);
log.info("findCrossObjectIndex总查耗时:{}ms,params:{}",System.currentTimeMillis()-st1,params); log.info("findCrossObjectIndex总查耗时:{}ms,params:{}", System.currentTimeMillis() - st1, params);
return jsonObject; return jsonObject;
} }
...@@ -566,13 +581,13 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH ...@@ -566,13 +581,13 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
po.setSpeed(0D); po.setSpeed(0D);
} else { } else {
r = ArithOfBigDecmial.div(po.getFlow(), maxFlow, 2); r = ArithOfBigDecmial.div(po.getFlow(), maxFlow, 2);
po.setDelayTime((int)ArithOfBigDecmial.round(5 + r * 20, 0)); po.setDelayTime((int) ArithOfBigDecmial.round(5 + r * 20, 0));
po.setSpeed(ArithOfBigDecmial.round(30 + 30 * (1 - r), 2)); po.setSpeed(ArithOfBigDecmial.round(30 + 30 * (1 - r), 2));
} }
po.setSturation(ArithOfBigDecmial.round(r * 100, 2)); po.setSturation(ArithOfBigDecmial.round(r * 100, 2));
po.setGreenLightEfficiency(ArithOfBigDecmial.round(r * 0.8 * 100, 2)); po.setGreenLightEfficiency(ArithOfBigDecmial.round(r * 0.8 * 100, 2));
po.setVehicleLengthRatioMean(ArithOfBigDecmial.round(r * 0.9 * 100, 2)); po.setVehicleLengthRatioMean(ArithOfBigDecmial.round(r * 0.9 * 100, 2));
if (po.getFlow()==0){ if (po.getFlow() == 0) {
po.setDelayTime(0); po.setDelayTime(0);
} }
// DateTime dateTime = new DateTime(po.getStartTime()); // DateTime dateTime = new DateTime(po.getStartTime());
...@@ -765,7 +780,7 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH ...@@ -765,7 +780,7 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
@Override @Override
public GreenHistIndexDTO findGreenIndexByDateScope(Integer greenId, String startDate, String endDate) { public GreenHistIndexDTO findGreenIndexByDateScope(Integer greenId, String startDate, String endDate) {
List<GreenHistIndexDTO> list = greenwaveHistoryMapper.findGreenIndexByDateScope(greenId,startDate,endDate); List<GreenHistIndexDTO> list = greenwaveHistoryMapper.findGreenIndexByDateScope(greenId, startDate, endDate);
if (!list.isEmpty()) { if (!list.isEmpty()) {
GreenHistIndexDTO dto = list.get(0); GreenHistIndexDTO dto = list.get(0);
String flowAll = dto.getFlowAll(); String flowAll = dto.getFlowAll();
...@@ -944,7 +959,7 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH ...@@ -944,7 +959,7 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
tmp.setTurnType(value.get(0).getTurnType()); tmp.setTurnType(value.get(0).getTurnType());
tmp.setDirType(value.get(0).getDirType()); tmp.setDirType(value.get(0).getDirType());
tmp.setTimeAxis(timeSec); tmp.setTimeAxis(timeSec);
// String parseTime = startTime.substring(0, startTime.lastIndexOf(" ") + 1) + timeSec; // String parseTime = startTime.substring(0, startTime.lastIndexOf(" ") + 1) + timeSec;
if (Objects.equals("4", groupType)) { if (Objects.equals("4", groupType)) {
tmp.setStartTime(DateTime.parse(timeSec, DateTimeFormat.forPattern(EsDateIndexUtil.YMD_FORMATTER)).toDate()); tmp.setStartTime(DateTime.parse(timeSec, DateTimeFormat.forPattern(EsDateIndexUtil.YMD_FORMATTER)).toDate());
} else { } else {
...@@ -970,7 +985,7 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH ...@@ -970,7 +985,7 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
return value; return value;
} }
private List<String> getTimeAxisList(String groupType,List<String> timeList) { private List<String> getTimeAxisList(String groupType, List<String> timeList) {
//存放时段 //存放时段
List<String> formatTimeList = new ArrayList<>(); List<String> formatTimeList = new ArrayList<>();
if (Objects.equals("4", groupType)) { if (Objects.equals("4", groupType)) {
...@@ -978,8 +993,8 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH ...@@ -978,8 +993,8 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
formatTimeList.addAll(timeList); formatTimeList.addAll(timeList);
} else { } else {
//小时分钟粒度 //小时分钟粒度
formatTimeList.addAll(timeList.stream().map(dt -> dt.substring(dt.indexOf(" "),dt.lastIndexOf(":"))).collect(Collectors.toList())); formatTimeList.addAll(timeList.stream().map(dt -> dt.substring(dt.indexOf(" "), dt.lastIndexOf(":"))).collect(Collectors.toList()));
} }
return formatTimeList; return formatTimeList;
} }
} }
...@@ -397,7 +397,7 @@ ...@@ -397,7 +397,7 @@
and a.cross_id = #{crossId} and a.cross_id = #{crossId}
</if> </if>
<if test="dir != null and dir != ''"> <if test="dir != null and dir != ''">
and t1.dir = #{dir} and a.dir = #{dir}
</if> </if>
GROUP BY a.cross_id,a.dir,a.id GROUP BY a.cross_id,a.dir,a.id
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment