|
@@ -1,7 +1,7 @@
|
|
package cn.cslg.report.service.business;
|
|
package cn.cslg.report.service.business;
|
|
|
|
|
|
|
|
|
|
-import cn.cslg.report.common.core.base.Constants;
|
|
|
|
|
|
+
|
|
import cn.cslg.report.common.model.dto.TaskTDO;
|
|
import cn.cslg.report.common.model.dto.TaskTDO;
|
|
import cn.cslg.report.common.model.vo.*;
|
|
import cn.cslg.report.common.model.vo.*;
|
|
import cn.cslg.report.common.model.vo.queryVo.QueryCMVO;
|
|
import cn.cslg.report.common.model.vo.queryVo.QueryCMVO;
|
|
@@ -9,7 +9,6 @@ import cn.cslg.report.common.utils.*;
|
|
import cn.cslg.report.common.utils.SecurityUtils.LoginUtils;
|
|
import cn.cslg.report.common.utils.SecurityUtils.LoginUtils;
|
|
import cn.cslg.report.common.utils.message.MessageUtils;
|
|
import cn.cslg.report.common.utils.message.MessageUtils;
|
|
import cn.cslg.report.entity.*;
|
|
import cn.cslg.report.entity.*;
|
|
-import cn.cslg.report.entity.asso.AssoReportFile;
|
|
|
|
import cn.cslg.report.entity.asso.AssoTaskPersonel;
|
|
import cn.cslg.report.entity.asso.AssoTaskPersonel;
|
|
import cn.cslg.report.entity.asso.SyneryCode;
|
|
import cn.cslg.report.entity.asso.SyneryCode;
|
|
import cn.cslg.report.entity.asso.Synery_CC;
|
|
import cn.cslg.report.entity.asso.Synery_CC;
|
|
@@ -25,18 +24,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
-import io.swagger.v3.oas.models.security.SecurityScheme;
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
-
|
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
import org.springframework.context.annotation.Lazy;
|
|
import org.springframework.context.annotation.Lazy;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
-import org.springframework.transaction.annotation.Isolation;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
-
|
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
@@ -166,7 +161,7 @@ public class TaskService extends ServiceImpl<TaskMapper, Task> {
|
|
//当查询未使用发起人名称时
|
|
//当查询未使用发起人名称时
|
|
if(taskVO.getCreateName()!=null&&taskVO.getCreateName()!=""){
|
|
if(taskVO.getCreateName()!=null&&taskVO.getCreateName()!=""){
|
|
String res =outInterfaceService.getPersonIdByNamePCS(taskVO.getCreateName());
|
|
String res =outInterfaceService.getPersonIdByNamePCS(taskVO.getCreateName());
|
|
- List<Integer> createIds = JSONArray.parseArray(res,Integer.class);
|
|
|
|
|
|
+ List<Integer> createIds = JSONArray.parseArray(res,Integer.class);
|
|
taskVO.setIds(createIds);
|
|
taskVO.setIds(createIds);
|
|
//当未查询到时直接返回空页
|
|
//当未查询到时直接返回空页
|
|
if(createIds==null||createIds.size()==0){
|
|
if(createIds==null||createIds.size()==0){
|
|
@@ -174,9 +169,9 @@ public class TaskService extends ServiceImpl<TaskMapper, Task> {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
dataPage = baseMapper.queryTasks(new Page<>(taskVO.getCurrent(), taskVO.getSize()), taskVO);
|
|
dataPage = baseMapper.queryTasks(new Page<>(taskVO.getCurrent(), taskVO.getSize()), taskVO);
|
|
- List<TaskReportVO> taskReportVOS = dataPage.getRecords();
|
|
|
|
- taskReportVOS =this.reTaskReportVOs(taskReportVOS);
|
|
|
|
- dataPage.setRecords(taskReportVOS);
|
|
|
|
|
|
+ List<TaskReportVO> taskReportVOS = dataPage.getRecords();
|
|
|
|
+ taskReportVOS =this.reTaskReportVOs(taskReportVOS);
|
|
|
|
+ dataPage.setRecords(taskReportVOS);
|
|
return dataPage;
|
|
return dataPage;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -630,50 +625,9 @@ public class TaskService extends ServiceImpl<TaskMapper, Task> {
|
|
PersonnelVO personnelVO = cacheUtils.getLoginUser(StpUtil.getLoginIdAsInt());
|
|
PersonnelVO personnelVO = cacheUtils.getLoginUser(StpUtil.getLoginIdAsInt());
|
|
LambdaQueryWrapper<Task> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
LambdaQueryWrapper<Task> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
lambdaQueryWrapper.eq(Task::getReportId, taskVO.getReportId());
|
|
lambdaQueryWrapper.eq(Task::getReportId, taskVO.getReportId());
|
|
- List<Task> list = this.list(lambdaQueryWrapper);
|
|
|
|
- List<Task> list1 = new ArrayList<>();
|
|
|
|
- List<Integer> collect = list.stream().map(Task::getCreateID).collect(Collectors.toList());
|
|
|
|
- if (collect.get(0).equals(personnelVO.getId())) {
|
|
|
|
- //负责人可以查看所有的
|
|
|
|
- LambdaQueryWrapper<Task> lambdaQueryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
|
- //分页
|
|
|
|
- lambdaQueryWrapper1.eq(Task::getCreateID, personnelVO.getId())
|
|
|
|
- .eq(Task::getReportId, taskVO.getReportId());
|
|
|
|
- if (taskVO.getTaskName() != null) {
|
|
|
|
- lambdaQueryWrapper1.like(Task::getTaskName, taskVO.getTaskName());
|
|
|
|
- }
|
|
|
|
- if (taskVO.getHandlePersonName() != null) {
|
|
|
|
- lambdaQueryWrapper1.like(Task::getHandlePersonName, taskVO.getHandlePersonName());
|
|
|
|
- }
|
|
|
|
- if (taskVO.getTaskStatus() != null) {
|
|
|
|
- lambdaQueryWrapper1.eq(Task::getTaskStatus, taskVO.getTaskStatus());
|
|
|
|
- }
|
|
|
|
- if (taskVO.getType() != null) {
|
|
|
|
- lambdaQueryWrapper1.eq(Task::getType, taskVO.getType());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (taskVO.getCurrent() != null && taskVO.getSize() != null) {
|
|
|
|
- List<Task> records = this.page(new Page<>(taskVO.getCurrent(), taskVO.getSize()), lambdaQueryWrapper1).getRecords();
|
|
|
|
- records =this.reTasks(records);
|
|
|
|
- Long count = this.count(lambdaQueryWrapper1);
|
|
|
|
- return Response.success(records, DataUtils.setPageColumn(taskVO.getSize(), taskVO.getCurrent(), Math.toIntExact(count)));
|
|
|
|
- }
|
|
|
|
- return Response.success(lambdaQueryWrapper1);
|
|
|
|
- } else {
|
|
|
|
- //被分配人可以查看自己的任务
|
|
|
|
- LambdaQueryWrapper<Task> lambdaQueryWrapper1 = new LambdaQueryWrapper<>();
|
|
|
|
- lambdaQueryWrapper1.eq(Task::getHandlePersonId, personnelVO.getId())
|
|
|
|
- .eq(Task::getReportId, taskVO.getReportId());
|
|
|
|
- if (taskVO.getCurrent() != null && taskVO.getSize() != null) {
|
|
|
|
- //分页
|
|
|
|
- List<Task> records = this.page(new Page<>(taskVO.getCurrent(), taskVO.getSize()), lambdaQueryWrapper1).getRecords();
|
|
|
|
- records =this.reTasks(records);
|
|
|
|
- Long count = this.count(lambdaQueryWrapper1);
|
|
|
|
- return Response.success(records, DataUtils.setPageColumn(taskVO.getSize(), taskVO.getCurrent(), Math.toIntExact(count)));
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
- return Response.success(this.list(lambdaQueryWrapper1));
|
|
|
|
- }
|
|
|
|
|
|
+ List<Task> records = this.page(new Page<>(taskVO.getCurrent(), taskVO.getSize()), lambdaQueryWrapper).getRecords();
|
|
|
|
+ Long count = this.count(lambdaQueryWrapper);
|
|
|
|
+ return Response.success(records, DataUtils.setPageColumn(taskVO.getSize(), taskVO.getCurrent(), Math.toIntExact(count)));
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|