|
@@ -4,6 +4,7 @@ package com.management.platform.controller;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.management.platform.entity.*;
|
|
import com.management.platform.entity.*;
|
|
|
|
+import com.management.platform.mapper.TaskCommentMapper;
|
|
import com.management.platform.mapper.UserMapper;
|
|
import com.management.platform.mapper.UserMapper;
|
|
import com.management.platform.service.*;
|
|
import com.management.platform.service.*;
|
|
import com.management.platform.util.HttpRespMsg;
|
|
import com.management.platform.util.HttpRespMsg;
|
|
@@ -65,6 +66,8 @@ public class TaskController {
|
|
private InformationService informationService;
|
|
private InformationService informationService;
|
|
@Resource
|
|
@Resource
|
|
private TaskProgressService taskProgressService;
|
|
private TaskProgressService taskProgressService;
|
|
|
|
+ @Resource
|
|
|
|
+ private TaskCommentMapper taskCommentMapper;
|
|
|
|
|
|
@RequestMapping("/save")
|
|
@RequestMapping("/save")
|
|
public HttpRespMsg save(Task task) {
|
|
public HttpRespMsg save(Task task) {
|
|
@@ -103,6 +106,7 @@ public class TaskController {
|
|
if (task.getExecutorId() != null) {
|
|
if (task.getExecutorId() != null) {
|
|
msgRecepient = task.getExecutorId();
|
|
msgRecepient = task.getExecutorId();
|
|
}
|
|
}
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
//更新的情况,需要对比是否修改了任务标题,更新子任务的parentTname
|
|
//更新的情况,需要对比是否修改了任务标题,更新子任务的parentTname
|
|
Task oldTask = taskService.getById(task.getId());
|
|
Task oldTask = taskService.getById(task.getId());
|
|
@@ -120,8 +124,17 @@ public class TaskController {
|
|
msgRecepient = task.getExecutorId();
|
|
msgRecepient = task.getExecutorId();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
taskService.saveOrUpdate(task);
|
|
taskService.saveOrUpdate(task);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ TaskComment comment = new TaskComment();
|
|
|
|
+ comment.setTaskId(task.getId());
|
|
|
|
+ comment.setUserId(user.getId());
|
|
|
|
+ comment.setUserName(user.getName());
|
|
|
|
+ comment.setType(isNew?1:2);
|
|
|
|
+ comment.setContent(user.getName()+"创建了任务");
|
|
|
|
+ taskCommentMapper.insert(comment);
|
|
|
|
+
|
|
//更新执行人近期任务
|
|
//更新执行人近期任务
|
|
if (!StringUtils.isEmpty(task.getExecutorId())) {
|
|
if (!StringUtils.isEmpty(task.getExecutorId())) {
|
|
saveOrUpdateRecentTask(task, task.getExecutorId());
|
|
saveOrUpdateRecentTask(task, task.getExecutorId());
|