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
bcd6e35d
Commit
bcd6e35d
authored
Jan 07, 2023
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获取用户站点列表树
parent
12e6ae27
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
25 deletions
+13
-25
sst-manager/src/main/java/com/mortals/xhx/module/sst/web/SstBasicController.java
...va/com/mortals/xhx/module/sst/web/SstBasicController.java
+13
-25
No files found.
sst-manager/src/main/java/com/mortals/xhx/module/sst/web/SstBasicController.java
View file @
bcd6e35d
...
@@ -11,6 +11,7 @@ import com.mortals.xhx.common.key.ParamKey;
...
@@ -11,6 +11,7 @@ import com.mortals.xhx.common.key.ParamKey;
import
com.mortals.xhx.feign.base.IApiBaseManagerFeign
;
import
com.mortals.xhx.feign.base.IApiBaseManagerFeign
;
import
com.mortals.xhx.feign.base.pdu.SitePdu
;
import
com.mortals.xhx.feign.base.pdu.SitePdu
;
import
com.mortals.xhx.feign.rsp.ApiResp
;
import
com.mortals.xhx.feign.rsp.ApiResp
;
import
com.mortals.xhx.feign.site.ISiteFeign
;
import
com.mortals.xhx.module.sst.model.SstAppsEntity
;
import
com.mortals.xhx.module.sst.model.SstAppsEntity
;
import
com.mortals.xhx.module.sst.service.SstAppsService
;
import
com.mortals.xhx.module.sst.service.SstAppsService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -52,6 +53,9 @@ public class SstBasicController extends BaseCRUDJsonBodyMappingController<SstBas
...
@@ -52,6 +53,9 @@ public class SstBasicController extends BaseCRUDJsonBodyMappingController<SstBas
@Autowired
@Autowired
private
SstAppsService
sstAppsService
;
private
SstAppsService
sstAppsService
;
@Autowired
private
ISiteFeign
iSiteFeign
;
public
SstBasicController
(){
public
SstBasicController
(){
super
.
setModuleDesc
(
"基础配置"
);
super
.
setModuleDesc
(
"基础配置"
);
}
}
...
@@ -120,37 +124,21 @@ public class SstBasicController extends BaseCRUDJsonBodyMappingController<SstBas
...
@@ -120,37 +124,21 @@ public class SstBasicController extends BaseCRUDJsonBodyMappingController<SstBas
return
ret
;
return
ret
;
}
}
@PostMapping
({
"site/list"
})
@PostMapping
({
"site/siteTree"
})
public
Rest
<
Object
>
list
()
{
public
Rest
<
Object
>
list
(
@RequestHeader
(
"Authorization"
)
String
authorization
)
{
IUser
user
=
this
.
getCurUser
();
if
(
user
==
null
)
{
throw
new
AppException
(
"用户未登录"
);
}
Rest
<
Object
>
ret
=
new
Rest
();
Rest
<
Object
>
ret
=
new
Rest
();
Map
<
String
,
Object
>
model
=
new
HashMap
();
Map
<
String
,
Object
>
model
=
new
HashMap
();
String
busiDesc
=
"查询用户站点列表"
;
String
busiDesc
=
"查询用户站点列表"
;
int
code
=
1
;
int
code
=
1
;
try
{
try
{
String
resp
=
iSiteFeign
.
siteTree
(
authorization
);
if
(
StringUtils
.
isNotEmpty
(
user
.
getSiteIds
()))
{
SitePdu
sitePdu
=
new
SitePdu
();
List
<
String
>
siteIds
=
Arrays
.
asList
(
user
.
getSiteIds
().
split
(
","
));
List
<
Long
>
idList
=
new
ArrayList
<>();
siteIds
.
forEach
(
s
->
{
idList
.
add
(
DataUtil
.
converStr2Long
(
s
,
0
));
});
sitePdu
.
setIdList
(
idList
);
String
resp
=
iApiBaseManagerFeign
.
getSitesByQuery
(
sitePdu
);
ApiResp
<
JSONObject
>
apiResp
=
JSON
.
parseObject
(
resp
,
ApiResp
.
class
);
ApiResp
<
JSONObject
>
apiResp
=
JSON
.
parseObject
(
resp
,
ApiResp
.
class
);
if
(
apiResp
.
getCode
()
!=
YesNoEnum
.
YES
.
getValue
())
{
if
(
apiResp
.
getCode
()
!=
YesNoEnum
.
YES
.
getValue
())
{
throw
new
AppException
(
"获取用户站点列表树数据失败:"
+
apiResp
.
getMsg
());
throw
new
AppException
(
"获取用户站点列表树数据失败:"
+
apiResp
.
getMsg
());
}
}
if
(
apiResp
.
getData
().
get
(
"data"
)
!=
null
)
{
if
(
apiResp
.
getData
().
get
(
"siteTree"
)
!=
null
)
{
model
.
put
(
"data"
,
apiResp
.
getData
().
get
(
"data"
));
model
.
put
(
"data"
,
apiResp
.
getData
().
get
(
"siteTree"
));
}
else
{
model
.
put
(
"data"
,
Collections
.
emptyList
());
}
}
else
{
}
else
{
model
.
put
(
"data"
,
Collections
.
emptyList
());
model
.
put
(
"data"
,
Collections
.
emptyList
());
}
}
...
...
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