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
19376395
Commit
19376395
authored
Jul 05, 2023
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 优化实时灯态方向转向倒计时
parent
da8bb6a8
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
42 additions
and
17 deletions
+42
-17
SchemeConfigServiceImpl.java
...anji/web/service/scheme/impl/SchemeConfigServiceImpl.java
+4
-4
HkLightsStatusServiceImpl.java
...c/service/runninginfo/impl/HkLightsStatusServiceImpl.java
+25
-7
BaseCrossPhaseMapper.java
...va/net/wanji/databus/dao/mapper/BaseCrossPhaseMapper.java
+3
-3
CrossPhaseMapper.java
...n/java/net/wanji/databus/dao/mapper/CrossPhaseMapper.java
+2
-0
LightsStatusVO.java
...us/src/main/java/net/wanji/databus/vo/LightsStatusVO.java
+1
-1
BaseCrossPhaseMapper.xml
...atabus/src/main/resources/mapper/BaseCrossPhaseMapper.xml
+2
-2
CrossPhaseMapper.xml
wj-databus/src/main/resources/mapper/CrossPhaseMapper.xml
+5
-0
No files found.
signal-control-service/src/main/java/net/wanji/web/service/scheme/impl/SchemeConfigServiceImpl.java
View file @
19376395
...
...
@@ -203,7 +203,7 @@ public class SchemeConfigServiceImpl implements SchemeConfigService {
phaseListElement
.
setYellowFlash
(
1
);
}
phaseListElement
.
setAccompanyPhaseNoList
(
new
ArrayList
<>());
Integer
phaseId
=
crossPhaseMapper
.
selectIdByCrossIdAnd
Coord
PhaseNo
(
crossId
,
schemeId
,
phaseNo
);
Integer
phaseId
=
crossPhaseMapper
.
selectIdByCrossIdAndPhaseNo
(
crossId
,
schemeId
,
phaseNo
);
List
<
SaveSchemeConfigDTO
.
DirListElement
>
dirList
=
buildDirList
(
crossId
,
phaseId
);
phaseListElement
.
setDirList
(
dirList
);
...
...
@@ -307,7 +307,7 @@ public class SchemeConfigServiceImpl implements SchemeConfigService {
phaseListElement
.
setGreenFlash
(
1
);
}
// 伴随相位的母相位列表
Integer
phaseId
=
crossPhaseMapper
.
selectIdByCrossIdAnd
Coord
PhaseNo
(
crossId
,
schemeId
,
phaseNo
);
Integer
phaseId
=
crossPhaseMapper
.
selectIdByCrossIdAndPhaseNo
(
crossId
,
schemeId
,
phaseNo
);
if
(
phaseType
==
3
)
{
List
<
String
>
superPhaseNoList
=
new
ArrayList
<>();
List
<
Integer
>
superIdList
=
crossAccompanyPhaseMapper
.
selectByPhaseId
(
phaseId
);
...
...
@@ -453,7 +453,7 @@ public class SchemeConfigServiceImpl implements SchemeConfigService {
String
schemeNo
=
phaseScheme
.
getSchemeNo
();
Integer
schemeId
=
baseCrossSchemeMapper
.
selectIdByCrossIdAndSchemeNo
(
crossId
,
schemeNo
);
String
coordPhaseNo
=
phaseScheme
.
getCoordPhaseNo
();
Integer
phaseId
=
crossPhaseMapper
.
selectIdByCrossIdAnd
Coord
PhaseNo
(
crossId
,
schemeId
,
coordPhaseNo
);
Integer
phaseId
=
crossPhaseMapper
.
selectIdByCrossIdAndPhaseNo
(
crossId
,
schemeId
,
coordPhaseNo
);
if
(
phaseId
!=
null
)
{
baseCrossSchemeMapper
.
updateCoordPhase
(
crossId
,
schemeNo
,
phaseId
);
}
...
...
@@ -585,7 +585,7 @@ public class SchemeConfigServiceImpl implements SchemeConfigService {
CrossAccompanyPhasePO
crossAccompanyPhasePO
=
new
CrossAccompanyPhasePO
();
crossAccompanyPhasePO
.
setCrossId
(
crossId
);
crossAccompanyPhasePO
.
setPhaseId
(
accompanyPhaseId
);
Integer
superPhaseId
=
crossPhaseMapper
.
selectIdByCrossIdAnd
Coord
PhaseNo
(
Integer
superPhaseId
=
crossPhaseMapper
.
selectIdByCrossIdAndPhaseNo
(
crossId
,
schemeId
,
superPhaseNo
);
crossAccompanyPhasePO
.
setSuperId
(
superPhaseId
);
crossAccompanyPhasePOList
.
add
(
crossAccompanyPhasePO
);
...
...
signal-utc-service/src/main/java/net/wanji/utc/service/runninginfo/impl/HkLightsStatusServiceImpl.java
View file @
19376395
...
...
@@ -7,10 +7,10 @@ import com.hikvision.artemis.sdk.ArtemisHttpUtil;
import
com.hikvision.artemis.sdk.config.ArtemisConfig
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
net.wanji.databus.dao.entity.BaseCrossSchemePO
;
import
net.wanji.databus.dao.entity.CrossLightsPO
;
import
net.wanji.databus.dao.mapper.CrossInfoMapper
;
import
net.wanji.databus.dao.mapper.CrossLightsMapper
;
import
net.wanji.databus.dao.mapper.ManufacturerInfoMapper
;
import
net.wanji.databus.dao.entity.CrossPhaseLightsPO
;
import
net.wanji.databus.dao.mapper.*
;
import
net.wanji.databus.po.CrossInfoPO
;
import
net.wanji.databus.po.ManufacturerInfoPO
;
import
net.wanji.databus.vo.BaseCrossInfo
;
...
...
@@ -39,6 +39,9 @@ public class HkLightsStatusServiceImpl implements HkLightsStatusService {
private
final
CrossLightsMapper
crossLightsMapper
;
private
final
CrossInfoMapper
crossInfoMapper
;
private
final
ManufacturerInfoMapper
manufacturerInfoMapper
;
private
final
CrossPhaseMapper
crossPhaseMapper
;
private
final
CrossPhaseLightsMapper
crossPhaseLightsMapper
;
private
final
CrossSchemeMapper
crossSchemeMapper
;
public
static
Map
<
String
,
String
>
runModeParseMap
=
new
HashMap
<
String
,
String
>();
...
...
@@ -93,7 +96,7 @@ public class HkLightsStatusServiceImpl implements HkLightsStatusService {
List
<
LightsStatusVO
>
result
=
new
ArrayList
<>();
CrossInfoPO
crossInfoPO
=
crossInfoMapper
.
selectByPrimaryKey
(
crossId
);
List
<
CrossLightsPO
>
C
rossLightsPOList
=
crossLightsMapper
.
selectByCrossId
(
crossId
);
List
<
CrossLightsPO
>
c
rossLightsPOList
=
crossLightsMapper
.
selectByCrossId
(
crossId
);
if
(
Objects
.
nonNull
(
crossInfoPO
))
{
String
signalCode
=
crossInfoPO
.
getCode
();
...
...
@@ -106,6 +109,7 @@ public class HkLightsStatusServiceImpl implements HkLightsStatusService {
for
(
RealTimeStateInfoPO
resultPO
:
realTimeStateInfoListPO
.
getList
())
{
infoVo
=
new
LightsStatusVO
();
Integer
patternNo
=
resultPO
.
getPatternNo
();
BaseCrossSchemePO
baseCrossSchemePO
=
crossSchemeMapper
.
selectByCrossIdAndSchemeNo
(
crossId
,
patternNo
);
List
<
RingsPO
>
rings
=
resultPO
.
getRings
();
// 环列表
List
<
ChannelStatePO
>
channelState
=
resultPO
.
getChannelState
();
// 灯组列表
String
HKControlType
=
resultPO
.
getControlType
();
...
...
@@ -132,13 +136,27 @@ public class HkLightsStatusServiceImpl implements HkLightsStatusService {
List
<
PhaseInfoPO
>
phaseList
=
ring
.
getPhaseList
();
for
(
PhaseInfoPO
phaseInfoPO
:
phaseList
)
{
Integer
phaseNo
=
phaseInfoPO
.
getPhaseNo
();
Integer
countdown
=
phaseInfoPO
.
getCountdown
();
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
);
}
}
}
}
Integer
vehicleStatus
=
phaseInfoPO
.
getVehicleStatus
();
Integer
phaseLength
=
phaseInfoPO
.
getPhaseLength
();
Integer
red
=
phaseInfoPO
.
getRed
();
Integer
yellow
=
phaseInfoPO
.
getYellow
();
Integer
green
=
phaseLength
-
yellow
-
red
;
// 修改逻辑,value为相位倒计时
phaseMap
.
put
(
String
.
valueOf
(
phaseNo
),
phaseInfoPO
.
getCountdown
());
if
(
2
!=
vehicleStatus
)
{
// 2红灯
infoVo
.
setPhaseId
(
String
.
valueOf
(
phaseNo
));
}
...
...
@@ -152,7 +170,7 @@ public class HkLightsStatusServiceImpl implements HkLightsStatusService {
Integer
channelNo
=
channelStatePO
.
getChannelNo
();
Integer
state
=
channelStatePO
.
getState
();
String
color
=
transferHKLampGroup
(
state
);
for
(
CrossLightsPO
po
:
C
rossLightsPOList
)
{
for
(
CrossLightsPO
po
:
c
rossLightsPOList
)
{
if
(
StringUtils
.
equals
(
po
.
getLightsNo
(),
String
.
valueOf
(
channelNo
)))
{
String
direction
=
po
.
getDir
().
toString
();
String
turn
=
po
.
getTurn
().
toString
();
...
...
wj-databus/src/main/java/net/wanji/databus/dao/mapper/BaseCrossPhaseMapper.java
View file @
19376395
...
...
@@ -14,9 +14,9 @@ import java.util.List;
@Repository
public
interface
BaseCrossPhaseMapper
{
Integer
selectIdByCrossIdAnd
Coord
PhaseNo
(
@Param
(
"crossId"
)
String
crossId
,
Integer
selectIdByCrossIdAndPhaseNo
(
@Param
(
"crossId"
)
String
crossId
,
@Param
(
"schemeId"
)
Integer
schemeId
,
@Param
(
"coordPhaseNo"
)
String
coordP
haseNo
);
@Param
(
"phaseNo"
)
String
p
haseNo
);
void
insertOne
(
CrossPhasePO
crossPhasePO
);
...
...
wj-databus/src/main/java/net/wanji/databus/dao/mapper/CrossPhaseMapper.java
View file @
19376395
...
...
@@ -23,4 +23,6 @@ public interface CrossPhaseMapper {
List
<
CrossPhasePO
>
selectByCrossId
(
@Param
(
"crossId"
)
String
crossId
);
void
deleteByCrossId
(
String
crossId
);
Integer
selectPhaseId
(
@Param
(
"crossId"
)
String
crossId
,
@Param
(
"schemeId"
)
Integer
schemeId
,
@Param
(
"phaseNo"
)
Integer
phaseNo
);
}
wj-databus/src/main/java/net/wanji/databus/vo/LightsStatusVO.java
View file @
19376395
...
...
@@ -35,7 +35,7 @@ public class LightsStatusVO extends BaseCrossInfo {
private
String
schemeId
;
@ApiModelProperty
(
value
=
"灯组状态"
)
private
Map
<
String
,
Object
>
dirLampGroupMap
;
@ApiModelProperty
(
value
=
"
相位对象:key相位编号,value绿灯时长,"
,
notes
=
"目前没有用到
"
)
@ApiModelProperty
(
value
=
"
方向转向倒计时
"
)
private
Map
<
String
,
Object
>
phaseMap
;
public
void
setCycleCountDown
(
Integer
cycleCountDown
)
{
...
...
wj-databus/src/main/resources/mapper/BaseCrossPhaseMapper.xml
View file @
19376395
...
...
@@ -120,9 +120,9 @@
where cross_id = #{crossId}
</delete>
<select
id=
"selectIdByCrossIdAnd
Coord
PhaseNo"
resultType=
"java.lang.Integer"
>
<select
id=
"selectIdByCrossIdAndPhaseNo"
resultType=
"java.lang.Integer"
>
select id from t_base_cross_phase
where cross_id = #{crossId} and plan_id = #{schemeId} and phase_no = #{
coordP
haseNo}
where cross_id = #{crossId} and plan_id = #{schemeId} and phase_no = #{
p
haseNo}
</select>
<select
id=
"selectById"
resultMap=
"BaseResultMap"
>
...
...
wj-databus/src/main/resources/mapper/CrossPhaseMapper.xml
View file @
19376395
...
...
@@ -71,6 +71,11 @@
where cross_id = #{crossId} and phase_no = #{phaseNo}
</select>
<select
id=
"selectPhaseId"
resultType=
"java.lang.Integer"
>
select id from t_cross_phase
where cross_id = #{crossId} and plan_id = #{schemeId} and phase_no = #{phaseNo}
</select>
<select
id=
"selectByCrossId"
resultMap=
"BaseResultMap"
>
select
id,phase_no,name,sort,cross_id,plan_id,ring_no,control_mode,phase_time,green_time,green_flash_time,ped_flash_time,yellow_time,red_time,min_green_time,max_green_time,gmt_create,gmt_modified
...
...
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