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
5c4e63a8
Commit
5c4e63a8
authored
Dec 12, 2024
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 灯态增加线程
parent
09c5fc13
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
45 deletions
+51
-45
SignalDataCache.java
...ain/java/net/wanji/utc/hisense/cache/SignalDataCache.java
+1
-1
HisensePhaseCountDownTask.java
...net/wanji/utc/hisense/task/HisensePhaseCountDownTask.java
+50
-44
No files found.
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/cache/SignalDataCache.java
View file @
5c4e63a8
...
@@ -26,5 +26,5 @@ public class SignalDataCache {
...
@@ -26,5 +26,5 @@ public class SignalDataCache {
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
Concurrent
HashMap
<>();
}
}
signal-utc-hisense-service/src/main/java/net/wanji/utc/hisense/task/HisensePhaseCountDownTask.java
View file @
5c4e63a8
...
@@ -19,6 +19,7 @@ import net.wanji.utc.hisense.pojo.dto.CrossSchemePhaseCountDownDTO;
...
@@ -19,6 +19,7 @@ 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.apache.commons.lang3.time.DateUtils
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
...
@@ -40,9 +41,12 @@ public class HisensePhaseCountDownTask {
...
@@ -40,9 +41,12 @@ public class HisensePhaseCountDownTask {
private
CrossSchemeMapper
crossSchemeMapper
;
private
CrossSchemeMapper
crossSchemeMapper
;
@Resource
@Resource
private
CrossLightsMapper
crossLightsMapper
;
private
CrossLightsMapper
crossLightsMapper
;
@Resource
(
name
=
"commonThreadPoolExecutor"
)
ThreadPoolTaskExecutor
commonThreadPoolExecutor
;
@Scheduled
(
fixedRate
=
1000
,
initialDelay
=
1000
)
@Scheduled
(
fixedRate
=
1000
,
initialDelay
=
1000
)
public
void
phaseTimeCountDown
()
throws
Exception
{
public
void
phaseTimeCountDown
()
throws
Exception
{
commonThreadPoolExecutor
.
execute
(()
->
{
try
{
try
{
Map
<
String
,
LightsStatusVO
>
runningStateInfoCacheNoLamp
=
SignalDataCache
.
runningStateInfoCacheNoLamp
;
Map
<
String
,
LightsStatusVO
>
runningStateInfoCacheNoLamp
=
SignalDataCache
.
runningStateInfoCacheNoLamp
;
if
(!
runningStateInfoCacheNoLamp
.
isEmpty
())
{
if
(!
runningStateInfoCacheNoLamp
.
isEmpty
())
{
...
@@ -92,8 +96,10 @@ public class HisensePhaseCountDownTask {
...
@@ -92,8 +96,10 @@ public class HisensePhaseCountDownTask {
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"定时任务计算路口相位灯态倒计时异常"
,
e
);
log
.
error
(
"定时任务计算路口相位灯态倒计时异常"
,
e
);
throw
new
Exception
(
e
);
throw
new
Runtime
Exception
(
e
);
}
}
});
}
}
private
static
void
getRedCountDown
(
String
crossId
,
LightsStatusVO
lightsStatusVO
,
String
schemeId
)
{
private
static
void
getRedCountDown
(
String
crossId
,
LightsStatusVO
lightsStatusVO
,
String
schemeId
)
{
...
...
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