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
b8f0fc81
Commit
b8f0fc81
authored
Feb 09, 2023
by
hanbing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
渠化配置-修改车道ID生成规则
parent
94eeaaf8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
14 deletions
+26
-14
LaneInfoMapper.java
...main/java/net/wanji/web/mapper/scheme/LaneInfoMapper.java
+2
-0
CrossConfigServiceImpl.java
...wanji/web/service/scheme/impl/CrossConfigServiceImpl.java
+14
-11
LaneInfoMapper.xml
...rvice/src/main/resources/mapper/scheme/LaneInfoMapper.xml
+5
-0
TrendServiceImpl.java
...ain/java/net/wanji/opt/service/impl/TrendServiceImpl.java
+5
-3
No files found.
signal-control-service/src/main/java/net/wanji/web/mapper/scheme/LaneInfoMapper.java
View file @
b8f0fc81
...
...
@@ -31,4 +31,6 @@ public interface LaneInfoMapper {
@Param
(
"category"
)
Integer
category
);
List
<
LaneInfoPO
>
selectByLaneIds
(
@Param
(
"laneIds"
)
List
<
String
>
laneIds
);
String
selectPreId
(
String
crossId
,
Integer
dir
);
}
signal-control-service/src/main/java/net/wanji/web/service/scheme/impl/CrossConfigServiceImpl.java
View file @
b8f0fc81
...
...
@@ -210,7 +210,7 @@ public class CrossConfigServiceImpl implements CrossConfigService {
&&
Objects
.
equals
(
oldPO
.
getType
(),
newPO
.
getType
()));
}
private
static
void
setType
(
LedConfigListElement
ledConfigListElement
,
CrossLightsPO
crossLightsPO
)
{
private
void
setType
(
LedConfigListElement
ledConfigListElement
,
CrossLightsPO
crossLightsPO
)
{
Integer
type
=
ledConfigListElement
.
getType
();
Integer
signalType
=
ledConfigListElement
.
getSignalType
();
String
address
=
ledConfigListElement
.
getAddress
();
...
...
@@ -271,7 +271,7 @@ public class CrossConfigServiceImpl implements CrossConfigService {
List
<
Integer
>
dirListFromDb
=
crossDirInfoPOList
.
stream
()
.
map
(
CrossDirInfoPO:
:
getDirType
)
.
collect
(
Collectors
.
toList
());
// 删除数据库中有,前端对象中没有的
数据
// 删除数据库中有,前端对象中没有的
方向
for
(
Integer
dirFromDb
:
dirListFromDb
)
{
if
(!
dirList
.
contains
(
dirFromDb
))
{
List
<
LaneInfoPO
>
laneInfoPOList
=
laneInfoMapper
.
selectByCrossIdAndDir
(
crossId
,
dirFromDb
);
...
...
@@ -291,7 +291,7 @@ public class CrossConfigServiceImpl implements CrossConfigService {
cleanDataBase
(
crossId
,
dir
,
laneInfoPOList
);
// 插入进口信息
List
<
LaneInfoPO
>
laneInfoPOListForInsert
=
getLaneInfoPOListForInsert
(
crossId
,
dir
ListElement
,
dir
,
laneListFromClient
);
crossId
,
dir
,
laneListFromClient
);
if
(
laneInfoPOListForInsert
.
size
()
>
0
)
{
laneInfoMapper
.
insertBatch
(
laneInfoPOListForInsert
);
}
...
...
@@ -300,8 +300,8 @@ public class CrossConfigServiceImpl implements CrossConfigService {
crossDirInfoMapper
.
insertOne
(
crossDirInfoPO
);
}
// 更新是否有行人道
String
i
d
=
getId
(
crossId
,
dirListElement
);
crossDirInfoMapper
.
updateIsPedestrian
(
dirListElement
.
getIsPersonCross
(),
i
d
);
String
crossDirInfoI
d
=
getId
(
crossId
,
dirListElement
);
crossDirInfoMapper
.
updateIsPedestrian
(
dirListElement
.
getIsPersonCross
(),
crossDirInfoI
d
);
}
}
...
...
@@ -382,7 +382,7 @@ public class CrossConfigServiceImpl implements CrossConfigService {
ledConfigList
.
sort
(
Comparator
.
comparing
(
LedConfigListElement:
:
getOrder
));
}
private
static
void
setLightAddress
(
LedConfigListElement
ledConfigListElement
,
String
s
)
{
private
void
setLightAddress
(
LedConfigListElement
ledConfigListElement
,
String
s
)
{
int
i
=
Integer
.
parseInt
(
s
);
String
address
=
LightsAddressEnum
.
getMsgByCode
(
i
);
ledConfigListElement
.
setAddress
(
address
);
...
...
@@ -454,13 +454,13 @@ public class CrossConfigServiceImpl implements CrossConfigService {
}
}
private
static
String
getId
(
String
crossId
,
DirListElement
dirListElement
)
{
private
String
getId
(
String
crossId
,
DirListElement
dirListElement
)
{
Integer
dir
=
dirListElement
.
getDir
();
String
id
=
crossId
+
"_"
+
dir
+
"_"
+
1
+
"_"
+
0
;
// todo 暂无主辅路序号,赋值0
return
id
;
}
private
static
CrossDirInfoPO
getCrossDirInfoPO
(
String
crossId
,
DirListElement
dirListElement
)
{
private
CrossDirInfoPO
getCrossDirInfoPO
(
String
crossId
,
DirListElement
dirListElement
)
{
CrossDirInfoPO
crossDirInfoPO
=
new
CrossDirInfoPO
();
Integer
dir
=
dirListElement
.
getDir
();
crossDirInfoPO
.
setId
(
crossId
+
"_"
+
dir
+
"_"
+
1
+
"_"
+
0
);
// todo 暂无主辅路序号,赋值0
...
...
@@ -472,8 +472,8 @@ public class CrossConfigServiceImpl implements CrossConfigService {
return
crossDirInfoPO
;
}
private
static
List
<
LaneInfoPO
>
getLaneInfoPOListForInsert
(
String
crossId
,
DirListElement
dirListElement
,
Integer
dir
,
List
<
LaneListElement
>
laneListFromClient
)
{
private
List
<
LaneInfoPO
>
getLaneInfoPOListForInsert
(
String
crossId
,
Integer
dir
,
List
<
LaneListElement
>
laneListFromClient
)
{
List
<
LaneInfoPO
>
laneInfoPOListForInsert
=
new
ArrayList
<>();
for
(
LaneListElement
laneListElement
:
laneListFromClient
)
{
LaneInfoPO
laneInfoPO
=
new
LaneInfoPO
();
...
...
@@ -482,7 +482,10 @@ public class CrossConfigServiceImpl implements CrossConfigService {
String
substring
=
name
.
substring
(
name
.
length
()
-
1
);
// 1
String
s
=
1
+
substring
;
int
sort
=
Integer
.
parseInt
(
s
);
laneInfoPO
.
setId
(
crossId
+
"_"
+
dirListElement
.
getDir
()
+
"_"
+
2
+
"_"
+
sort
);
// 信控车道类型都是进口车道
// 上一个路口ID
String
preId
=
laneInfoMapper
.
selectPreId
(
crossId
,
dir
);
// 0 主路;900 进口道渠化序号。信控车道类型都是进口车道
laneInfoPO
.
setId
(
preId
+
crossId
+
0
+
900
+
sort
);
laneInfoPO
.
setCode
(
name
);
laneInfoPO
.
setSort
(
sort
);
laneInfoPO
.
setDir
(
dir
);
...
...
signal-control-service/src/main/resources/mapper/scheme/LaneInfoMapper.xml
View file @
b8f0fc81
...
...
@@ -70,4 +70,9 @@
order by sort
</select>
<select
id=
"selectPreId"
resultType=
"java.lang.String"
>
SELECT start_cross_id FROM t_base_rid_info
WHERE end_cross_id = #{crossId} and in_dir = #{dir}
</select>
</mapper>
signal-optimize-service/src/main/java/net/wanji/opt/service/impl/TrendServiceImpl.java
View file @
b8f0fc81
...
...
@@ -53,8 +53,10 @@ public class TrendServiceImpl implements TrendService {
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
public
TrendServiceImpl
(
GreenwaveInfoMapper
greenwaveInfoMapper
,
CrossInfoMapper
crossInfoMapper
,
CrossDataRealtimeMapper
crossDataRealtimeMapper
,
CrossTurnDataRealtimeMapper
crossTurnDataRealtimeMapper
,
CrossDirDataHistMapper
crossDirDataHistMapper
,
EventAlarmMapper
eventAlarmMapper
)
{
public
TrendServiceImpl
(
GreenwaveInfoMapper
greenwaveInfoMapper
,
CrossInfoMapper
crossInfoMapper
,
CrossDataRealtimeMapper
crossDataRealtimeMapper
,
CrossTurnDataRealtimeMapper
crossTurnDataRealtimeMapper
,
CrossDirDataHistMapper
crossDirDataHistMapper
,
EventAlarmMapper
eventAlarmMapper
)
{
this
.
greenwaveInfoMapper
=
greenwaveInfoMapper
;
this
.
crossInfoMapper
=
crossInfoMapper
;
this
.
crossDataRealtimeMapper
=
crossDataRealtimeMapper
;
...
...
@@ -69,7 +71,7 @@ public class TrendServiceImpl implements TrendService {
String
name
=
greenwaveListDTO
.
getName
();
Integer
type
=
greenwaveListDTO
.
getType
();
List
<
GreenwaveListVO
>
greenwaveListVOList
=
greenwaveInfoMapper
.
listGreenwave
(
status
,
name
,
type
);
// 3
以上
都算拥堵
// 3
、4
都算拥堵
if
(
status
!=
null
&&
status
==
3
)
{
List
<
GreenwaveListVO
>
extraList
=
greenwaveInfoMapper
.
listGreenwave
(
4
,
name
,
type
);
greenwaveListVOList
.
addAll
(
extraList
);
...
...
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