加销售数据权限控制
This commit is contained in:
+23
@@ -1,6 +1,8 @@
|
||||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
@@ -65,6 +67,27 @@ public class SysUserController extends BaseController
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户下拉选项(业务员/客服/采购员等选择用)。
|
||||
* 不加 @PreAuthorize:登录即可访问,只返回 id/账号/姓名/部门等展示字段,
|
||||
* 避免给业务角色额外开放 system:user:list(含手机号/邮箱等完整信息)。
|
||||
*/
|
||||
@GetMapping("/optionselect")
|
||||
public AjaxResult optionselect()
|
||||
{
|
||||
List<Map<String, Object>> options = userService.selectUserOptions().stream().map(u -> {
|
||||
Map<String, Object> m = new LinkedHashMap<>();
|
||||
m.put("userId", u.getUserId());
|
||||
m.put("userName", u.getUserName());
|
||||
m.put("nickName", u.getNickName());
|
||||
m.put("deptId", u.getDeptId());
|
||||
m.put("deptName", u.getDept() == null ? null : u.getDept().getDeptName());
|
||||
m.put("status", u.getStatus());
|
||||
return m;
|
||||
}).collect(Collectors.toList());
|
||||
return AjaxResult.success(options);
|
||||
}
|
||||
|
||||
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
|
||||
@PreAuthorize("@ss.hasPermi('system:user:export')")
|
||||
@PostMapping("/export")
|
||||
|
||||
Reference in New Issue
Block a user