|
@@ -2,6 +2,7 @@ package com.wtkj.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.wtkj.dto.ProjectTaskPageDTO;
|
|
|
import com.wtkj.entity.FileAndFolder;
|
|
|
import com.wtkj.entity.Task;
|
|
|
import com.wtkj.entity.TaskFile;
|
|
@@ -77,9 +78,18 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public IPage<Task> projectTaskPage(Long projectId, IPage<Task> page) {
|
|
|
+ public IPage<Task> projectTaskPage(ProjectTaskPageDTO dto, IPage<Task> page) {
|
|
|
LambdaQueryWrapper<Task> lqw = new LambdaQueryWrapper<>();
|
|
|
- lqw.eq(Task::getProjectId, projectId);
|
|
|
+ lqw.eq(Task::getProjectId, dto.getProjectId());
|
|
|
+ if (dto.getName() != null) {
|
|
|
+ lqw.like(Task::getTitle, dto.getName());
|
|
|
+ }
|
|
|
+ if (dto.getOrgDeptId() != null) {
|
|
|
+ lqw.eq(Task::getOrgDeptId, dto.getOrgDeptId());
|
|
|
+ }
|
|
|
+ if (dto.getTaskStatus() != null) {
|
|
|
+ lqw.eq(Task::getTaskStatus, dto.getTaskStatus());
|
|
|
+ }
|
|
|
lqw.orderByAsc(Task::getTaskStatus);
|
|
|
return baseMapper.selectPage(page, lqw);
|
|
|
}
|
|
@@ -174,10 +184,17 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public MyTaskStatistics myTaskStatistics(Integer year, Integer month) {
|
|
|
+ public MyTaskStatistics TaskStatistics(Long projectId, Integer year, Integer month) {
|
|
|
MyTaskStatistics statistics = new MyTaskStatistics();
|
|
|
Long userId = AuthUtil.getUserId();
|
|
|
- List<Task> tasks = this.listByUser(userId, year, month);
|
|
|
+ List<Task> tasks = null;
|
|
|
+ if (projectId == null) {
|
|
|
+ //个人任务统计
|
|
|
+ tasks = this.listByUser(userId, year, month);
|
|
|
+ } else {
|
|
|
+ //项目下的所有任务
|
|
|
+ tasks = this.listByProjectId(projectId);
|
|
|
+ }
|
|
|
if (!CollectionUtils.isEmpty(tasks)) {
|
|
|
//全部任务数
|
|
|
statistics.setAll(tasks.size());
|
|
@@ -222,6 +239,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
return statistics;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
public List<Task> listByUser(Long userId, Integer year, Integer month) {
|
|
|
LambdaQueryWrapper<Task> lqw = new LambdaQueryWrapper<>();
|
|
@@ -235,7 +253,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
wq.eq(Task::getCreateUser, userId);
|
|
|
wq.or().like(Task::getExecuteUser, String.valueOf(userId));
|
|
|
});
|
|
|
- lqw.orderByDesc(Task::getCreateTime);
|
|
|
+ lqw.orderByAsc(Task::getEndTime);
|
|
|
return this.list(lqw);
|
|
|
}
|
|
|
|
|
@@ -244,4 +262,12 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
|
public boolean deleteTask(List<Long> taskIds) {
|
|
|
return false;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<Task> listByProjectId(Long projectId) {
|
|
|
+ LambdaQueryWrapper<Task> lqw = new LambdaQueryWrapper<>();
|
|
|
+ lqw.eq(Task::getProjectId, projectId);
|
|
|
+ lqw.orderByAsc(Task::getEndTime);
|
|
|
+ return this.list(lqw);
|
|
|
+ }
|
|
|
}
|