|
@@ -19,6 +19,7 @@ package org.springblade.system.user.controller;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
@@ -80,6 +81,7 @@ public class UserController {
|
|
|
private final IUserSearchClient userSearchClient;
|
|
private final IUserSearchClient userSearchClient;
|
|
|
|
|
|
|
|
private final IRedisClient redisClient;
|
|
private final IRedisClient redisClient;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 查询单条
|
|
* 查询单条
|
|
|
*/
|
|
*/
|
|
@@ -88,8 +90,13 @@ public class UserController {
|
|
|
@GetMapping("/detail")
|
|
@GetMapping("/detail")
|
|
|
@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
|
|
@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
|
|
|
public R<UserVO> detail(User user) {
|
|
public R<UserVO> detail(User user) {
|
|
|
- User detail = userService.getOne(Condition.getQueryWrapper(user));
|
|
|
|
|
- return R.data(UserWrapper.build().entityVO(detail));
|
|
|
|
|
|
|
+ if (ObjectUtils.isNotNull(user.getId())) {
|
|
|
|
|
+ User detail = userService.getOne(Condition.getQueryWrapper(user));
|
|
|
|
|
+ return R.data(UserWrapper.build().entityVO(detail));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return R.data(new UserVO());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -110,10 +117,10 @@ public class UserController {
|
|
|
|
|
|
|
|
@GetMapping("/userList")
|
|
@GetMapping("/userList")
|
|
|
public R userList(UserVO userVO) {
|
|
public R userList(UserVO userVO) {
|
|
|
- if (AuthUtil.getTenantId().equals("234557") && StringUtil.isBlank(userVO.getRoleAlias())){
|
|
|
|
|
|
|
+ if (AuthUtil.getTenantId().equals("234557") && StringUtil.isBlank(userVO.getRoleAlias())) {
|
|
|
userVO.setRoleAlias("业务员");
|
|
userVO.setRoleAlias("业务员");
|
|
|
}
|
|
}
|
|
|
- if (AuthUtil.getTenantId().equals("119111") && StringUtil.isBlank(userVO.getRoleAlias())){
|
|
|
|
|
|
|
+ if (AuthUtil.getTenantId().equals("119111") && StringUtil.isBlank(userVO.getRoleAlias())) {
|
|
|
userVO.setRoleAlias("业务员");
|
|
userVO.setRoleAlias("业务员");
|
|
|
}
|
|
}
|
|
|
LambdaQueryWrapper<User> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<User> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
@@ -137,7 +144,7 @@ public class UserController {
|
|
|
List<Long> userIdList = userService.getUserIdByCorpId(Long.parseLong(userVO.getUserExt()));
|
|
List<Long> userIdList = userService.getUserIdByCorpId(Long.parseLong(userVO.getUserExt()));
|
|
|
if (CollectionUtil.isNotEmpty(userIdList)) {
|
|
if (CollectionUtil.isNotEmpty(userIdList)) {
|
|
|
lambdaQueryWrapper.in(User::getId, userIdList);
|
|
lambdaQueryWrapper.in(User::getId, userIdList);
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
return R.data(new ArrayList<>());
|
|
return R.data(new ArrayList<>());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -159,7 +166,7 @@ public class UserController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/deptUserList")
|
|
@GetMapping("/deptUserList")
|
|
|
public R deptUserList(UserVO userVO) {
|
|
public R deptUserList(UserVO userVO) {
|
|
|
- if (ObjectUtil.isEmpty(userVO.getDeptPid())){
|
|
|
|
|
|
|
+ if (ObjectUtil.isEmpty(userVO.getDeptPid())) {
|
|
|
return R.data(new ArrayList<>());
|
|
return R.data(new ArrayList<>());
|
|
|
}
|
|
}
|
|
|
LambdaQueryWrapper<User> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<User> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
@@ -169,9 +176,9 @@ public class UserController {
|
|
|
.eq(User::getIsDeleted, 0);
|
|
.eq(User::getIsDeleted, 0);
|
|
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(userVO.getDeptPid())) {
|
|
if (ObjectUtil.isNotEmpty(userVO.getDeptPid())) {
|
|
|
- if ("1504336886057963521".equals(userVO.getDeptPid())){
|
|
|
|
|
|
|
+ if ("1504336886057963521".equals(userVO.getDeptPid())) {
|
|
|
userVO.setRoleAlias("分管调度");
|
|
userVO.setRoleAlias("分管调度");
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
userVO.setRoleAlias("大件调度");
|
|
userVO.setRoleAlias("大件调度");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -477,7 +484,7 @@ public class UserController {
|
|
|
@GetMapping("/MCSelectList")
|
|
@GetMapping("/MCSelectList")
|
|
|
@ApiOperationSupport(order = 3)
|
|
@ApiOperationSupport(order = 3)
|
|
|
public R<List<User>> list() {
|
|
public R<List<User>> list() {
|
|
|
- return userSearchClient.listByRole(SysCache.getRoleIds(AuthUtil.getTenantId(),"库管员"));
|
|
|
|
|
|
|
+ return userSearchClient.listByRole(SysCache.getRoleIds(AuthUtil.getTenantId(), "库管员"));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -485,7 +492,7 @@ public class UserController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/stockClerkList")
|
|
@GetMapping("/stockClerkList")
|
|
|
public R<List<User>> stockClerkList() {
|
|
public R<List<User>> stockClerkList() {
|
|
|
- return userSearchClient.listByRole(SysCache.getRoleIds(AuthUtil.getTenantId(),"库管"));
|
|
|
|
|
|
|
+ return userSearchClient.listByRole(SysCache.getRoleIds(AuthUtil.getTenantId(), "库管"));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -493,7 +500,7 @@ public class UserController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/financeList")
|
|
@GetMapping("/financeList")
|
|
|
public R<List<User>> financeList() {
|
|
public R<List<User>> financeList() {
|
|
|
- return userSearchClient.listByRole(SysCache.getRoleIds(AuthUtil.getTenantId(),"财务"));
|
|
|
|
|
|
|
+ return userSearchClient.listByRole(SysCache.getRoleIds(AuthUtil.getTenantId(), "财务"));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -501,7 +508,7 @@ public class UserController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/salerList")
|
|
@GetMapping("/salerList")
|
|
|
public R<List<User>> salerList() {
|
|
public R<List<User>> salerList() {
|
|
|
- return userSearchClient.listByRole(SysCache.getRoleIds(AuthUtil.getTenantId(),"财务"));
|
|
|
|
|
|
|
+ return userSearchClient.listByRole(SysCache.getRoleIds(AuthUtil.getTenantId(), "财务"));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -509,7 +516,7 @@ public class UserController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/getWarehouseKeeper")
|
|
@GetMapping("/getWarehouseKeeper")
|
|
|
public R<List<User>> getWarehouseKeeper(@RequestParam("salesCompanyId") String salesCompanyId) {
|
|
public R<List<User>> getWarehouseKeeper(@RequestParam("salesCompanyId") String salesCompanyId) {
|
|
|
- return userSearchClient.getWarehouseKeeper(SysCache.getRoleIds(AuthUtil.getTenantId(),"库管"),salesCompanyId);
|
|
|
|
|
|
|
+ return userSearchClient.getWarehouseKeeper(SysCache.getRoleIds(AuthUtil.getTenantId(), "库管"), salesCompanyId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|