Commit cee4bb11 authored by zhoushiguang's avatar zhoushiguang

出口道=》方向级指标、 车道级指标 统一接口

parent 68e7a695
......@@ -10,6 +10,7 @@ import org.joda.time.Days;
import org.joda.time.Hours;
import org.joda.time.Minutes;
import org.joda.time.Months;
import org.joda.time.format.DateTimeFormat;
import java.io.File;
import java.util.ArrayList;
......@@ -24,17 +25,45 @@ public class EsDateIndexUtil {
public static final String YMDHM_FORMATTER = "yyyyMMddHHmm";
public static final String YMDHMSFORMATTER = "yyyyMMddHHmmss";
public static final String YMD_HM_FORMATTER = "yyyy-MM-dd HH:mm:00";
public static final String YMD_HM_FORMATTER = "yyyy-MM-dd HH:mm:ss";
public static final String YMD_H_FORMATTER = "yyyyMMddHH";
public static final String YMD_FORMATTER = "yyyyMMdd";
public static final String YM_FORMATTER = "yyyyMM";
public static final String HMS_FORMATTER = "HH:mm:ss";
public static final String HMS_SSS_FORMATTER = "HH:mm:ss SSS";
public static final String HM_FORMATTER = "HH:mm";
public static final String H_FORMATTER = "HH";
public static final String H_FORMATTER = "HH:00";
private static final String FORMATSTR = "%s_%s";
/**
* 获取时段范围内不同时间粒度的时间轴
* @param groupType 0:5分钟 1:15分钟 2:30分钟 3:1小时 4:天粒度
* @param startTime 开始时间
* @param endTime 截止时间
* @return
*/
public static Set<String> getTimeGranularityAxis(String groupType,String startTime, String endTime) {
//存放时段
Set<String> sortedSet = new TreeSet<>();
//===========================根据开始、结束时间输出完整时刻点=================================================//
DateTime start = DateTime.parse(startTime, DateTimeFormat.forPattern(EsDateIndexUtil.YMD_HM_FORMATTER));
DateTime end = DateTime.parse(endTime, DateTimeFormat.forPattern(EsDateIndexUtil.YMD_HM_FORMATTER));
if (Objects.equals("0", groupType)) {
sortedSet.addAll(EsDateIndexUtil.getTimeScopeList(start, end, TimeGranularityEnum.FIVE_MINUTE, EsDateIndexUtil.HM_FORMATTER));
} else if (Objects.equals("1", groupType)) {
sortedSet.addAll(EsDateIndexUtil.getTimeScopeList(start, end, TimeGranularityEnum.FIFTEEN_MINUTE, EsDateIndexUtil.HM_FORMATTER));
} else if (Objects.equals("2", groupType)) {
sortedSet.addAll(EsDateIndexUtil.getTimeScopeList(start, end, TimeGranularityEnum.THIRTY_MINUTE, EsDateIndexUtil.HM_FORMATTER));
} else if (Objects.equals("3", groupType)) {
sortedSet.addAll(EsDateIndexUtil.getTimeScopeList(start, end, TimeGranularityEnum.ONE_HOUR, EsDateIndexUtil.H_FORMATTER));
} else if (Objects.equals("4", groupType)) {
sortedSet.addAll(EsDateIndexUtil.getTimeScopeList(start, end, TimeGranularityEnum.ONE_DAY, EsDateIndexUtil.YMD_FORMATTER));
}
return sortedSet;
}
/**
* 根据开始结束时间获取不同时间粒度的时刻点
*
......@@ -59,7 +88,7 @@ public class EsDateIndexUtil {
}else if (Objects.equals(TimeGranularityEnum.ONE_HOUR, timeGranularityEnum)) {
unitTime = 60;
}else if (Objects.equals(TimeGranularityEnum.ONE_DAY, timeGranularityEnum)) {
unitTime = 24*60*60;
unitTime = 24*60;
}
for (int i = 0; i <= diffNum; i=i+unitTime) {
......
......@@ -79,5 +79,34 @@ public interface GreenwaveHistoryMapper extends BaseInterfaceMapper<GreenwaveHis
*/
List<CrossLaneDataHistPoExtend> findGreenWaveCrossLaneIndex(Map<String,Object> params);
/**
* 出口车道信息查询
* @param params
* @return
*/
List<Map<String,Object>> findCrossExitRoadLaneInfo(Map<String,Object> params);
/**
* 出口车道信息查询
* @param params
* @return
*/
List<Map<String,Object>> findCrossExitRoadDirInfo(Map<String,Object> params);
/**
* 出口车道信指标息查询
* @param params
* @return
*/
List<CrossLaneDataHistPoExtend> findCrossExitRoadLaneIndex(Map<String,Object> params);
/**
* 出口道方向指标数据查询
* @param params
* @return
*/
List<CrossLaneDataHistPoExtend> findCrossExitRoadIndex(Map<String,Object> params);
}
......@@ -14,7 +14,9 @@ import java.util.Date;
* @description
*/
@Data
public class CrossLaneDataHistPoExtend extends CrossLaneDataHistPO {
public class CrossLaneDataHistPoExtend {
@ApiModelProperty(name = "路口编号",notes = "")
private String crossId;
//车道ID
@ApiModelProperty(value = "车道ID", notes = "")
private String laneId;
......@@ -37,8 +39,22 @@ public class CrossLaneDataHistPoExtend extends CrossLaneDataHistPO {
@ApiModelProperty(value = "平均排队长度", notes = "")
private Integer avgQueueLength;
@ApiModelProperty(name = "交通流量(辆)",notes = "")
private Integer flow;
@ApiModelProperty(name = "平均速度(km/h)",notes = "")
private Double speed;
@ApiModelProperty(name = "停车次数",notes = "")
private Double stopTimes;
@ApiModelProperty(name = "延误时间",notes = "")
private Integer delayTime;
@ApiModelProperty(name = "饱和度",notes = "")
private Double sturation;
@ApiModelProperty(value = "开始时间:yyyy-MM-dd HH:mm:ss", notes = "")
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
public Date startTime;
@ApiModelProperty(value = "时间轴", notes = "")
public String timeAxis;
}
......@@ -5,6 +5,7 @@ import net.wanji.common.framework.dubbointerface.BaseDubboInterface;
import net.wanji.common.framework.exception.DubboProviderException;
import net.wanji.databus.po.CrossDirDataHistPO;
import net.wanji.opt.entity.GreenwaveHist;
import net.wanji.opt.po.base.CrossLaneDataHistPoExtend;
import net.wanji.opt.vo.GreenWaveRunStateVO;
import java.util.List;
......@@ -103,4 +104,28 @@ public interface GreenwaveHistProvider extends BaseDubboInterface<GreenwaveHist>
* @throws DubboProviderException
*/
JSONObject findGreenWaveCrossLaneIndex(String crossId, String startTime, String endTime, String groupType,Integer objectType) throws DubboProviderException;
/**
* 出口车道信指标息查询
* @param crossId
* @param startTime
* @param endTime
* @param groupType
* @return
* @throws DubboProviderException
*/
JSONObject findCrossExitRoadLaneInfo(String crossId, String startTime, String endTime, String groupType) throws DubboProviderException;
/**
* 出口道方向指标数据查询
* @param crossId
* @param startTime
* @param endTime
* @param groupType
* @param objectType 1:出口道方向级指标 2:出口道车道级指标
* @return
* @throws DubboProviderException
*/
JSONObject findCrossExitRoadDirInfo(String crossId, String startTime, String endTime, String groupType,Integer objectType) throws DubboProviderException;
}
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