|
@@ -4,6 +4,8 @@ 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.shiro.SecurityUtils;
|
|
@@ -14,6 +16,7 @@ import org.jeecg.modules.ctop.mapper.ProjectMemberMapper;
|
|
|
import org.jeecg.modules.ctop.service.IProjectMemberService;
|
|
|
import org.jeecg.modules.system.entity.SysUser;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
@@ -90,7 +93,29 @@ public class ProjectMemberServiceImpl extends ServiceImpl<ProjectMemberMapper, P
|
|
|
return projectMemberList;
|
|
|
}
|
|
|
|
|
|
- public Map<String, Object> queryAccountByProjectId(ProjectMember projectMember) {
|
|
|
+ @Override
|
|
|
+ @Cacheable(value = "cache_project_account",key="'projectAccount:userId='+#userId",unless = "#result ==null")
|
|
|
+ public List<Map<String, Object>> getProjectAccountByUserId(String userId) {
|
|
|
+ List<Map<String, Object>> result = new ArrayList<>();
|
|
|
+ List<Integer> mediaList = new ArrayList<>();
|
|
|
+ mediaList.add(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INT);
|
|
|
+ mediaList.add(CtopAdConstant.PLATFORM_TYPE_BYTEDANCE_INSIDE_INT);
|
|
|
+ //查询登录账号下的项目
|
|
|
+ List<ProjectMember> projectMemberList = this.getProjects(mediaList);
|
|
|
+ if (projectMemberList.isEmpty()) {
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ projectMemberList.forEach(ProjectMember -> {
|
|
|
+ Map<String, Object> temp=this.queryAccountByProjectId(ProjectMember);
|
|
|
+ if(temp!=null){
|
|
|
+ result.add(temp);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ private Map<String, Object> queryAccountByProjectId(ProjectMember projectMember) {
|
|
|
Map<String, Object> temp = new HashMap<>();
|
|
|
temp.put("project", projectMember);
|
|
|
QueryWrapper<UserAllocation> queryWrapper = new QueryWrapper<>();
|