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
5fa2b8b5
Commit
5fa2b8b5
authored
Mar 23, 2023
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 故障告警 信号服务添加时间倒序
parent
bd6cf17b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
5 deletions
+15
-5
SituationDetectionServiceImpl.java
...wanji/web/service/impl/SituationDetectionServiceImpl.java
+1
-0
SystemServiceStatusTask.java
...main/java/net/wanji/web/task/SystemServiceStatusTask.java
+10
-5
SystemServiceStatusDTO.java
...ain/java/net/wanji/common/dto/SystemServiceStatusDTO.java
+4
-0
No files found.
signal-control-service/src/main/java/net/wanji/web/service/impl/SituationDetectionServiceImpl.java
View file @
5fa2b8b5
...
@@ -598,6 +598,7 @@ public class SituationDetectionServiceImpl implements SituationDetectionService
...
@@ -598,6 +598,7 @@ public class SituationDetectionServiceImpl implements SituationDetectionService
}
else
{
}
else
{
result
=
signalFaultInfoVOS
;
result
=
signalFaultInfoVOS
;
}
}
result
=
result
.
stream
().
sorted
(
Comparator
.
comparing
(
SignalFaultInfoVO:
:
getStartTime
).
reversed
()).
collect
(
Collectors
.
toList
());
return
result
;
return
result
;
}
}
...
...
signal-control-service/src/main/java/net/wanji/web/task/SystemServiceStatusTask.java
View file @
5fa2b8b5
...
@@ -14,7 +14,10 @@ import org.springframework.stereotype.Component;
...
@@ -14,7 +14,10 @@ import org.springframework.stereotype.Component;
import
java.time.LocalTime
;
import
java.time.LocalTime
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
/**
* @author duanruiming
* @author duanruiming
...
@@ -27,9 +30,9 @@ public class SystemServiceStatusTask {
...
@@ -27,9 +30,9 @@ public class SystemServiceStatusTask {
public
static
final
List
<
SystemServiceStatusDTO
>
sysList
=
new
ArrayList
<
SystemServiceStatusDTO
>();
public
static
final
List
<
SystemServiceStatusDTO
>
sysList
=
new
ArrayList
<
SystemServiceStatusDTO
>();
static
{
static
{
sysList
.
add
(
new
SystemServiceStatusDTO
(
"MYSQL"
,
"10.102.1.182"
,
3306
,
30000
,
0
,
null
));
sysList
.
add
(
new
SystemServiceStatusDTO
(
"MYSQL"
,
"10.102.1.182"
,
3306
,
30000
,
0
,
null
,
null
));
sysList
.
add
(
new
SystemServiceStatusDTO
(
"UTC"
,
"10.102.1.182"
,
32000
,
30000
,
0
,
null
));
sysList
.
add
(
new
SystemServiceStatusDTO
(
"UTC"
,
"10.102.1.182"
,
32000
,
30000
,
0
,
null
,
null
));
sysList
.
add
(
new
SystemServiceStatusDTO
(
"海康"
,
"10.102.1.183"
,
80
,
30000
,
0
,
null
));
sysList
.
add
(
new
SystemServiceStatusDTO
(
"海康"
,
"10.102.1.183"
,
80
,
30000
,
0
,
null
,
null
));
}
}
@Scheduled
(
fixedRate
=
1
*
60
*
1000
)
@Scheduled
(
fixedRate
=
1
*
60
*
1000
)
...
@@ -48,9 +51,11 @@ public class SystemServiceStatusTask {
...
@@ -48,9 +51,11 @@ public class SystemServiceStatusTask {
LocalTime
now
=
LocalTime
.
now
();
LocalTime
now
=
LocalTime
.
now
();
String
format
=
now
.
format
(
DateTimeFormatter
.
ofPattern
(
DateStyle
.
HH_MM_SS
.
getValue
()));
String
format
=
now
.
format
(
DateTimeFormatter
.
ofPattern
(
DateStyle
.
HH_MM_SS
.
getValue
()));
dto
.
setStartTime
(
format
);
dto
.
setStartTime
(
format
);
dto
.
setStartDate
(
new
Date
());
}
}
}
}
List
<
SystemServiceStatusDTO
>
sort
=
sysList
.
stream
().
sorted
(
Comparator
.
comparing
(
SystemServiceStatusDTO:
:
getStartDate
)).
collect
(
Collectors
.
toList
());
WebSocketServer
.
sendInfo2All
(
JSON
.
toJSONString
(
s
ysLis
t
),
Constant
.
WEBSOCKET_TOPIC_SYS_SERVICE_STATUS
);
WebSocketServer
.
sendInfo2All
(
JSON
.
toJSONString
(
s
or
t
),
Constant
.
WEBSOCKET_TOPIC_SYS_SERVICE_STATUS
);
}
}
}
}
wj-common/src/main/java/net/wanji/common/dto/SystemServiceStatusDTO.java
View file @
5fa2b8b5
...
@@ -6,6 +6,8 @@ import lombok.AllArgsConstructor;
...
@@ -6,6 +6,8 @@ import lombok.AllArgsConstructor;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
java.util.Date
;
/**
/**
* @author duanruiming
* @author duanruiming
* @date 2023/03/21 10:45
* @date 2023/03/21 10:45
...
@@ -27,4 +29,6 @@ public class SystemServiceStatusDTO {
...
@@ -27,4 +29,6 @@ public class SystemServiceStatusDTO {
private
int
status
;
private
int
status
;
@ApiModelProperty
(
value
=
"开始时间"
,
notes
=
""
)
@ApiModelProperty
(
value
=
"开始时间"
,
notes
=
""
)
private
String
startTime
;
private
String
startTime
;
@ApiModelProperty
(
value
=
"开始日期"
,
notes
=
""
)
private
Date
startDate
;
}
}
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