|
|
@@ -203,31 +203,39 @@ public class RestrictProjectServiceImpl extends BaseMybatisDao<RestrictProjectMa
|
|
|
public Object getRestrictProjectUser(String ids) {
|
|
|
List<UserRestrictProjectBo> list = new ArrayList<>();
|
|
|
String aid=TokenManager.getAdminId();
|
|
|
+ Admin my = adminMapper.selectByPrimaryKey(aid);
|
|
|
+ boolean flag= my.getPublicPurview() == 1;
|
|
|
if (ids!=null&& !ids.isEmpty()){
|
|
|
String[] split = ids.split(",");
|
|
|
for (String s : split) {
|
|
|
UserRestrictProjectBo bo = new UserRestrictProjectBo();
|
|
|
bo.setUid(s);
|
|
|
- User user = userMapper.selectByPrimaryKey(s);
|
|
|
- if (user.getShareType()==0||user.getShareType()==2){
|
|
|
- //0私有 2签单 查询当前是否有签订限定项目
|
|
|
- if (user.getAid().equals(aid)){
|
|
|
- //是自己的
|
|
|
- bo.setType(0);
|
|
|
- }else{
|
|
|
- //不是自己的
|
|
|
- List<RestrictProject> restrictProjects = restrictProjectMapper.selectListByParam(new InputRestrictProject(s, aid));
|
|
|
- if (!restrictProjects.isEmpty()){
|
|
|
- // 有限定项目
|
|
|
- bo.setType(1);
|
|
|
+ if (!flag){
|
|
|
+ User user = userMapper.selectByPrimaryKey(s);
|
|
|
+ if (user.getShareType()==0||user.getShareType()==2){
|
|
|
+ //0私有 2签单 查询当前是否有签订限定项目
|
|
|
+ if (user.getAid().equals(aid)){
|
|
|
+ //是自己的
|
|
|
+ bo.setType(0);
|
|
|
}else{
|
|
|
- //没有限定
|
|
|
- bo.setType(2);
|
|
|
+ //不是自己的
|
|
|
+ List<RestrictProject> restrictProjects = restrictProjectMapper.selectListByParam(new InputRestrictProject(s, aid));
|
|
|
+ if (!restrictProjects.isEmpty()){
|
|
|
+ // 有限定项目
|
|
|
+ bo.setType(1);
|
|
|
+ }else{
|
|
|
+ //没有限定
|
|
|
+ bo.setType(2);
|
|
|
+ Admin admin = adminMapper.selectByPrimaryKey(user.getAid());
|
|
|
+ bo.setAdminName(admin.getName());
|
|
|
+ }
|
|
|
}
|
|
|
+ }else if(user.getShareType()==1){
|
|
|
+ //公共客户
|
|
|
+ bo.setType(3);
|
|
|
}
|
|
|
- }else if(user.getShareType()==1){
|
|
|
- //公共客户
|
|
|
- bo.setType(3);
|
|
|
+ }else {
|
|
|
+ bo.setType(4);
|
|
|
}
|
|
|
list.add(bo);
|
|
|
}
|