|
@@ -1,6 +1,7 @@
|
|
|
package com.ozs.web.controller.system;
|
|
|
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
@@ -9,12 +10,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.ozs.system.domain.vo.requestVo.SysUserPageRequestVo;
|
|
|
import com.ozs.system.domain.vo.requestVo.SysUserRequestVo;
|
|
|
+import com.ozs.system.domain.vo.responseVo.SysDeptResponseVo;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.apache.commons.lang3.ArrayUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.util.ObjectUtils;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -88,6 +91,19 @@ public class SysUserController extends BaseController
|
|
|
LambdaQueryWrapper<SysUser> lw = new LambdaQueryWrapper<>();
|
|
|
lw.eq(SysUser::getDelFlag,0);
|
|
|
IPage<SysUser> page = userService.page(new Page<>(sysUserPageRequestVo.getPageNum(), sysUserPageRequestVo.getPageSize()), lw);
|
|
|
+ if(!ObjectUtils.isEmpty(page) && !ObjectUtils.isEmpty(page.getRecords())){
|
|
|
+ List<SysUser> dto1 = page.getRecords().stream().map(o -> {
|
|
|
+ Map<String, Object> stringObjectMap = deptService.selectDeptById(o.getDeptId());
|
|
|
+ Object sysDept = stringObjectMap.get("dto");
|
|
|
+ if (!ObjectUtils.isEmpty(sysDept)) {
|
|
|
+ SysDept dto = (SysDept) sysDept;
|
|
|
+ o.setDept(dto);
|
|
|
+ o.setDeptName(dto.getDeptName());
|
|
|
+ }
|
|
|
+ return o;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ page.setRecords(dto1);
|
|
|
+ }
|
|
|
return success(page);
|
|
|
}
|
|
|
|
|
@@ -173,8 +189,8 @@ public class SysUserController extends BaseController
|
|
|
// user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
|
|
// return toAjax(userService.insertUser(user));
|
|
|
// }
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 新增用户
|
|
@@ -251,7 +267,7 @@ public class SysUserController extends BaseController
|
|
|
user.setUpdateBy(getUsername());
|
|
|
return toAjax(userService.updateUsers(user));
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 删除用户
|
|
|
*/
|