|
@@ -3,18 +3,21 @@ package com.management.platform.service.impl;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
+import com.management.platform.constant.Constant;
|
|
import com.management.platform.entity.*;
|
|
import com.management.platform.entity.*;
|
|
|
|
+import com.management.platform.entity.vo.GanttDataItem;
|
|
import com.management.platform.mapper.InformationMapper;
|
|
import com.management.platform.mapper.InformationMapper;
|
|
import com.management.platform.mapper.UserMapper;
|
|
import com.management.platform.mapper.UserMapper;
|
|
import com.management.platform.mapper.WxCorpInfoMapper;
|
|
import com.management.platform.mapper.WxCorpInfoMapper;
|
|
-import com.management.platform.service.CompanyDingdingService;
|
|
|
|
-import com.management.platform.service.InformationService;
|
|
|
|
|
|
+import com.management.platform.service.*;
|
|
import com.management.platform.util.HttpRespMsg;
|
|
import com.management.platform.util.HttpRespMsg;
|
|
import com.management.platform.util.MessageUtils;
|
|
import com.management.platform.util.MessageUtils;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -41,12 +44,24 @@ public class InformationServiceImpl extends ServiceImpl<InformationMapper, Infor
|
|
private InformationService informationService;
|
|
private InformationService informationService;
|
|
@Resource
|
|
@Resource
|
|
private CompanyDingdingService companyDingdingService;
|
|
private CompanyDingdingService companyDingdingService;
|
|
|
|
+ @Resource
|
|
|
|
+ private TaskService taskService;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private ProjectLeaderService projectLeaderService;
|
|
|
|
+ @Resource
|
|
|
|
+ private ProjectService projectService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public HttpRespMsg getInformationList(HttpServletRequest request) {
|
|
public HttpRespMsg getInformationList(HttpServletRequest request) {
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
try {
|
|
try {
|
|
User user = userMapper.selectById(request.getHeader("token"));
|
|
User user = userMapper.selectById(request.getHeader("token"));
|
|
|
|
+
|
|
|
|
+ int countLeader = projectLeaderService.count(new QueryWrapper<ProjectLeader>().eq("leader_id", user.getId()).eq("company_id", user.getCompanyId()));
|
|
|
|
+ int countFirstCheck = projectService.count(new QueryWrapper<Project>().eq("incharger_id", user.getId()));
|
|
|
|
+ int countSecondCheck = taskService.count(new QueryWrapper<Task>().eq("check_second_id", user.getId()));
|
|
|
|
+
|
|
List<Information> information = informationMapper.selectList(new QueryWrapper<Information>()
|
|
List<Information> information = informationMapper.selectList(new QueryWrapper<Information>()
|
|
.eq("user_id", user.getId()).orderByDesc("time").last("LIMIT 20"));
|
|
.eq("user_id", user.getId()).orderByDesc("time").last("LIMIT 20"));
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id",user.getCompanyId()));
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id",user.getCompanyId()));
|
|
@@ -73,6 +88,27 @@ public class InformationServiceImpl extends ServiceImpl<InformationMapper, Infor
|
|
String newMsg = msg.replace(name, "$userName=" + userWxId + "$");
|
|
String newMsg = msg.replace(name, "$userName=" + userWxId + "$");
|
|
info.setMsg(newMsg);
|
|
info.setMsg(newMsg);
|
|
}
|
|
}
|
|
|
|
+ if (Constant.MLD_COMPANY_ID==user.getCompanyId()&&info.getTaskId()!=null){
|
|
|
|
+ Task task = taskService.getById(info.getTaskId());
|
|
|
|
+ GanttDataItem dataItem = new GanttDataItem();
|
|
|
|
+ dataItem.setTaskStatus(task.getTaskStatus());
|
|
|
|
+
|
|
|
|
+ if(countLeader>0){
|
|
|
|
+ dataItem.setLeaderOrManager(1);
|
|
|
|
+ } else if (countFirstCheck > 0 || countSecondCheck > 0) {
|
|
|
|
+ dataItem.setLeaderOrManager(2);
|
|
|
|
+ }
|
|
|
|
+ dataItem.setCheckFirstId(task.getCheckFirstId());
|
|
|
|
+ dataItem.setCheckSecondId(task.getCheckSecondId());
|
|
|
|
+ dataItem.setObjType(2);
|
|
|
|
+ dataItem.setIsTaskPlan(task.getIsTaskPlan());
|
|
|
|
+ dataItem.setTaskPlan(task.getTaskPlan());
|
|
|
|
+
|
|
|
|
+ DateTimeFormatter customFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
|
+ dataItem.setEnd_date(task.getEndDate()!=null ? task.getEndDate().format(customFormatter) : null);
|
|
|
|
+ dataItem.setStart_date(task.getStartDate()!=null ? task.getStartDate().format(customFormatter) : null);
|
|
|
|
+ info.setGanttData(dataItem);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
httpRespMsg.data = information;
|
|
httpRespMsg.data = information;
|
|
} catch (NullPointerException e) {
|
|
} catch (NullPointerException e) {
|