49 lines
1.9 KiB
Markdown
49 lines
1.9 KiB
Markdown
# 任务
|
|
|
|
- [x] 项目:周报。
|
|
- [x] 开发:自动化统计展示各类客户数据,CDN累计客户总数。
|
|
|
|
# 日志
|
|
|
|
```java
|
|
// 获取所有企业的ecId
|
|
List<String> ecIds = enterpriseInfos.stream().map(EnterpriseInfoDTO::getEcId).collect(Collectors.toList());
|
|
|
|
// 使用已有的线程池创建异步任务
|
|
CompletableFuture<List<OrderSummaryDTO>> ordersFuture = CompletableFuture.supplyAsync(
|
|
() -> orderDao.findSpecializedOrders(ecIds), threadPoolExecutor);
|
|
|
|
CompletableFuture<List<TestOrderChangeRecordDTO>> changeRecordFuture = CompletableFuture.supplyAsync(
|
|
testOrderChangeRecordDao::findAllProjected, threadPoolExecutor);
|
|
|
|
CompletableFuture<List<OrderDetailsDTO>> orderDetailsFuture = CompletableFuture.supplyAsync(
|
|
bBossOrderDao::findOrderDetailsByOrderNum, threadPoolExecutor);
|
|
|
|
CompletableFuture<List<EpProductInfoDTO>> preOrderNumFuture = CompletableFuture.supplyAsync(
|
|
epProductInfoDao::findPreOrderNumByProductState, threadPoolExecutor);
|
|
|
|
// 等待所有异步任务完成并获取结果
|
|
List<OrderSummaryDTO> allOrders;
|
|
List<TestOrderChangeRecordDTO> allChangeRecord;
|
|
List<OrderDetailsDTO> allOrderDetails;
|
|
List<EpProductInfoDTO> preOrderNumByProductState;
|
|
|
|
try {
|
|
allOrders = ordersFuture.join();
|
|
allChangeRecord = changeRecordFuture.join();
|
|
allOrderDetails = orderDetailsFuture.join();
|
|
preOrderNumByProductState = preOrderNumFuture.join();
|
|
} catch (Exception e) {
|
|
log.error("异步获取数据失败", e);
|
|
throw new RuntimeException("获取数据失败", e);
|
|
}
|
|
```
|
|
|
|
# 总结
|
|
|
|
写了新的需求开发。最近状态就好像回到了从石油离职的日子。
|
|
|
|
下班和田宝玩儿了飞盘。
|
|
|
|
公司开了关于需求拆分的会。
|