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
a6587680
Commit
a6587680
authored
Jan 11, 2023
by
hanbing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
方案管理-处理伴随相位
parent
7dcd568f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
18 deletions
+16
-18
SaveSchemeConfigDTO.java
.../src/main/java/net/wanji/web/dto/SaveSchemeConfigDTO.java
+2
-4
CrossPhaseMapper.java
...in/java/net/wanji/web/mapper/scheme/CrossPhaseMapper.java
+2
-2
SchemeConfigServiceImpl.java
...anji/web/service/scheme/impl/SchemeConfigServiceImpl.java
+10
-10
CrossPhaseMapper.xml
...ice/src/main/resources/mapper/scheme/CrossPhaseMapper.xml
+2
-2
No files found.
signal-control-service/src/main/java/net/wanji/web/dto/SaveSchemeConfigDTO.java
View file @
a6587680
...
@@ -98,11 +98,9 @@ public class SaveSchemeConfigDTO {
...
@@ -98,11 +98,9 @@ public class SaveSchemeConfigDTO {
@Data
@Data
public
static
class
LaneListElement
{
public
static
class
LaneListElement
{
@ApiModelProperty
(
value
=
"车道序号,从左车道开始编号11、12、13..."
,
required
=
true
)
private
Integer
sort
;
@ApiModelProperty
(
value
=
"车道转向:1左转;2直行;3右转;4掉头;5左直;6直右;7左直右;8左右;9左转掉头;10直行掉头;11右转掉头;12左直掉头;13直右掉头;14左直右掉头;15左右掉头"
,
required
=
true
)
@ApiModelProperty
(
value
=
"车道转向:1左转;2直行;3右转;4掉头;5左直;6直右;7左直右;8左右;9左转掉头;10直行掉头;11右转掉头;12左直掉头;13直右掉头;14左直右掉头;15左右掉头"
,
required
=
true
)
private
Integer
tur
n
;
private
Integer
directio
n
;
@ApiModelProperty
(
value
=
"车道类别:1机动车;2非机动车;3公交专用;4可变;5潮汐"
,
required
=
true
)
@ApiModelProperty
(
value
=
"车道类别:1机动车;2非机动车;3公交专用;4可变;5潮汐"
,
required
=
true
)
private
Integer
category
;
private
Integer
laneType
;
}
}
}
}
\ No newline at end of file
signal-control-service/src/main/java/net/wanji/web/mapper/scheme/CrossPhaseMapper.java
View file @
a6587680
...
@@ -20,8 +20,8 @@ public interface CrossPhaseMapper {
...
@@ -20,8 +20,8 @@ public interface CrossPhaseMapper {
void
deleteByCrossId
(
@Param
(
"crossId"
)
String
crossId
);
void
deleteByCrossId
(
@Param
(
"crossId"
)
String
crossId
);
void
updateAccompanyPhaseNo
(
@Param
(
"
coordPhaseNo"
)
String
coor
dPhaseNo
,
void
updateAccompanyPhaseNo
(
@Param
(
"
accompaniedPhaseNo"
)
String
accompanie
dPhaseNo
,
@Param
(
"
phaseNoReal"
)
String
phaseNoReal
,
@Param
(
"
accompanyPhaseNo"
)
String
accompanyPhaseNo
,
@Param
(
"planId"
)
Integer
planId
,
@Param
(
"planId"
)
Integer
planId
,
@Param
(
"crossId"
)
String
crossId
);
@Param
(
"crossId"
)
String
crossId
);
}
}
signal-control-service/src/main/java/net/wanji/web/service/scheme/impl/SchemeConfigServiceImpl.java
View file @
a6587680
...
@@ -117,11 +117,11 @@ public class SchemeConfigServiceImpl implements SchemeConfigService {
...
@@ -117,11 +117,11 @@ public class SchemeConfigServiceImpl implements SchemeConfigService {
String
crossId
=
saveSchemeConfigDTO
.
getCrossId
();
String
crossId
=
saveSchemeConfigDTO
.
getCrossId
();
crossPhaseMapper
.
deleteByCrossId
(
crossId
);
crossPhaseMapper
.
deleteByCrossId
(
crossId
);
crossPhaseLightsMapper
.
deleteByCrossId
(
crossId
);
crossPhaseLightsMapper
.
deleteByCrossId
(
crossId
);
// 用于限制相位号不能重复
Set
<
String
>
phaseNoSet
=
new
HashSet
<>();
List
<
SaveSchemeConfigDTO
.
PhaseScheme
>
phaseSchemeList
=
saveSchemeConfigDTO
.
getPhaseSchemeList
();
List
<
SaveSchemeConfigDTO
.
PhaseScheme
>
phaseSchemeList
=
saveSchemeConfigDTO
.
getPhaseSchemeList
();
for
(
SaveSchemeConfigDTO
.
PhaseScheme
phaseScheme
:
phaseSchemeList
)
{
for
(
SaveSchemeConfigDTO
.
PhaseScheme
phaseScheme
:
phaseSchemeList
)
{
// 用于限制相位号不能重复
Set
<
String
>
phaseNoSet
=
new
HashSet
<>();
String
schemeNo
=
phaseScheme
.
getSchemeNo
();
String
schemeNo
=
phaseScheme
.
getSchemeNo
();
// 获取方案ID
// 获取方案ID
Integer
schemeId
=
crossSchemeMapper
.
selectIdByCrossIdAndSchemeNo
(
crossId
,
schemeNo
);
Integer
schemeId
=
crossSchemeMapper
.
selectIdByCrossIdAndSchemeNo
(
crossId
,
schemeNo
);
...
@@ -139,7 +139,7 @@ public class SchemeConfigServiceImpl implements SchemeConfigService {
...
@@ -139,7 +139,7 @@ public class SchemeConfigServiceImpl implements SchemeConfigService {
String
phaseNo
=
phase
.
getPhaseNo
();
String
phaseNo
=
phase
.
getPhaseNo
();
testPhaseNo
(
phaseNoSet
,
phaseNo
);
testPhaseNo
(
phaseNoSet
,
phaseNo
);
Integer
phaseType
=
phase
.
getPhaseType
();
Integer
phaseType
=
phase
.
getPhaseType
();
if
(
phaseType
!=
3
)
{
//
非伴随
相位
if
(
phaseType
!=
3
)
{
//
实相位或虚
相位
phaseNoMap
.
put
(
phaseNo
,
phase
);
phaseNoMap
.
put
(
phaseNo
,
phase
);
Integer
yellowFlashTime
=
phase
.
getYellowFlashTime
();
Integer
yellowFlashTime
=
phase
.
getYellowFlashTime
();
Integer
redFlashTime
=
phase
.
getRedFlashTime
();
Integer
redFlashTime
=
phase
.
getRedFlashTime
();
...
@@ -199,8 +199,8 @@ public class SchemeConfigServiceImpl implements SchemeConfigService {
...
@@ -199,8 +199,8 @@ public class SchemeConfigServiceImpl implements SchemeConfigService {
Integer
coordMaxGreenTime
=
0
;
Integer
coordMaxGreenTime
=
0
;
List
<
String
>
accompanyPhaseNoList
=
phase
.
getAccompanyPhaseNoList
();
List
<
String
>
accompanyPhaseNoList
=
phase
.
getAccompanyPhaseNoList
();
if
(
accompanyPhaseNoList
!=
null
)
{
if
(
accompanyPhaseNoList
!=
null
)
{
for
(
String
accompan
y
PhaseNo
:
accompanyPhaseNoList
)
{
for
(
String
accompan
ied
PhaseNo
:
accompanyPhaseNoList
)
{
SaveSchemeConfigDTO
.
PhaseListElement
phaseListElement
=
phaseNoMap
.
get
(
accompan
y
PhaseNo
);
SaveSchemeConfigDTO
.
PhaseListElement
phaseListElement
=
phaseNoMap
.
get
(
accompan
ied
PhaseNo
);
// 时长加总
// 时长加总
coordGreenTime
+=
phaseListElement
.
getGreenTime
();
coordGreenTime
+=
phaseListElement
.
getGreenTime
();
coordGreenFlashTime
+=
phaseListElement
.
getGreenFlashTime
();
coordGreenFlashTime
+=
phaseListElement
.
getGreenFlashTime
();
...
@@ -210,11 +210,11 @@ public class SchemeConfigServiceImpl implements SchemeConfigService {
...
@@ -210,11 +210,11 @@ public class SchemeConfigServiceImpl implements SchemeConfigService {
coordRedTime
+=
phaseListElement
.
getRedTime
();
coordRedTime
+=
phaseListElement
.
getRedTime
();
coordMinGreenTime
+=
phaseListElement
.
getMinGreenTime
();
coordMinGreenTime
+=
phaseListElement
.
getMinGreenTime
();
coordMaxGreenTime
+=
phaseListElement
.
getMaxGreenTime
();
coordMaxGreenTime
+=
phaseListElement
.
getMaxGreenTime
();
//
实
相位号
//
伴随
相位号
String
phaseNoReal
=
phaseListElement
.
getPhaseNo
();
String
accompanyPhaseNo
=
phase
.
getPhaseNo
();
// 更新伴随相位号
// 更新伴随相位号
Integer
planId
=
crossSchemeMapper
.
selectIdByCrossIdAndSchemeNo
(
crossId
,
schemeNo
);
Integer
planId
=
crossSchemeMapper
.
selectIdByCrossIdAndSchemeNo
(
crossId
,
schemeNo
);
crossPhaseMapper
.
updateAccompanyPhaseNo
(
accompan
yPhaseNo
,
phaseNoReal
,
planId
,
crossId
);
crossPhaseMapper
.
updateAccompanyPhaseNo
(
accompan
iedPhaseNo
,
accompanyPhaseNo
,
planId
,
crossId
);
}
}
}
}
crossPhasePO
.
setGreenTime
(
coordGreenTime
);
crossPhasePO
.
setGreenTime
(
coordGreenTime
);
...
@@ -300,8 +300,8 @@ public class SchemeConfigServiceImpl implements SchemeConfigService {
...
@@ -300,8 +300,8 @@ public class SchemeConfigServiceImpl implements SchemeConfigService {
List
<
SaveSchemeConfigDTO
.
LaneListElement
>
laneList
=
dirListElement
.
getLaneList
();
List
<
SaveSchemeConfigDTO
.
LaneListElement
>
laneList
=
dirListElement
.
getLaneList
();
for
(
SaveSchemeConfigDTO
.
LaneListElement
laneListElement
:
laneList
)
{
for
(
SaveSchemeConfigDTO
.
LaneListElement
laneListElement
:
laneList
)
{
CrossPhaseLightsPO
crossPhaseLightsPO
=
new
CrossPhaseLightsPO
();
CrossPhaseLightsPO
crossPhaseLightsPO
=
new
CrossPhaseLightsPO
();
Integer
category
=
laneListElement
.
get
Category
();
Integer
category
=
laneListElement
.
get
LaneType
();
Integer
turn
=
laneListElement
.
get
Tur
n
();
Integer
turn
=
laneListElement
.
get
Directio
n
();
// 根据车道获得灯组ID
// 根据车道获得灯组ID
String
laneId
=
laneInfoMapper
.
selectIdByCrossIdDirTurn
(
crossId
,
dir
,
turn
,
category
);
String
laneId
=
laneInfoMapper
.
selectIdByCrossIdDirTurn
(
crossId
,
dir
,
turn
,
category
);
Integer
lightsId
=
crossLaneLightsMapper
.
selectLightsIdByLaneId
(
crossId
,
laneId
);
Integer
lightsId
=
crossLaneLightsMapper
.
selectLightsIdByLaneId
(
crossId
,
laneId
);
...
...
signal-control-service/src/main/resources/mapper/scheme/CrossPhaseMapper.xml
View file @
a6587680
...
@@ -34,8 +34,8 @@
...
@@ -34,8 +34,8 @@
<update
id=
"updateAccompanyPhaseNo"
>
<update
id=
"updateAccompanyPhaseNo"
>
update t_base_cross_phase
update t_base_cross_phase
set
coord_phase_no = #{coord
PhaseNo}
set
accompany_phase_no = #{accompany
PhaseNo}
where cross_id = #{crossId} and plan_id = #{planId} and phase_no = #{
phaseNoReal
}
where cross_id = #{crossId} and plan_id = #{planId} and phase_no = #{
accompaniedPhaseNo
}
</update>
</update>
<delete
id=
"deleteByCrossId"
>
<delete
id=
"deleteByCrossId"
>
...
...
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