Commit 9759fb71 authored by tangfang's avatar tangfang

修改用户二维码生成

parent eb1d5500
......@@ -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 ListUserReqVo reqVo){
public ResponseResult<PageSizeData<WebUserResVo>> listUsers(@RequestBody QueryUserReqVo 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 ListUserReqVo reqVo){
public ResponseResult<PageSizeData<UserVo>> userList(@RequestBody QueryUserReqVo 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){
......
......@@ -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(ListUserReqVo reqVo);
PageSizeData<UserVo> getUserVoList(QueryUserReqVo reqVo);
UserVo getAdmin(UserGetSuperAdminReqVo reqVo);
......
......@@ -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,reqVo,QUERY_USER,reqVo);
public PageSizeData<UserVo> getUserVoList(QueryUserReqVo req) {
return this.queryPage(UserVo.class,req,QUERY_USER,req);
}
@Override
......
......@@ -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(ListUserReqVo reqVo);
PageSizeData<UserVo> getUserVoList(QueryUserReqVo reqVo);
/**
* 获取用户返回信息分页对象
......@@ -116,7 +117,7 @@ public interface UserService {
* @param reqVo
* @return 用户返回信息分页对象
*/
PageSizeData<WebUserResVo> getWebUserResVoList(ListUserReqVo reqVo);
PageSizeData<WebUserResVo> getWebUserResVoList(QueryUserReqVo reqVo);
/**
* 通过userId查询user和role对应关系对象列表
......
......@@ -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;
}
......
......@@ -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(ListUserReqVo reqVo) {
public PageSizeData<UserVo> getUserVoList(QueryUserReqVo 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(ListUserReqVo reqVo) {
public PageSizeData<WebUserResVo> getWebUserResVoList(QueryUserReqVo reqVo) {
PageSizeData<WebUserResVo> webUserResVoPageSizeData = new PageSizeData();
// 找到用户列表
......
......@@ -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;
}
......
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;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment