| | |
| | | String handleLiableUserId = projectDto.getLiableUserId().replace("-", ""); |
| | | // 负责人ID列表 |
| | | String[] handleLiableUserIdList = handleLiableUserId.split(","); |
| | | // 循环处理后负责人ID列表 |
| | | // 循环负责人ID列表 |
| | | for (String liableUserId : handleLiableUserIdList) { |
| | | // 负责人ID列表 |
| | | liableUserIdList.add(Long.valueOf(liableUserId)); |
| | |
| | | } |
| | | criteria.setIdInList(totalProjectIdList); |
| | | } |
| | | return projectMapper.toDto(projectRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); |
| | | // 项目列表 |
| | | List<ProjectDto> projectDtoList = projectMapper.toDto(projectRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); |
| | | // 循环项目列表 |
| | | for (int i = 0; i < projectDtoList.size(); i ++) { |
| | | // 项目 |
| | | ProjectDto projectDto = projectDtoList.get(i); |
| | | // 负责人ID列表 |
| | | List<Long> liableUserIdList = new ArrayList<>(); |
| | | // 负责人ID |
| | | String handleLiableUserId = projectDto.getLiableUserId().replace("-", ""); |
| | | // 负责人ID列表 |
| | | String[] handleLiableUserIdList = handleLiableUserId.split(","); |
| | | // 循环负责人ID列表 |
| | | for (String liableUserId : handleLiableUserIdList) { |
| | | // 负责人ID列表 |
| | | liableUserIdList.add(Long.valueOf(liableUserId)); |
| | | } |
| | | // 负责人ID列表 |
| | | projectDto.setLiableUserIdList(liableUserIdList); |
| | | } |
| | | return projectDtoList; |
| | | } |
| | | |
| | | @Override |
| | |
| | | private String projectName; |
| | | |
| | | /** 项目责任人ID */ |
| | | private Long projectLiableUserId; |
| | | private List<Long> projectLiableUserIdList; |
| | | |
| | | /** 父任务名称 */ |
| | | private String pidName; |
| | |
| | | private String projectName; |
| | | |
| | | /** 项目责任人ID */ |
| | | private Long projectLiableUserId; |
| | | private List<Long> projectLiableUserIdList; |
| | | |
| | | /** 任务名称 */ |
| | | private String taskName; |
| | |
| | | ValidationUtil.isNull(project.getId(),"Project","id",taskDto.getProjectId()); |
| | | // 项目名称 |
| | | taskDto.setProjectName(project.getName()); |
| | | // 负责人ID列表 |
| | | List<Long> projectLiableUserIdList = new ArrayList<>(); |
| | | // 项目责任人ID |
| | | taskDto.setProjectLiableUserId(project.getLiableUserId()); |
| | | String projectLiableUserId = project.getLiableUserId().replace("-", ""); |
| | | String[] projectLiableUserIds = projectLiableUserId.split(","); |
| | | // 循环负责人ID列表 |
| | | for (String liableUserId : projectLiableUserIds) { |
| | | // 负责人ID列表 |
| | | projectLiableUserIdList.add(Long.valueOf(liableUserId)); |
| | | } |
| | | // 项目责任人ID |
| | | taskDto.setProjectLiableUserIdList(projectLiableUserIdList); |
| | | // 判断父级任务ID是否为空 |
| | | if (taskDto.getPid() != null) { |
| | | // 根据父级任务ID查询任务信息 |
| | |
| | | ValidationUtil.isNull(project.getId(),"Project","id",taskUserDto.getProjectId()); |
| | | // 项目名称 |
| | | taskUserDto.setProjectName(project.getName()); |
| | | // 负责人ID列表 |
| | | List<Long> projectLiableUserIdList = new ArrayList<>(); |
| | | // 项目责任人ID |
| | | taskUserDto.setProjectLiableUserId(project.getLiableUserId()); |
| | | String projectLiableUserId = project.getLiableUserId().replace("-", ""); |
| | | String[] projectLiableUserIds = projectLiableUserId.split(","); |
| | | // 循环负责人ID列表 |
| | | for (String liableUserId : projectLiableUserIds) { |
| | | // 负责人ID列表 |
| | | projectLiableUserIdList.add(Long.valueOf(liableUserId)); |
| | | } |
| | | // 项目责任人ID |
| | | taskUserDto.setProjectLiableUserIdList(projectLiableUserIdList); |
| | | // 根据任务ID查询任务信息 |
| | | Task task = taskRepository.findById(taskUserDto.getTaskId()).orElseGet(Task::new); |
| | | ValidationUtil.isNull(task.getId(),"Task","id",taskUserDto.getTaskId()); |
| | |
| | | <el-table-column v-if="checkPer(['admin','task:divide','task:edit','task:del'])" label="操作" width="180px" align="center" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <udOperation |
| | | v-if="userRolesLevelMin == roleLevelSuper || userRolesLevelMin == roleLevelGeneral || scope.row.projectLiableUserId == $store.state.user.user.id" |
| | | v-if="userRolesLevelMin == roleLevelSuper || userRolesLevelMin == roleLevelGeneral || scope.row.projectLiableUserIdList.indexOf($store.state.user.user.id) != -1" |
| | | :data="scope.row" |
| | | :permission="permission" |
| | | > |
| | |
| | | return item.id === this.divideForm.projectId |
| | | }) |
| | | // 判断是否是项目责任人 |
| | | if (chooseProject.length !== 1 || chooseProject[0].liableUserId !== this.$store.state.user.user.id) { |
| | | if (chooseProject.length !== 1 || chooseProject[0].liableUserIdList.indexOf(this.$store.state.user.user.id) === -1) { |
| | | // 消息提示 |
| | | this.crud.notify('您不是当前项目责任人,无法进行任务分配操作', CRUD.NOTIFICATION_TYPE.WARNING) |
| | | // 分配表单加载 |
| | |
| | | return item.id === this.form.projectId |
| | | }) |
| | | // 判断是否是项目责任人 |
| | | if (chooseProject.length === 1 && chooseProject[0].liableUserId === this.$store.state.user.user.id) { |
| | | if (chooseProject.length === 1 && chooseProject[0].liableUserIdList.indexOf(this.$store.state.user.user.id) !== -1) { |
| | | return true |
| | | } else { |
| | | // 消息提示 |
| | |
| | | <el-table-column v-if="checkPer(['admin','taskUser:edit','taskUser:del'])" label="操作" width="150px" align="center" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <udOperation |
| | | v-if="userRolesLevelMin == roleLevelSuper || userRolesLevelMin == roleLevelGeneral || scope.row.projectLiableUserId == $store.state.user.user.id || scope.row.userId == $store.state.user.user.id" |
| | | v-if="userRolesLevelMin == roleLevelSuper || userRolesLevelMin == roleLevelGeneral || scope.row.projectLiableUserIdList.indexOf($store.state.user.user.id) != -1 || scope.row.userId == $store.state.user.user.id" |
| | | :data="scope.row" |
| | | :permission="permission" |
| | | /> |
| | |
| | | return item.id === this.form.projectId |
| | | }) |
| | | // 判断是否是项目责任人 |
| | | if ((chooseProject.length === 1 && chooseProject[0].liableUserId === this.$store.state.user.user.id) || this.form.userId === this.$store.state.user.user.id) { |
| | | if ((chooseProject.length === 1 && chooseProject[0].liableUserIdList.indexOf(this.$store.state.user.user.id) !== -1) || this.form.userId === this.$store.state.user.user.id) { |
| | | return true |
| | | } else { |
| | | // 消息提示 |