Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
项目统一框架
amos-boot-biz
Commits
c61c8e08
Commit
c61c8e08
authored
Jun 09, 2023
by
曹盼盼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增行政区域
parent
ec0ab2ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
0 deletions
+40
-0
TzsAppController.java
...amos/boot/module/tzs/biz/controller/TzsAppController.java
+10
-0
TzsAppService.java
.../amos/boot/module/tzs/biz/service/impl/TzsAppService.java
+30
-0
No files found.
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/TzsAppController.java
View file @
c61c8e08
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
...
...
@@ -216,5 +217,14 @@ public class TzsAppController {
return
ResponseHelper
.
buildResponse
(
appService
.
getTable
(
map
));
}
//行政区划树
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"行政区划code"
,
notes
=
"行政区划code"
)
@GetMapping
(
value
=
"/getRegionName"
)
public
ResponseModel
<
JSONArray
>
getRegionName
()
{
return
ResponseHelper
.
buildResponse
(
appService
.
getRegionName
());
}
}
amos-boot-system-tzs/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/TzsAppService.java
View file @
c61c8e08
...
...
@@ -29,6 +29,7 @@ import com.yeejoin.amos.feign.privilege.Privilege;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.IdPasswordAuthModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.SneakyThrows
;
...
...
@@ -169,6 +170,7 @@ public class TzsAppService {
* 产品product
*/
private
static
final
String
product
=
"AMOS_STUDIO_WEB"
;
private
static
final
String
regionRedis
=
"app_region_redis"
;
private
final
int
successsCode
=
200
;
...
...
@@ -529,4 +531,32 @@ public class TzsAppService {
}
return
table
;
}
public
JSONArray
getRegionName
(){
JSONArray
jsonArray
=
new
JSONArray
();
if
(
redisUtils
.
hasKey
(
regionRedis
))
{
jsonArray
=
JSONArray
.
parseArray
(
redisUtils
.
get
(
regionRedis
).
toString
());
}
else
{
Collection
<
RegionModel
>
regionChild
=
new
ArrayList
<>();
RegionModel
regionModel1
=
new
RegionModel
();
regionChild
.
add
(
regionModel1
);
FeignClientResult
<
Collection
<
RegionModel
>>
collectionFeignClientResult
=
Systemctl
.
regionClient
.
queryForTreeParent
(
610000L
);
Collection
<
RegionModel
>
result
=
collectionFeignClientResult
.
getResult
();
for
(
RegionModel
regionModel
:
result
)
{
for
(
RegionModel
child
:
regionModel
.
getChildren
())
{
for
(
RegionModel
childChild
:
child
.
getChildren
())
{
jsonArray
.
add
(
childChild
);
}
child
.
setChildren
(
regionChild
);
jsonArray
.
add
(
child
);
}
regionModel
.
setChildren
(
regionChild
);
jsonArray
.
add
(
regionModel
);
}
redisUtils
.
set
(
regionRedis
,
jsonArray
);
}
return
jsonArray
;
}
}
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