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
142c9b32
Commit
142c9b32
authored
Jan 08, 2025
by
zhoushiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
场景事件数据格式调整
parent
70c81cea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
13 deletions
+28
-13
EventServiceImpl.java
...ain/java/net/wanji/opt/service/impl/EventServiceImpl.java
+17
-11
GreenwaveHistProviderImpl.java
...net/wanji/opt/service/impl/GreenwaveHistProviderImpl.java
+11
-2
No files found.
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/EventServiceImpl.java
View file @
142c9b32
...
...
@@ -168,11 +168,14 @@ public class EventServiceImpl implements EventService {
//每5分组分组
Map
<
String
,
List
<
EventInfoSimplePo
>>
group
=
list
.
stream
().
collect
(
Collectors
.
groupingBy
(
o
->
o
.
getTimeAxisStart
()));
List
<
EventInfoSimplePo
>
tmpList
=
new
ArrayList
<>();
List
<
String
>
dataserList
=
new
ArrayList
<>();
group
.
forEach
((
time
,
valList1
)
->
{
//5分组内数据按类型分组
Map
<
String
,
List
<
EventInfoSimplePo
>>
groupByType
=
valList1
.
stream
().
collect
(
Collectors
.
groupingBy
(
o
->
o
.
getEventType
()));
List
<
EventInfoSimplePo
>
tmpList
=
new
ArrayList
<>();
//
List<EventInfoSimplePo> tmpList = new ArrayList<>();
groupByType
.
forEach
((
type
,
valList2
)
->
{
EventInfoSimplePo
tmp
=
null
;
...
...
@@ -190,7 +193,7 @@ public class EventServiceImpl implements EventService {
po
.
setStartTime
(
agoStartTime
);
po
.
setEndTime
(
currentEndTime
);
po
.
setTimeAxisStart
(
tmp
.
getTimeAxisStart
());
po
.
setCount
(
po
.
getCount
()
+
1
);
po
.
setCount
(
po
.
getCount
()
+
1
);
//清理合并前的记录
tmpList
.
remove
(
tmp
);
}
...
...
@@ -203,7 +206,7 @@ public class EventServiceImpl implements EventService {
List
<
String
>
dataTimeList
=
po
.
getDataTimeList
();
for
(
int
i
=
0
;
i
<=
diffNum
;
i
++)
{
DateTime
axisDateTime
=
startAxis
.
plusMinutes
(
i
*
1
);
int
m
=
axisDateTime
.
getMinuteOfHour
();
int
m
=
axisDateTime
.
getMinuteOfHour
();
if
(
m
%
5
==
0
&&
axisDateTime
.
isBefore
(
endAxis
))
{
dataTimeList
.
add
(
axisDateTime
.
toString
(
"yyyy-MM-dd HH:mm:ss"
));
}
...
...
@@ -215,13 +218,16 @@ public class EventServiceImpl implements EventService {
tmp
=
po
;
}
});
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"timeAxis"
,
time
);
map
.
put
(
"statusByDateList"
,
tmpList
);
retList
.
add
(
map
);
});
Set
<
String
>
timeList
=
group
.
keySet
();
tmpList
.
forEach
(
po
->
{
String
axis
=
DateUtil
.
formatDate
(
po
.
getStartTime
(),
"M/d"
)
+
","
+
DateUtil
.
formatDate
(
po
.
getStartTime
(),
"HH:mm"
)
+
","
+
po
.
getEventType
();
dataserList
.
add
(
axis
);
});
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"statusByDateList"
,
tmpList
);
map
.
put
(
"dataser"
,
dataserList
);
retList
.
add
(
map
);
// Set<String> timeList = group.keySet();
//补充缺少时段数据,保留时段字段默认值
// for (String timeSec : sortedSet) {
// if (!timeList.contains(timeSec)) {
...
...
@@ -232,9 +238,9 @@ public class EventServiceImpl implements EventService {
// }
// }
List
<
Map
<
String
,
Object
>>
sortList
=
retList
.
stream
().
sorted
(
Comparator
.
comparing
(
o
->
o
.
get
(
"timeAxis"
).
toString
())).
collect
(
Collectors
.
toList
());
//
List<Map<String, Object>> sortList = retList.stream().sorted(Comparator.comparing(o -> o.get("timeAxis").toString())).collect(Collectors.toList());
return
sor
tList
;
return
re
tList
;
}
...
...
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/GreenwaveHistProviderImpl.java
View file @
142c9b32
...
...
@@ -10,10 +10,13 @@ import net.wanji.common.framework.exception.DubboProviderException;
import
net.wanji.common.framework.mapper.BaseInterfaceMapper
;
import
net.wanji.common.gts.Tools
;
import
net.wanji.common.utils.tool.DateUtil
;
import
net.wanji.databus.dao.mapper.BaseCrossInfoMapper
;
import
net.wanji.databus.po.BaseCrossInfoPO
;
import
net.wanji.databus.po.CrossDataHistPO
;
import
net.wanji.databus.po.CrossDirDataHistPO
;
import
net.wanji.databus.po.CrossTurnDataHistPO
;
import
net.wanji.databus.po.CrossTurnInfoPO
;
import
net.wanji.databus.po.TBaseCrossInfo
;
import
net.wanji.opt.bo.BottomMenuBO
;
import
net.wanji.opt.common.EsDateIndexUtil
;
import
net.wanji.opt.common.enums.TimeGranularityEnum
;
...
...
@@ -68,6 +71,10 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
@Resource
private
MainlineEvaluateService
mainlineEvaluateService
;
@Resource
BaseCrossInfoMapper
baseCrossInfoMapper
;
@Override
public
BaseInterfaceMapper
<
GreenwaveHist
>
getBaseInterfaceMapper
()
{
return
this
.
greenwaveHistoryMapper
;
...
...
@@ -410,8 +417,10 @@ public class GreenwaveHistProviderImpl extends BaseDubboInterfaceImpl<GreenwaveH
String
dirTurnDesc
=
null
;
Map
<
String
,
Object
>
mapList
=
new
HashMap
<>();
if
(
Objects
.
equals
(
3
,
objectType
))
{
if
(
Objects
.
equals
(
4
,
objectType
)){
TBaseCrossInfo
tBaseCrossInfo
=
baseCrossInfoMapper
.
selectByPrimaryKey
(
sps
[
0
]);
dirTurnDesc
=
tBaseCrossInfo
.
getName
();
}
else
if
(
Objects
.
equals
(
3
,
objectType
))
{
mapList
.
put
(
"laneId"
,
laneId
);
mapList
.
put
(
"laneNo"
,
laneNo
);
dirType
=
Integer
.
parseInt
(
sps
[
2
]);
...
...
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