Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
traffic-signal-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
signal
traffic-signal-platform
Commits
213879a6
Commit
213879a6
authored
Nov 26, 2024
by
zhouleilei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
临时方案下发,发送海信信号机
parent
3b708c3e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
ControlCommandServiceImpl.java
...i/utc/hisense/service/impl/ControlCommandServiceImpl.java
+12
-7
No files found.
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/service/impl/ControlCommandServiceImpl.java
View file @
213879a6
...
@@ -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
());
//周期长度
//周期长度
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment