Commit 213879a6 authored by zhouleilei's avatar zhouleilei

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

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