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
3c93e6a1
Commit
3c93e6a1
authored
Jul 05, 2023
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 优化红灯倒计时,特殊控制时倒计时为0
parent
efdd8a3e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
14 deletions
+39
-14
HkLightsStatusServiceImpl.java
...c/service/runninginfo/impl/HkLightsStatusServiceImpl.java
+39
-14
No files found.
signal-utc-service/src/main/java/net/wanji/utc/service/runninginfo/impl/HkLightsStatusServiceImpl.java
View file @
3c93e6a1
...
@@ -10,6 +10,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -10,6 +10,7 @@ import lombok.extern.slf4j.Slf4j;
import
net.wanji.databus.dao.entity.BaseCrossSchemePO
;
import
net.wanji.databus.dao.entity.BaseCrossSchemePO
;
import
net.wanji.databus.dao.entity.CrossLightsPO
;
import
net.wanji.databus.dao.entity.CrossLightsPO
;
import
net.wanji.databus.dao.entity.CrossPhaseLightsPO
;
import
net.wanji.databus.dao.entity.CrossPhaseLightsPO
;
import
net.wanji.databus.dao.entity.CrossPhasePO
;
import
net.wanji.databus.dao.mapper.*
;
import
net.wanji.databus.dao.mapper.*
;
import
net.wanji.databus.po.CrossInfoPO
;
import
net.wanji.databus.po.CrossInfoPO
;
import
net.wanji.databus.po.ManufacturerInfoPO
;
import
net.wanji.databus.po.ManufacturerInfoPO
;
...
@@ -137,20 +138,7 @@ public class HkLightsStatusServiceImpl implements HkLightsStatusService {
...
@@ -137,20 +138,7 @@ public class HkLightsStatusServiceImpl implements HkLightsStatusService {
for
(
PhaseInfoPO
phaseInfoPO
:
phaseList
)
{
for
(
PhaseInfoPO
phaseInfoPO
:
phaseList
)
{
Integer
phaseNo
=
phaseInfoPO
.
getPhaseNo
();
Integer
phaseNo
=
phaseInfoPO
.
getPhaseNo
();
Integer
countdown
=
phaseInfoPO
.
getCountdown
();
Integer
countdown
=
phaseInfoPO
.
getCountdown
();
Integer
phaseId
=
crossPhaseMapper
.
selectPhaseId
(
crossId
,
baseCrossSchemePO
.
getId
(),
phaseNo
);
setDirTurnRedCountDown
(
crossId
,
crossLightsPOList
,
baseCrossSchemePO
,
phaseMap
,
phaseNo
,
countdown
);
List
<
CrossPhaseLightsPO
>
crossPhaseLightsPOList
=
crossPhaseLightsMapper
.
selectByCrossId
(
crossId
);
for
(
CrossPhaseLightsPO
crossPhaseLightsPO
:
crossPhaseLightsPOList
)
{
if
(
Objects
.
equals
(
phaseId
,
crossPhaseLightsPO
.
getPhaseId
()))
{
Integer
lightsId
=
crossPhaseLightsPO
.
getLightsId
();
for
(
CrossLightsPO
crossLightsPO
:
crossLightsPOList
)
{
if
(
Objects
.
equals
(
lightsId
,
crossLightsPO
.
getId
()))
{
Integer
dir
=
crossLightsPO
.
getDir
();
Integer
turn
=
crossLightsPO
.
getTurn
();
phaseMap
.
put
(
String
.
join
(
"-"
,
String
.
valueOf
(
dir
),
String
.
valueOf
(
turn
)),
countdown
);
}
}
}
}
Integer
vehicleStatus
=
phaseInfoPO
.
getVehicleStatus
();
Integer
vehicleStatus
=
phaseInfoPO
.
getVehicleStatus
();
Integer
phaseLength
=
phaseInfoPO
.
getPhaseLength
();
Integer
phaseLength
=
phaseInfoPO
.
getPhaseLength
();
Integer
red
=
phaseInfoPO
.
getRed
();
Integer
red
=
phaseInfoPO
.
getRed
();
...
@@ -195,6 +183,43 @@ public class HkLightsStatusServiceImpl implements HkLightsStatusService {
...
@@ -195,6 +183,43 @@ public class HkLightsStatusServiceImpl implements HkLightsStatusService {
return
result
;
return
result
;
}
}
private
void
setDirTurnRedCountDown
(
String
crossId
,
List
<
CrossLightsPO
>
crossLightsPOList
,
BaseCrossSchemePO
baseCrossSchemePO
,
Map
<
String
,
Object
>
phaseMap
,
Integer
phaseNo
,
Integer
countdown
)
{
if
(
Objects
.
nonNull
(
baseCrossSchemePO
))
{
Integer
phaseId
=
crossPhaseMapper
.
selectPhaseId
(
crossId
,
baseCrossSchemePO
.
getId
(),
phaseNo
);
List
<
CrossPhaseLightsPO
>
crossPhaseLightsPOList
=
crossPhaseLightsMapper
.
selectByCrossId
(
crossId
);
for
(
CrossPhaseLightsPO
crossPhaseLightsPO
:
crossPhaseLightsPOList
)
{
if
(
Objects
.
equals
(
phaseId
,
crossPhaseLightsPO
.
getPhaseId
()))
{
Integer
lightsId
=
crossPhaseLightsPO
.
getLightsId
();
for
(
CrossLightsPO
crossLightsPO
:
crossLightsPOList
)
{
if
(
Objects
.
equals
(
lightsId
,
crossLightsPO
.
getId
()))
{
Integer
dir
=
crossLightsPO
.
getDir
();
Integer
turn
=
crossLightsPO
.
getTurn
();
phaseMap
.
put
(
String
.
join
(
"-"
,
String
.
valueOf
(
dir
),
String
.
valueOf
(
turn
)),
countdown
);
}
}
}
}
}
else
{
// 特殊控制的时候
List
<
CrossPhasePO
>
crossPhasePOS
=
crossPhaseMapper
.
selectByCrossId
(
crossId
);
for
(
CrossPhasePO
crossPhasePO
:
crossPhasePOS
)
{
Integer
phaseId
=
crossPhasePO
.
getId
();
List
<
CrossPhaseLightsPO
>
crossPhaseLightsPOList
=
crossPhaseLightsMapper
.
selectByCrossId
(
crossId
);
for
(
CrossPhaseLightsPO
crossPhaseLightsPO
:
crossPhaseLightsPOList
)
{
if
(
Objects
.
equals
(
phaseId
,
crossPhaseLightsPO
.
getPhaseId
()))
{
Integer
lightsId
=
crossPhaseLightsPO
.
getLightsId
();
for
(
CrossLightsPO
crossLightsPO
:
crossLightsPOList
)
{
if
(
Objects
.
equals
(
lightsId
,
crossLightsPO
.
getId
()))
{
Integer
dir
=
crossLightsPO
.
getDir
();
Integer
turn
=
crossLightsPO
.
getTurn
();
phaseMap
.
put
(
String
.
join
(
"-"
,
String
.
valueOf
(
dir
),
String
.
valueOf
(
turn
)),
0
);
}
}
}
}
}
}
}
/**
/**
* 构建信号机请求参数
* 构建信号机请求参数
*
*
...
...
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