Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
T
tcm-system
Project
Project
Details
Activity
Releases
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
TCM
tcm-system
Commits
9759fb71
Commit
9759fb71
authored
Jan 13, 2023
by
tangfang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改用户二维码生成
parent
eb1d5500
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
29 additions
and
87 deletions
+29
-87
UserController.java
...com/pangding/web/authority/controller/UserController.java
+4
-2
UserDao.java
src/main/java/com/pangding/web/authority/dao/UserDao.java
+2
-1
UserDaoImpl.java
...java/com/pangding/web/authority/dao/impl/UserDaoImpl.java
+5
-3
UserService.java
.../java/com/pangding/web/authority/service/UserService.java
+3
-2
AuthorityServiceImpl.java
...ding/web/authority/service/impl/AuthorityServiceImpl.java
+2
-60
UserServiceImpl.java
.../pangding/web/authority/service/impl/UserServiceImpl.java
+3
-2
ListUserReqVo.java
...va/com/pangding/web/authority/vo/reqvo/ListUserReqVo.java
+10
-0
QueryUserReqVo.java
...a/com/pangding/web/authority/vo/reqvo/QueryUserReqVo.java
+0
-17
No files found.
src/main/java/com/pangding/web/authority/controller/UserController.java
View file @
9759fb71
...
...
@@ -9,6 +9,7 @@ import com.pangding.web.util.RSAUtils;
import
com.pangding.web.vo.system.pd.authority.UserVo
;
import
com.pangding.web.vo.system.req.authority.SaveUserReqVo
;
import
com.pangding.web.vo.system.req.authority.UserReqVo
;
import
com.pangding.web.vo.system.req.authority.V2.QueryUserReqVo
;
import
com.yanzuoguang.util.exception.CodeException
;
import
com.yanzuoguang.util.helper.CheckerHelper
;
import
com.yanzuoguang.util.helper.StringHelper
;
...
...
@@ -94,7 +95,7 @@ public class UserController {
* @return
*/
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseResult
<
PageSizeData
<
WebUserResVo
>>
listUsers
(
@RequestBody
List
UserReqVo
reqVo
){
public
ResponseResult
<
PageSizeData
<
WebUserResVo
>>
listUsers
(
@RequestBody
Query
UserReqVo
reqVo
){
return
ResponseResult
.
result
(
userServiceImpl
.
getWebUserResVoList
(
reqVo
));
}
...
...
@@ -104,10 +105,11 @@ public class UserController {
*/
@RequestMapping
(
value
=
"/userList"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@ApiOperation
(
value
=
"查询用户列表"
,
notes
=
"返回用户列表信息."
)
public
ResponseResult
<
PageSizeData
<
UserVo
>>
userList
(
@RequestBody
List
UserReqVo
reqVo
){
public
ResponseResult
<
PageSizeData
<
UserVo
>>
userList
(
@RequestBody
Query
UserReqVo
reqVo
){
return
ResponseResult
.
result
(
userServiceImpl
.
getUserVoList
(
reqVo
));
}
@RequestMapping
(
value
=
"/updateUserInfo"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@ApiOperation
(
value
=
"只修改用户信息"
,
notes
=
"返回修改结果."
)
public
ResponseResult
updateUserInfo
(
@RequestBody
UserReqVo
req
){
...
...
src/main/java/com/pangding/web/authority/dao/UserDao.java
View file @
9759fb71
...
...
@@ -6,6 +6,7 @@ import com.pangding.web.authority.vo.reqvo.UserGetReqVo;
import
com.pangding.web.authority.vo.reqvo.UserGetSuperAdminReqVo
;
import
com.pangding.web.vo.system.pd.authority.UserVo
;
import
com.pangding.web.vo.system.req.authority.UserReqVo
;
import
com.pangding.web.vo.system.req.authority.V2.QueryUserReqVo
;
import
com.pangding.web.vo.system.res.authority.UserResVo
;
import
com.yanzuoguang.dao.BaseDao
;
import
com.yanzuoguang.util.vo.PageSizeData
;
...
...
@@ -37,7 +38,7 @@ public interface UserDao extends BaseDao {
* @param reqVo
* @return 用户分页对象
*/
PageSizeData
<
UserVo
>
getUserVoList
(
List
UserReqVo
reqVo
);
PageSizeData
<
UserVo
>
getUserVoList
(
Query
UserReqVo
reqVo
);
UserVo
getAdmin
(
UserGetSuperAdminReqVo
reqVo
);
...
...
src/main/java/com/pangding/web/authority/dao/impl/UserDaoImpl.java
View file @
9759fb71
...
...
@@ -6,6 +6,7 @@ import com.pangding.web.authority.vo.reqvo.ListUserReqVo;
import
com.pangding.web.authority.vo.reqvo.UserGetSuperAdminReqVo
;
import
com.pangding.web.vo.system.pd.authority.UserVo
;
import
com.pangding.web.vo.system.req.authority.UserReqVo
;
import
com.pangding.web.vo.system.req.authority.V2.QueryUserReqVo
;
import
com.pangding.web.vo.system.res.authority.UserResVo
;
import
com.yanzuoguang.dao.impl.BaseDaoImpl
;
import
com.yanzuoguang.util.vo.PageSizeData
;
...
...
@@ -31,7 +32,8 @@ public class UserDaoImpl extends BaseDaoImpl implements UserDao {
.
add
(
"companyId"
,
"and company_id = ? "
)
.
add
(
"account"
,
"and account = ? "
)
.
add
(
"phone"
,
"and phone = ? "
)
.
add
(
"loginAccount"
,
"and (account = ? or phone = ?) "
);
.
add
(
"loginAccount"
,
"and (account = ? or phone = ?) "
)
.
add
(
"roleId"
,
" id in (select user_id from pd_user_role where role_id = ? )"
);
table
.
addExist
(
CHECK_ACCOUNT
,
"account"
);
...
...
@@ -63,8 +65,8 @@ public class UserDaoImpl extends BaseDaoImpl implements UserDao {
}
@Override
public
PageSizeData
<
UserVo
>
getUserVoList
(
ListUserReqVo
reqVo
)
{
return
this
.
queryPage
(
UserVo
.
class
,
req
Vo
,
QUERY_USER
,
reqVo
);
public
PageSizeData
<
UserVo
>
getUserVoList
(
QueryUserReqVo
req
)
{
return
this
.
queryPage
(
UserVo
.
class
,
req
,
QUERY_USER
,
req
);
}
@Override
...
...
src/main/java/com/pangding/web/authority/service/UserService.java
View file @
9759fb71
...
...
@@ -9,6 +9,7 @@ import com.pangding.web.vo.system.pd.authority.UserVo;
import
com.pangding.web.vo.system.req.LoginReqVo
;
import
com.pangding.web.vo.system.req.authority.SaveUserReqVo
;
import
com.pangding.web.vo.system.req.authority.UserReqVo
;
import
com.pangding.web.vo.system.req.authority.V2.QueryUserReqVo
;
import
com.pangding.web.vo.system.res.LoginResVo
;
import
com.pangding.web.vo.system.res.authority.UserResVo
;
import
com.yanzuoguang.util.vo.PageSizeData
;
...
...
@@ -108,7 +109,7 @@ public interface UserService {
* @param reqVo
* @return 用户分页对象
*/
PageSizeData
<
UserVo
>
getUserVoList
(
List
UserReqVo
reqVo
);
PageSizeData
<
UserVo
>
getUserVoList
(
Query
UserReqVo
reqVo
);
/**
* 获取用户返回信息分页对象
...
...
@@ -116,7 +117,7 @@ public interface UserService {
* @param reqVo
* @return 用户返回信息分页对象
*/
PageSizeData
<
WebUserResVo
>
getWebUserResVoList
(
List
UserReqVo
reqVo
);
PageSizeData
<
WebUserResVo
>
getWebUserResVoList
(
Query
UserReqVo
reqVo
);
/**
* 通过userId查询user和role对应关系对象列表
...
...
src/main/java/com/pangding/web/authority/service/impl/AuthorityServiceImpl.java
View file @
9759fb71
...
...
@@ -302,76 +302,18 @@ public class AuthorityServiceImpl implements AuthorityService {
throw
new
CodeException
(
"该公司用户未设置管理员角色"
);
}
// 查询该公司管理员角色权限
RoleAuthorityGetReqVo
roleAuthorityGetReqVo
=
new
RoleAuthorityGetReqVo
();
roleAuthorityGetReqVo
.
setRole
(
roleVo
.
getId
());
List
<
AuthorityListByLevelResVo
>
roleAuthorityVoList
=
roleAuthorityDao
.
loadList
(
roleAuthorityGetReqVo
,
AuthorityListByLevelResVo
.
class
);
authorityListResVo
.
setAuthorityListByLevel
(
getChildList
(
roleAuthorityVoList
,
false
));
// 查询该角色的权限
RoleAuthorityGetReqVo
roleAuthorityGetReqVo1
=
new
RoleAuthorityGetReqVo
();
roleAuthorityGetReqVo1
.
setRole
(
reqVo
.
getRoleId
());
List
<
AuthorityVo
>
roleAuthorityVoList1
=
roleAuthorityDao
.
loadList
(
roleAuthorityGetReqVo1
,
AuthorityVo
.
class
);
authorityListResVo
.
setAuthorityListByRole
(
roleAuthorityVoList1
);
// for (RoleAuthorityVo roleAuthorityVo:roleAuthorityVoList) {
// authorityIdSet.add(roleAuthorityVo.getAuthorityId());
// }
// List<String> authorityIdList = new ArrayList<>();
// Object[] objs = authorityIdSet.toArray();
// for (Object obj:objs) {
// authorityIdList.add((String) obj);
// }
// List<AuthorityVo> levelOneList = new ArrayList();
// for (int i = 0; i < authorityIdList.size(); i++) {
// AuthorityGetReqVo authorityGetReqVo = new AuthorityGetReqVo();
// authorityGetReqVo.setId(authorityIdList.get(i));
// AuthorityVo authorityVo = authorityDao.load(authorityGetReqVo,AuthorityVo.class);
// if (!StringHelper.isEmpty(authorityVo) && StringHelper.isEmpty(authorityVo.getPid())){
// levelOneList.add(authorityVo);
// authorityIdList.set(i,"");
// }
// }
// List<String> authorityIds = new ArrayList<>();
// for (int i = 0; i < authorityIdList.size(); i++) {
// if (!"".equals(authorityIdList.get(i))){
// authorityIds.add(authorityIdList.get(i));
// }
// }
// Collections.sort(levelOneList);
// if (levelOneList.isEmpty()){
// throw new CodeException("该用户暂无权限,请添加");
// }
// List<AuthorityListByLevelResVo> authorityListByLevel = new ArrayList<>();
// for (AuthorityVo authorityVo:levelOneList) {
// AuthorityListByLevelResVo resVo1 = new AuthorityListByLevelResVo();
// ObjectHelper.writeWithFrom(resVo1,authorityVo);
// List<AuthorityListByLevelResVo> childList = registerServiceImpl.getChildList(authorityVo,authorityIds);
// resVo1.setChildList(childList);
// authorityListByLevel.add(resVo1);
// }
// Collections.sort(authorityListByLevel);
// AuthorityListResVo authorityListResVo = new AuthorityListResVo();
// authorityListResVo.setAuthorityListByLevel(authorityListByLevel);
// /*若roleId存在,则需要返回该角色拥有的权限列表*/
// if (null != reqVo.getRoleId() && !reqVo.getRoleId().isEmpty()){
// RoleAuthorityGetReqVo roleAuthorityGetReqVo1 = new RoleAuthorityGetReqVo();
// roleAuthorityGetReqVo1.setRoleId(reqVo.getRoleId());
// List<RoleAuthorityVo> roleAuthorityVos = roleAuthorityDao.loadList(roleAuthorityGetReqVo1,RoleAuthorityVo.class);
// List<AuthorityVo> authorityVoList = new ArrayList<>();
// if (null != roleAuthorityVos && !roleAuthorityVos.isEmpty()){
// for (RoleAuthorityVo roleAuthorityVo:roleAuthorityVos) {
// AuthorityGetReqVo getReqVo = new AuthorityGetReqVo();
// getReqVo.setId(roleAuthorityVo.getAuthorityId());
// AuthorityVo authorityVo = authorityDao.load(getReqVo,AuthorityVo.class);
// if (null != authorityVo){
// authorityVoList.add(authorityVo);
// }
// }
// }
// authorityListResVo.setAuthorityListByRole(authorityVoList);
// }
return
authorityListResVo
;
}
...
...
src/main/java/com/pangding/web/authority/service/impl/UserServiceImpl.java
View file @
9759fb71
...
...
@@ -22,6 +22,7 @@ import com.pangding.web.vo.system.req.LoginReqVo;
import
com.pangding.web.vo.system.req.authority.AuthorityReqVo
;
import
com.pangding.web.vo.system.req.authority.SaveUserReqVo
;
import
com.pangding.web.vo.system.req.authority.UserReqVo
;
import
com.pangding.web.vo.system.req.authority.V2.QueryUserReqVo
;
import
com.pangding.web.vo.system.res.LoginResVo
;
import
com.pangding.web.vo.system.res.authority.AuthorityListByLevelResVo
;
import
com.pangding.web.vo.system.res.authority.AuthorityResVo
;
...
...
@@ -546,7 +547,7 @@ public class UserServiceImpl implements UserService {
}
@Override
public
PageSizeData
<
UserVo
>
getUserVoList
(
List
UserReqVo
reqVo
)
{
public
PageSizeData
<
UserVo
>
getUserVoList
(
Query
UserReqVo
reqVo
)
{
PageSizeData
<
UserVo
>
userVoPageSizeData
=
userDao
.
getUserVoList
(
reqVo
);
if
(
userVoPageSizeData
.
getList
()
==
null
||
userVoPageSizeData
.
getList
().
isEmpty
())
{
throw
new
CodeException
(
"没有更多用户"
);
...
...
@@ -555,7 +556,7 @@ public class UserServiceImpl implements UserService {
}
@Override
public
PageSizeData
<
WebUserResVo
>
getWebUserResVoList
(
List
UserReqVo
reqVo
)
{
public
PageSizeData
<
WebUserResVo
>
getWebUserResVoList
(
Query
UserReqVo
reqVo
)
{
PageSizeData
<
WebUserResVo
>
webUserResVoPageSizeData
=
new
PageSizeData
();
// 找到用户列表
...
...
src/main/java/com/pangding/web/authority/vo/reqvo/ListUserReqVo.java
View file @
9759fb71
...
...
@@ -11,6 +11,16 @@ public class ListUserReqVo extends PageSizeReqVo{
private
String
companyId
;
private
String
roleId
;
public
String
getRoleId
()
{
return
roleId
;
}
public
void
setRoleId
(
String
roleId
)
{
this
.
roleId
=
roleId
;
}
public
String
getReqId
()
{
return
reqId
;
}
...
...
src/main/java/com/pangding/web/authority/vo/reqvo/QueryUserReqVo.java
deleted
100644 → 0
View file @
eb1d5500
package
com
.
pangding
.
web
.
authority
.
vo
.
reqvo
;
/**
* @Author zhangjinyao
* @create 2019/6/6 11:07
*/
public
class
QueryUserReqVo
{
private
String
query
;
public
String
getQuery
()
{
return
query
;
}
public
void
setQuery
(
String
query
)
{
this
.
query
=
query
;
}
}
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