|
|
@@ -8,6 +8,7 @@ import cn.hutool.core.collection.CollUtil; |
|
|
|
import cn.hutool.core.map.MapUtil; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Assert; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.google.common.collect.Lists; |
|
|
@@ -78,7 +79,6 @@ import com.ningdatech.basic.util.StrPool; |
|
|
|
import com.ningdatech.file.entity.File; |
|
|
|
import com.ningdatech.file.entity.vo.result.FileResultVO; |
|
|
|
import com.ningdatech.file.service.FileService; |
|
|
|
import com.sun.org.apache.xpath.internal.operations.Bool; |
|
|
|
import com.wflow.contants.HisProInsEndActId; |
|
|
|
import com.wflow.contants.ProcessConstant; |
|
|
|
import com.wflow.exception.BusinessException; |
|
|
@@ -152,9 +152,7 @@ public class TodoCenterManage { |
|
|
|
private final IRegionService regionService; |
|
|
|
private final ITodoService todoService; |
|
|
|
private final IPurchaseInstService purchaseInstService; |
|
|
|
|
|
|
|
private final IXinchuangService xinchuangService; |
|
|
|
|
|
|
|
private final IXinchuangInstService xinchuangInstService; |
|
|
|
|
|
|
|
/** |
|
|
@@ -224,21 +222,15 @@ public class TodoCenterManage { |
|
|
|
return PageVo.empty(); |
|
|
|
} |
|
|
|
|
|
|
|
List<ProcessTaskVo> userTodoList = list.stream() |
|
|
|
.skip((long) (pageNumber - 1) * pageSize) |
|
|
|
.limit(pageSize) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
|
|
|
|
List<ProcessTaskVo> userTodoList = CollUtils.page(list, pageNumber, pageSize); |
|
|
|
Set<String> processSet = Sets.newHashSet(); |
|
|
|
Map<String, ProcessTaskVo> taskMap = userTodoList.stream() |
|
|
|
.sorted((t1, t2) -> t2.getTaskCreateTime().compareTo(t1.getTaskCreateTime())) |
|
|
|
.collect(Collectors.toList()).stream() |
|
|
|
.filter(v -> processSet.add(v.getNodeId())) |
|
|
|
.collect(Collectors.toMap(ProcessTaskVo::getNodeId, v -> v)); |
|
|
|
List<String> instanceIds = CollUtils.fieldList(userTodoList, ProcessTaskVo::getInstanceId); |
|
|
|
List<PurchaseInst> purchaseInstList = purchaseInstService.listByInstCodes(instanceIds); |
|
|
|
Map<String, Long> purchaseInstMap = CollUtils.listToMap(purchaseInstList, |
|
|
|
PurchaseInst::getInstCode, PurchaseInst::getBidId); |
|
|
|
List<String> instCodes = CollUtils.fieldList(userTodoList, ProcessTaskVo::getInstanceId); |
|
|
|
Map<String, Long> purchaseInstMap = listInstCodeBidIdMap(instCodes); |
|
|
|
|
|
|
|
List<ResToBeProcessedVO> resVos = userTodoList.stream().map(d -> { |
|
|
|
Project projectInfo = projectInfoMap.get(d.getInstanceId()); |
|
|
@@ -262,6 +254,14 @@ public class TodoCenterManage { |
|
|
|
return PageVo.of(resVos, list.size()); |
|
|
|
} |
|
|
|
|
|
|
|
private Map<String, Long> listInstCodeBidIdMap(List<String> instanceIds) { |
|
|
|
Wrapper<PurchaseInst> query = Wrappers.lambdaQuery(PurchaseInst.class) |
|
|
|
.select(PurchaseInst::getInstCode, PurchaseInst::getBidId) |
|
|
|
.in(PurchaseInst::getInstCode, instanceIds); |
|
|
|
List<PurchaseInst> instList = purchaseInstService.list(query); |
|
|
|
return CollUtils.listToMap(instList, PurchaseInst::getInstCode, PurchaseInst::getBidId); |
|
|
|
} |
|
|
|
|
|
|
|
public PageVo<ResToBeProcessedVO> todoXinchuangList(ToBeProcessedReq param) { |
|
|
|
Long userId = Optional.ofNullable(param.getUserId()).orElseGet(LoginUserUtil::getUserId); |
|
|
|
String userIdStr = String.valueOf(userId); |
|
|
@@ -324,7 +324,6 @@ public class TodoCenterManage { |
|
|
|
.collect(Collectors.toList()).stream() |
|
|
|
.filter(v -> processSet.add(v.getNodeId())) |
|
|
|
.collect(Collectors.toMap(ProcessTaskVo::getNodeId, v -> v)); |
|
|
|
List<String> instanceIds = CollUtils.fieldList(userTodoList, ProcessTaskVo::getInstanceId); |
|
|
|
|
|
|
|
List<ResToBeProcessedVO> resVos = userTodoList.stream().map(d -> { |
|
|
|
XinchuangInst xinchuangInst = xinchuangInstMap.get(d.getInstanceId()); |
|
|
@@ -413,20 +412,22 @@ public class TodoCenterManage { |
|
|
|
.forEach(userTodoList::add); |
|
|
|
} |
|
|
|
ExcelExportWriter excelExportWriter = new ExcelExportWriter(); |
|
|
|
String fileName = null; |
|
|
|
if (IsAppendProjectEnum.APPEND_PROJECT.getCode().equals(param.getIsTemporaryAugment())) { |
|
|
|
String fileName; |
|
|
|
if (IsAppendProjectEnum.APPEND_PROJECT.eq(param.getIsTemporaryAugment())) { |
|
|
|
fileName = "待办中心_待我处理_增补项目列表"; |
|
|
|
} else if (IsAppendProjectEnum.NOT_APPEND_PROJECT.getCode().equals(param.getIsTemporaryAugment())) { |
|
|
|
} else if (IsAppendProjectEnum.NOT_APPEND_PROJECT.eq(param.getIsTemporaryAugment())) { |
|
|
|
fileName = "待办中心_待我处理_非增补项目列表"; |
|
|
|
} else { |
|
|
|
fileName = "待办中心_待我处理_全部项目列表"; |
|
|
|
} |
|
|
|
excelExportWriter.setFileName(fileName); |
|
|
|
List<String> sheetsNames = Lists.newArrayList(fileName); |
|
|
|
List<List<String>> exportDatas = ExcelDownUtil.getTaskExportDatas(param.getExportOptionList(), userTodoList, projectInfoMap); |
|
|
|
List<List<String>> exportDataList = ExcelDownUtil.getTaskExportDatas(param.getExportOptionList(), userTodoList, projectInfoMap); |
|
|
|
// sheet列表集合 |
|
|
|
List<List<List<String>>> sheets = Lists.newArrayList(); |
|
|
|
sheets.add(exportDatas); |
|
|
|
sheets.add(exportDataList); |
|
|
|
excelExportWriter.setHeads(sheets); |
|
|
|
excelExportWriter.setDatas(exportDatas); |
|
|
|
excelExportWriter.setDatas(exportDataList); |
|
|
|
excelExportWriter.setSheets(sheetsNames); |
|
|
|
excelExportWriter.setHeadPropertyClass(List.class); |
|
|
|
excelExportWriter.setHeadPropertyFlag(Boolean.FALSE); |
|
|
@@ -714,7 +715,8 @@ public class TodoCenterManage { |
|
|
|
//转码 |
|
|
|
byte[] b = Base64Decoder.decode(signPdf); |
|
|
|
for (int i = 0; i < b.length; ++i) { |
|
|
|
if (b[i] < 0) {//调整异常数据 |
|
|
|
if (b[i] < 0) { |
|
|
|
//调整异常数据 |
|
|
|
b[i] += 256; |
|
|
|
} |
|
|
|
} |
|
|
@@ -916,8 +918,7 @@ public class TodoCenterManage { |
|
|
|
.filter(p -> StringUtils.isNotBlank(p.getInstCode()) && |
|
|
|
!Declared.NULL_INST_CODE.equals(p.getInstCode())) |
|
|
|
.collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId()))); |
|
|
|
List<String> instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList()); |
|
|
|
|
|
|
|
List<String> instCodes = CollUtils.fieldList(projectInstList, ProjectInst::getInstCode); |
|
|
|
// 查出用户工作流 |
|
|
|
TodoCenterListReqDTO req = new TodoCenterListReqDTO(); |
|
|
|
Integer pageNumber = param.getPageNumber(); |
|
|
@@ -930,14 +931,9 @@ public class TodoCenterManage { |
|
|
|
if (CollUtil.isEmpty(iDoList)) { |
|
|
|
return PageVo.empty(); |
|
|
|
} |
|
|
|
List<ProcessTaskVo> userIdoList = iDoList.stream() |
|
|
|
.skip((long) (pageNumber - 1) * pageSize) |
|
|
|
.limit(pageSize) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
List<String> instanceIds = CollUtils.fieldList(userIdoList, ProcessTaskVo::getInstanceId); |
|
|
|
List<PurchaseInst> purchaseInstList = purchaseInstService.listByInstCodes(instanceIds); |
|
|
|
Map<String, Long> purchaseInstMap = CollUtils.listToMap(purchaseInstList, |
|
|
|
PurchaseInst::getInstCode, PurchaseInst::getBidId); |
|
|
|
List<ProcessTaskVo> userIdoList = CollUtils.page(iDoList, pageNumber, pageSize); |
|
|
|
List<String> currPageInstCodes = CollUtils.fieldList(userIdoList, ProcessTaskVo::getInstanceId); |
|
|
|
Map<String, Long> purchaseInstMap = listInstCodeBidIdMap(currPageInstCodes); |
|
|
|
List<ResToBeProcessedVO> resVos = userIdoList.stream().map(d -> { |
|
|
|
ResToBeProcessedVO res = new ResToBeProcessedVO(); |
|
|
|
Project projectInfo = projectInfoMap.get(d.getInstanceId()); |
|
|
|