提交 05099259 authored 作者: 000516's avatar 000516

店内执行,人客关系是否存在根据角色权限标识开放(运营中心、大区TM)

上级 53cb9362
package com.sfa.operation.controller.qc.query;
import com.sfa.common.core.constant.RoleConstants;
import com.sfa.common.security.utils.SecurityUtils;
import com.sfa.operation.service.qc.IQinceMarketEmployeeService;
import com.sfa.system.api.domain.SysRole;
import com.sfa.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -9,6 +11,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Optional;
/**
* @author : liqiulin
......@@ -23,8 +26,14 @@ public class QcMarketEmpQuery {
@GetMapping
public boolean query() {
// 区域销售部的人员,查看人客关系
// 运营中心、大区TM、区域销售部的人员,查看人客关系
LoginUser loginUser = SecurityUtils.getLoginUser();
List<SysRole> roles = loginUser.getSysUser().getRoles();
Optional<SysRole> first = roles.stream().filter(role -> RoleConstants.OPERATION_CENTER_AP_MANAGER.equals(role.getRoleKey()) || RoleConstants.DISTRICT_AP_MANAGER.equals(role.getRoleKey())).findFirst();
if (first.isPresent()) {
return true;
}
String empNo = loginUser.getUsername();
List<String> dealerCodes = qinceMarketEmployeeService.checkPermission(empNo);
return !dealerCodes.isEmpty();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论