Commit c9a2f535 by huangjinxin

1:返回code优化

2:用户列表添加组织过滤
1 parent 3843d5ce
......@@ -95,6 +95,12 @@ public class UserInfoSearch extends PageRequest implements Serializable {
* 是否禁用 0: 否 1:是 默认0
*/
private Integer ban;
/**
* 组织id
*/
private String orgId;
/**
* 创建人
*/
......
......@@ -142,7 +142,7 @@ public interface IUser {
* @return
*/
@RequestMapping(value = "/pea-user/list", method = RequestMethod.GET)
WebResult<PageResult<UserInfoSearch>> list(UserInfoSearch search);
Result<PageResult<UserInfoSearch>> list(UserInfoSearch search);
/**
......
......@@ -2,6 +2,7 @@ package com.dituhui.pea.order.controller;
import javax.servlet.http.HttpServletRequest;
import com.dituhui.pea.pojo.UserInfoSearch;
import com.dituhui.pea.pojo.UserLoginParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -52,4 +53,10 @@ public class UserController {
return Result.success(result.getResult());
}
@GetMapping("/user/list")
public Result<?> list(UserInfoSearch search) {
return user.list(search);
}
}
......@@ -139,9 +139,9 @@ public class UserController implements IUser {
* @return
*/
@Override
public WebResult<PageResult<UserInfoSearch>> list(UserInfoSearch search) {
public Result<PageResult<UserInfoSearch>> list(UserInfoSearch search) {
PageResult<UserInfoSearch> result = userService.list(search);
return WebResult.ok(result);
return Result.success(result);
}
......
......@@ -672,13 +672,16 @@ public class UserService {
String count = "select count(*) ";
String select = "SELECT su.*,sr.name roleName ";
String limit = " ORDER BY su.CREATED_TIME DESC limit " + (search.getPage() - 1) * search.getSize() + "," + search.getSize();
StringBuffer querySql = new StringBuffer("from sys_user su left join sys_user_role sur on su.id =sur.user_id left JOIN sys_role sr on sr.id =sur.role_id where 1=1 ");
StringBuffer querySql = new StringBuffer("from sys_user su left join sys_user_role sur on su.id =sur.user_id left JOIN sys_role sr on sr.id =sur.role_id left join sys_user_org suo on su.id=suo.user_id where 1=1 ");
if (StringUtils.isNotBlank(search.getRoleId())) {
querySql.append("and sr.id ='" + search.getRoleId() + "'");
}
if (null != search.getSource()) {
querySql.append("and su.source =" + search.getSource() + " ");
}
if (null != search.getOrgId()) {
querySql.append("and suo.org_id =" + search.getOrgId() + " ");
}
if (null != search.getQueryString()) {
querySql.append("and (su.engineer_code LIKE '%" + search.getQueryString() + "%' or su.nickname like '%" + search.getQueryString() + "%' or su.phone like '%" + search.getQueryString() + "%' or su.email like '%" + search.getQueryString() + "%' )");
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!