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
abf01b7c
Commit
abf01b7c
authored
Dec 29, 2022
by
hanbing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
方案管理-路口配置-渠化配置列表
parent
8a44ad2f
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
86 additions
and
11 deletions
+86
-11
CrossConfigController.java
...et/wanji/web/controller/scheme/CrossConfigController.java
+15
-0
SaveLaneInfoDTO.java
...vice/src/main/java/net/wanji/web/dto/SaveLaneInfoDTO.java
+1
-1
CrossDirInfoMapper.java
.../java/net/wanji/web/mapper/scheme/CrossDirInfoMapper.java
+2
-0
CrossLaneLightsMapper.java
...va/net/wanji/web/mapper/scheme/CrossLaneLightsMapper.java
+1
-1
LaneInfoMapper.java
...main/java/net/wanji/web/mapper/scheme/LaneInfoMapper.java
+3
-1
CrossConfigService.java
...java/net/wanji/web/service/scheme/CrossConfigService.java
+3
-0
CrossConfigServiceImpl.java
...wanji/web/service/scheme/impl/CrossConfigServiceImpl.java
+42
-3
CrossDirInfoMapper.xml
...-service/src/main/resources/mapper/CrossDirInfoMapper.xml
+8
-1
CrossLaneLightsMapper.xml
...rvice/src/main/resources/mapper/CrossLaneLightsMapper.xml
+3
-3
LaneInfoMapper.xml
...trol-service/src/main/resources/mapper/LaneInfoMapper.xml
+8
-1
No files found.
signal-control-service/src/main/java/net/wanji/web/controller/scheme/CrossConfigController.java
View file @
abf01b7c
...
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiOperation;
...
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiOperation;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponses
;
import
io.swagger.annotations.ApiResponses
;
import
net.wanji.web.common.entity.JsonViewObject
;
import
net.wanji.web.common.entity.JsonViewObject
;
import
net.wanji.web.dto.CrossIdDTO
;
import
net.wanji.web.dto.SaveLaneInfoDTO
;
import
net.wanji.web.dto.SaveLaneInfoDTO
;
import
net.wanji.web.service.scheme.impl.CrossConfigServiceImpl
;
import
net.wanji.web.service.scheme.impl.CrossConfigServiceImpl
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
@@ -41,4 +42,18 @@ public class CrossConfigController {
...
@@ -41,4 +42,18 @@ public class CrossConfigController {
return
jsonViewObject
.
success
();
return
jsonViewObject
.
success
();
}
}
@ApiOperation
(
value
=
"渠化配置列表"
,
notes
=
"渠化配置列表"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/listLaneInfo"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
JsonViewObject
.
class
),
})
public
JsonViewObject
listLaneInfo
(
@RequestBody
CrossIdDTO
crossIdDTO
)
{
SaveLaneInfoDTO
saveLaneInfoDTO
=
crossConfigServiceImpl
.
listLaneInfo
(
crossIdDTO
);
JsonViewObject
jsonViewObject
=
JsonViewObject
.
newInstance
();
return
jsonViewObject
.
success
(
saveLaneInfoDTO
);
}
}
}
signal-control-service/src/main/java/net/wanji/web/dto/SaveLaneInfoDTO.java
View file @
abf01b7c
...
@@ -16,7 +16,7 @@ import java.util.List;
...
@@ -16,7 +16,7 @@ import java.util.List;
@Data
@Data
public
class
SaveLaneInfoDTO
{
public
class
SaveLaneInfoDTO
{
/**
/**
* crossId :
13FNK0C6790
* crossId :
c7e7b1f352dd4acab4a60088eb391cca
* dirList : [{"dir":1,"laneList":[{"direction":1,"name":"01","laneType":1}]}]
* dirList : [{"dir":1,"laneList":[{"direction":1,"name":"01","laneType":1}]}]
*/
*/
@ApiModelProperty
(
value
=
"路口ID,如:c7e7b1f352dd4acab4a60088eb391cca"
,
required
=
true
)
@ApiModelProperty
(
value
=
"路口ID,如:c7e7b1f352dd4acab4a60088eb391cca"
,
required
=
true
)
...
...
signal-control-service/src/main/java/net/wanji/web/mapper/scheme/CrossDirInfoMapper.java
View file @
abf01b7c
...
@@ -15,4 +15,6 @@ public interface CrossDirInfoMapper {
...
@@ -15,4 +15,6 @@ public interface CrossDirInfoMapper {
void
insertOne
(
CrossDirInfoPO
crossDirInfoPO
);
void
insertOne
(
CrossDirInfoPO
crossDirInfoPO
);
void
updateIsPedestrian
(
@Param
(
"isPersonCross"
)
Integer
isPersonCross
,
@Param
(
"id"
)
String
id
);
void
updateIsPedestrian
(
@Param
(
"isPersonCross"
)
Integer
isPersonCross
,
@Param
(
"id"
)
String
id
);
CrossDirInfoPO
selectByCrossIdAndDirType
(
@Param
(
"crossId"
)
String
crossId
,
@Param
(
"dirType"
)
Integer
dirType
);
}
}
signal-control-service/src/main/java/net/wanji/web/mapper/scheme/CrossLaneLightsMapper.java
View file @
abf01b7c
...
@@ -11,5 +11,5 @@ import java.util.List;
...
@@ -11,5 +11,5 @@ import java.util.List;
*/
*/
@Repository
@Repository
public
interface
CrossLaneLightsMapper
{
public
interface
CrossLaneLightsMapper
{
void
deleteByLaneIds
(
@Param
(
"
ids"
)
List
<
String
>
i
ds
);
void
deleteByLaneIds
(
@Param
(
"
laneIds"
)
List
<
String
>
laneI
ds
);
}
}
signal-control-service/src/main/java/net/wanji/web/mapper/scheme/LaneInfoMapper.java
View file @
abf01b7c
package
net
.
wanji
.
web
.
mapper
.
scheme
;
package
net
.
wanji
.
web
.
mapper
.
scheme
;
import
io.lettuce.core.dynamic.annotation.Param
;
import
net.wanji.web.po.scheme.LaneInfoPO
;
import
net.wanji.web.po.scheme.LaneInfoPO
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
import
java.util.List
;
...
@@ -17,4 +17,6 @@ public interface LaneInfoMapper {
...
@@ -17,4 +17,6 @@ public interface LaneInfoMapper {
void
deleteByCrossIdAndDir
(
@Param
(
"crossId"
)
String
crossId
,
@Param
(
"dir"
)
Integer
dir
);
void
deleteByCrossIdAndDir
(
@Param
(
"crossId"
)
String
crossId
,
@Param
(
"dir"
)
Integer
dir
);
void
insertBatch
(
@Param
(
"entities"
)
List
<
LaneInfoPO
>
laneInfoPOListForInsert
);
void
insertBatch
(
@Param
(
"entities"
)
List
<
LaneInfoPO
>
laneInfoPOListForInsert
);
List
<
LaneInfoPO
>
selectBycrossId
(
@Param
(
"crossId"
)
String
crossId
);
}
}
signal-control-service/src/main/java/net/wanji/web/service/scheme/CrossConfigService.java
View file @
abf01b7c
package
net
.
wanji
.
web
.
service
.
scheme
;
package
net
.
wanji
.
web
.
service
.
scheme
;
import
net.wanji.web.dto.CrossIdDTO
;
import
net.wanji.web.dto.SaveLaneInfoDTO
;
import
net.wanji.web.dto.SaveLaneInfoDTO
;
/**
/**
...
@@ -8,4 +9,6 @@ import net.wanji.web.dto.SaveLaneInfoDTO;
...
@@ -8,4 +9,6 @@ import net.wanji.web.dto.SaveLaneInfoDTO;
*/
*/
public
interface
CrossConfigService
{
public
interface
CrossConfigService
{
void
saveLaneInfo
(
SaveLaneInfoDTO
saveLaneInfoDTO
);
void
saveLaneInfo
(
SaveLaneInfoDTO
saveLaneInfoDTO
);
SaveLaneInfoDTO
listLaneInfo
(
CrossIdDTO
crossIdDTO
);
}
}
signal-control-service/src/main/java/net/wanji/web/service/scheme/impl/CrossConfigServiceImpl.java
View file @
abf01b7c
package
net
.
wanji
.
web
.
service
.
scheme
.
impl
;
package
net
.
wanji
.
web
.
service
.
scheme
.
impl
;
import
net.wanji.web.dto.CrossIdDTO
;
import
net.wanji.web.dto.DirListElement
;
import
net.wanji.web.dto.DirListElement
;
import
net.wanji.web.dto.LaneListElement
;
import
net.wanji.web.dto.LaneListElement
;
import
net.wanji.web.dto.SaveLaneInfoDTO
;
import
net.wanji.web.dto.SaveLaneInfoDTO
;
...
@@ -13,6 +14,8 @@ import org.springframework.stereotype.Service;
...
@@ -13,6 +14,8 @@ import org.springframework.stereotype.Service;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
/**
* @author Kent HAN
* @author Kent HAN
...
@@ -51,7 +54,9 @@ public class CrossConfigServiceImpl implements CrossConfigService {
...
@@ -51,7 +54,9 @@ public class CrossConfigServiceImpl implements CrossConfigService {
crossDirInfoMapper
.
deleteInByDirType
(
crossId
,
dir
);
crossDirInfoMapper
.
deleteInByDirType
(
crossId
,
dir
);
// 删除灯组-车道关系表数据
// 删除灯组-车道关系表数据
List
<
String
>
laneIds
=
getLaneIds
(
laneInfoPOList
);
List
<
String
>
laneIds
=
getLaneIds
(
laneInfoPOList
);
if
(
laneIds
.
size
()!=
0
){
crossLaneLightsMapper
.
deleteByLaneIds
(
laneIds
);
crossLaneLightsMapper
.
deleteByLaneIds
(
laneIds
);
}
// 插入进口信息
// 插入进口信息
List
<
LaneInfoPO
>
laneInfoPOListForInsert
=
getLaneInfoPOListForInsert
(
List
<
LaneInfoPO
>
laneInfoPOListForInsert
=
getLaneInfoPOListForInsert
(
crossId
,
dirListElement
,
dir
,
laneListFromClient
);
crossId
,
dirListElement
,
dir
,
laneListFromClient
);
...
@@ -66,6 +71,40 @@ public class CrossConfigServiceImpl implements CrossConfigService {
...
@@ -66,6 +71,40 @@ public class CrossConfigServiceImpl implements CrossConfigService {
}
}
}
}
@Override
public
SaveLaneInfoDTO
listLaneInfo
(
CrossIdDTO
crossIdDTO
)
{
String
crossId
=
crossIdDTO
.
getCrossId
();
SaveLaneInfoDTO
saveLaneInfoDTO
=
new
SaveLaneInfoDTO
();
saveLaneInfoDTO
.
setCrossId
(
crossId
);
saveLaneInfoDTO
.
setDirList
(
new
ArrayList
<>());
List
<
LaneInfoPO
>
laneInfoPOList
=
laneInfoMapper
.
selectBycrossId
(
crossId
);
Map
<
Integer
,
List
<
LaneInfoPO
>>
collect
=
laneInfoPOList
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
LaneInfoPO:
:
getDir
));
for
(
Map
.
Entry
<
Integer
,
List
<
LaneInfoPO
>>
entry
:
collect
.
entrySet
())
{
Integer
key
=
entry
.
getKey
();
DirListElement
dirListElement
=
new
DirListElement
();
dirListElement
.
setDir
(
key
);
// 获取是否有行人道
CrossDirInfoPO
crossDirInfoPO
=
crossDirInfoMapper
.
selectByCrossIdAndDirType
(
crossId
,
key
);
Integer
isPedestrian
=
crossDirInfoPO
.
getIsPedestrian
();
dirListElement
.
setIsPersonCross
(
isPedestrian
);
// 构造内层List
List
<
LaneInfoPO
>
value
=
entry
.
getValue
();
List
<
LaneListElement
>
laneListElementList
=
new
ArrayList
<>();
for
(
LaneInfoPO
laneInfoPO
:
value
)
{
LaneListElement
laneListElement
=
new
LaneListElement
();
laneListElement
.
setDirection
(
laneInfoPO
.
getTurn
());
laneListElement
.
setLaneType
(
laneInfoPO
.
getCategory
());
laneListElement
.
setName
(
laneInfoPO
.
getCode
());
laneListElementList
.
add
(
laneListElement
);
}
dirListElement
.
setLaneList
(
laneListElementList
);
List
<
DirListElement
>
dirList
=
saveLaneInfoDTO
.
getDirList
();
dirList
.
add
(
dirListElement
);
}
return
saveLaneInfoDTO
;
}
private
static
String
getId
(
String
crossId
,
DirListElement
dirListElement
)
{
private
static
String
getId
(
String
crossId
,
DirListElement
dirListElement
)
{
CrossDirInfoPO
crossDirInfoPO
=
new
CrossDirInfoPO
();
CrossDirInfoPO
crossDirInfoPO
=
new
CrossDirInfoPO
();
Integer
dir
=
dirListElement
.
getDir
();
Integer
dir
=
dirListElement
.
getDir
();
...
@@ -76,7 +115,7 @@ public class CrossConfigServiceImpl implements CrossConfigService {
...
@@ -76,7 +115,7 @@ public class CrossConfigServiceImpl implements CrossConfigService {
private
static
CrossDirInfoPO
getCrossDirInfoPO
(
String
crossId
,
DirListElement
dirListElement
)
{
private
static
CrossDirInfoPO
getCrossDirInfoPO
(
String
crossId
,
DirListElement
dirListElement
)
{
CrossDirInfoPO
crossDirInfoPO
=
new
CrossDirInfoPO
();
CrossDirInfoPO
crossDirInfoPO
=
new
CrossDirInfoPO
();
Integer
dir
=
dirListElement
.
getDir
();
Integer
dir
=
dirListElement
.
getDir
();
crossDirInfoPO
.
setId
(
crossId
+
dir
+
1
+
0
);
// todo 暂无主辅路序号,赋值0
crossDirInfoPO
.
setId
(
crossId
+
"_"
+
dir
+
"_"
+
1
+
"_"
+
0
);
// todo 暂无主辅路序号,赋值0
crossDirInfoPO
.
setDirType
(
dir
);
crossDirInfoPO
.
setDirType
(
dir
);
crossDirInfoPO
.
setInOutType
(
1
);
crossDirInfoPO
.
setInOutType
(
1
);
crossDirInfoPO
.
setCrossId
(
crossId
);
crossDirInfoPO
.
setCrossId
(
crossId
);
...
@@ -95,7 +134,7 @@ public class CrossConfigServiceImpl implements CrossConfigService {
...
@@ -95,7 +134,7 @@ public class CrossConfigServiceImpl implements CrossConfigService {
String
substring
=
name
.
substring
(
name
.
length
()
-
1
);
// 1
String
substring
=
name
.
substring
(
name
.
length
()
-
1
);
// 1
String
s
=
1
+
substring
;
String
s
=
1
+
substring
;
int
sort
=
Integer
.
parseInt
(
s
);
int
sort
=
Integer
.
parseInt
(
s
);
laneInfoPO
.
setId
(
crossId
+
dirListElement
.
getDir
()
+
sort
);
laneInfoPO
.
setId
(
crossId
+
"_"
+
dirListElement
.
getDir
()
+
"_"
+
sort
);
laneInfoPO
.
setCode
(
name
);
laneInfoPO
.
setCode
(
name
);
laneInfoPO
.
setSort
(
sort
);
laneInfoPO
.
setSort
(
sort
);
laneInfoPO
.
setDir
(
dir
);
laneInfoPO
.
setDir
(
dir
);
...
...
signal-control-service/src/main/resources/mapper/CrossDirInfoMapper.xml
View file @
abf01b7c
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
<result
property=
"gmtModified"
column=
"gmt_modified"
/>
<result
property=
"gmtModified"
column=
"gmt_modified"
/>
</resultMap>
</resultMap>
<insert
id=
"insertOne"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
<insert
id=
"insertOne"
keyProperty=
"id"
>
insert into t_base_cross_dir_info(id,dir_type,in_out_type,cross_id,length,is_pedestrian)
insert into t_base_cross_dir_info(id,dir_type,in_out_type,cross_id,length,is_pedestrian)
values (#{id},#{dirType},#{inOutType},#{crossId},#{length},#{isPedestrian})
values (#{id},#{dirType},#{inOutType},#{crossId},#{length},#{isPedestrian})
</insert>
</insert>
...
@@ -29,4 +29,11 @@
...
@@ -29,4 +29,11 @@
delete from t_base_cross_dir_info
delete from t_base_cross_dir_info
where cross_id = #{crossId} and in_out_type = 1 and dir_type = #{dir}
where cross_id = #{crossId} and in_out_type = 1 and dir_type = #{dir}
</delete>
</delete>
<select
id=
"selectByCrossIdAndDirType"
resultMap=
"BaseResultMap"
>
select
id,dir_type,in_out_type,cross_id,length,is_pedestrian,gmt_create,gmt_modified
from t_base_cross_dir_info
where cross_id = #{crossId} and dir_type = #{dirType}
</select>
</mapper>
</mapper>
signal-control-service/src/main/resources/mapper/CrossLaneLightsMapper.xml
View file @
abf01b7c
...
@@ -14,9 +14,9 @@
...
@@ -14,9 +14,9 @@
<delete
id=
"deleteByLaneIds"
>
<delete
id=
"deleteByLaneIds"
>
delete from t_base_cross_lane_lights
delete from t_base_cross_lane_lights
where id in
where
lane_
id in
<foreach
collection=
"
ids"
item=
"i
d"
separator=
","
open=
"("
close=
")"
>
<foreach
collection=
"
laneIds"
item=
"laneI
d"
separator=
","
open=
"("
close=
")"
>
#{
i
d}
#{
laneI
d}
</foreach>
</foreach>
</delete>
</delete>
...
...
signal-control-service/src/main/resources/mapper/LaneInfoMapper.xml
View file @
abf01b7c
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
<result
property=
"gmtModified"
column=
"gmt_modified"
/>
<result
property=
"gmtModified"
column=
"gmt_modified"
/>
</resultMap>
</resultMap>
<insert
id=
"insertBatch"
keyProperty=
"id"
useGeneratedKeys=
"true"
>
<insert
id=
"insertBatch"
>
insert into t_base_lane_info(id,code,sort,dir,turn,category,cross_id)
insert into t_base_lane_info(id,code,sort,dir,turn,category,cross_id)
values
values
<foreach
collection=
"entities"
item=
"entity"
separator=
","
>
<foreach
collection=
"entities"
item=
"entity"
separator=
","
>
...
@@ -38,4 +38,11 @@
...
@@ -38,4 +38,11 @@
where cross_id = #{crossId} and dir = #{dir}
where cross_id = #{crossId} and dir = #{dir}
</select>
</select>
<select
id=
"selectBycrossId"
resultMap=
"BaseResultMap"
>
select
id,code,sort,dir,turn,category,cross_id,rid,length,width,gmt_create,gmt_modified
from t_base_lane_info
where cross_id = #{crossId}
</select>
</mapper>
</mapper>
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