From 68e7e3e35d2e9864efd789a12c4e8b34dfc7026b Mon Sep 17 00:00:00 2001 From: ma <1062634917@qq.com> Date: Mon, 16 Aug 2021 15:55:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1-=E9=A1=B9=E7=9B=AE=E7=BB=8F=E7=90=86=E5=8F=AA?= =?UTF-8?q?=E8=83=BD=E6=9F=A5=E7=9C=8B=E8=87=AA=E5=B7=B1=E7=9A=84=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ccsens/common/service/TaskService.java | 83 ++++++++++--------- 1 file changed, 44 insertions(+), 39 deletions(-) diff --git a/common/src/main/java/com/ccsens/common/service/TaskService.java b/common/src/main/java/com/ccsens/common/service/TaskService.java index 82cf1afc..206b0a9c 100644 --- a/common/src/main/java/com/ccsens/common/service/TaskService.java +++ b/common/src/main/java/com/ccsens/common/service/TaskService.java @@ -195,20 +195,21 @@ public class TaskService implements ITaskService { if (BooleanUtil.isFalse(isLook)) { throw new BaseException(CommonCodeError.NOT_PERMISSION); } - //查询当前角色是否项目经理 List roleIds = new ArrayList<>(); - List roleList = roleDao.findAllRoleById(param.getRoleId()); - if (CollectionUtil.isNotEmpty(roleList)){ - List roles = roleList.stream().filter(allRole -> allRole.getId().equals(param.getRoleId())).collect(Collectors.toList()); - if (CollectionUtil.isNotEmpty(roles)){ - if (Constant.ROLE_LEVEL.PM.value.equals(roles.get(0).getLevel())){ - List allRoleId = roleList.stream().map(CRoleVo.AllRole::getId).collect(Collectors.toList()); - roleIds.addAll(allRoleId); - }else{ - roleIds.add(param.getRoleId()); - } - } - } + roleIds.add(param.getRoleId()); + //查询当前角色是否项目经理 +// List roleList = roleDao.findAllRoleById(param.getRoleId()); +// if (CollectionUtil.isNotEmpty(roleList)){ +// List roles = roleList.stream().filter(allRole -> allRole.getId().equals(param.getRoleId())).collect(Collectors.toList()); +// if (CollectionUtil.isNotEmpty(roles)){ +// if (Constant.ROLE_LEVEL.PM.value.equals(roles.get(0).getLevel())){ +// List allRoleId = roleList.stream().map(CRoleVo.AllRole::getId).collect(Collectors.toList()); +// roleIds.addAll(allRoleId); +// }else{ +// roleIds.add(param.getRoleId()); +// } +// } +// } List permanentGlobalTask = taskDetailDao.queryPermanentGlobalTask(roleIds); //查找项目面板和插件信息 queryPluginForTask(permanentGlobalTask); @@ -223,20 +224,22 @@ public class TaskService implements ITaskService { if (BooleanUtil.isFalse(isLook)) { throw new BaseException(CommonCodeError.NOT_PERMISSION); } - //查询当前角色是否项目经理 List roleIds = new ArrayList<>(); - List roleList = roleDao.findAllRoleById(param.getRoleId()); - if (CollectionUtil.isNotEmpty(roleList)){ - List roles = roleList.stream().filter(allRole -> allRole.getId().equals(param.getRoleId())).collect(Collectors.toList()); - if (CollectionUtil.isNotEmpty(roles)){ - if (Constant.ROLE_LEVEL.PM.value.equals(roles.get(0).getLevel())){ - List allRoleId = roleList.stream().map(CRoleVo.AllRole::getId).collect(Collectors.toList()); - roleIds.addAll(allRoleId); - }else{ - roleIds.add(param.getRoleId()); - } - } - } + roleIds.add(param.getRoleId()); + //查询当前角色是否项目经理 +// List roleIds = new ArrayList<>(); +// List roleList = roleDao.findAllRoleById(param.getRoleId()); +// if (CollectionUtil.isNotEmpty(roleList)){ +// List roles = roleList.stream().filter(allRole -> allRole.getId().equals(param.getRoleId())).collect(Collectors.toList()); +// if (CollectionUtil.isNotEmpty(roles)){ +// if (Constant.ROLE_LEVEL.PM.value.equals(roles.get(0).getLevel())){ +// List allRoleId = roleList.stream().map(CRoleVo.AllRole::getId).collect(Collectors.toList()); +// roleIds.addAll(allRoleId); +// }else{ +// roleIds.add(param.getRoleId()); +// } +// } +// } List globalTask = taskDetailDao.queryGlobalTask(roleIds, param.getTimeNode(), param.getTimeUnit()); queryPluginForTask(globalTask); return globalTask; @@ -259,20 +262,22 @@ public class TaskService implements ITaskService { if (BooleanUtil.isFalse(isLook)) { throw new BaseException(CommonCodeError.NOT_PERMISSION); } - //查询当前角色是否项目经理 List roleIds = new ArrayList<>(); - List roleList = roleDao.findAllRoleById(param.getRoleId()); - if (CollectionUtil.isNotEmpty(roleList)){ - List roles = roleList.stream().filter(allRole -> allRole.getId().equals(param.getRoleId())).collect(Collectors.toList()); - if (CollectionUtil.isNotEmpty(roles)){ - if (Constant.ROLE_LEVEL.PM.value.equals(roles.get(0).getLevel())){ - List allRoleId = roleList.stream().map(CRoleVo.AllRole::getId).collect(Collectors.toList()); - roleIds.addAll(allRoleId); - }else{ - roleIds.add(param.getRoleId()); - } - } - } + roleIds.add(param.getRoleId()); + //查询当前角色是否项目经理 +// List roleIds = new ArrayList<>(); +// List roleList = roleDao.findAllRoleById(param.getRoleId()); +// if (CollectionUtil.isNotEmpty(roleList)){ +// List roles = roleList.stream().filter(allRole -> allRole.getId().equals(param.getRoleId())).collect(Collectors.toList()); +// if (CollectionUtil.isNotEmpty(roles)){ +// if (Constant.ROLE_LEVEL.PM.value.equals(roles.get(0).getLevel())){ +// List allRoleId = roleList.stream().map(CRoleVo.AllRole::getId).collect(Collectors.toList()); +// roleIds.addAll(allRoleId); +// }else{ +// roleIds.add(param.getRoleId()); +// } +// } +// } //TODO 季度未实现 List regularTask = taskDetailDao.queryRegularTask(roleIds, param.getTimeUnit(), param.getTimeNode(), param.getQueryType(), query, timeFormat); //如果该时段没有任务向上或向下补充