Commit 5af88d05 authored by duwei's avatar duwei

转向接口优化

parent 9e513323
......@@ -4,6 +4,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import net.wanji.common.enums.TurnConvertEnum;
import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.databus.bo.CrossIdBO;
import net.wanji.databus.vo.GreenwaveListVO;
......@@ -309,6 +310,23 @@ public class TrendController {
@ApiResponse(code = 200, message = "OK", response = AnalysisRidTurnIndicators.class),
})
public JsonViewObject lanePeriodTurnData(@RequestBody LanePeriodTurnVO lanePeriodTurnVO) throws Exception {
String turns = lanePeriodTurnVO.getTurns();
if (turns != null){
StringBuilder inDir = new StringBuilder();
StringBuilder turnType = new StringBuilder();
String[] turnArr = turns.split(",");
for (int i =0; i < turnArr.length; i++){
String[] s = turnArr[i].split("-");
if (i < turnArr.length - 1) {
inDir.append(s[0]).append(",");
String t = TurnConvertEnum.getCodeByKey(Integer.parseInt(s[0]));
turnType.append(t).append(",");
}
}
lanePeriodTurnVO.setInDir(inDir.toString());
lanePeriodTurnVO.setTurnType(turnType.toString());
}
List<CrossingTurnQueryVO.CycleDataElement> result = trendService.lanePeriodTurnData(lanePeriodTurnVO);
return JsonViewObject.newInstance().success(result);
}
......
......@@ -17,6 +17,14 @@ import java.util.List;
public class LanePeriodTurnVO extends CommonCrossIdDateTimeVO {
@ApiModelProperty(value = "分析粒度【5m:五分钟 10m:10分钟 30m:30分钟 1h:一小时】")
private String granularity;
/**
* 方向-转向
* 例:1-1(北-左转)
*/
@ApiModelProperty(value = "方向-转向")
private String turns;
/**
* 用逗号分隔
*/
......
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