Commit 1b5999eb authored by duanruiming's avatar duanruiming

[update] 解决锁定阶段和临时方案

parent 6b4b6158
......@@ -312,12 +312,17 @@ public class DTControlCommandServiceImpl implements ControlCommandService {
if (commandVO.getCommand() == 0) {
setSignalControl(commandVO);
} else {
CrossInfoPO crossInfoPO = checkCrossId(commandVO.getCrossCode());
// 先将控制模式改为手动
String body = String.format(Constants.COMMAND_CENTER_COMMON, Constants.COMMAND_SET, Constants.COMMAND_CENTER_CONTROL_MODEL, "15");
String controlMessage = Constants.buildMessage(body);
MessageResultPojo result = NettyClient.sendMessage(crossInfoPO.getIp(), crossInfoPO.getPort(), controlMessage, null, 300);
List<Integer> phaseList = commandVO.getPhaseList();
int stageId = 0;
if (!CollectionUtils.isEmpty(phaseList)) {
stageId = phaseList.get(0);
} // 锁定阶段,目前锁定成功,但是阶段还在跳
CrossInfoPO crossInfoPO = checkCrossId(commandVO.getCrossCode());
String message = String.format(Constants.COMMAND_CENTER_COMMON, Constants.COMMAND_SET, Constants.COMMAND_CENTER_CONTROL_STAGE, String.format("%02x", stageId));
String lockSign = StringUtils.join(Constants.COMMAND_CENTER_COMMON_SIGN, Constants.COMMAND_SET_REPLY);
String lockMessage = Constants.buildMessage(message);
......@@ -608,6 +613,12 @@ public class DTControlCommandServiceImpl implements ControlCommandService {
JsonViewObject jsonViewObject = JsonViewObject.newInstance(); // 下发成功,不生效,查询返回下发方案号
try {
CrossInfoPO crossInfoPO = checkCrossId(crossId);
// 先将控制模式改为中心协调
String body = String.format(Constants.COMMAND_CENTER_COMMON, Constants.COMMAND_SET, Constants.COMMAND_CENTER_CONTROL_MODEL, "13");
String controlMessage = Constants.buildMessage(body);
MessageResultPojo result = NettyClient.sendMessage(crossInfoPO.getIp(), crossInfoPO.getPort(), controlMessage, null, 300);
String message = String.format(Constants.COMMAND_CENTER_COMMON, Constants.COMMAND_SET, Constants.COMMAND_CENTER_CONTROL_SCHEME, String.format("%02x", schemeNo));
String tempSchemeSign = StringUtils.join(Constants.COMMAND_CENTER_COMMON_SIGN, Constants.COMMAND_SET_REPLY);
String tempSchemeMessage = Constants.buildMessage(message);
......
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