|
@@ -37,6 +37,7 @@ import java.io.*;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDate;
|
|
|
+import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -100,6 +101,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
|
|
|
|
@Resource
|
|
|
private TaskCommentMapper taskCommentMapper;
|
|
|
+ @Autowired
|
|
|
+ private InformationMapper informationMapper;
|
|
|
|
|
|
@Override
|
|
|
public HttpRespMsg getExecutorPanel(Integer projectId) {
|
|
@@ -1058,7 +1061,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
String userId = request.getHeader("Token");
|
|
|
User user = userMapper.selectById(userId);
|
|
|
- WxCorpInfo wxCorpInfo = wxCorpInfoService.getOne(new QueryWrapper<WxCorpInfo>().eq("company_id", user.getCompanyId()));
|
|
|
|
|
|
Task task = taskMapper.selectById(taskId);
|
|
|
if (!userId.equals(task.getCheckFirstId())&&!userId.equals(task.getCheckSecondId())){
|
|
@@ -1075,14 +1077,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
|
taskMapper.updateById(task);
|
|
|
//给第二审核人发送信息提醒
|
|
|
User owner = userMapper.selectById(task.getCheckSecondId());
|
|
|
- if (wxCorpInfo != null) {
|
|
|
- //推送到企业微信
|
|
|
- StringBuilder stringBuilder = new StringBuilder();
|
|
|
- stringBuilder.append("$userName="+owner.getCorpwxUserid()+"$")
|
|
|
- .append(":有新的工作计划待审核");
|
|
|
- wxCorpInfoService.sendWXCorpMsg(wxCorpInfo,owner.getCorpwxUserid(), stringBuilder.toString(), "task",
|
|
|
- WxCorpInfoServiceImpl.TEXT_CARD_MSG_TASK_PLAN_NEED_CHECK);
|
|
|
- }
|
|
|
+ Information information = new Information();
|
|
|
+ information.setMsg("您有工作计划待审核");
|
|
|
+ information.setUserId(owner.getId());
|
|
|
+ information.setType(11);
|
|
|
+ information.setTime(LocalDateTime.now());
|
|
|
+ informationMapper.insert(information);
|
|
|
}
|
|
|
//第二审核人通过
|
|
|
else if (task.getIsTaskPlan() == 1 && task.getTaskStatus() == 4
|
|
@@ -1098,14 +1098,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
|
for (TaskExecutor taskExecutor : taskExecutorList) {
|
|
|
//给任务的执行人发送信息提醒
|
|
|
User owner = userMapper.selectById(taskExecutor.getExecutorId());
|
|
|
- if (wxCorpInfo != null) {
|
|
|
- //推送到企业微信
|
|
|
- StringBuilder stringBuilder = new StringBuilder();
|
|
|
- stringBuilder.append("$userName="+owner.getCorpwxUserid()+"$")
|
|
|
- .append(":有新的任务,请及时查看");
|
|
|
- wxCorpInfoService.sendWXCorpMsg(wxCorpInfo,owner.getCorpwxUserid(), stringBuilder.toString(), "task",
|
|
|
- WxCorpInfoServiceImpl.TEXT_CARD_MSG_TASK_PLAN_NEED_CHECK);
|
|
|
- }
|
|
|
+ Information information = new Information();
|
|
|
+ information.setMsg("您有新的任务");
|
|
|
+ information.setType(1);
|
|
|
+ information.setUserId(owner.getId());
|
|
|
+ information.setTime(LocalDateTime.now());
|
|
|
+ informationMapper.insert(information);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1120,14 +1118,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
|
taskMapper.updateById(task);
|
|
|
//给小组长发送信息提醒
|
|
|
User owner = userMapper.selectById(task.getCreaterId());
|
|
|
- if (wxCorpInfo != null) {
|
|
|
- //推送到企业微信
|
|
|
- StringBuilder stringBuilder = new StringBuilder();
|
|
|
- stringBuilder.append("$userName="+owner.getCorpwxUserid()+"$")
|
|
|
- .append(":有工作计划被驳回,请查看");
|
|
|
- wxCorpInfoService.sendWXCorpMsg(wxCorpInfo,owner.getCorpwxUserid(), stringBuilder.toString(), "task",
|
|
|
- WxCorpInfoServiceImpl.TEXT_CARD_MSG_TASK_PLAN_NEED_CHECK);
|
|
|
- }
|
|
|
+ Information information = new Information();
|
|
|
+ information.setMsg("您有工作计划被驳回");
|
|
|
+ information.setType(11);
|
|
|
+ information.setUserId(owner.getId());
|
|
|
+ information.setTime(LocalDateTime.now());
|
|
|
+ informationMapper.insert(information);
|
|
|
}
|
|
|
//第二审核人驳回
|
|
|
else if (task.getIsTaskPlan() == 1 && task.getTaskStatus() == 4
|
|
@@ -1139,14 +1135,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
|
|
|
|
|
|
//给小组长发送信息提醒
|
|
|
User owner = userMapper.selectById(task.getCreaterId());
|
|
|
- if (wxCorpInfo != null) {
|
|
|
- //推送到企业微信
|
|
|
- StringBuilder stringBuilder = new StringBuilder();
|
|
|
- stringBuilder.append("$userName="+owner.getCorpwxUserid()+"$")
|
|
|
- .append(":有工作计划被驳回,请查看");
|
|
|
- wxCorpInfoService.sendWXCorpMsg(wxCorpInfo,owner.getCorpwxUserid(), stringBuilder.toString(), "task",
|
|
|
- WxCorpInfoServiceImpl.TEXT_CARD_MSG_TASK_PLAN_NEED_CHECK);
|
|
|
- }
|
|
|
+ Information information = new Information();
|
|
|
+ information.setMsg("您有工作计划被驳回");
|
|
|
+ information.setType(11);
|
|
|
+ information.setUserId(owner.getId());
|
|
|
+ information.setTime(LocalDateTime.now());
|
|
|
+ informationMapper.insert(information);
|
|
|
}
|
|
|
}
|
|
|
return msg;
|