Commit 644f8018 authored by hanbing's avatar hanbing

方案管理-方案配置,根据灯组查询车道返回车道对象全部字段

parent 3306671d
package net.wanji.web.po.scheme;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -10,68 +11,70 @@ import java.util.Date;
* @date 2022/12/28 17:45
*/
@Data
@ApiModel(value = "LaneInfoPO", description = "车道对象")
public class LaneInfoPO {
/**
* 车道ID(路口ID_方向_序号)
*/
@ApiModelProperty(name = "车道ID(路口ID_方向_序号)", notes = "")
@ApiModelProperty(value = "车道ID(路口ID_方向_序号)", notes = "")
private String id;
/**
* 车道代码
*/
@ApiModelProperty(name = "车道代码", notes = "")
@ApiModelProperty(value = "车道代码", notes = "")
private String code;
/**
* 车道序号;从左车道开始编号11、12、13...
*/
@ApiModelProperty(name = "车道序号", notes = "从左车道开始编号11、12、13...")
@ApiModelProperty(value = "车道序号", notes = "从左车道开始编号11、12、13...")
private Integer sort;
/** 车道类型:1路段车道;2进口车道;3出口车道;4左转弯待转区;6直行待行区 */
@ApiModelProperty(name = "车道类型:1路段车道;2进口车道;3出口车道;4左转弯待转区;6直行待行区",notes = "")
@ApiModelProperty(value = "车道类型:1路段车道;2进口车道;3出口车道;4左转弯待转区;6直行待行区",notes = "")
private Integer type = 2 ; // todo 信控只用到进口车道
/**
* 车道方向:1北;2东北;3东;4东南;5南;6西南;7西;8西北
*/
@ApiModelProperty(name = "车道方向:1北;2东北;3东;4东南;5南;6西南;7西;8西北", notes = "")
@ApiModelProperty(value = "车道方向:1北;2东北;3东;4东南;5南;6西南;7西;8西北", notes = "")
private Integer dir;
/**
* 车道转向:0未知;1左转;2直行;3右转;4掉头;5直左;6直右;7左直右;8左右;9左转掉头;10直行掉头;11右转掉头;12左直掉头;13直右掉头;14左直右掉头;15左右掉头
*/
@ApiModelProperty(name = "车道转向:0未知;1左转;2直行;3右转;4掉头;5直左;6直右;7左直右;8左右;9左转掉头;10直行掉头;11右转掉头;12左直掉头;13直右掉头;14左直右掉头;15左右掉头", notes = "")
@ApiModelProperty(value = "车道转向:0未知;1:直行2:左转,3:右转,4:掉头,5:左直,6:右直,7:左转掉头,8:左直掉头, 9:左直右, 10:左右转", notes = "")
// 后端数据库对应关系:0未知;1左转;2直行;3右转;4掉头;5直左;6直右;7左直右;8左右;9左转掉头;10直行掉头;11右转掉头;12左直掉头;13直右掉头;14左直右掉头;15左右掉头
private Integer turn;
/**
* 车道类别:1机动车;2非机动车;3公交专用;4可变;5潮汐
*/
@ApiModelProperty(name = "车道类别:1机动车;2非机动车;3公交专用;4可变;5潮汐", notes = "")
@ApiModelProperty(value = "车道类别:1机动车;2非机动车;3公交专用;4可变;5潮汐", notes = "")
private Integer category;
/**
* 路口ID
*/
@ApiModelProperty(name = "路口ID", notes = "")
@ApiModelProperty(value = "路口ID", notes = "")
private String crossId;
/**
* 路段编号
*/
@ApiModelProperty(name = "路段编号", notes = "")
@ApiModelProperty(value = "路段编号", notes = "")
private String rid = "";
/**
* 车道长度
*/
@ApiModelProperty(name = "车道长度", notes = "")
@ApiModelProperty(value = "车道长度", notes = "")
private Double length = 0.0;
/**
* 车道宽度
*/
@ApiModelProperty(name = "车道宽度", notes = "")
@ApiModelProperty(value = "车道宽度", notes = "")
private Double width = 0.0;
/**
* 创建时间
*/
@ApiModelProperty(name = "创建时间", notes = "")
@ApiModelProperty(value = "创建时间", notes = "")
private Date gmtCreate;
/**
* 修改时间
*/
@ApiModelProperty(name = "修改时间", notes = "")
@ApiModelProperty(value = "修改时间", notes = "")
private Date gmtModified;
}
\ No newline at end of file
package net.wanji.web.service.scheme.impl;
import net.wanji.web.common.constant.ControlModeConst;
import net.wanji.web.common.enums.CrossTurnEnum;
import net.wanji.web.common.exception.PhaseNoNotUniqueException;
import net.wanji.web.dto.CrossIdDTO;
import net.wanji.web.dto.LaneIdDTO;
......@@ -76,7 +77,13 @@ public class SchemeConfigServiceImpl implements SchemeConfigService {
List<String> laneIds = crossLaneLightsPOList.stream()
.map(CrossLaneLightsPO::getLaneId)
.collect(Collectors.toList());
laneIdsVO.setLaneIds(laneIds);
List<LaneInfoPO> laneInfoPOList = laneInfoMapper.selectByLaneIds(laneIds);
for (LaneInfoPO laneInfoPO : laneInfoPOList) {
Integer backEndTurn = laneInfoPO.getTurn();
Integer frontEndTurn = CrossTurnEnum.getFrontByBack(backEndTurn);
laneInfoPO.setTurn(frontEndTurn);
}
laneIdsVO.setLanes(laneInfoPOList);
return laneIdsVO;
}
......
package net.wanji.web.vo.scheme;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import net.wanji.web.po.scheme.LaneInfoPO;
import java.util.List;
......@@ -10,9 +12,10 @@ import java.util.List;
* @date 2023/1/9 8:56
*/
@Data
@ApiModel(value = "LaneIdsVO", description = "根据灯组查询车道信息返回值")
public class LaneIdsVO {
@ApiModelProperty(value = "路口ID", required = true)
private String crossId;
@ApiModelProperty(value = "车道ID列表", required = true)
private List<String> laneIds;
@ApiModelProperty(value = "车道列表", required = true)
private List<LaneInfoPO> lanes;
}
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