|
@@ -1,24 +1,21 @@
|
|
|
package org.jeecg.modules.ctop.service.impl;
|
|
|
|
|
|
+import cn.com.ctop.common.module.entity.Project;
|
|
|
import cn.com.ctop.common.module.entity.UserAllocation;
|
|
|
import cn.com.ctop.common.module.mapper.UserAllocationMapper;
|
|
|
import cn.com.ctop.common.module.service.ISysRoleService;
|
|
|
import cn.com.ctop.common.module.utils.Check;
|
|
|
import cn.com.ctop.common.module.utils.CtopAdConstant;
|
|
|
-import cn.com.ctop.common.module.utils.SpringUtils;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import org.apache.commons.lang.ArrayUtils;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
|
-import org.jeecg.modules.ctop.entity.Project;
|
|
|
import org.jeecg.modules.ctop.entity.ProjectMember;
|
|
|
import org.jeecg.modules.ctop.mapper.ProjectMemberMapper;
|
|
|
import org.jeecg.modules.ctop.service.IProjectMemberService;
|
|
|
import org.jeecg.modules.system.entity.SysUser;
|
|
|
-import org.openqa.selenium.By;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
@@ -43,7 +40,8 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
|
|
|
@Autowired
|
|
|
private UserAllocationMapper userAllocationMapper;
|
|
|
|
|
|
- private static final String[] PERMISSION_VIEW_PROJECT={"admin","saleDirector","sale","saleAssistant","saleAm"};
|
|
|
+ private static final String[] PERMISSION_VIEW_PROJECT = {"admin", "saleDirector", "sale", "saleAssistant", "saleAm"};
|
|
|
+
|
|
|
@Override
|
|
|
public void addMember(SysUser sysUser, Project project) {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
@@ -103,13 +101,13 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
|
|
|
mediaList.add(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INT);
|
|
|
mediaList.add(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INSIDE_INT);
|
|
|
//查询登录账号下的项目
|
|
|
- List<ProjectMember> projectMemberList = this.queryProjectMemberBy(userId,mediaList);
|
|
|
+ List<ProjectMember> projectMemberList = this.queryProjectMemberBy(userId, mediaList);
|
|
|
if (projectMemberList.isEmpty()) {
|
|
|
return result;
|
|
|
}
|
|
|
projectMemberList.forEach(ProjectMember -> {
|
|
|
- Map<String, Object> temp=this.queryAccountByProjectId(ProjectMember);
|
|
|
- if(temp!=null){
|
|
|
+ Map<String, Object> temp = this.queryAccountByProjectId(ProjectMember);
|
|
|
+ if (temp != null) {
|
|
|
result.add(temp);
|
|
|
}
|
|
|
});
|
|
@@ -124,9 +122,9 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
|
|
|
queryWrapper.eq("project_id", projectMember.getProjectId());
|
|
|
queryWrapper.isNotNull("account_id");
|
|
|
List<UserAllocation> userAllocations = userAllocationMapper.selectList(queryWrapper);
|
|
|
- if(userAllocations.isEmpty()){
|
|
|
- temp=null;
|
|
|
- }else {
|
|
|
+ if (userAllocations.isEmpty()) {
|
|
|
+ temp = null;
|
|
|
+ } else {
|
|
|
temp.put("account", userAllocations);
|
|
|
}
|
|
|
return temp;
|
|
@@ -134,9 +132,9 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
|
|
|
|
|
|
private List<ProjectMember> queryProjectMemberBy(String userId, List<Integer> mediaIds) {
|
|
|
String roleCode = memberMapper.getRoleCodeByUserId(userId);
|
|
|
- if(ArrayUtils.contains(PERMISSION_VIEW_PROJECT,roleCode)){
|
|
|
+ if (ArrayUtils.contains(PERMISSION_VIEW_PROJECT, roleCode)) {
|
|
|
return memberMapper.adminProjects(mediaIds);
|
|
|
}
|
|
|
- return memberMapper.queryProjectMemberByUserId(userId,mediaIds);
|
|
|
+ return memberMapper.queryProjectMemberByUserId(userId, mediaIds);
|
|
|
}
|
|
|
}
|