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
c7d743fe
Commit
c7d743fe
authored
Mar 22, 2023
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 优化故障告警列表
parent
efbb69ab
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
38 deletions
+39
-38
SituationDetectionServiceImpl.java
...wanji/web/service/impl/SituationDetectionServiceImpl.java
+10
-8
CommonEventWarnTask.java
...src/main/java/net/wanji/web/task/CommonEventWarnTask.java
+21
-26
SignalFaultInfoVO.java
...et/wanji/web/vo/situationDetection/SignalFaultInfoVO.java
+3
-0
AllDeviceStatusMapper.xml
...rvice/src/main/resources/mapper/AllDeviceStatusMapper.xml
+5
-4
No files found.
signal-control-service/src/main/java/net/wanji/web/service/impl/SituationDetectionServiceImpl.java
View file @
c7d743fe
...
@@ -571,20 +571,22 @@ public class SituationDetectionServiceImpl implements SituationDetectionService
...
@@ -571,20 +571,22 @@ public class SituationDetectionServiceImpl implements SituationDetectionService
@Override
@Override
public
List
<
SignalFaultInfoVO
>
listSignalFaultInfos
()
throws
Exception
{
public
List
<
SignalFaultInfoVO
>
listSignalFaultInfos
()
throws
Exception
{
LambdaQueryWrapper
<
TDeviceStatusLog
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
List
<
TDeviceStatusInfo
>
tDeviceStatusInfos
=
allDeviceStatusMapper
.
selectByEntity
(
new
TDeviceStatusInfo
());
queryWrapper
.
ne
(
TDeviceStatusLog:
:
getFaultType
,
0
);
List
<
TDeviceStatusLog
>
tDeviceStatusLogs
=
tDeviceStatusLogMapper
.
selectList
(
queryWrapper
);
List
<
CrossInfoOutVo
>
crossInfoOutVoList
=
getCrossInfoOutVoList
(
new
CrossInfoPageVO
());
List
<
CrossInfoOutVo
>
crossInfoOutVoList
=
getCrossInfoOutVoList
(
new
CrossInfoPageVO
());
List
<
SignalFaultInfoVO
>
signalFaultInfoVOS
=
new
ArrayList
<>(
tDeviceStatus
Log
s
.
size
());
List
<
SignalFaultInfoVO
>
signalFaultInfoVOS
=
new
ArrayList
<>(
tDeviceStatus
Info
s
.
size
());
tDeviceStatus
Logs
.
forEach
(
tDeviceStatusLog
->
{
tDeviceStatus
Infos
.
forEach
(
tDeviceStatus
->
{
SignalFaultInfoVO
signalFaultInfoVO
=
new
SignalFaultInfoVO
();
SignalFaultInfoVO
signalFaultInfoVO
=
new
SignalFaultInfoVO
();
BeanUtils
.
copyProperties
(
tDeviceStatusLog
,
signalFaultInfoVO
);
signalFaultInfoVO
.
setDealStatus
(
"1"
);
// 默认未处理
signalFaultInfoVO
.
setStartTime
(
tDeviceStatusLog
.
getGmtCreate
().
toString
().
substring
(
11
,
19
));
BeanUtils
.
copyProperties
(
tDeviceStatus
,
signalFaultInfoVO
);
signalFaultInfoVO
.
setStartTime
(
tDeviceStatus
.
getGmtCreate
().
toString
().
substring
(
11
,
19
));
if
(!
CollectionUtils
.
isEmpty
(
crossInfoOutVoList
))
{
if
(!
CollectionUtils
.
isEmpty
(
crossInfoOutVoList
))
{
for
(
CrossInfoOutVo
crossInfoOutVo
:
crossInfoOutVoList
)
{
for
(
CrossInfoOutVo
crossInfoOutVo
:
crossInfoOutVoList
)
{
if
(
StringUtils
.
equals
(
crossInfoOutVo
.
getId
(),
tDeviceStatus
Log
.
getCode
()))
{
if
(
StringUtils
.
equals
(
crossInfoOutVo
.
getId
(),
tDeviceStatus
.
getCode
()))
{
signalFaultInfoVO
.
setIp
(
crossInfoOutVo
.
getIp
());
signalFaultInfoVO
.
setIp
(
crossInfoOutVo
.
getIp
());
if
(
tDeviceStatus
.
getFaultType
()
==
0
)
{
signalFaultInfoVO
.
setDealStatus
(
"2"
);
}
}
}
}
}
}
}
...
...
signal-control-service/src/main/java/net/wanji/web/task/CommonEventWarnTask.java
View file @
c7d743fe
...
@@ -84,27 +84,27 @@ public class CommonEventWarnTask {
...
@@ -84,27 +84,27 @@ public class CommonEventWarnTask {
private
JsonViewObject
getSignalWarnData
()
{
private
JsonViewObject
getSignalWarnData
()
{
List
<
CommonEventAlarmOutVo
>
results
=
new
ArrayList
<>();
List
<
CommonEventAlarmOutVo
>
results
=
new
ArrayList
<>();
if
(
true
)
{
//
if (true) {
CommonEventAlarmOutVo
commonEventAlarmOutVo
=
new
CommonEventAlarmOutVo
();
//
CommonEventAlarmOutVo commonEventAlarmOutVo = new CommonEventAlarmOutVo();
commonEventAlarmOutVo
.
setEventType
(
3
);
//
commonEventAlarmOutVo.setEventType(3);
commonEventAlarmOutVo
.
setEventId
(
"14Q3709IOR0"
);
//
commonEventAlarmOutVo.setEventId("14Q3709IOR0");
commonEventAlarmOutVo
.
setEventName
(
"相融路与蠡太路交叉口"
);
//
commonEventAlarmOutVo.setEventName("相融路与蠡太路交叉口");
commonEventAlarmOutVo
.
setStatus
(
"3"
);
//
commonEventAlarmOutVo.setStatus("3");
commonEventAlarmOutVo
.
setCoordinate
(
"120.630807,31.422317"
);
//
commonEventAlarmOutVo.setCoordinate("120.630807,31.422317");
//
CommonEventAlarmOutVo
commonEventAlarmOutVo1
=
new
CommonEventAlarmOutVo
();
//
CommonEventAlarmOutVo commonEventAlarmOutVo1 = new CommonEventAlarmOutVo();
commonEventAlarmOutVo1
.
setEventType
(
3
);
//
commonEventAlarmOutVo1.setEventType(3);
commonEventAlarmOutVo1
.
setEventId
(
"8"
);
//
commonEventAlarmOutVo1.setEventId("8");
commonEventAlarmOutVo1
.
setEventName
(
"青龙港路与云集街交叉口"
);
//
commonEventAlarmOutVo1.setEventName("青龙港路与云集街交叉口");
commonEventAlarmOutVo1
.
setStatus
(
"3"
);
//
commonEventAlarmOutVo1.setStatus("3");
commonEventAlarmOutVo1
.
setCoordinate
(
"120.640305,31.418544"
);
//
commonEventAlarmOutVo1.setCoordinate("120.640305,31.418544");
results
.
add
(
commonEventAlarmOutVo
);
//
results.add(commonEventAlarmOutVo);
LocalDateTime
now
=
LocalDateTime
.
now
();
//
LocalDateTime now = LocalDateTime.now();
JsonViewObject
jsonViewObject
=
JsonViewObject
.
newInstance
();
//
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
jsonViewObject
.
setTimestamp
(
now
.
toInstant
(
ZoneOffset
.
of
(
"+8"
)).
toEpochMilli
());
//
jsonViewObject.setTimestamp(now.toInstant(ZoneOffset.of("+8")).toEpochMilli());
jsonViewObject
.
setContent
(
results
);
//
jsonViewObject.setContent(results);
return
jsonViewObject
;
//
return jsonViewObject;
}
//
}
JsonViewObject
jsonViewObject
=
utcFeignClients
.
runningStatusAlarm
();
JsonViewObject
jsonViewObject
=
utcFeignClients
.
runningStatusAlarm
();
if
(
Objects
.
isNull
(
jsonViewObject
)
||
jsonViewObject
.
getCode
()
!=
200
)
{
if
(
Objects
.
isNull
(
jsonViewObject
)
||
jsonViewObject
.
getCode
()
!=
200
)
{
...
@@ -118,11 +118,6 @@ public class CommonEventWarnTask {
...
@@ -118,11 +118,6 @@ public class CommonEventWarnTask {
String
signalId
=
(
String
)
result
.
get
(
"signalId"
);
String
signalId
=
(
String
)
result
.
get
(
"signalId"
);
String
crossId
=
(
String
)
result
.
get
(
"crossId"
);
String
crossId
=
(
String
)
result
.
get
(
"crossId"
);
Integer
currentFaultType
=
(
Integer
)
result
.
get
(
"faultType"
);
Integer
currentFaultType
=
(
Integer
)
result
.
get
(
"faultType"
);
// todo 配合测试提供数据, 后续删除
if
(
Objects
.
equals
(
crossId
,
"13FNK0C6790"
))
{
currentFaultType
=
1
;
}
String
coordinate
=
""
;
String
coordinate
=
""
;
int
faultTypeDB
=
0
;
int
faultTypeDB
=
0
;
if
(
StringUtils
.
isNotEmpty
(
crossId
))
{
if
(
StringUtils
.
isNotEmpty
(
crossId
))
{
...
...
signal-control-service/src/main/java/net/wanji/web/vo/situationDetection/SignalFaultInfoVO.java
View file @
c7d743fe
package
net
.
wanji
.
web
.
vo
.
situationDetection
;
package
net
.
wanji
.
web
.
vo
.
situationDetection
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
net.wanji.web.entity.TDeviceStatusInfo
;
import
net.wanji.web.entity.TDeviceStatusInfo
;
...
@@ -11,4 +12,6 @@ import net.wanji.web.entity.TDeviceStatusInfo;
...
@@ -11,4 +12,6 @@ import net.wanji.web.entity.TDeviceStatusInfo;
public
class
SignalFaultInfoVO
extends
TDeviceStatusInfo
{
public
class
SignalFaultInfoVO
extends
TDeviceStatusInfo
{
private
String
startTime
;
private
String
startTime
;
private
String
ip
;
private
String
ip
;
@ApiModelProperty
(
value
=
"处理状态:1未处理 2已处理"
)
private
String
dealStatus
;
}
}
\ No newline at end of file
signal-control-service/src/main/resources/mapper/AllDeviceStatusMapper.xml
View file @
c7d743fe
...
@@ -16,20 +16,21 @@
...
@@ -16,20 +16,21 @@
order by type
order by type
</select>
</select>
<resultMap
type=
"net.wanji.web.
po.AllDeviceStatusPO
"
id=
"TDeviceStatusInfoMap"
>
<resultMap
type=
"net.wanji.web.
entity.TDeviceStatusInfo
"
id=
"TDeviceStatusInfoMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"id"
column=
"id"
/>
<result
property=
"code"
column=
"code"
/>
<result
property=
"code"
column=
"code"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"type"
column=
"type"
/>
<result
property=
"type"
column=
"type"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"faultType"
column=
"fault_type"
/>
<result
property=
"faultType"
column=
"fault_type"
/>
<result
property=
"gmtCreate"
column=
"gmt_create"
/>
<result
property=
"gmtCreate"
column=
"gmt_create"
/>
</resultMap>
</resultMap>
<select
id=
"selectByEntity"
parameterType=
"net.wanji.web.entity.TDeviceStatusInfo"
resultMap=
"TDeviceStatusInfoMap"
>
<select
id=
"selectByEntity"
parameterType=
"net.wanji.web.entity.TDeviceStatusInfo"
resultMap=
"TDeviceStatusInfoMap"
>
select id, code, name, type,
fault_type, gmt_create from where
t_device_status
select id, code, name, type,
status, fault_type, gmt_create from
t_device_status
<where>
<where>
<if
test=
"
code != null and
code != ''"
>
<if
test=
"
entity.code != null and entity.
code != ''"
>
code = #{code}
code = #{
entity.
code}
</if>
</if>
</where>
</where>
</select>
</select>
...
...
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