diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/WalletTransactionController.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/WalletTransactionController.java index f9b8ed9ac..f9e362697 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/WalletTransactionController.java +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/WalletTransactionController.java @@ -255,13 +255,6 @@ public class WalletTransactionController { DataScope dataScope = null; Long count = walletTransactionMapper.count(dto, dataScope); if (count > 3 * 10000) throw new RuntimeException("导出数据超出30000条,请缩小查询范围"); - - try { - ThreadUtil.sleep(10000, TimeUnit.SECONDS); - } catch (Exception e) { - - } - walletTransactionService.exportByTemplate(response, dto, count, "file/个人充值明细.xlsx", dataScope); } diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/WalletTransactionServiceImpl.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/WalletTransactionServiceImpl.java index 69491c685..3affbd64a 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/WalletTransactionServiceImpl.java +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/WalletTransactionServiceImpl.java @@ -67,6 +67,9 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.stream.Collectors; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; + /** * 会员钱包流水表 * @@ -333,7 +336,7 @@ public class WalletTransactionServiceImpl extends ServiceImpl { - RequestContextHolder.setRequestAttributes(requestAttributes); - Page pageList = scopePageList(new Page<>(currentPage, pageSize), dto, dataScope); - if (ObjectUtil.isEmpty(pageList) || ObjectUtil.isEmpty(pageList.getRecords())) { - return new ArrayList<>(); + if (requestAttributes != null) { + RequestContextHolder.setRequestAttributes(requestAttributes); } - List list = pageList.getRecords(); - for (WalletTransactionVo v : list) { - if (ObjectUtil.isNotEmpty(v.getPrice())) { - v.setPriceStr(BigDecimal.valueOf(v.getPrice()).divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).toString()); + try { + Page pageList = scopePageList(new Page<>(currentPage, pageSize), dto, dataScope); + if (ObjectUtil.isEmpty(pageList) || ObjectUtil.isEmpty(pageList.getRecords())) { + return new ArrayList<>(); } - if (ObjectUtil.isNotEmpty(v.getBizType())) { - v.setBizType(WalletBizEnum.valueOfByType(v.getBizType()).getDesc()); + List list = pageList.getRecords(); + for (WalletTransactionVo v : list) { + if (ObjectUtil.isNotEmpty(v.getPrice())) { + v.setPriceStr(BigDecimal.valueOf(v.getPrice()).divide(BigDecimal.valueOf(100)).setScale(2, RoundingMode.HALF_UP).toString()); + } + if (ObjectUtil.isNotEmpty(v.getBizType())) { + v.setBizType(WalletBizEnum.valueOfByType(v.getBizType()).getDesc()); + } } + return list; + } finally { + RequestContextHolder.resetRequestAttributes(); } - return list; }, executor)); }