|
@@ -3,11 +3,11 @@ package com.management.platform.controller;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.management.platform.entity.*;
|
|
|
import com.management.platform.mapper.*;
|
|
|
import com.management.platform.service.CompanyDingdingService;
|
|
|
import com.management.platform.service.ProjectDocumentService;
|
|
|
+import com.management.platform.service.TaskFilesService;
|
|
|
import com.management.platform.service.WxCorpInfoService;
|
|
|
import com.management.platform.task.SFTPAsyncUploader;
|
|
|
import com.management.platform.util.DocumentTypeUtil;
|
|
@@ -18,6 +18,7 @@ import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
@@ -29,8 +30,8 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
import java.time.LocalDateTime;
|
|
|
-import java.util.List;
|
|
|
-import java.util.UUID;
|
|
|
+import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -75,6 +76,154 @@ public class TaskFilesController {
|
|
|
@Resource
|
|
|
private CompanyDingdingService companyDingdingService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private DepartmentMapper departmentMapper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private ProjectMapper projectMapper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private TaskFilesService taskFilesService;
|
|
|
+
|
|
|
+ @PostMapping("/reUploadFile")
|
|
|
+ public HttpRespMsg reUploadFile(@RequestParam Integer projectId,
|
|
|
+ @RequestParam Integer taskId,
|
|
|
+ @RequestParam Integer taskFileId,
|
|
|
+ @RequestParam("file") MultipartFile file,
|
|
|
+ HttpServletRequest request) {
|
|
|
+ HttpRespMsg msg = new HttpRespMsg();
|
|
|
+ User user = userMapper.selectById(request.getHeader("Token"));
|
|
|
+ TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
|
|
|
+ Department department = departmentMapper.selectById(user.getDepartmentId());
|
|
|
+ Project project = projectMapper.selectById(projectId);
|
|
|
+ TaskFiles oldTaskFile = taskFilesMapper.selectById(taskFileId);
|
|
|
+
|
|
|
+ if(!oldTaskFile.getCreatorId().equals(user.getId())){
|
|
|
+ msg.setError("您非文件上传人,无法重新上传");
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ if (oldTaskFile.getDocumentId() == null) {
|
|
|
+ //仅当前任务上传的,需要把文件删掉
|
|
|
+ File dir = new File(uploadPath);
|
|
|
+ File targetFile = new File(dir, oldTaskFile.getServerName());
|
|
|
+ if (targetFile.exists()) {
|
|
|
+ targetFile.delete();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+// StringBuilder fileNames = new StringBuilder();
|
|
|
+ TaskFiles record = new TaskFiles();
|
|
|
+ record.setId(taskFileId);
|
|
|
+ record.setCreatorId(user.getId());
|
|
|
+ record.setCreatorName(user.getName());
|
|
|
+ record.setDocumentName(file.getOriginalFilename());
|
|
|
+ record.setTaskId(taskId);
|
|
|
+ record.setProjectId(projectId);
|
|
|
+ if(1 == timeType.getTaskFileCharge()){
|
|
|
+ record.setNeedFileCharge(1);
|
|
|
+ if(org.apache.commons.lang3.StringUtils.isBlank(department.getManagerId())){
|
|
|
+ msg.setError("员工所在部门无负责人,请重新设置");
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ if(org.apache.commons.lang3.StringUtils.isBlank(project.getInchargerId())){
|
|
|
+ msg.setError("该项目未设置项目经理,请重新设置");
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ record.setChargeOneId(department.getManagerId());
|
|
|
+ record.setChargeTwoId(project.getInchargerId());
|
|
|
+ //根据老阶段重置任务状态
|
|
|
+ record.setFinalChargeStatus(0);
|
|
|
+ if(1 == oldTaskFile.getChargeStage()){
|
|
|
+ record.setChargeOneStatus(0);
|
|
|
+ }else if(2 == oldTaskFile.getChargeStage()){
|
|
|
+ record.setChargeTwoStatus(0);
|
|
|
+ } else if (3 == oldTaskFile.getChargeStage()) {
|
|
|
+ record.setChargeStage(1);
|
|
|
+ record.setChargeOneStatus(0);
|
|
|
+ record.setChargeTwoStatus(0);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (file != null && !file.isEmpty()) {
|
|
|
+ //截取文件后缀
|
|
|
+ String fileSuffix = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
|
|
+ record.setDocumentType(DocumentTypeUtil.DocumentType(fileSuffix));
|
|
|
+ //处理文件
|
|
|
+ File dir = new File(uploadPath);
|
|
|
+ if (!dir.exists()) {
|
|
|
+ dir.mkdir();
|
|
|
+ }
|
|
|
+ String fileName= "";
|
|
|
+ if (file!=null && !file.isEmpty()) {
|
|
|
+ fileName = file.getOriginalFilename();
|
|
|
+
|
|
|
+ int pos = fileName.lastIndexOf(".");
|
|
|
+ String suffix = fileName.substring(pos).toLowerCase();
|
|
|
+ //用uuid替换原始的文件名
|
|
|
+ String purFName = UUID.randomUUID().toString().replaceAll("-", "");
|
|
|
+ fileName = purFName + suffix;
|
|
|
+ File saveFile = new File(dir, fileName);
|
|
|
+ try {
|
|
|
+ saveFile.createNewFile();
|
|
|
+ file.transferTo(saveFile);
|
|
|
+ //异步上传到备份服务器
|
|
|
+ sftpAsyncUploader.uploadFileAsync(saveFile);
|
|
|
+ //计算文件大小
|
|
|
+ long fileSize = saveFile.length();
|
|
|
+ String fileLength = FileUtil.getReadableFileSize(fileSize);
|
|
|
+ record.setServerName(uploadPath + fileName);
|
|
|
+ record.setSize(fileLength);
|
|
|
+ String pathPrefix = "/upload/";
|
|
|
+ record.setUrl(pathPrefix + fileName);
|
|
|
+
|
|
|
+ taskFilesMapper.updateById(record);
|
|
|
+ //生成原文件名称与服务器文件名称对应
|
|
|
+ msg.data = record;
|
|
|
+
|
|
|
+
|
|
|
+ //添加动态消息
|
|
|
+ Task task = taskMapper.selectById(taskId);
|
|
|
+ String content = user.getName()+"在任务【"+task.getName()+"】中重新上传了文件【"+file.getOriginalFilename()+"】";
|
|
|
+ TaskComment comment = new TaskComment();
|
|
|
+ comment.setTaskId(taskId);
|
|
|
+ comment.setUserId(user.getId());
|
|
|
+ comment.setContent(content);
|
|
|
+ comment.setCreateTime(LocalDateTime.now());
|
|
|
+ comment.setUserColor(user.getColor());
|
|
|
+ comment.setUserName(user.getName());
|
|
|
+ taskCommentMapper.insert(comment);
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ fileName = null;
|
|
|
+ msg.setError(e.getMessage()+", path="+dir.getAbsolutePath());
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ fileName = null;
|
|
|
+ msg.setError(e.getMessage()+", path="+dir.getAbsolutePath());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //msg.setError("文件不存在");
|
|
|
+ msg.setError(MessageUtils.message("file.nonExistentError"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return msg;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping("/approveFile")
|
|
|
+ public HttpRespMsg approveFile(@RequestParam("taskFileIds")String taskFileIds
|
|
|
+ ,HttpServletRequest request) {
|
|
|
+ return taskFilesService.approveFile(taskFileIds,request);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/rejectFile")
|
|
|
+ public HttpRespMsg rejectFile(@RequestParam("taskFileIds")String taskFileIds
|
|
|
+ ,@RequestParam(value = "reason",required = false)String reason
|
|
|
+ ,HttpServletRequest request) {
|
|
|
+ return taskFilesService.rejectFile(taskFileIds,reason,request);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取该项目下的所有有效的文件列表
|
|
|
* @param keyword
|
|
@@ -114,17 +263,32 @@ public class TaskFilesController {
|
|
|
record.setSize(document.getSize());
|
|
|
record.setServerName(document.getServerName());
|
|
|
record.setUrl(document.getUrl());
|
|
|
- taskFilesMapper.insert(record);
|
|
|
-
|
|
|
- //判断文件阶段做回退处理
|
|
|
TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
|
|
|
if(1 == timeType.getTaskFileCharge()){
|
|
|
- this.resetTaskChargeStatus(taskId);
|
|
|
+ record.setNeedFileCharge(1);
|
|
|
+ Department department = departmentMapper.selectById(user.getDepartmentId());
|
|
|
+ Project project = projectMapper.selectById(taskId);
|
|
|
+ if(org.apache.commons.lang3.StringUtils.isBlank(department.getManagerId())){
|
|
|
+ msg.setError("员工所在部门无负责人,请重新设置");
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ if(org.apache.commons.lang3.StringUtils.isBlank(project.getInchargerId())){
|
|
|
+ msg.setError("该项目未设置项目经理,请重新设置");
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ record.setChargeOneId(department.getManagerId());
|
|
|
+ record.setChargeTwoId(project.getInchargerId());
|
|
|
}
|
|
|
+ taskFilesMapper.insert(record);
|
|
|
+
|
|
|
+// //判断文件阶段做回退处理[修改为对文件,废弃]
|
|
|
+// if(1 == timeType.getTaskFileCharge()){
|
|
|
+// this.resetTaskChargeStatus(taskId);
|
|
|
+// }
|
|
|
|
|
|
//添加动态消息
|
|
|
Task task = taskMapper.selectById(taskId);
|
|
|
- String content = user.getName()+"在任务:"+task.getName()+"中关联了文件:"+document.getDocumentName();
|
|
|
+ String content = user.getName()+"在任务【"+task.getName()+"】中关联了文件【"+document.getDocumentName()+"】";
|
|
|
TaskComment comment = new TaskComment();
|
|
|
comment.setTaskId(taskId);
|
|
|
comment.setUserId(user.getId());
|
|
@@ -164,6 +328,9 @@ public class TaskFilesController {
|
|
|
HttpServletResponse response) throws Exception {
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
|
User user = userMapper.selectById(request.getHeader("Token"));
|
|
|
+ TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
|
|
|
+ Department department = departmentMapper.selectById(user.getDepartmentId());
|
|
|
+ Project project = projectMapper.selectById(projectId);
|
|
|
StringBuilder fileNames = new StringBuilder();
|
|
|
for (MultipartFile file : files) {
|
|
|
TaskFiles record = new TaskFiles();
|
|
@@ -173,6 +340,19 @@ public class TaskFilesController {
|
|
|
fileNames.append(file.getOriginalFilename()).append(",");
|
|
|
record.setTaskId(taskId);
|
|
|
record.setProjectId(projectId);
|
|
|
+ if(1 == timeType.getTaskFileCharge()){
|
|
|
+ record.setNeedFileCharge(1);
|
|
|
+ if(org.apache.commons.lang3.StringUtils.isBlank(department.getManagerId())){
|
|
|
+ msg.setError("员工所在部门无负责人,请重新设置");
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ if(org.apache.commons.lang3.StringUtils.isBlank(project.getInchargerId())){
|
|
|
+ msg.setError("该项目未设置项目经理,请重新设置");
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+ record.setChargeOneId(department.getManagerId());
|
|
|
+ record.setChargeTwoId(project.getInchargerId());
|
|
|
+ }
|
|
|
if (file != null && !file.isEmpty()) {
|
|
|
//截取文件后缀
|
|
|
String fileSuffix = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf("."));
|
|
@@ -244,16 +424,16 @@ public class TaskFilesController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //判断文件阶段做回退处理
|
|
|
- TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
|
|
|
- if(1 == timeType.getTaskFileCharge()){
|
|
|
- this.resetTaskChargeStatus(taskId);
|
|
|
- }
|
|
|
+ //判断文件阶段做回退处理[修改为对文件,废弃]
|
|
|
+// TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
|
|
|
+// if(1 == timeType.getTaskFileCharge()){
|
|
|
+// this.resetTaskChargeStatus(taskId);
|
|
|
+// }
|
|
|
|
|
|
//添加动态消息
|
|
|
String resFileNames = fileNames.deleteCharAt(fileNames.length() - 1).toString();
|
|
|
Task task = taskMapper.selectById(taskId);
|
|
|
- String content = user.getName()+"在任务:"+task.getName()+"中上传了文件:"+resFileNames;
|
|
|
+ String content = user.getName()+"在任务【"+task.getName()+"】中上传了文件【"+resFileNames+"】";
|
|
|
TaskComment comment = new TaskComment();
|
|
|
comment.setTaskId(taskId);
|
|
|
comment.setUserId(user.getId());
|
|
@@ -294,16 +474,15 @@ public class TaskFilesController {
|
|
|
}
|
|
|
taskFilesMapper.deleteById(id);
|
|
|
|
|
|
- //判断文件阶段做回退处理
|
|
|
-
|
|
|
- TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
|
|
|
- if(1 == timeType.getTaskFileCharge()){
|
|
|
- this.resetTaskChargeStatus(taskFiles.getTaskId());
|
|
|
- }
|
|
|
+ //判断文件阶段做回退处理[修改为对文件,废弃]
|
|
|
+// TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
|
|
|
+// if(1 == timeType.getTaskFileCharge()){
|
|
|
+// this.resetTaskChargeStatus(taskFiles.getTaskId());
|
|
|
+// }
|
|
|
|
|
|
//添加动态消息
|
|
|
Task task = taskMapper.selectById(taskFiles.getTaskId());
|
|
|
- String content = user.getName()+"删除了任务:"+task.getName()+"中的文件:"+taskFiles.getDocumentName();
|
|
|
+ String content = user.getName()+"删除了任务【"+task.getName()+"】中的文件【"+taskFiles.getDocumentName()+"】";
|
|
|
TaskComment comment = new TaskComment();
|
|
|
comment.setTaskId(taskFiles.getTaskId());
|
|
|
comment.setUserId(user.getId());
|
|
@@ -350,53 +529,72 @@ public class TaskFilesController {
|
|
|
@RequestMapping(value="getTaskFiles")
|
|
|
public HttpRespMsg getTaskFiles(Integer taskId,HttpServletRequest request) {
|
|
|
User user = userMapper.selectById(request.getHeader("Token"));
|
|
|
- Task task = taskMapper.selectById(taskId);
|
|
|
+// Task task = taskMapper.selectById(taskId);
|
|
|
TimeType timeType = timeTypeMapper.selectById(user.getCompanyId());
|
|
|
WxCorpInfo wxCorpInfo = wxCorpInfoMapper.selectOne(new QueryWrapper<WxCorpInfo>().eq("company_id",user.getCompanyId()));
|
|
|
CompanyDingding dingding = companyDingdingService.getOne(new LambdaQueryWrapper<CompanyDingding>().eq(CompanyDingding::getCompanyId, user.getCompanyId()));
|
|
|
- String fileChargeStatusText = "";
|
|
|
- int fileChargeStatus = 0;
|
|
|
- if(1 == timeType.getTaskFileCharge()){
|
|
|
- if(org.apache.commons.lang3.StringUtils.isNotBlank(task.getChargeOneId())
|
|
|
- &&org.apache.commons.lang3.StringUtils.isNotBlank(task.getChargeTwoId())){
|
|
|
- if(1 == task.getFinalChargeStatus()){
|
|
|
- fileChargeStatusText = "审核通过";
|
|
|
- fileChargeStatus = 1;
|
|
|
- } else if (0 == task.getFinalChargeStatus()) {
|
|
|
- String name = "";
|
|
|
- String statusText = "";
|
|
|
- String userWxId = "";
|
|
|
- int finalStatus = 1==task.getChargeStage()?task.getChargeOneStatus():task.getChargeTwoStatus();
|
|
|
- String userId = 1==task.getChargeStage()?task.getChargeOneId():task.getChargeTwoId();
|
|
|
- User chargeUser = userMapper.selectById(userId);
|
|
|
- if(null != chargeUser){
|
|
|
- if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
- userWxId = chargeUser.getCorpwxRealUserid();
|
|
|
- }else if(dingding!=null&&dingding.getContactNeedTranslate()==1){
|
|
|
- userWxId = chargeUser.getDingdingUserid();
|
|
|
- }
|
|
|
- name = chargeUser.getName();
|
|
|
- }
|
|
|
- switch (finalStatus)
|
|
|
- {
|
|
|
- case 0: statusText = "待审核";fileChargeStatus = 0;break;
|
|
|
- case 1: statusText = "通过";break;
|
|
|
- case 2: statusText = "驳回";fileChargeStatus = 2;break;
|
|
|
- }
|
|
|
- if(org.apache.commons.lang3.StringUtils.isBlank(userWxId)){
|
|
|
- fileChargeStatusText = statusText+"("+name+")";
|
|
|
- }else{
|
|
|
- fileChargeStatusText = statusText+"("+("$userName=" + userWxId + "$")+")";
|
|
|
- }
|
|
|
|
|
|
- }
|
|
|
+ //审核通过的 或者是老文件 所有人都能看到
|
|
|
+ //审核不通过的需要判断 登录人 是否是 文件上传人/审核人一、二中的一个 ,能则可以看到
|
|
|
+ List<TaskFiles> list = taskFilesMapper.getTaskFiles(taskId,user.getId());
|
|
|
+
|
|
|
+ List<String> allIds = new ArrayList<>();
|
|
|
+ List<String> chargeOneIds = list.stream().filter(t -> org.apache.commons.lang3.StringUtils.isNotBlank(t.getChargeOneId()))
|
|
|
+ .map(TaskFiles::getChargeOneId).collect(Collectors.toList());
|
|
|
+ List<String> chargeTwoIds = list.stream().filter(t -> org.apache.commons.lang3.StringUtils.isNotBlank(t.getChargeTwoId()))
|
|
|
+ .map(TaskFiles::getChargeTwoId).collect(Collectors.toList());
|
|
|
+ allIds.addAll(chargeOneIds);
|
|
|
+ allIds.addAll(chargeTwoIds);
|
|
|
+ Map<String,User> userIdMap = new HashMap<>();
|
|
|
+ if(CollectionUtils.isNotEmpty(allIds)){
|
|
|
+ List<User> users = userMapper.selectList(new LambdaQueryWrapper<User>().in(User::getId, allIds));
|
|
|
+ if(CollectionUtils.isNotEmpty(users)){
|
|
|
+ userIdMap = users.stream().collect(Collectors.toMap(User::getId,t->t));
|
|
|
}
|
|
|
}
|
|
|
- List<TaskFiles> list = taskFilesMapper.selectList(new LambdaQueryWrapper<TaskFiles>()
|
|
|
- .eq(TaskFiles::getTaskId,taskId)
|
|
|
- );
|
|
|
if(CollectionUtils.isNotEmpty(list)){
|
|
|
for (TaskFiles taskFiles : list) {
|
|
|
+ String fileChargeStatusText = "";
|
|
|
+ int fileChargeStatus = 0;
|
|
|
+ if(1 == timeType.getTaskFileCharge()){
|
|
|
+ if(0 == taskFiles.getNeedFileCharge()){
|
|
|
+ fileChargeStatusText = "无审核状态";
|
|
|
+ fileChargeStatus = 3;
|
|
|
+ }else{
|
|
|
+ if(1 == taskFiles.getFinalChargeStatus()){
|
|
|
+ fileChargeStatusText = "审核通过";
|
|
|
+ fileChargeStatus = 1;
|
|
|
+ } else if (0 == taskFiles.getFinalChargeStatus()) {
|
|
|
+ String name = "";
|
|
|
+ String statusText = "";
|
|
|
+ String userWxId = "";
|
|
|
+ int finalStatus = 1==taskFiles.getChargeStage()?taskFiles.getChargeOneStatus():taskFiles.getChargeTwoStatus();
|
|
|
+ String userId = 1==taskFiles.getChargeStage()?taskFiles.getChargeOneId():taskFiles.getChargeTwoId();
|
|
|
+ User chargeUser = userIdMap.get(userId);
|
|
|
+ if(null != chargeUser){
|
|
|
+ if(wxCorpInfo!=null&&wxCorpInfo.getSaasSyncContact()==1){
|
|
|
+ userWxId = chargeUser.getCorpwxRealUserid();
|
|
|
+ }else if(dingding!=null&&dingding.getContactNeedTranslate()==1){
|
|
|
+ userWxId = chargeUser.getDingdingUserid();
|
|
|
+ }
|
|
|
+ name = chargeUser.getName();
|
|
|
+ }
|
|
|
+ switch (finalStatus)
|
|
|
+ {
|
|
|
+ case 0: statusText = "待审核";fileChargeStatus = 0;break;
|
|
|
+ case 1: statusText = "通过";break;
|
|
|
+ case 2: statusText = "驳回";fileChargeStatus = 2;break;
|
|
|
+ }
|
|
|
+ if(org.apache.commons.lang3.StringUtils.isBlank(userWxId)){
|
|
|
+ fileChargeStatusText = statusText+"("+name+")";
|
|
|
+ }else{
|
|
|
+ fileChargeStatusText = statusText+"("+("$userName=" + userWxId + "$")+")";
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
taskFiles.setFileChargeStatusText(fileChargeStatusText);
|
|
|
taskFiles.setFileChargeStatus(fileChargeStatus);
|
|
|
}
|
|
@@ -407,47 +605,53 @@ public class TaskFilesController {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void resetTaskChargeStatus(Integer taskId){
|
|
|
- Task task = taskMapper.selectById(taskId);
|
|
|
- if(1 == task.getFinalChargeStatus()){
|
|
|
- //重置阶段一、二的时间、状态、理由
|
|
|
- //重置 文件审核阶段为 1 阶段一 最终审核状态为 0未通过
|
|
|
- taskMapper.update(null,new LambdaUpdateWrapper<Task>()
|
|
|
- .set(Task::getFinalChargeStatus, 0)
|
|
|
- .set(Task::getChargeStage,1)
|
|
|
- .set(Task::getChargeOneStatus,0)
|
|
|
- .set(Task::getChargeTwoStatus,0)
|
|
|
- .set(Task::getChargeOneTime,null)
|
|
|
- .set(Task::getChargeTwoTime,null)
|
|
|
- .set(Task::getFileRejectReason,null)
|
|
|
-// .set(Task::getChargeOneReason,null)
|
|
|
-// .set(Task::getChargeTwoReason,null)
|
|
|
- .eq(Task::getId,task.getId())
|
|
|
- );
|
|
|
- } else if (0 == task.getFinalChargeStatus()) {
|
|
|
- //判断当前阶段
|
|
|
- if(1==task.getChargeStage()){
|
|
|
- //重置阶段一的时间、状态、理由
|
|
|
- taskMapper.update(null,new LambdaUpdateWrapper<Task>()
|
|
|
- .set(Task::getChargeOneStatus,0)
|
|
|
- .set(Task::getChargeOneTime,null)
|
|
|
- .set(Task::getFileRejectReason,null)
|
|
|
- .eq(Task::getId,task.getId())
|
|
|
- );
|
|
|
- } else if (2 == task.getChargeStage()) {
|
|
|
- //重置阶段二的时间、状态、理由
|
|
|
- taskMapper.update(null,new LambdaUpdateWrapper<Task>()
|
|
|
- .set(Task::getChargeStage,1)
|
|
|
- .set(Task::getChargeOneStatus,0)
|
|
|
- .set(Task::getChargeOneTime,null)
|
|
|
- .set(Task::getChargeTwoStatus,0)
|
|
|
- .set(Task::getChargeTwoTime,null)
|
|
|
- .set(Task::getFileRejectReason,null)
|
|
|
- .eq(Task::getId,task.getId())
|
|
|
- );
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
+ @RequestMapping(value = "/getUnChargedFilesByTaskId")
|
|
|
+ public HttpRespMsg getUnChargedFilesByTaskId(Integer taskId,HttpServletRequest request){
|
|
|
+ return taskFilesService.getUnChargedFilesByTaskId(taskId,request);
|
|
|
}
|
|
|
|
|
|
+// public void resetTaskChargeStatus(Integer taskId){
|
|
|
+// Task task = taskMapper.selectById(taskId);
|
|
|
+// if(1 == task.getFinalChargeStatus()){
|
|
|
+// //重置阶段一、二的时间、状态、理由
|
|
|
+// //重置 文件审核阶段为 1 阶段一 最终审核状态为 0未通过
|
|
|
+// taskMapper.update(null,new LambdaUpdateWrapper<Task>()
|
|
|
+// .set(Task::getFinalChargeStatus, 0)
|
|
|
+// .set(Task::getChargeStage,1)
|
|
|
+// .set(Task::getChargeOneStatus,0)
|
|
|
+// .set(Task::getChargeTwoStatus,0)
|
|
|
+// .set(Task::getChargeOneTime,null)
|
|
|
+// .set(Task::getChargeTwoTime,null)
|
|
|
+// .set(Task::getFileRejectReason,null)
|
|
|
+//// .set(Task::getChargeOneReason,null)
|
|
|
+//// .set(Task::getChargeTwoReason,null)
|
|
|
+// .eq(Task::getId,task.getId())
|
|
|
+// );
|
|
|
+// } else if (0 == task.getFinalChargeStatus()) {
|
|
|
+// //判断当前阶段
|
|
|
+// if(1==task.getChargeStage()){
|
|
|
+// //重置阶段一的时间、状态、理由
|
|
|
+// taskMapper.update(null,new LambdaUpdateWrapper<Task>()
|
|
|
+// .set(Task::getChargeOneStatus,0)
|
|
|
+// .set(Task::getChargeOneTime,null)
|
|
|
+// .set(Task::getFileRejectReason,null)
|
|
|
+// .eq(Task::getId,task.getId())
|
|
|
+// );
|
|
|
+// } else if (2 == task.getChargeStage()) {
|
|
|
+// //重置阶段二的时间、状态、理由
|
|
|
+// taskMapper.update(null,new LambdaUpdateWrapper<Task>()
|
|
|
+// .set(Task::getChargeStage,1)
|
|
|
+// .set(Task::getChargeOneStatus,0)
|
|
|
+// .set(Task::getChargeOneTime,null)
|
|
|
+// .set(Task::getChargeTwoStatus,0)
|
|
|
+// .set(Task::getChargeTwoTime,null)
|
|
|
+// .set(Task::getFileRejectReason,null)
|
|
|
+// .eq(Task::getId,task.getId())
|
|
|
+// );
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
}
|
|
|
|