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
a73368ab
Commit
a73368ab
authored
Mar 23, 2023
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 优化时间告警状态同步任务
parent
7bc7adc0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
27 deletions
+9
-27
CommonEventWarnTask.java
...src/main/java/net/wanji/web/task/CommonEventWarnTask.java
+2
-24
SignalStatusTask.java
...ce/src/main/java/net/wanji/web/task/SignalStatusTask.java
+7
-3
No files found.
signal-control-service/src/main/java/net/wanji/web/task/CommonEventWarnTask.java
View file @
a73368ab
...
...
@@ -84,28 +84,6 @@ public class CommonEventWarnTask {
private
JsonViewObject
getSignalWarnData
()
{
List
<
CommonEventAlarmOutVo
>
results
=
new
ArrayList
<>();
// if (true) {
// CommonEventAlarmOutVo commonEventAlarmOutVo = new CommonEventAlarmOutVo();
// commonEventAlarmOutVo.setEventType(3);
// commonEventAlarmOutVo.setEventId("14Q3709IOR0");
// commonEventAlarmOutVo.setEventName("相融路与蠡太路交叉口");
// commonEventAlarmOutVo.setStatus("3");
// commonEventAlarmOutVo.setCoordinate("120.630807,31.422317");
//
// CommonEventAlarmOutVo commonEventAlarmOutVo1 = new CommonEventAlarmOutVo();
// commonEventAlarmOutVo1.setEventType(3);
// commonEventAlarmOutVo1.setEventId("8");
// commonEventAlarmOutVo1.setEventName("青龙港路与云集街交叉口");
// commonEventAlarmOutVo1.setStatus("3");
// commonEventAlarmOutVo1.setCoordinate("120.640305,31.418544");
// results.add(commonEventAlarmOutVo);
// LocalDateTime now = LocalDateTime.now();
// JsonViewObject jsonViewObject = JsonViewObject.newInstance();
// jsonViewObject.setTimestamp(now.toInstant(ZoneOffset.of("+8")).toEpochMilli());
// jsonViewObject.setContent(results);
// return jsonViewObject;
// }
JsonViewObject
jsonViewObject
=
utcFeignClients
.
runningStatusAlarm
();
if
(
Objects
.
isNull
(
jsonViewObject
)
||
jsonViewObject
.
getCode
()
!=
200
)
{
return
jsonViewObject
.
fail
(
"信号机告警UTC服务调用异常!"
);
...
...
@@ -135,8 +113,8 @@ public class CommonEventWarnTask {
CommonEventAlarmOutVo
commonEventAlarmOutVo
=
new
CommonEventAlarmOutVo
();
commonEventAlarmOutVo
.
setEventType
(
3
);
commonEventAlarmOutVo
.
setEventId
(
signalId
);
commonEventAlarmOutVo
.
setEventName
(
"信号机
故障"
);
// todo 信号机厂商
commonEventAlarmOutVo
.
setEventDesc
(
"信号机
故障
"
);
commonEventAlarmOutVo
.
setEventName
(
"信号机
告警"
);
commonEventAlarmOutVo
.
setEventDesc
(
"信号机
告警
"
);
commonEventAlarmOutVo
.
setStatus
(
String
.
valueOf
(
currentFaultType
));
commonEventAlarmOutVo
.
setStartTime
(
formatNow
);
commonEventAlarmOutVo
.
setCoordinate
(
coordinate
);
...
...
signal-control-service/src/main/java/net/wanji/web/task/SignalStatusTask.java
View file @
a73368ab
...
...
@@ -18,6 +18,7 @@ import org.springframework.scheduling.annotation.Scheduled;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
...
...
@@ -54,15 +55,16 @@ public class SignalStatusTask {
// 更新数据库状态
LambdaQueryWrapper
<
TDeviceStatusInfo
>
lambdaQueryWrapper
=
new
LambdaQueryWrapper
<>();
if
(
StringUtils
.
isNotEmpty
(
signal
Id
))
{
lambdaQueryWrapper
.
eq
(
TDeviceStatusInfo:
:
getCode
,
signal
Id
);
if
(
StringUtils
.
isNotEmpty
(
cross
Id
))
{
lambdaQueryWrapper
.
eq
(
TDeviceStatusInfo:
:
getCode
,
cross
Id
);
TDeviceStatusInfo
tDeviceStatusInfo
=
tDeviceStatusMapper
.
selectOne
(
lambdaQueryWrapper
);
if
(
isExucuteUpdate
(
currentSignalStatus
,
currentFaultType
,
tDeviceStatusInfo
))
{
tDeviceStatusInfo
.
setStatus
(
currentSignalStatus
);
tDeviceStatusInfo
.
setFaultType
(
currentFaultType
);
tDeviceStatusInfo
.
setGmtCreate
(
new
Date
());
// 实时数据,创建和修改时间一致
tDeviceStatusMapper
.
updateById
(
tDeviceStatusInfo
);
insertDeviceStatusLog
(
signalStatusVO
,
crossId
,
currentSignalStatus
,
currentFaultType
);
}
insertDeviceStatusLog
(
signalStatusVO
,
crossId
,
currentSignalStatus
,
currentFaultType
);
}
insertControlHist
(
signalStatusVO
);
});
...
...
@@ -101,6 +103,7 @@ public class SignalStatusTask {
if
(
Objects
.
nonNull
(
tDeviceStatusLogInfoDB
)
||
tDeviceStatusLogInfoDB
.
getFaultType
()
!=
0
&&
currentFaultType
==
0
)
{
tDeviceStatusLogInfoDB
.
setStatus
(
currentSignalStatus
);
tDeviceStatusLogInfoDB
.
setFaultType
(
100
);
tDeviceStatusLogInfoDB
.
setGmtCreate
(
new
Date
());
tDeviceStatusLogInfoDB
.
setId
(
null
);
tDeviceStatusLogMapper
.
insert
(
tDeviceStatusLogInfoDB
);
}
else
{
...
...
@@ -110,6 +113,7 @@ public class SignalStatusTask {
tDeviceStatusLog
.
setType
(
1
);
tDeviceStatusLog
.
setStatus
(
signalStatusVO
.
getStatus
());
tDeviceStatusLog
.
setFaultType
(
currentFaultType
);
tDeviceStatusLog
.
setGmtCreate
(
new
Date
());
tDeviceStatusLog
.
setId
(
null
);
tDeviceStatusLogMapper
.
insert
(
tDeviceStatusLog
);
}
...
...
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