|
@@ -860,9 +860,17 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
if (projectFirst.isPresent()) {
|
|
if (projectFirst.isPresent()) {
|
|
Project project = projectFirst.get();
|
|
Project project = projectFirst.get();
|
|
Information information = new Information();
|
|
Information information = new Information();
|
|
- information.setMsg(project.getProjectName()+"项目有新的预计FTE计划审批任务,请您查收.");
|
|
|
|
|
|
+ String executorNames = task.getExecutorList().stream()
|
|
|
|
+ .map(TaskExecutor::getExecutorName)
|
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
|
+
|
|
|
|
+ String infoMsg = project.getProjectName() + "项目有新的预计FTE计划审批任务" +
|
|
|
|
+ (executorNames.isEmpty() ? "" : ",执行人有:" + executorNames) +
|
|
|
|
+ ",请您查收.";
|
|
|
|
+ information.setMsg(infoMsg);
|
|
information.setTaskId(task.getId());
|
|
information.setTaskId(task.getId());
|
|
information.setType(11);
|
|
information.setType(11);
|
|
|
|
+ information.setJumpType(3);
|
|
information.setTime(LocalDateTime.now());
|
|
information.setTime(LocalDateTime.now());
|
|
Optional<User> first = allUserList.stream().filter(u -> u.getId().equals(project.getInchargerId())).findFirst();
|
|
Optional<User> first = allUserList.stream().filter(u -> u.getId().equals(project.getInchargerId())).findFirst();
|
|
if (first.isPresent()) {
|
|
if (first.isPresent()) {
|
|
@@ -1411,11 +1419,24 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
taskExecutorMapper.updateById(e);
|
|
taskExecutorMapper.updateById(e);
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ List<String> secondAuditorIdList = executorList.stream()
|
|
|
|
+ .map(TaskExecutor::getSecondAuditorId)
|
|
|
|
+ .filter(Objects::nonNull) // 过滤 null 值
|
|
|
|
+ .distinct() // 去重
|
|
|
|
+ .collect(Collectors.toList());
|
|
//给第二审核人发送信息提醒
|
|
//给第二审核人发送信息提醒
|
|
- executorList.forEach(e->{
|
|
|
|
- User owner = userMapper.selectById(e.getSecondAuditorId());
|
|
|
|
|
|
+ secondAuditorIdList.forEach(e->{
|
|
|
|
+ User owner = userMapper.selectById(e);
|
|
Information information = new Information();
|
|
Information information = new Information();
|
|
- information.setMsg(project.getProjectName()+"项目有新的预计FTE计划审批任务,请您查收.");
|
|
|
|
|
|
+ String executorNames = executorList.stream()
|
|
|
|
+ .map(TaskExecutor::getExecutorName)
|
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
|
+
|
|
|
|
+ String infoMsg = project.getProjectName() + "项目有新的预计FTE计划审批任务" +
|
|
|
|
+ (executorNames.isEmpty() ? "" : ",执行人有:" + executorNames) +
|
|
|
|
+ ",请您查收.";
|
|
|
|
+ information.setMsg(infoMsg);
|
|
|
|
+ information.setJumpType(3);
|
|
information.setTaskId(task.getId());
|
|
information.setTaskId(task.getId());
|
|
information.setUserId(owner.getId());
|
|
information.setUserId(owner.getId());
|
|
information.setType(11);
|
|
information.setType(11);
|
|
@@ -1436,9 +1457,17 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
//给小组长发消息,提醒通过了
|
|
//给小组长发消息,提醒通过了
|
|
User owner = userMapper.selectById(task.getCreaterId());
|
|
User owner = userMapper.selectById(task.getCreaterId());
|
|
Information information = new Information();
|
|
Information information = new Information();
|
|
- information.setMsg("您有工作计划审核通过了");
|
|
|
|
|
|
+ String executorNames = executorList.stream()
|
|
|
|
+ .map(TaskExecutor::getExecutorName)
|
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
|
+
|
|
|
|
+ String infoMsg = project.getProjectName() + "项目的FTE计划审批任务" +
|
|
|
|
+ (executorNames.isEmpty() ? "" : ",执行人有:" + executorNames) +
|
|
|
|
+ ",工作计划审核通过了.";
|
|
|
|
+ information.setMsg(infoMsg);
|
|
information.setType(11);
|
|
information.setType(11);
|
|
information.setUserId(owner.getId());
|
|
information.setUserId(owner.getId());
|
|
|
|
+ information.setJumpType(2);
|
|
information.setTime(LocalDateTime.now());
|
|
information.setTime(LocalDateTime.now());
|
|
informationMapper.insert(information);
|
|
informationMapper.insert(information);
|
|
|
|
|
|
@@ -1447,10 +1476,11 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
for (TaskExecutor taskExecutor : executorList) {
|
|
for (TaskExecutor taskExecutor : executorList) {
|
|
//给任务的执行人发送信息提醒
|
|
//给任务的执行人发送信息提醒
|
|
information = new Information();
|
|
information = new Information();
|
|
- information.setMsg("您有新的任务");
|
|
|
|
|
|
+ information.setMsg(project.getProjectName() + "项目的FTE计划审批任务,您有新的工作计划");
|
|
information.setContent(taskExecutor.getProjectId()==null?null:(""+taskExecutor.getProjectId()));
|
|
information.setContent(taskExecutor.getProjectId()==null?null:(""+taskExecutor.getProjectId()));
|
|
- information.setType(1);
|
|
|
|
- information.setUserId(owner.getId());
|
|
|
|
|
|
+ information.setType(11);
|
|
|
|
+ information.setJumpType(1);
|
|
|
|
+ information.setUserId(taskExecutor.getExecutorId());
|
|
information.setTime(LocalDateTime.now());
|
|
information.setTime(LocalDateTime.now());
|
|
informationMapper.insert(information);
|
|
informationMapper.insert(information);
|
|
}
|
|
}
|
|
@@ -1474,8 +1504,16 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
//给小组长发送信息提醒
|
|
//给小组长发送信息提醒
|
|
User owner = userMapper.selectById(task.getCreaterId());
|
|
User owner = userMapper.selectById(task.getCreaterId());
|
|
Information information = new Information();
|
|
Information information = new Information();
|
|
- information.setMsg("您有工作计划被驳回");
|
|
|
|
|
|
+ String executorNames = executorList.stream()
|
|
|
|
+ .map(TaskExecutor::getExecutorName)
|
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
|
+
|
|
|
|
+ String infoMsg = project.getProjectName() + "项目的FTE计划审批任务" +
|
|
|
|
+ (executorNames.isEmpty() ? "" : ",执行人有:" + executorNames) +
|
|
|
|
+ ",工作计划被驳回";
|
|
|
|
+ information.setMsg(infoMsg);
|
|
information.setType(11);
|
|
information.setType(11);
|
|
|
|
+ information.setJumpType(2);
|
|
information.setUserId(owner.getId());
|
|
information.setUserId(owner.getId());
|
|
information.setTime(LocalDateTime.now());
|
|
information.setTime(LocalDateTime.now());
|
|
informationMapper.insert(information);
|
|
informationMapper.insert(information);
|
|
@@ -1496,8 +1534,16 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
//给小组长发送信息提醒
|
|
//给小组长发送信息提醒
|
|
User owner = userMapper.selectById(task.getCreaterId());
|
|
User owner = userMapper.selectById(task.getCreaterId());
|
|
Information information = new Information();
|
|
Information information = new Information();
|
|
- information.setMsg("您有工作计划被驳回");
|
|
|
|
|
|
+ String executorNames = executorList.stream()
|
|
|
|
+ .map(TaskExecutor::getExecutorName)
|
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
|
+
|
|
|
|
+ String infoMsg = project.getProjectName() + "项目的FTE计划审批任务" +
|
|
|
|
+ (executorNames.isEmpty() ? "" : ",执行人有:" + executorNames) +
|
|
|
|
+ ",工作计划被驳回";
|
|
|
|
+ information.setMsg(infoMsg);
|
|
information.setType(11);
|
|
information.setType(11);
|
|
|
|
+ information.setJumpType(2);
|
|
information.setUserId(owner.getId());
|
|
information.setUserId(owner.getId());
|
|
information.setTime(LocalDateTime.now());
|
|
information.setTime(LocalDateTime.now());
|
|
informationMapper.insert(information);
|
|
informationMapper.insert(information);
|
|
@@ -1511,25 +1557,38 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
String token = request.getHeader("TOKEN");
|
|
String token = request.getHeader("TOKEN");
|
|
Task task = taskMapper.selectById(id);
|
|
Task task = taskMapper.selectById(id);
|
|
|
|
+ //给执行人发消息
|
|
|
|
+ List<TaskExecutor> executorList = taskExecutorMapper.selectList(new QueryWrapper<TaskExecutor>().eq("task_id", id));
|
|
|
|
+ Project project = projectMapper.selectById(task.getProjectId());
|
|
|
|
+
|
|
if (task.getTaskStatus() == TaskController.STATUS_DOING) {
|
|
if (task.getTaskStatus() == TaskController.STATUS_DOING) {
|
|
task.setTaskStatus(TaskController.STATUS_CANCEL);
|
|
task.setTaskStatus(TaskController.STATUS_CANCEL);
|
|
taskMapper.updateById(task);
|
|
taskMapper.updateById(task);
|
|
//给小组长发送信息提醒
|
|
//给小组长发送信息提醒
|
|
User owner = userMapper.selectById(task.getCreaterId());
|
|
User owner = userMapper.selectById(task.getCreaterId());
|
|
|
|
+
|
|
Information information = new Information();
|
|
Information information = new Information();
|
|
- information.setMsg("您有工作计划被取消");
|
|
|
|
|
|
+ String executorNames = executorList.stream()
|
|
|
|
+ .map(TaskExecutor::getExecutorName)
|
|
|
|
+ .collect(Collectors.joining(","));
|
|
|
|
+
|
|
|
|
+ String infoMsg = project.getProjectName() + "项目" +
|
|
|
|
+ (executorNames.isEmpty() ? "" : ",执行人有:" + executorNames) +
|
|
|
|
+ ",FTE计划审批任务您有工作计划被取消.";
|
|
|
|
+ information.setMsg(infoMsg);
|
|
information.setType(11);
|
|
information.setType(11);
|
|
|
|
+ information.setJumpType(2);
|
|
information.setUserId(owner.getId());
|
|
information.setUserId(owner.getId());
|
|
information.setTime(LocalDateTime.now());
|
|
information.setTime(LocalDateTime.now());
|
|
informationMapper.insert(information);
|
|
informationMapper.insert(information);
|
|
|
|
|
|
- //给执行人发消息
|
|
|
|
- List<TaskExecutor> executorList = taskExecutorMapper.selectList(new QueryWrapper<TaskExecutor>().eq("task_id", id));
|
|
|
|
|
|
+
|
|
executorList.forEach(e->{
|
|
executorList.forEach(e->{
|
|
User executor = userMapper.selectById(e.getExecutorId());
|
|
User executor = userMapper.selectById(e.getExecutorId());
|
|
Information exeInformation = new Information();
|
|
Information exeInformation = new Information();
|
|
- exeInformation.setMsg("您有工作计划被取消");
|
|
|
|
|
|
+ exeInformation.setMsg(project.getProjectName() + "项目,FTE计划审批任务您有工作计划被取消");
|
|
exeInformation.setType(11);
|
|
exeInformation.setType(11);
|
|
|
|
+ exeInformation.setJumpType(1);
|
|
exeInformation.setUserId(executor.getId());
|
|
exeInformation.setUserId(executor.getId());
|
|
exeInformation.setTime(LocalDateTime.now());
|
|
exeInformation.setTime(LocalDateTime.now());
|
|
informationMapper.insert(exeInformation);
|
|
informationMapper.insert(exeInformation);
|