Commit 17ff6a00 authored by zhoushiguang's avatar zhoushiguang

Merge remote-tracking branch 'origin/master'

parents b3346a1e 2945f0f3
...@@ -55,7 +55,7 @@ public class StrategyControlController { ...@@ -55,7 +55,7 @@ public class StrategyControlController {
@ApiOperation(httpMethod="GET",value="策略执行记录历史->路口/干线,时间粒度, 策略成功失败类型", notes="") @ApiOperation(httpMethod="GET",value="策略执行记录历史->路口/干线,时间粒度, 策略成功失败类型", notes="")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "strategyType", value = "策略类型 0-路口 1-干线 空-查所有", required = false, dataType = "Integer"), @ApiImplicitParam(name = "strategyType", value = "策略类型 0-路口 1-干线 空-查所有", required = false, dataType = "Integer"),
@ApiImplicitParam(name = "groupType", value = "时间粒度类型 0-1小时 1-1天", required = false, dataType = "Integer", defaultValue = "1"), @ApiImplicitParam(name = "groupType", value = "时间粒度类型 0-1小时 1-1天 2-5秒", required = false, dataType = "Integer", defaultValue = "1"),
@ApiImplicitParam(name = "resultType", value = "时间粒度类型 0-失败 1-成功 空-查所有", required = false, dataType = "Integer"), @ApiImplicitParam(name = "resultType", value = "时间粒度类型 0-失败 1-成功 空-查所有", required = false, dataType = "Integer"),
}) })
@ApiResponses({ @ApiResponses({
......
...@@ -6,7 +6,6 @@ import com.fasterxml.jackson.core.JsonProcessingException; ...@@ -6,7 +6,6 @@ import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.wanji.common.enums.DateStyle;
import net.wanji.common.framework.Constants; import net.wanji.common.framework.Constants;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.common.utils.tool.DateUtil; import net.wanji.common.utils.tool.DateUtil;
...@@ -188,7 +187,22 @@ public class StrategyControlServiceImpl implements StrategyControlService { ...@@ -188,7 +187,22 @@ public class StrategyControlServiceImpl implements StrategyControlService {
if (Objects.isNull(groupType)) { if (Objects.isNull(groupType)) {
groupType = 1; groupType = 1;
} }
LocalDateTime localDateTime = Objects.equals(0, groupType) ? DateUtil.getPlusHour(-1) : DateUtil.getMidNight(); // LocalDateTime localDateTime = Objects.equals(0, groupType) ? DateUtil.getPlusHour(-1) : DateUtil.getMidNight();
LocalDateTime localDateTime = null;
switch(groupType){
case 0:
localDateTime = DateUtil.getPlusHour(-1);
break;
case 1:
localDateTime = DateUtil.getMidNight();
break;
case 2:
localDateTime = DateUtil.getPlusSecond(-5);
break;
default:
localDateTime = DateUtil.getMidNight();
}
// 查询干线和路口 // 查询干线和路口
if (Objects.isNull(strategyType)) { if (Objects.isNull(strategyType)) {
setGreenOptHist(results, localDateTime, resultType); setGreenOptHist(results, localDateTime, resultType);
......
...@@ -15,4 +15,6 @@ public class CrossEventListPO { ...@@ -15,4 +15,6 @@ public class CrossEventListPO {
private Integer duration; private Integer duration;
private String type; private String type;
private String typeName; private String typeName;
private String wkt;
private Double trafficIndex;
} }
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
<!-- 路口监测左下角路口事件列表 --> <!-- 路口监测左下角路口事件列表 -->
<select id = "selectCrossEventList" resultType="net.wanji.opt.vo.CrossEventListPO"> <select id = "selectCrossEventList" resultType="net.wanji.opt.vo.CrossEventListPO">
select t1.id crossId, t2.type, ifnull(t2.place_desc, "畅通") typeName, select t1.id crossId, t2.type, ifnull(t2.place_desc, "畅通") typeName,
ifnull(t2.count, 0) count, ifnull(t2.duration, 0) duration, t1.`name` name ifnull(t2.count, 0) count, ifnull(t2.duration, 0) duration, t1.`name` name,t1.location wkt, ROUND(t3.traffic_index,2) trafficIndex
from t_base_cross_info t1 from t_base_cross_info t1
left join left join
(select cross_id, type, place_desc, (select cross_id, type, place_desc,
...@@ -111,6 +111,8 @@ ...@@ -111,6 +111,8 @@
group by cross_id, type group by cross_id, type
order by duration desc) t2 order by duration desc) t2
on t2.cross_id = t1.id on t2.cross_id = t1.id
LEFT JOIN t_cross_data_realtime t3
ON t1.id = t3.cross_id
where t1.is_signal = 1 where t1.is_signal = 1
order by t2.duration desc order by t2.duration desc
</select> </select>
......
...@@ -567,4 +567,10 @@ public class DateUtil { ...@@ -567,4 +567,10 @@ public class DateUtil {
return localDateTime; return localDateTime;
} }
public static LocalDateTime getPlusSecond(Integer offset) {
LocalDateTime now = LocalDateTime.now();
LocalDateTime localDateTime = now.plusSeconds(offset);
return localDateTime;
}
} }
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