Commit 40c53c3c authored by wuxiaokai's avatar wuxiaokai

控制指令接口-测试

parent f1f0d70a
...@@ -382,8 +382,6 @@ public class HKControlCommandServiceImpl implements ControlCommandService { ...@@ -382,8 +382,6 @@ public class HKControlCommandServiceImpl implements ControlCommandService {
if (manufacturerInfoPO.getCode().equals(BasicEnum.ManufacturerEnum.HK.getCode())) { if (manufacturerInfoPO.getCode().equals(BasicEnum.ManufacturerEnum.HK.getCode())) {
if (commandVO.getCommand().equals(TRUE)) { if (commandVO.getCommand().equals(TRUE)) {
Map<String, Object> param = new HashMap<String, Object>() { Map<String, Object> param = new HashMap<String, Object>() {
private static final long serialVersionUID = 7462850358909460605L;
{ {
//put("crossCode", commandVO.getCrossCode()); //put("crossCode", commandVO.getCrossCode());
put("crossCode", manufacturerInfoPO.getName()); put("crossCode", manufacturerInfoPO.getName());
...@@ -391,15 +389,25 @@ public class HKControlCommandServiceImpl implements ControlCommandService { ...@@ -391,15 +389,25 @@ public class HKControlCommandServiceImpl implements ControlCommandService {
} }
}; };
// 控制命令为灯态锁定时,设置相关车道参数信息 // 控制命令为灯态锁定时,设置相关车道参数信息
// 获取当前运行方案的相位id
//List<SignalRunring> runrings = getSignalInfoVos(commandVO.getCrossCode()).get(0).getRunrings(); //List<SignalRunring> runrings = getSignalInfoVos(commandVO.getCrossCode()).get(0).getRunrings();
List<SignalRunring> runrings = getSignalInfoVos(manufacturerInfoPO.getName()).get(0).getRunrings();
// HK 为单环 // HK 为单环
Integer phaseId = Integer.valueOf(runrings.get(0).getPhaseId()); // 获取当前运行方案的相位id
LightsStatusVO statusVO = getSignalInfoVos(manufacturerInfoPO.getName()).get(0);
Integer phaseId = Integer.valueOf(statusVO.getPhaseId());
// 获取某一路口下海康相位和车道关系 // 获取某一路口下海康相位和车道关系
//Map<Integer, JSONArray> laneArrayMap = getPhaseRelationLanes(commandVO.getCrossCode()); //Map<Integer, JSONArray> laneArrayMap = getPhaseRelationLanes(commandVO.getCrossCode());
Map<Integer, JSONArray> laneArrayMap = getPhaseRelationLanes(manufacturerInfoPO.getName()); Map<Integer, JSONArray> laneArrayMap = getPhaseRelationLanes(manufacturerInfoPO.getName());
param.put("laneInfos", laneArrayMap.get(phaseId)); JSONArray jsonArray = laneArrayMap.get(phaseId);
List<Map<String, Object>> laneList = new ArrayList<>();
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
Map<String, Object> laneMap = new HashMap<>();
laneMap.put("laneNo", jsonObject.getInteger("laneNo"));
laneMap.put("turn", jsonObject.getInteger("turn"));
laneMap.put("direction", jsonObject.getInteger("direction"));
laneList.add(laneMap);
}
param.put("laneInfos", laneList);
param.put("controlNo", 0); param.put("controlNo", 0);
// 控制时长,单位 s,0 则持续控制 // 控制时长,单位 s,0 则持续控制
param.put("duration", 0); param.put("duration", 0);
...@@ -429,7 +437,7 @@ public class HKControlCommandServiceImpl implements ControlCommandService { ...@@ -429,7 +437,7 @@ public class HKControlCommandServiceImpl implements ControlCommandService {
* @throws Exception 异常 * @throws Exception 异常
*/ */
private Map<Integer, JSONArray> getPhaseRelationLanes(String crossCode) throws Exception { private Map<Integer, JSONArray> getPhaseRelationLanes(String crossCode) throws Exception {
Map<String, String> path = PathUtil.getPathMapByApiCode("queryPhaseRlatLanes"); Map<String, String> path = PathUtil.getPathMapByApiCode("getPhaseRlatLanes");
Map<String, String> queryMap = new HashMap<>(); Map<String, String> queryMap = new HashMap<>();
queryMap.put("crossCode", crossCode); queryMap.put("crossCode", crossCode);
String strResult = ArtemisHttpUtil.doPostStringArtemis(artemisConfig, path, null, queryMap, String strResult = ArtemisHttpUtil.doPostStringArtemis(artemisConfig, path, null, queryMap,
...@@ -459,8 +467,6 @@ public class HKControlCommandServiceImpl implements ControlCommandService { ...@@ -459,8 +467,6 @@ public class HKControlCommandServiceImpl implements ControlCommandService {
if (command.equals(TRUE)) { if (command.equals(TRUE)) {
Map<String, Object> param = new HashMap<String, Object>() { Map<String, Object> param = new HashMap<String, Object>() {
private static final long serialVersionUID = -4365720940762732691L;
{ {
//put("crossCode", code); //put("crossCode", code);
put("crossCode", manufacturerInfoPO.getName()); put("crossCode", manufacturerInfoPO.getName());
...@@ -473,7 +479,7 @@ public class HKControlCommandServiceImpl implements ControlCommandService { ...@@ -473,7 +479,7 @@ public class HKControlCommandServiceImpl implements ControlCommandService {
//LightsStatusVO lightsStatusVO = getSignalInfoVos(code).get(0); //LightsStatusVO lightsStatusVO = getSignalInfoVos(code).get(0);
LightsStatusVO lightsStatusVO = getSignalInfoVos(manufacturerInfoPO.getName()).get(0); LightsStatusVO lightsStatusVO = getSignalInfoVos(manufacturerInfoPO.getName()).get(0);
//暂时按单环处理 //暂时按单环处理
String phaseId = lightsStatusVO.getRunrings().get(0).getPhaseId(); String phaseId = lightsStatusVO.getPhaseId();
//获取方案数据列表 //获取方案数据列表
List<CrossPhasePO> baseCrossPhasePlanList = crossPhaseMapper.selectByCrossIdAndPlanId(lightsStatusVO.getCode(), lightsStatusVO.getPhasePlanId()); List<CrossPhasePO> baseCrossPhasePlanList = crossPhaseMapper.selectByCrossIdAndPlanId(lightsStatusVO.getCode(), lightsStatusVO.getPhasePlanId());
Map<String, List<CrossPhasePO>> groupByPhase = baseCrossPhasePlanList.stream().collect(Collectors.groupingBy(CrossPhasePO::getPhaseNo)); Map<String, List<CrossPhasePO>> groupByPhase = baseCrossPhasePlanList.stream().collect(Collectors.groupingBy(CrossPhasePO::getPhaseNo));
...@@ -584,8 +590,6 @@ public class HKControlCommandServiceImpl implements ControlCommandService { ...@@ -584,8 +590,6 @@ public class HKControlCommandServiceImpl implements ControlCommandService {
} }
} }
Map<String, Object> param = new HashMap<String, Object>() { Map<String, Object> param = new HashMap<String, Object>() {
private static final long serialVersionUID = -3468722905882654820L;
{ {
put("crossCode", code); put("crossCode", code);
put("controlType", runningMode); put("controlType", runningMode);
......
...@@ -54,22 +54,22 @@ public class PhaseTimingSendVO { ...@@ -54,22 +54,22 @@ public class PhaseTimingSendVO {
/** /**
* 绿闪 * 绿闪
*/ */
@ApiModelProperty(value = "绿闪", notes = "") @ApiModelProperty(value = "绿闪", notes = "绿闪")
private String greenFlash; private String greenFlash;
/** /**
* 红闪 * 红闪
*/ */
@ApiModelProperty(value = "红闪", notes = "") @ApiModelProperty(value = "红闪", notes = "红闪")
private String redFlash; private String redFlash;
/** /**
* 最小绿 * 最小绿
*/ */
@ApiModelProperty(value = "最小绿", notes = "") @ApiModelProperty(value = "最小绿", notes = "最小绿")
private String minGreen; private String minGreen;
/** /**
* 最大绿 * 最大绿
*/ */
@ApiModelProperty(value = "最大绿", notes = "") @ApiModelProperty(value = "最大绿", notes = "最大绿")
private String maxGreen; private String maxGreen;
/** /**
* 相位关联的车道列表 * 相位关联的车道列表
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<select id="selectByCrossIdAndPlanId" resultMap="BaseResultMap"> <select id="selectByCrossIdAndPlanId" resultMap="BaseResultMap">
select select
<include refid="baseColumn"/> <include refid="baseColumn"/>
from t_cross_phase where cross_id = #{crossId} and planId = #{planId} from t_cross_phase where cross_id = #{crossId} and plan_id = #{planId}
</select> </select>
<select id="selectIdsByPhaseNo" resultType="java.lang.Integer"> <select id="selectIdsByPhaseNo" resultType="java.lang.Integer">
......
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