Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wj-datacenter-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
jinan
wj-datacenter-platform
Commits
23a1e45d
Commit
23a1e45d
authored
Jan 13, 2025
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 事件方向转向数据结构优化
parent
43fab979
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
EventDataDTO.java
...main/java/net/wanji/datacenter/pojo/dto/EventDataDTO.java
+3
-3
EventDataServiceImpl.java
...va/net/wanji/datacenter/service/EventDataServiceImpl.java
+13
-5
No files found.
wj-datacenter-service/src/main/java/net/wanji/datacenter/pojo/dto/EventDataDTO.java
View file @
23a1e45d
...
...
@@ -2,10 +2,10 @@ package net.wanji.datacenter.pojo.dto;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
/**
* @author duanruiming
...
...
@@ -17,7 +17,7 @@ public class EventDataDTO {
private
String
eventId
;
private
String
crossId
;
private
String
eventType
;
private
String
direction
;
private
List
<
String
>
direction
;
private
Double
eventLongitude
;
private
Double
eventLatitude
;
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
...
...
@@ -30,7 +30,7 @@ public class EventDataDTO {
/**
* add 20250107
*/
private
String
turn
;
private
List
<
String
>
turn
;
private
Double
unbalanceIndex
;
private
Double
spilloverIndex
;
...
...
wj-datacenter-service/src/main/java/net/wanji/datacenter/service/EventDataServiceImpl.java
View file @
23a1e45d
...
...
@@ -12,12 +12,11 @@ import net.wanji.datacenter.pojo.po.EventInfoPO;
import
org.jetbrains.annotations.NotNull
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
javax.annotation.Resource
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.*
;
/**
* @author duanruiming
...
...
@@ -63,7 +62,8 @@ public class EventDataServiceImpl implements EventDataService {
}
@NotNull
private
static
EventInfoPO
getEventInfoPO
(
EventDataDTO
eventDataDTO
)
{
private
static
EventInfoPO
getEventInfoPO
(
EventDataDTO
eventDataDTO
)
throws
Exception
{
ObjectMapper
mapper
=
JacksonUtils
.
getInstance
();
Map
<
String
,
Integer
>
crossIdGreenIdMap
=
CrossGreenWaveInfoCache
.
crossIdGreenIdMap
;
EventInfoPO
eventInfoPO
=
new
EventInfoPO
();
String
crossId
=
eventDataDTO
.
getCrossId
();
...
...
@@ -82,7 +82,15 @@ public class EventDataServiceImpl implements EventDataService {
eventInfoPO
.
setLng
(
eventInfoPO
.
getLng
());
eventInfoPO
.
setCategory
(
eventDataDTO
.
getEventLevel
());
eventInfoPO
.
setPlaceDesc
(
eventDataDTO
.
getEventType
());
eventInfoPO
.
setDir
(
eventDataDTO
.
getDirection
());
List
<
String
>
directions
=
eventDataDTO
.
getDirection
();
List
<
Integer
>
dirs
=
new
ArrayList
<>(
directions
.
size
());
if
(!
CollectionUtils
.
isEmpty
(
directions
))
{
directions
.
forEach
(
item
->
{
dirs
.
add
(
Integer
.
valueOf
(
item
)
+
1
);
});
}
eventInfoPO
.
setDir
(
mapper
.
writeValueAsString
(
dirs
));
eventInfoPO
.
setTurn
(
mapper
.
writeValueAsString
(
eventDataDTO
.
getTurn
()));
eventInfoPO
.
setRuksj
(
new
Date
());
eventInfoPO
.
setAlarmStatus
(
eventDataDTO
.
getEventStatus
());
// 默认未优化
...
...
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