Commit 436c4543 by 赵剑炜

优化部分代码

parent d0fa519d
......@@ -363,9 +363,6 @@ public class TjServiceImpl implements TjService {
// 等待所有 CompletableFuture 完成
allOf.join();
tjOrgPriceDtoList = futures.stream()
.map(CompletableFuture::join)
.collect(Collectors.toList());
if (req.getOrgId()!=1369509498032808905L){
//获取本级数据
......@@ -441,7 +438,7 @@ public class TjServiceImpl implements TjService {
finalTjOrgPriceDto.setEndPrice(BigDecimal.ZERO);
finalTjOrgPriceDto.setDestoryPrice(BigDecimal.ZERO);
List<String> orgList= inventorySummaryMapper.getTotalData(String.valueOf(req.getOrgId()));
List<TjOrgPriceDto> tjOrgPriceDtoList=new ArrayList<>();
//根据条件查询财务汇总表
List<CompletableFuture<TjOrgPriceDto>> futures = orgList.stream()
.map(orgId -> CompletableFuture.supplyAsync(() ->
......@@ -453,7 +450,9 @@ public class TjServiceImpl implements TjService {
// 等待所有 CompletableFuture 完成
allOf.join();
tjOrgPriceDtoList = futures.stream()
List<TjOrgPriceDto> tjOrgPriceDtoList = orgList.parallelStream()
.map(orgId -> CompletableFuture.supplyAsync(() ->
priceSumSummaryMapper.TjOrgPrice(orgId, req.getYear(), req.getTypeIdsList(), req.getSizeNameList())))
.map(CompletableFuture::join)
.collect(Collectors.toList());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论