Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
self-service
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
廖旭伟
self-service
Commits
9884d93c
Commit
9884d93c
authored
Jun 14, 2023
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改站点树接口返回值结构,增加层级
parent
72cc6d70
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
common-lib/src/main/java/com/mortals/xhx/common/pdu/site/SiteTreeSelectVO.java
...ava/com/mortals/xhx/common/pdu/site/SiteTreeSelectVO.java
+2
-0
sst-manager/src/main/java/com/mortals/xhx/module/sst/web/SstBasicController.java
...va/com/mortals/xhx/module/sst/web/SstBasicController.java
+5
-3
No files found.
common-lib/src/main/java/com/mortals/xhx/common/pdu/site/SiteTreeSelectVO.java
View file @
9884d93c
...
...
@@ -50,6 +50,8 @@ public class SiteTreeSelectVO implements Serializable {
* 图标
*/
private
String
icon
;
/** 层级 */
private
Integer
level
;
/**
* 子节点
...
...
sst-manager/src/main/java/com/mortals/xhx/module/sst/web/SstBasicController.java
View file @
9884d93c
...
...
@@ -203,8 +203,9 @@ public class SstBasicController extends BaseCRUDJsonBodyMappingController<SstBas
rootNode
.
setIsLeaf
(
false
);
rootNode
.
setLatitude
(
"30.595081"
);
rootNode
.
setLongitude
(
"104.062983"
);
rootNode
.
setSiteCount
(
getChildrenCount
(
resultList
)-
1
);
rootNode
.
setSiteCount
(
getChildrenCount
(
resultList
,
2
)-
1
);
rootNode
.
setChildren
(
resultList
);
rootNode
.
setLevel
(
1
);
List
<
SiteTreeSelectVO
>
dataList
=
new
ArrayList
<>();
dataList
.
add
(
rootNode
);
model
.
put
(
"data"
,
dataList
);
...
...
@@ -225,14 +226,15 @@ public class SstBasicController extends BaseCRUDJsonBodyMappingController<SstBas
return
ret
;
}
private
static
Integer
getChildrenCount
(
List
<
SiteTreeSelectVO
>
children
){
private
static
Integer
getChildrenCount
(
List
<
SiteTreeSelectVO
>
children
,
int
initLevel
){
if
(
CollectionUtils
.
isEmpty
(
children
))
{
return
1
;
}
else
{
int
size
=
1
;
for
(
SiteTreeSelectVO
vo:
children
){
int
c
=
getChildrenCount
(
vo
.
getChildren
());
int
c
=
getChildrenCount
(
vo
.
getChildren
()
,
initLevel
+
1
);
vo
.
setSiteCount
(
c
);
vo
.
setLevel
(
initLevel
);
size
+=
c
;
}
return
size
;
...
...
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