|
@@ -36,6 +36,7 @@ import org.springblade.system.feign.ISysClient;
|
|
import org.springblade.system.user.entity.User;
|
|
import org.springblade.system.user.entity.User;
|
|
import org.springblade.system.user.feign.IUserClient;
|
|
import org.springblade.system.user.feign.IUserClient;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
@@ -238,7 +239,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
}
|
|
}
|
|
} else if (role.contains(STAFF_SECOND_ADMIN)) {
|
|
} else if (role.contains(STAFF_SECOND_ADMIN)) {
|
|
// 2.2 次级机构主管 ---> 任务是派遣给自己部门的
|
|
// 2.2 次级机构主管 ---> 任务是派遣给自己部门的
|
|
- List<Task> list = this.getByExecuteDept(deptId);
|
|
|
|
|
|
+ List<Task> list = this.getByDeptAndDate(dto.getTopDept(), deptId, null, null);
|
|
if (!CollectionUtils.isEmpty(list)) {
|
|
if (!CollectionUtils.isEmpty(list)) {
|
|
Set<Long> taskIds = list.stream().map(Task::getId).collect(Collectors.toSet());
|
|
Set<Long> taskIds = list.stream().map(Task::getId).collect(Collectors.toSet());
|
|
ids.addAll(taskIds);
|
|
ids.addAll(taskIds);
|
|
@@ -278,7 +279,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
}
|
|
}
|
|
} else if (role.contains(STAFF_SECOND_ADMIN)) {
|
|
} else if (role.contains(STAFF_SECOND_ADMIN)) {
|
|
// 2.2 次级机构主管 ---> 任务是派遣给自己部门的
|
|
// 2.2 次级机构主管 ---> 任务是派遣给自己部门的
|
|
- List<Task> list = this.getByExecuteDept(deptId);
|
|
|
|
|
|
+ List<Task> list = this.getByDeptAndDate(dto.getTopDept(), deptId, null, null);
|
|
if (!CollectionUtils.isEmpty(list)) {
|
|
if (!CollectionUtils.isEmpty(list)) {
|
|
Set<Long> taskIds = list.stream().map(Task::getId).collect(Collectors.toSet());
|
|
Set<Long> taskIds = list.stream().map(Task::getId).collect(Collectors.toSet());
|
|
lqw.in(Task::getId, taskIds);
|
|
lqw.in(Task::getId, taskIds);
|
|
@@ -324,6 +325,7 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
}
|
|
}
|
|
Date now = DateUtil.now();
|
|
Date now = DateUtil.now();
|
|
Date endTime = task.getEndTime();
|
|
Date endTime = task.getEndTime();
|
|
|
|
+ Integer isExpire = task.getIsExpire();
|
|
if (endTime != null) {
|
|
if (endTime != null) {
|
|
//2.已逾期
|
|
//2.已逾期
|
|
if (taskStatus.equals(6)) {
|
|
if (taskStatus.equals(6)) {
|
|
@@ -342,8 +344,8 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
statistics.setTodayToExpire(statistics.getTodayToExpire() + 1);
|
|
statistics.setTodayToExpire(statistics.getTodayToExpire() + 1);
|
|
}
|
|
}
|
|
|
|
|
|
- //5.逾期完成
|
|
|
|
- if (endTime.before(now) && taskStatus.equals(4)) {
|
|
|
|
|
|
+ //5.逾期完成 isExpire = 1 且taskStatus = 4
|
|
|
|
+ if (isExpire.equals(1) && taskStatus.equals(4)) {
|
|
statistics.setOverdueComplete(statistics.getOverdueComplete() + 1);
|
|
statistics.setOverdueComplete(statistics.getOverdueComplete() + 1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -744,11 +746,6 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
- public List<Task> getByExecuteDept(Long deptId) {
|
|
|
|
- return baseMapper.getByExecuteDept(deptId);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
public List<Task> getByCompetentUnit(Long deptId) {
|
|
public List<Task> getByCompetentUnit(Long deptId) {
|
|
return baseMapper.selectByCompetentUnit(deptId);
|
|
return baseMapper.selectByCompetentUnit(deptId);
|
|
@@ -778,6 +775,26 @@ public class TaskServiceImpl extends BaseServiceImpl<TaskMapper, Task> implement
|
|
return res;
|
|
return res;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public boolean delete(List<Long> ids) {
|
|
|
|
+ ids.forEach(id -> {
|
|
|
|
+ Task task = this.getById(id);
|
|
|
|
+ if (task != null) {
|
|
|
|
+ Long projectId = task.getProjectId();
|
|
|
|
+ Project project = projectMapper.selectById(projectId);
|
|
|
|
+ if (project != null) {
|
|
|
|
+ Integer todoTask = project.getTodoTask();
|
|
|
|
+ todoTask = todoTask - 1;
|
|
|
|
+ project.setTodoTask(todoTask < 0 ? 0 : todoTask);
|
|
|
|
+ projectMapper.updateById(project);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ return removeByIds(ids);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
private List<Task> getListByDateAndStageAndStatus(Long stageId, String formatDate, Integer taskStatus) {
|
|
private List<Task> getListByDateAndStageAndStatus(Long stageId, String formatDate, Integer taskStatus) {
|
|
return baseMapper.selectByDateAndStageAndStatus(stageId, formatDate, taskStatus);
|
|
return baseMapper.selectByDateAndStageAndStatus(stageId, formatDate, taskStatus);
|