Merge remote-tracking branch 'origin/master'
commit
056a5ee8f7
|
@ -38,7 +38,7 @@ public interface ITaskService extends IService<Task> {
|
|||
*/
|
||||
Integer getHolderLevel(String token, Long taskId);
|
||||
|
||||
List<TaskDTO> listMyTasks(String token, Integer projectId) throws BadRequestException;
|
||||
List<TaskDTO> listMyTasks(String token, Integer projectId) throws BadRequestException, ForbiddenException;
|
||||
|
||||
Boolean canBeDone(Long taskId);
|
||||
|
||||
|
|
|
@ -213,6 +213,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements IT
|
|||
|
||||
private int upperBound(List<Task> data, long x) {
|
||||
int l = 0, r = data.size() - 1;
|
||||
if(data.get(r).getTaskFatherId().equals(x))
|
||||
return r;
|
||||
while (l < r) {
|
||||
int mid = (l + r) / 2;
|
||||
if (data.get(mid).getTaskFatherId() <= x) l = mid + 1;
|
||||
|
@ -223,8 +225,11 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements IT
|
|||
|
||||
|
||||
@Override
|
||||
public List<TaskDTO> listMyTasks(String token, Integer projectId) {
|
||||
public List<TaskDTO> listMyTasks(String token, Integer projectId) throws ForbiddenException {
|
||||
Integer staffId = TokenUtils.getStaffId(token);
|
||||
if(projectGroupService.getProjectAccessLevel(token,projectId)==0){
|
||||
throw new ForbiddenException("不可操作的项目");
|
||||
}
|
||||
List<Task> resList = baseMapper.selectList(Wrappers.<Task>lambdaQuery()
|
||||
.select(Task::getTaskId, Task::getTaskFatherId, Task::getTaskHolderId)
|
||||
.eq(Task::getTaskProjectId, projectId)
|
||||
|
|
Loading…
Reference in New Issue