Commit 857e7476 authored by Fred's avatar Fred

Merge branch 'master' of http://115.233.227.46:8066/root/govdna.git

Conflicts: src/main/java/com/govmade/modules/system/service/impl/UserServiceImpl.java
parents 67b7c94b 786001e8
......@@ -19,7 +19,7 @@ public abstract class AbstractController {
//return (UserEntity) SecurityUtils.getSubject().getPrincipal();
UserEntity ue = new UserEntity();
ue.setDeptId(1L);
return null;
return ue;
}
protected Long getUserId() {
......
......@@ -7,6 +7,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.govmade.common.utils.Constant;
import com.govmade.common.utils.PageUtils;
......@@ -52,7 +53,7 @@ public class UserController extends AbstractController {
* 用户列表
*/
@GetMapping("/list")
public R list(Map<String, Object> params) {
public R list(@RequestParam Map<String, Object> params) {
// 只有超级管理员,才能查看所有用户列表
if (getUserId() == Constant.SUPER_ADMIN) {
......
......@@ -16,11 +16,11 @@ import com.govmade.modules.system.service.UserService;
import cn.hutool.core.util.StrUtil;
/**
* 系统用户
* 系统管理 - 用户设置
*
* @author chenshun
* @email sunlightcs@gmail.com
* @date 2016年9月18日 上午9:46:09
* @author Fred
* @email fangtaosh@qq.com
* @date 2018年8月7日
*/
@Service("UserService")
public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements UserService {
......@@ -30,9 +30,11 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
// TODO Auto-generated method stub
String username = (String) params.get("username");
Long createBy = (Long) params.get("createBy");
Long deptId = (Long) params.get("deptId");
Page<UserEntity> page = this.selectPage(new Query<UserEntity>(params).getPage(), new EntityWrapper<UserEntity>()
.like(StrUtil.isNotBlank(username), "username", username).eq(createBy != null, "create_by", createBy));
Page<UserEntity> page = this.selectPage(new Query<UserEntity>(params).getPage(),
new EntityWrapper<UserEntity>().like(StrUtil.isNotBlank(username), "username", username)
.eq(deptId != null, "dept_id", deptId).eq(createBy != null, "create_by", createBy));
return new PageUtils(page);
}
......
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