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
db754279
Commit
db754279
authored
Jun 25, 2023
by
hanbing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update] 路口管理,行政区划编号改为区域ID
parent
374dffcb
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
78 additions
and
40 deletions
+78
-40
AreaTreePO.java
...ol-service/src/main/java/net/wanji/web/po/AreaTreePO.java
+2
-2
CrossInfoService.java
...src/main/java/net/wanji/web/service/CrossInfoService.java
+5
-5
BaseCrossInfoVO.java
...rvice/src/main/java/net/wanji/web/vo/BaseCrossInfoVO.java
+2
-2
AddOrUpdateAreaBO.java
...ice/src/main/java/net/wanji/opt/bo/AddOrUpdateAreaBO.java
+27
-0
CrossController.java
...c/main/java/net/wanji/opt/controller/CrossController.java
+13
-0
CrossInfoDTO.java
...service/src/main/java/net/wanji/opt/dto/CrossInfoDTO.java
+2
-4
BaseCrossInfoPO.java
...s/src/main/java/net/wanji/databus/po/BaseCrossInfoPO.java
+1
-1
TBaseCrossInfo.java
...us/src/main/java/net/wanji/databus/po/TBaseCrossInfo.java
+2
-2
CrossInfoVO.java
...tabus/src/main/java/net/wanji/databus/vo/CrossInfoVO.java
+2
-2
BaseCrossInfoMapper.xml
wj-databus/src/main/resources/mapper/BaseCrossInfoMapper.xml
+19
-19
RidInfoMapper.xml
wj-databus/src/main/resources/mapper/RidInfoMapper.xml
+3
-3
No files found.
signal-control-service/src/main/java/net/wanji/web/po/AreaTreePO.java
View file @
db754279
...
...
@@ -18,8 +18,8 @@ import java.util.List;
@ApiModel
(
value
=
"树形区域目录实体"
,
description
=
"树形区域目录实体"
)
public
class
AreaTreePO
{
@ApiModelProperty
(
value
=
"
行政区划代码
"
)
private
Integer
area
Code
;
@ApiModelProperty
(
value
=
"
区域ID
"
)
private
Integer
area
Id
;
@ApiModelProperty
(
value
=
"行政区划名称"
)
private
String
areaName
;
...
...
signal-control-service/src/main/java/net/wanji/web/service/CrossInfoService.java
View file @
db754279
...
...
@@ -106,18 +106,18 @@ public class CrossInfoService {
IdWorker
idWorker
=
new
IdWorker
(
0
,
0
);
crossInfoPO
.
setId
(
String
.
valueOf
(
idWorker
.
nextId
()));
}
if
(
crossInfoPO
.
getArea
Code
()
==
null
)
{
if
(
crossInfoPO
.
getArea
Id
()
==
null
)
{
QueryWrapper
<
TBaseAreaInfo
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
lambda
().
like
(
TBaseAreaInfo:
:
getName
,
crossInfoPO
.
getAreaName
());
// 查询area
Code
// 查询area
Id
List
<
TBaseAreaInfo
>
tBaseAreaInfos
=
areaInfoMapper
.
selectList
(
queryWrapper
);
if
(
tBaseAreaInfos
!=
null
&&
tBaseAreaInfos
.
size
()
>
0
)
{
crossInfoPO
.
setArea
Code
(
tBaseAreaInfos
.
get
(
0
).
getCode
());
crossInfoPO
.
setArea
Id
(
tBaseAreaInfos
.
get
(
0
).
getId
());
}
}
if
(
crossInfoPO
.
getAreaName
()
==
null
)
{
QueryWrapper
<
TBaseAreaInfo
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
lambda
().
eq
(
TBaseAreaInfo:
:
getCode
,
crossInfoPO
.
getArea
Code
());
queryWrapper
.
lambda
().
eq
(
TBaseAreaInfo:
:
getCode
,
crossInfoPO
.
getArea
Id
());
List
<
TBaseAreaInfo
>
tBaseAreaInfos
=
areaInfoMapper
.
selectList
(
queryWrapper
);
if
(
tBaseAreaInfos
!=
null
&&
tBaseAreaInfos
.
size
()
>
0
)
{
crossInfoPO
.
setAreaName
(
tBaseAreaInfos
.
get
(
0
).
getName
());
...
...
@@ -168,7 +168,7 @@ public class CrossInfoService {
Map
<
Integer
,
List
<
AreaTreePO
>>
parentCodeMap
=
infos
.
stream
().
collect
(
Collectors
.
groupingBy
(
AreaTreePO:
:
getParentCode
));
for
(
AreaTreePO
info
:
infos
)
{
for
(
Integer
parentCode
:
parentCodeMap
.
keySet
())
{
if
(
info
.
getArea
Code
().
equals
(
parentCode
))
{
if
(
info
.
getArea
Id
().
equals
(
parentCode
))
{
info
.
setChildren
(
parentCodeMap
.
get
(
parentCode
));
break
;
}
...
...
signal-control-service/src/main/java/net/wanji/web/vo/BaseCrossInfoVO.java
View file @
db754279
...
...
@@ -49,9 +49,9 @@ public class BaseCrossInfoVO {
/**
* 行政区划代码
*/
@ApiModelProperty
(
value
=
"
行政区划代码
"
)
@ApiModelProperty
(
value
=
"
区域ID
"
)
//@NotNull(message = "行政区划代码不可为空", groups = {Save.class, Update.class})
private
Integer
area
Code
;
private
Integer
area
Id
;
/**
* 行政区划名称
...
...
signal-optimize-service/src/main/java/net/wanji/opt/bo/AddOrUpdateAreaBO.java
0 → 100644
View file @
db754279
package
net
.
wanji
.
opt
.
bo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.Pattern
;
import
java.util.List
;
/**
* @author Kent HAN
* @date 2023/6/9 13:52
*/
@Data
@ApiModel
(
value
=
"AddOrUpdateAreaBO"
,
description
=
"新增/修改子区"
)
public
class
AddOrUpdateAreaBO
{
@ApiModelProperty
(
value
=
"子区ID"
)
private
Integer
areaId
;
@ApiModelProperty
(
value
=
"子区名称"
)
@Pattern
(
regexp
=
"^[\\u4E00-\\u9FA5\\w\\-]{0,20}$"
,
message
=
"子区名称只能包含中文、英文、数字、下划线和中横线,0~20个字符"
)
private
String
areaName
;
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
@ApiModelProperty
(
value
=
"路口ID数组"
)
private
List
<
String
>
crossIdList
;
}
signal-optimize-service/src/main/java/net/wanji/opt/controller/CrossController.java
View file @
db754279
...
...
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiOperation;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponses
;
import
net.wanji.common.framework.rest.JsonViewObject
;
import
net.wanji.opt.bo.AddOrUpdateAreaBO
;
import
net.wanji.opt.bo.PolygonBO
;
import
net.wanji.opt.service.impl.CrossManageServiceImpl
;
import
net.wanji.opt.vo.CrossIdAndNameVO
;
...
...
@@ -44,4 +45,16 @@ public class CrossController {
return
JsonViewObject
.
newInstance
().
success
(
res
);
}
@ApiOperation
(
value
=
"新增/修改子区"
,
notes
=
"新增/修改子区,传ID为修改,不传ID为新增"
,
response
=
JsonViewObject
.
class
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@PostMapping
(
value
=
"/addOrUpdateArea"
,
produces
=
MediaType
.
APPLICATION_JSON
,
consumes
=
MediaType
.
APPLICATION_JSON
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
JsonViewObject
.
class
),
})
public
JsonViewObject
addOrUpdateArea
(
@RequestBody
AddOrUpdateAreaBO
addOrUpdateAreaBO
)
{
// crossManageService.addOrUpdateArea(addOrUpdateAreaBO);
return
JsonViewObject
.
newInstance
().
success
();
}
}
\ No newline at end of file
signal-optimize-service/src/main/java/net/wanji/opt/dto/CrossInfoDTO.java
View file @
db754279
...
...
@@ -4,8 +4,6 @@ import io.swagger.annotations.ApiModel;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author hfx
* @date 2023/1/12 09:11
...
...
@@ -27,8 +25,8 @@ public class CrossInfoDTO {
@ApiModelProperty
(
name
=
"路口级别"
,
notes
=
""
)
private
Integer
level
;
@ApiModelProperty
(
name
=
"
行政区划代码
"
,
notes
=
""
)
private
Integer
area
Code
;
@ApiModelProperty
(
name
=
"
区域Id
"
,
notes
=
""
)
private
Integer
area
Id
;
@ApiModelProperty
(
name
=
"路口位置"
,
notes
=
""
)
private
String
location
;
...
...
wj-databus/src/main/java/net/wanji/databus/po/BaseCrossInfoPO.java
View file @
db754279
...
...
@@ -38,7 +38,7 @@ public class BaseCrossInfoPO {
/**
* 行政区划代码
*/
private
Integer
area
Code
;
private
Integer
area
Id
;
/**
* 行政区划名称
...
...
wj-databus/src/main/java/net/wanji/databus/po/TBaseCrossInfo.java
View file @
db754279
...
...
@@ -53,8 +53,8 @@ public class TBaseCrossInfo implements Serializable {
/**
* 行政区划代码
*/
@TableField
(
"area_
code
"
)
private
Integer
area
Code
;
@TableField
(
"area_
id
"
)
private
Integer
area
Id
;
/**
* 路口位置
...
...
wj-databus/src/main/java/net/wanji/databus/vo/CrossInfoVO.java
View file @
db754279
...
...
@@ -21,8 +21,8 @@ public class CrossInfoVO {
/**
* 行政区划代码
*/
@ApiModelProperty
(
value
=
"
行政区划代码
"
,
required
=
true
)
private
Integer
area
Code
;
@ApiModelProperty
(
value
=
"
区域ID
"
,
required
=
true
)
private
Integer
area
Id
;
/**
* 行政区划名称
...
...
wj-databus/src/main/resources/mapper/BaseCrossInfoMapper.xml
View file @
db754279
...
...
@@ -6,7 +6,7 @@
<result
column=
"name"
property=
"name"
jdbcType=
"VARCHAR"
/>
<result
column=
"type"
property=
"type"
jdbcType=
"TINYINT"
/>
<result
column=
"level"
property=
"level"
jdbcType=
"TINYINT"
/>
<result
column=
"area_
code"
property=
"areaCode
"
jdbcType=
"INTEGER"
/>
<result
column=
"area_
id"
property=
"areaId
"
jdbcType=
"INTEGER"
/>
<result
column=
"location"
property=
"location"
jdbcType=
"VARCHAR"
/>
<result
column=
"is_signal"
property=
"isSignal"
jdbcType=
"TINYINT"
/>
<result
column=
"is_start"
property=
"isStart"
jdbcType=
"TINYINT"
/>
...
...
@@ -19,7 +19,7 @@
<result
column=
"name"
property=
"name"
jdbcType=
"VARCHAR"
/>
<result
column=
"type"
property=
"type"
jdbcType=
"TINYINT"
/>
<result
column=
"level"
property=
"level"
jdbcType=
"TINYINT"
/>
<result
column=
"area_
code"
property=
"areaCode
"
jdbcType=
"INTEGER"
/>
<result
column=
"area_
id"
property=
"areaId
"
jdbcType=
"INTEGER"
/>
<result
column=
"area_name"
property=
"areaName"
jdbcType=
"VARCHAR"
/>
<result
column=
"location"
property=
"location"
jdbcType=
"VARCHAR"
/>
<result
column=
"is_signal"
property=
"isSignal"
jdbcType=
"TINYINT"
/>
...
...
@@ -30,7 +30,7 @@
</resultMap>
<sql
id=
"baseColumn"
>
id, name, type, level, area_
code
, location, is_signal, is_start, is_send, gmt_create, gmt_modified
id, name, type, level, area_
id
, location, is_signal, is_start, is_send, gmt_create, gmt_modified
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
...
...
@@ -46,11 +46,11 @@
</delete>
<insert
id=
"insert"
parameterType=
"net.wanji.databus.po.TBaseCrossInfo"
>
insert into t_base_cross_info (id, name, type,
level, area_
code
, location,
level, area_
id
, location,
is_signal, is_start, is_send,
gmt_create, gmt_modified)
values (#{id,jdbcType=CHAR}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT},
#{level,jdbcType=TINYINT}, #{area
Code
,jdbcType=INTEGER}, #{location,jdbcType=VARCHAR},
#{level,jdbcType=TINYINT}, #{area
Id
,jdbcType=INTEGER}, #{location,jdbcType=VARCHAR},
#{isSignal,jdbcType=TINYINT}, #{isStart,jdbcType=TINYINT}, #{isSend,jdbcType=TINYINT},
#{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP})
</insert>
...
...
@@ -69,8 +69,8 @@
<if
test=
"level != null"
>
level,
</if>
<if
test=
"area
Code
!= null"
>
area_
code
,
<if
test=
"area
Id
!= null"
>
area_
id
,
</if>
<if
test=
"location != null"
>
location,
...
...
@@ -104,8 +104,8 @@
<if
test=
"level != null"
>
#{level,jdbcType=TINYINT},
</if>
<if
test=
"area
Code
!= null"
>
#{area
Code
,jdbcType=INTEGER},
<if
test=
"area
Id
!= null"
>
#{area
Id
,jdbcType=INTEGER},
</if>
<if
test=
"location != null"
>
#{location,jdbcType=VARCHAR},
...
...
@@ -139,8 +139,8 @@
<if
test=
"level != null"
>
level = #{level,jdbcType=TINYINT},
</if>
<if
test=
"area
Code
!= null"
>
area_
code = #{areaCode
,jdbcType=INTEGER},
<if
test=
"area
Id
!= null"
>
area_
id = #{areaId
,jdbcType=INTEGER},
</if>
<if
test=
"location != null"
>
location = #{location,jdbcType=VARCHAR},
...
...
@@ -168,7 +168,7 @@
set name = #{name,jdbcType=VARCHAR},
type = #{type,jdbcType=TINYINT},
level = #{level,jdbcType=TINYINT},
area_
code = #{areaCode
,jdbcType=INTEGER},
area_
id = #{areaId
,jdbcType=INTEGER},
location = #{location,jdbcType=VARCHAR},
is_signal = #{isSignal,jdbcType=TINYINT},
is_start = #{isStart,jdbcType=TINYINT},
...
...
@@ -179,16 +179,16 @@
</update>
<select
id=
"selectAll"
parameterType=
"net.wanji.databus.vo.CrossInfoPageVO"
resultMap=
"SelectAllMap"
>
<bind
name=
"startNum"
value=
"(pageNum - 1) * pageSize"
/>
select c.id,c.name,c.type,c.level,c.area_
code
,a.name
select c.id,c.name,c.type,c.level,c.area_
id
,a.name
area_name,c.location,c.is_signal,c.is_start,c.is_send,c.gmt_create,c.gmt_modified
from t_base_cross_info c
left join t_base_area_info a on c.area_
code
=a.code
left join t_base_area_info a on c.area_
id
=a.code
<where>
<if
test=
"name != null and name != ''"
>
and c.name like concat('%',#{name},'%')
</if>
<if
test=
"area
Code != null and areaCode
!= ''"
>
and a.
code = #{areaCode
}
<if
test=
"area
Id != null and areaId
!= ''"
>
and a.
id = #{areaId
}
</if>
<if
test=
"areaName != null and areaName != ''"
>
and a.name = #{areaName}
...
...
@@ -210,13 +210,13 @@
<select
id=
"countSelectAll"
parameterType=
"net.wanji.databus.vo.CrossInfoPageVO"
resultType=
"integer"
>
select count(1)
from t_base_cross_info c
left join t_base_area_info a on c.area_
code=a.code
left join t_base_area_info a on c.area_
id=a.id
<where>
<if
test=
"name != null and name != ''"
>
and c.name like concat('%',#{name},'%')
</if>
<if
test=
"area
Code != null and areaCode
!= ''"
>
and a.
code = #{areaCode
}
<if
test=
"area
Id != null and areaId
!= ''"
>
and a.
id = #{areaId
}
</if>
<if
test=
"areaName != null and areaName != ''"
>
and a.name = #{areaName}
...
...
wj-databus/src/main/resources/mapper/RidInfoMapper.xml
View file @
db754279
...
...
@@ -19,7 +19,7 @@
<result
property=
"sort"
column=
"sort"
/>
<result
property=
"trend"
column=
"trend"
/>
<result
property=
"level"
column=
"level"
/>
<result
property=
"areaCode"
column=
"area_
code
"
/>
<result
property=
"areaCode"
column=
"area_
id
"
/>
<result
property=
"length"
column=
"length"
/>
<result
property=
"width"
column=
"width"
/>
<result
property=
"isOneway"
column=
"is_oneway"
/>
...
...
@@ -34,7 +34,7 @@
<sql
id=
"Base_Column_List"
>
id,name,road_id,road_name,road_dir_id,start_cross_id,end_cross_id,out_dir,in_dir,start_angle,end_angle,
direction,sort,trend,level,area_
code
,length,width,is_oneway,type,wkt,sc_id,sc_name,sc_sort,gmt_create,gmt_modified
direction,sort,trend,level,area_
id
,length,width,is_oneway,type,wkt,sc_id,sc_name,sc_sort,gmt_create,gmt_modified
</sql>
<select
id=
"selectRoadLength"
resultType=
"java.lang.Double"
>
...
...
@@ -71,7 +71,7 @@
<select
id=
"selectByEndInDir"
resultType=
"net.wanji.databus.dao.entity.RidInfoEntity"
>
SELECT t1.id,t1.name,t1.road_id,t1.road_name,t1.road_dir_id,t1.start_cross_id,t1.end_cross_id,t1.out_dir,
t1.in_dir,t1.start_angle,t1.end_angle,t1.direction,t1.sort,t1.trend,t1.level,t1.area_
code
,t1.length,
t1.in_dir,t1.start_angle,t1.end_angle,t1.direction,t1.sort,t1.trend,t1.level,t1.area_
id
,t1.length,
t1.width,t1.is_oneway,t1.type,t1.wkt,t1.sc_id,t1.sc_name,t1.sc_sort,t1.gmt_create,t1.gmt_modified
FROM t_base_rid_info t1 JOIN t_base_cross_info t2 ON t1.start_cross_id = t2.id
WHERE t1.end_cross_id = #{endCrossId} and t1.in_dir = #{spilloverDirInt} and t2.is_signal = 1
...
...
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