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
02844cc3
Commit
02844cc3
authored
Oct 28, 2023
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 海信灯态优化
parent
8b03d0d2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
5 deletions
+23
-5
SignalDataCache.java
...ain/java/net/wanji/utc/hisense/cache/SignalDataCache.java
+1
-0
HisensePhaseCountDownTask.java
...net/wanji/utc/hisense/task/HisensePhaseCountDownTask.java
+22
-5
No files found.
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/cache/SignalDataCache.java
View file @
02844cc3
...
@@ -24,6 +24,7 @@ public class SignalDataCache {
...
@@ -24,6 +24,7 @@ public class SignalDataCache {
// 海信推送灯态数据
// 海信推送灯态数据
public
static
final
Map
<
String
,
RunningLightsStatusPojo
>
runningStateInfoCacheUdp
=
new
HashMap
<>();
public
static
final
Map
<
String
,
RunningLightsStatusPojo
>
runningStateInfoCacheUdp
=
new
HashMap
<>();
public
static
final
Map
<
String
,
LightsStatusVO
>
runningStateInfoCache
=
new
ConcurrentHashMap
<>();
public
static
final
Map
<
String
,
LightsStatusVO
>
runningStateInfoCache
=
new
ConcurrentHashMap
<>();
// 海信推送方案相位信息,未计算灯态缓存
public
static
final
Map
<
String
,
LightsStatusVO
>
runningStateInfoCacheNoLamp
=
new
ConcurrentHashMap
<>();
public
static
final
Map
<
String
,
LightsStatusVO
>
runningStateInfoCacheNoLamp
=
new
ConcurrentHashMap
<>();
public
static
final
Map
<
String
,
Long
>
runningStatusStampMap
=
new
HashMap
<>();
public
static
final
Map
<
String
,
Long
>
runningStatusStampMap
=
new
HashMap
<>();
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/task/HisensePhaseCountDownTask.java
View file @
02844cc3
...
@@ -15,6 +15,7 @@ import net.wanji.utc.hisense.cache.SignalDataCache;
...
@@ -15,6 +15,7 @@ import net.wanji.utc.hisense.cache.SignalDataCache;
import
net.wanji.utc.hisense.pojo.CrossPhaseDirTurnPojo
;
import
net.wanji.utc.hisense.pojo.CrossPhaseDirTurnPojo
;
import
net.wanji.utc.hisense.pojo.dto.CrossSchemePhaseCountDownDTO
;
import
net.wanji.utc.hisense.pojo.dto.CrossSchemePhaseCountDownDTO
;
import
net.wanji.utc.hisense.pojo.dto.PhaseCountDownDTO
;
import
net.wanji.utc.hisense.pojo.dto.PhaseCountDownDTO
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
...
@@ -50,8 +51,10 @@ public class HisensePhaseCountDownTask {
...
@@ -50,8 +51,10 @@ public class HisensePhaseCountDownTask {
// 通过时段表,切换方案 凌晨00:00 如果切换下一个日期方案,可能RefreshCacheTask还没执行
// 通过时段表,切换方案 凌晨00:00 如果切换下一个日期方案,可能RefreshCacheTask还没执行
String
nextSectionSchemeNo
=
CrossRunSchemeCache
.
currentRunSchemeNoCache
.
get
(
crossId
);
String
nextSectionSchemeNo
=
CrossRunSchemeCache
.
currentRunSchemeNoCache
.
get
(
crossId
);
String
currentTime
=
String
.
valueOf
(
new
Date
().
getTime
());
Date
currentDate
=
new
Date
();
if
(
StringUtils
.
equalsIgnoreCase
(
schemeStartTime
,
currentTime
))
{
String
currentTime
=
String
.
valueOf
(
currentDate
.
getTime
());
Date
date2HoursAgo
=
DateUtils
.
addHours
(
currentDate
,
-
1
);
if
(
StringUtils
.
equalsIgnoreCase
(
schemeStartTime
,
currentTime
)
||
Long
.
parseLong
(
schemeStartTime
)
<
date2HoursAgo
.
getTime
())
{
crossSchemePO
=
crossSchemeMapper
.
selectByCrossIdAndSchemeNo
(
crossId
,
Integer
.
valueOf
(
nextSectionSchemeNo
));
crossSchemePO
=
crossSchemeMapper
.
selectByCrossIdAndSchemeNo
(
crossId
,
Integer
.
valueOf
(
nextSectionSchemeNo
));
executeNextSectionScheme
(
crossId
,
lightsStatusVO
,
crossSchemePO
);
executeNextSectionScheme
(
crossId
,
lightsStatusVO
,
crossSchemePO
);
lightsStatusVO
.
setCycleLen
(
crossSchemePO
.
getCycle
());
lightsStatusVO
.
setCycleLen
(
crossSchemePO
.
getCycle
());
...
@@ -61,6 +64,18 @@ public class HisensePhaseCountDownTask {
...
@@ -61,6 +64,18 @@ public class HisensePhaseCountDownTask {
// 当前方案下一周期
// 当前方案下一周期
setDirLampGroupMap
(
lightsStatusVO
);
setDirLampGroupMap
(
lightsStatusVO
);
if
(
Objects
.
nonNull
(
lightsStatusVO
.
getDirLampGroupMap
()))
{
if
(
Objects
.
nonNull
(
lightsStatusVO
.
getDirLampGroupMap
()))
{
if
(
Objects
.
equals
(
crossId
,
"13NI00B5RM0"
))
{
List
<
String
>
dirList
=
Arrays
.
asList
(
"1"
,
"3"
,
"7"
);
Map
<
String
,
Object
>
dirLampGroupMap
=
lightsStatusVO
.
getDirLampGroupMap
();
for
(
String
dir
:
dirList
)
{
if
(!
dirLampGroupMap
.
containsKey
(
dir
))
{
Map
<
String
,
String
>
value
=
new
HashMap
<>();
setAllTurnColorRed
(
value
,
null
,
null
);
dirLampGroupMap
.
put
(
dir
,
value
);
}
}
lightsStatusVO
.
setDirLampGroupMap
(
dirLampGroupMap
);
}
SignalDataCache
.
runningStateInfoCache
.
put
(
crossId
,
lightsStatusVO
);
SignalDataCache
.
runningStateInfoCache
.
put
(
crossId
,
lightsStatusVO
);
}
}
}
}
...
@@ -213,6 +228,7 @@ public class HisensePhaseCountDownTask {
...
@@ -213,6 +228,7 @@ public class HisensePhaseCountDownTask {
/**
/**
* 两秒倒计时,全场红
* 两秒倒计时,全场红
*
* @param turnColor
* @param turnColor
* @param type
* @param type
* @param color
* @param color
...
@@ -231,6 +247,7 @@ public class HisensePhaseCountDownTask {
...
@@ -231,6 +247,7 @@ public class HisensePhaseCountDownTask {
/**
/**
* 设置所有转向灯色
* 设置所有转向灯色
*
* @param turnColor
* @param turnColor
* @param type
* @param type
* @param color
* @param color
...
...
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