|
|
@ -2,6 +2,8 @@ package org.dromara.productManagement.service.impl; |
|
|
|
|
|
|
|
import cn.dev33.satoken.stp.StpUtil; |
|
|
|
import cn.hutool.core.io.FileUtil; |
|
|
|
import cn.hutool.core.lang.UUID; |
|
|
|
import cn.hutool.core.util.IdUtil; |
|
|
|
import okhttp3.*; |
|
|
|
import org.dromara.common.core.domain.R; |
|
|
|
import org.dromara.common.core.service.DictService; |
|
|
@ -17,9 +19,7 @@ import lombok.RequiredArgsConstructor; |
|
|
|
import org.dromara.common.oss.core.OssClient; |
|
|
|
import org.dromara.common.oss.factory.OssFactory; |
|
|
|
import org.dromara.common.satoken.utils.LoginHelper; |
|
|
|
import org.dromara.productManagement.domain.DocumentTasksPermissionsDetail; |
|
|
|
import org.dromara.productManagement.domain.ModelPrompts; |
|
|
|
import org.dromara.productManagement.domain.ModelUserPromptssetting; |
|
|
|
import org.dromara.productManagement.domain.*; |
|
|
|
import org.dromara.productManagement.domain.vo.DocumentTasksPermissionsDetailVo; |
|
|
|
import org.dromara.productManagement.domain.vo.DocumentTasksPermissionsVo; |
|
|
|
import org.dromara.productManagement.mapper.*; |
|
|
@ -35,7 +35,6 @@ import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.dromara.productManagement.domain.bo.DocumentTasksBo; |
|
|
|
import org.dromara.productManagement.domain.vo.DocumentTasksVo; |
|
|
|
import org.dromara.productManagement.domain.DocumentTasks; |
|
|
|
import org.dromara.productManagement.service.IDocumentTasksService; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
@ -102,21 +101,36 @@ public class DocumentTasksServiceImpl implements IDocumentTasksService { |
|
|
|
* @return 文档任务分页列表 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public TableDataInfo<DocumentTasksVo> queryPageList(DocumentTasksBo bo, PageQuery pageQuery) { |
|
|
|
public TableDataInfo<DocumentTaskGroup> queryPageList(DocumentTasksBo bo, PageQuery pageQuery) { |
|
|
|
|
|
|
|
LambdaQueryWrapper<DocumentTasks> lqw = buildQueryWrapper(bo); |
|
|
|
Page<DocumentTasksVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); |
|
|
|
result.getRecords().forEach(vo -> { |
|
|
|
Integer pageSize = pageQuery.getPageSize(); |
|
|
|
if(pageSize != 5){ |
|
|
|
//增加lwd中的一个条件
|
|
|
|
List<String> taskNames = bo.getTaskNameList(); |
|
|
|
if(taskNames == null ||!taskNames.contains("contractReview")){ |
|
|
|
lqw.ne(DocumentTasks::getTaskName,"contractReview"); |
|
|
|
} |
|
|
|
} |
|
|
|
Page<DocumentTaskGroup> documentTaskGroupPage = baseMapper.selectDocumentTaskGroups(pageQuery.build(), lqw); |
|
|
|
documentTaskGroupPage.getRecords().forEach(vo -> { |
|
|
|
Long createBy = vo.getCreateBy(); |
|
|
|
vo.setCreateUser(userService.selectUserById(createBy).getNickName()); |
|
|
|
//计算updateTime 和 createTime之间相差的小时数
|
|
|
|
// 格式化输出
|
|
|
|
String formattedDuration=""; |
|
|
|
if(!vo.getProgressStatus().equals("PENDING")&&!vo.getProgressStatus().equals("STARTED")){ |
|
|
|
formattedDuration= MyTimeUtils.formatTimeDifference(vo.getCreateTime(), vo.getUpdateTime()); |
|
|
|
} |
|
|
|
vo.setTaskDuration(formattedDuration); |
|
|
|
}); |
|
|
|
return TableDataInfo.build(result); |
|
|
|
return TableDataInfo.build(documentTaskGroupPage); |
|
|
|
// Page<DocumentTasksVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
|
|
|
// result.getRecords().forEach(vo -> {
|
|
|
|
// Long createBy = vo.getCreateBy();
|
|
|
|
// vo.setCreateUser(userService.selectUserById(createBy).getNickName());
|
|
|
|
// //计算updateTime 和 createTime之间相差的小时数
|
|
|
|
// // 格式化输出
|
|
|
|
// String formattedDuration="";
|
|
|
|
// if(!vo.getProgressStatus().equals("PENDING")&&!vo.getProgressStatus().equals("STARTED")){
|
|
|
|
// formattedDuration= MyTimeUtils.formatTimeDifference(vo.getCreateTime(), vo.getUpdateTime());
|
|
|
|
// }
|
|
|
|
// vo.setTaskDuration(formattedDuration);
|
|
|
|
// });
|
|
|
|
// return TableDataInfo.build(result);
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
@ -145,9 +159,12 @@ public class DocumentTasksServiceImpl implements IDocumentTasksService { |
|
|
|
lqw.like(StringUtils.isNotBlank(bo.getDocumentName()), DocumentTasks::getDocumentName, bo.getDocumentName()); |
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getProgressStatus()), DocumentTasks::getProgressStatus, bo.getProgressStatus()); |
|
|
|
lqw.orderByDesc(DocumentTasks::getCreateTime); |
|
|
|
if(taskNames == null ||!taskNames.contains("contractReview")){ |
|
|
|
lqw.ne(DocumentTasks::getTaskName,"contractReview"); |
|
|
|
} |
|
|
|
//分组,作为父项
|
|
|
|
lqw.groupBy(DocumentTasks::getDocumentName, |
|
|
|
DocumentTasks::getCreateBy, |
|
|
|
DocumentTasks::getTaskIndustry, |
|
|
|
DocumentTasks::getTaskRegion, |
|
|
|
DocumentTasks::getCreateTime); |
|
|
|
return lqw; |
|
|
|
} |
|
|
|
|
|
|
|