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
f93b5775
Commit
f93b5775
authored
Mar 29, 2023
by
duanruiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 方案管理-方案查询-相位车道方向优化
parent
17181f0b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
1 deletion
+62
-1
CrossLisghtsLaneDirEnum.java
...a/net/wanji/web/common/enums/CrossLisghtsLaneDirEnum.java
+59
-0
SchemeConfigServiceImpl.java
...anji/web/service/scheme/impl/SchemeConfigServiceImpl.java
+3
-1
No files found.
signal-control-service/src/main/java/net/wanji/web/common/enums/CrossLisghtsLaneDirEnum.java
0 → 100644
View file @
f93b5775
package
net
.
wanji
.
web
.
common
.
enums
;
import
java.util.Objects
;
/**
* @author duanruiming
* @date 2023/03/29 17:47
*/
public
enum
CrossLisghtsLaneDirEnum
{
ONE
(
1
,
5
,
"北"
),
TWO
(
2
,
6
,
"东北"
),
THREE
(
3
,
7
,
"东"
),
FOUR
(
4
,
8
,
"东南"
),
FIVE
(
5
,
1
,
"南"
),
SIX
(
6
,
2
,
"西南"
),
SEVEN
(
7
,
3
,
"西"
),
EIGHT
(
8
,
4
,
"西北"
);
private
final
int
lightDir
;
private
final
int
laneDir
;
private
final
String
msg
;
public
static
Integer
getLaneDirByLightsDir
(
Integer
lightDir
)
{
CrossLisghtsLaneDirEnum
[]
values
=
CrossLisghtsLaneDirEnum
.
values
();
for
(
CrossLisghtsLaneDirEnum
value
:
values
)
{
if
(
Objects
.
equals
(
value
.
getLightDir
(),
lightDir
))
{
return
value
.
getLaneDir
();
}
}
return
null
;
}
public
static
Integer
getBackByFront
(
Integer
frontCode
)
{
for
(
CrossTurnEnum
value
:
CrossTurnEnum
.
values
())
{
if
(
value
.
getFrontCode
()
==
frontCode
)
{
return
value
.
getBackCode
();
}
}
return
null
;
}
CrossLisghtsLaneDirEnum
(
int
lightDir
,
int
laneDir
,
String
msg
)
{
this
.
lightDir
=
lightDir
;
this
.
laneDir
=
laneDir
;
this
.
msg
=
msg
;
}
public
int
getLightDir
()
{
return
lightDir
;
}
public
int
getLaneDir
()
{
return
laneDir
;
}
public
String
getMsg
()
{
return
msg
;
}
}
signal-control-service/src/main/java/net/wanji/web/service/scheme/impl/SchemeConfigServiceImpl.java
View file @
f93b5775
...
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
...
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
net.wanji.common.dto.CrossIdDTO
;
import
net.wanji.common.dto.CrossIdDTO
;
import
net.wanji.web.common.constant.ControlModeConst
;
import
net.wanji.web.common.constant.ControlModeConst
;
import
net.wanji.web.common.enums.CrossLisghtsLaneDirEnum
;
import
net.wanji.web.common.exception.NoLanesException
;
import
net.wanji.web.common.exception.NoLanesException
;
import
net.wanji.web.common.exception.PhaseNoNotUniqueException
;
import
net.wanji.web.common.exception.PhaseNoNotUniqueException
;
import
net.wanji.web.dto.LaneIdDTO
;
import
net.wanji.web.dto.LaneIdDTO
;
...
@@ -350,7 +351,8 @@ public class SchemeConfigServiceImpl implements SchemeConfigService {
...
@@ -350,7 +351,8 @@ public class SchemeConfigServiceImpl implements SchemeConfigService {
}
}
for
(
Integer
dir
:
dirSet
)
{
for
(
Integer
dir
:
dirSet
)
{
SaveSchemeConfigDTO
.
DirListElement
dirListElement
=
new
SaveSchemeConfigDTO
.
DirListElement
();
SaveSchemeConfigDTO
.
DirListElement
dirListElement
=
new
SaveSchemeConfigDTO
.
DirListElement
();
dirListElement
.
setDir
(
dir
);
Integer
laneDir
=
CrossLisghtsLaneDirEnum
.
getLaneDirByLightsDir
(
dir
);
dirListElement
.
setDir
(
laneDir
);
// 是否有行人相位
// 是否有行人相位
List
<
CrossLightsPO
>
crossLightsPOList
=
crossLightsMapper
.
selectByCrossIdAndDir
(
crossId
,
dir
);
List
<
CrossLightsPO
>
crossLightsPOList
=
crossLightsMapper
.
selectByCrossIdAndDir
(
crossId
,
dir
);
for
(
CrossLightsPO
crossLightsPO
:
crossLightsPOList
)
{
for
(
CrossLightsPO
crossLightsPO
:
crossLightsPOList
)
{
...
...
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