Commit 213879a6 authored by zhouleilei's avatar zhouleilei

临时方案下发,发送海信信号机

parent 3b708c3e
......@@ -240,6 +240,7 @@ public class ControlCommandServiceImpl implements ControlCommandService {
@Override
public JsonViewObject recoverSchedule(String code) throws Exception {
log.info("接收到恢复固定配时,code:{}",code);
CrossInfoPOExt crossInfoPOExt = crossInfoMapper.selectById(code);
//组装document
Document document = OperationBaseDom.generateBaseDoc();
......@@ -250,8 +251,8 @@ public class ControlCommandServiceImpl implements ControlCommandService {
messageContent.addElement(HttpConstants.PATTERN).setText("0");
//给海信发送http请求
// String post = OkHttpClientUtil.xmlPost(hisenseUrl, document.asXML());
String post = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
String post = OkHttpClientUtil.xmlPost(hisenseUrl, document.asXML());
/*String post = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<systemScription System=\"TCIP\" Version=\"1.0\">\n" +
" <subSystem>Hisense</subSystem>\n" +
" <messageType>12</messageType>\n" +
......@@ -267,7 +268,7 @@ public class ControlCommandServiceImpl implements ControlCommandService {
" <CoordCycleStatus>160</CoordCycleStatus>\n" +
" <CoordSyncStatus>123</CoordSyncStatus>\n" +
" </messageContent>\n" +
"</systemScription>";
"</systemScription>";*/
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
if (StringUtils.isBlank(post)) {
log.error("5.10. 手动方案控制- 恢复固定配时 失败");
......@@ -319,8 +320,8 @@ public class ControlCommandServiceImpl implements ControlCommandService {
messageContent.addElement(HttpConstants.SPLIT).setText(tempSchemeSendVO.getSplit());
//给海信发送http请求
// String post = OkHttpClientUtil.xmlPost(hisenseUrl, document.asXML());
String post = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
String post = OkHttpClientUtil.xmlPost(hisenseUrl, document.asXML());
/*String post = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"<systemScription System=\"TCIP\" Version=\"1.0\">\n" +
" <subSystem>Hisense</subSystem>\n" +
" <messageType>12</messageType>\n" +
......@@ -336,7 +337,7 @@ public class ControlCommandServiceImpl implements ControlCommandService {
" <CoordCycleStatus>160</CoordCycleStatus>\n" +
" <CoordSyncStatus>123</CoordSyncStatus>\n" +
" </messageContent>\n" +
"</systemScription>";
"</systemScription>";*/
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
if (StringUtils.isBlank(post)) {
log.error("HTTP请求 5.16. 方案优化控制 失败");
......@@ -348,13 +349,17 @@ public class ControlCommandServiceImpl implements ControlCommandService {
if (HttpConstants.RESULT_1.equals(result)) {
//指令下发成功
jsonViewObject.success("临时方案 - 指令下发成功");
log.info("临时方案下发成功,tempSchemeSendVO:{}",JSONObject.toJSONString(tempSchemeSendVO));
} else if (HttpConstants.RESULT_0.equals(result)) {
log.error("临时方案下发失败,tempSchemeSendVO:{}",JSONObject.toJSONString(tempSchemeSendVO));
//指令下发失败
jsonViewObject.fail("临时方案 - 指令下发失败");
} else if (HttpConstants.RESULT_2.equals(result)) {
log.info("临时方案指令执行成功,tempSchemeSendVO:{}",JSONObject.toJSONString(tempSchemeSendVO));
//指令执行成功
jsonViewObject.success("临时方案 - 指令执行成功");
} else {
log.error("临时方案指令执行失败,tempSchemeSendVO:{}",JSONObject.toJSONString(tempSchemeSendVO));
//指令执行失败
jsonViewObject.fail("临时方案 - 指令执行失败");
}
......@@ -385,7 +390,7 @@ public class ControlCommandServiceImpl implements ControlCommandService {
//方案环图请求
CrossSchemeRings crossSchemeRings = staticInfoService.crossSchemeRings(crossSchemeRingsDTO);
long currentTimeMillis = System.currentTimeMillis();
if (Optional.ofNullable(crossSchemeRings).isPresent()) {
if (Optional.ofNullable(crossSchemeRings).isPresent() || result == 2) {
//环数
int ringCount = Integer.parseInt(crossSchemeRings.getRingCount());
//周期长度
......
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