Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
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
赵啸非
smart_gov_platform
Commits
a71518cb
Commit
a71518cb
authored
Jul 28, 2022
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户列表查询以及站点授权bug修改
parent
b4c25cc3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
4 deletions
+18
-4
portal-manager/src/main/java/com/mortals/xhx/module/user/service/impl/UserServiceImpl.java
...mortals/xhx/module/user/service/impl/UserServiceImpl.java
+17
-3
portal-manager/src/main/java/com/mortals/xhx/module/user/web/UserController.java
.../java/com/mortals/xhx/module/user/web/UserController.java
+1
-1
No files found.
portal-manager/src/main/java/com/mortals/xhx/module/user/service/impl/UserServiceImpl.java
View file @
a71518cb
package
com.mortals.xhx.module.user.service.impl
;
package
com.mortals.xhx.module.user.service.impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mortals.framework.ap.SysConstains
;
import
com.mortals.framework.ap.SysConstains
;
import
com.mortals.framework.common.code.UserType
;
import
com.mortals.framework.common.code.UserType
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.exception.AppException
;
...
@@ -9,6 +11,8 @@ import com.mortals.framework.model.Result;
...
@@ -9,6 +11,8 @@ import com.mortals.framework.model.Result;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.util.SecurityUtil
;
import
com.mortals.framework.util.SecurityUtil
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.feign.rsp.ApiResp
;
import
com.mortals.xhx.module.area.model.AreaQuery
;
import
com.mortals.xhx.module.area.model.AreaQuery
;
import
com.mortals.xhx.module.area.service.AreaService
;
import
com.mortals.xhx.module.area.service.AreaService
;
import
com.mortals.xhx.module.menu.service.MenuService
;
import
com.mortals.xhx.module.menu.service.MenuService
;
...
@@ -80,7 +84,12 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
...
@@ -80,7 +84,12 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
}
}
if
(
StringUtils
.
isNotEmpty
(
entity
.
getAreaCodes
())){
if
(
StringUtils
.
isNotEmpty
(
entity
.
getAreaCodes
())){
List
<
String
>
areaCodeList
=
Arrays
.
asList
(
entity
.
getAreaCodes
().
split
(
","
));
List
<
String
>
areaCodeList
=
Arrays
.
asList
(
entity
.
getAreaCodes
().
split
(
","
));
String
siteIds
=
areaService
.
getFlatSitesByAreaCodes
(
new
AreaQuery
().
areaCodeList
(
areaCodeList
),
null
);
String
resp
=
areaService
.
getFlatSitesByAreaCodes
(
new
AreaQuery
().
areaCodeList
(
areaCodeList
),
null
);
JSONObject
apiResp
=
JSON
.
parseObject
(
resp
);
if
(
apiResp
.
getInteger
(
"code"
)
!=
YesNoEnum
.
YES
.
getValue
())
{
throw
new
AppException
(
"获取用户站点列表树数据失败:"
+
apiResp
.
getString
(
"msg"
));
}
String
siteIds
=
apiResp
.
getString
(
"data"
);
entity
.
setSiteIds
(
siteIds
);
entity
.
setSiteIds
(
siteIds
);
}
}
...
@@ -206,10 +215,15 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
...
@@ -206,10 +215,15 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
@Override
@Override
public
void
siteAuth
(
UserEntityExt
entityExt
,
Context
context
)
{
public
void
siteAuth
(
UserEntityExt
entityExt
,
Context
context
)
{
if
(
!
ObjectUtils
.
isEmpty
(
entityExt
.
getUserId
()))
{
if
(
ObjectUtils
.
isEmpty
(
entityExt
.
getUserId
()))
{
throw
new
AppException
(
"用户ID不能为空!"
);
throw
new
AppException
(
"用户ID不能为空!"
);
}
}
String
siteIds
=
areaService
.
getFlatSitesByAreaCodes
(
new
AreaQuery
().
areaCodeList
(
entityExt
.
getAreaCodeList
()),
context
);
String
resp
=
areaService
.
getFlatSitesByAreaCodes
(
new
AreaQuery
().
areaCodeList
(
entityExt
.
getAreaCodeList
()),
context
);
JSONObject
apiResp
=
JSON
.
parseObject
(
resp
);
if
(
apiResp
.
getInteger
(
"code"
)
!=
YesNoEnum
.
YES
.
getValue
())
{
throw
new
AppException
(
"获取用户站点列表树数据失败:"
+
apiResp
.
getString
(
"msg"
));
}
String
siteIds
=
apiResp
.
getString
(
"data"
);
UserEntity
userEntity
=
this
.
get
(
entityExt
.
getUserId
(),
context
);
UserEntity
userEntity
=
this
.
get
(
entityExt
.
getUserId
(),
context
);
userEntity
.
setAreaCodes
(
entityExt
.
getAreaCodeList
().
stream
().
collect
(
Collectors
.
joining
(
","
)));
userEntity
.
setAreaCodes
(
entityExt
.
getAreaCodeList
().
stream
().
collect
(
Collectors
.
joining
(
","
)));
userEntity
.
setSiteIds
(
siteIds
);
userEntity
.
setSiteIds
(
siteIds
);
...
...
portal-manager/src/main/java/com/mortals/xhx/module/user/web/UserController.java
View file @
a71518cb
...
@@ -100,7 +100,7 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
...
@@ -100,7 +100,7 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
@Override
@Override
@UnAuth
@UnAuth
public
Rest
<
Object
>
list
(
UserEntity
query
)
{
public
Rest
<
Object
>
list
(
@RequestBody
UserEntity
query
)
{
Map
<
String
,
Object
>
model
=
new
HashMap
();
Map
<
String
,
Object
>
model
=
new
HashMap
();
Rest
<
Object
>
ret
=
new
Rest
<>();
Rest
<
Object
>
ret
=
new
Rest
<>();
Context
context
=
this
.
getContext
();
Context
context
=
this
.
getContext
();
...
...
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