|
|
@@ -30,7 +30,10 @@ import lombok.AllArgsConstructor;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import java.util.Objects;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@@ -115,9 +118,20 @@ public class WfSubscriptionServiceImpl extends MPJBaseServiceImpl<WfSubscription
|
|
|
@Override
|
|
|
public Page<WfSubscriptionPageVo> getPage(Page<WfSubscriptionPageVo> page, WfSubscriptionPageDto dto) {
|
|
|
Page<WfSubscriptionPageVo> voPage = wfSubscriptionMapper.getPage(page, dto);
|
|
|
+ List<WfSubscriptionList> wfSubscriptionList = wfSubscriptionListMapper.selectList(
|
|
|
+ new QueryWrapper<WfSubscriptionList>().lambda().orderByAsc(WfSubscriptionList::getId)
|
|
|
+ );
|
|
|
+ Map<Long, String> flowMap = new HashMap<>();
|
|
|
+ for (WfSubscriptionList subscriptionList : wfSubscriptionList) {
|
|
|
+ if(flowMap.containsKey(subscriptionList.getParentId())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ flowMap.put(subscriptionList.getParentId(), subscriptionList.getNameOfThePurchasedItem());
|
|
|
+ }
|
|
|
for (WfSubscriptionPageVo record : voPage.getRecords()) {
|
|
|
List<File> list = fileService.list(Wrappers.lambdaQuery(File.class).eq(File::getFolderId, record.getFolderId()));
|
|
|
record.setFileInfos(list);
|
|
|
+ record.setFlowName(flowMap.get(Long.valueOf(record.getId())));
|
|
|
}
|
|
|
return voPage;
|
|
|
}
|
|
|
@@ -125,6 +139,10 @@ public class WfSubscriptionServiceImpl extends MPJBaseServiceImpl<WfSubscription
|
|
|
@Override
|
|
|
public WfSubscriptionListInfoVo getSubscriptionList(Long id) {
|
|
|
WfSubscriptionListInfoVo info = wfSubscriptionMapper.getInfoById(id);
|
|
|
+
|
|
|
+ List<File> list = fileService.list(Wrappers.lambdaQuery(File.class).eq(File::getFolderId, info.getFolderId()));
|
|
|
+ info.setFileInfos(list);
|
|
|
+
|
|
|
List<WfSubscriptionList> subscriptionListList = wfSubscriptionListMapper.selectList(
|
|
|
new QueryWrapper<WfSubscriptionList>().lambda().eq(WfSubscriptionList::getParentId, id)
|
|
|
);
|
|
|
@@ -143,7 +161,6 @@ public class WfSubscriptionServiceImpl extends MPJBaseServiceImpl<WfSubscription
|
|
|
info.setProcessId(relations.get(0).getProcessId());
|
|
|
}
|
|
|
|
|
|
-
|
|
|
//查询最后一个节点的taskId
|
|
|
List<WorkflowExtra> taskList = workflowExtraMapper.selectList(
|
|
|
new QueryWrapper<WorkflowExtra>().lambda()
|
|
|
@@ -159,6 +176,23 @@ public class WfSubscriptionServiceImpl extends MPJBaseServiceImpl<WfSubscription
|
|
|
|
|
|
@Override
|
|
|
public List<WfSubscriptionExcelVo> getList(WfSubscriptionPageDto dto) {
|
|
|
- return wfSubscriptionMapper.getList(dto);
|
|
|
+ List<WfSubscriptionList> wfSubscriptionList = wfSubscriptionListMapper.selectList(
|
|
|
+ new QueryWrapper<WfSubscriptionList>().lambda().orderByAsc(WfSubscriptionList::getId)
|
|
|
+ );
|
|
|
+ Map<Long, String> flowMap = new HashMap<>();
|
|
|
+ for (WfSubscriptionList subscriptionList : wfSubscriptionList) {
|
|
|
+ if(flowMap.containsKey(subscriptionList.getParentId())){
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ flowMap.put(subscriptionList.getParentId(), subscriptionList.getNameOfThePurchasedItem());
|
|
|
+ }
|
|
|
+ List<WfSubscription> list = wfSubscriptionMapper.getList(dto);
|
|
|
+ List<WfSubscriptionExcelVo> result = new ArrayList<>();
|
|
|
+ for (WfSubscription record : list) {
|
|
|
+ WfSubscriptionExcelVo excelVo = BeanUtil.toBean(record, WfSubscriptionExcelVo.class);
|
|
|
+ excelVo.setFlowName(flowMap.get(record.getId()));
|
|
|
+ result.add(excelVo);
|
|
|
+ }
|
|
|
+ return result;
|
|
|
}
|
|
|
}
|