feat(client-customer): 添加日志以追踪客户订单统计查询过程
- 在获取当前客户信息后添加日志,记录客户数量 - 在提取HIS客户ID后添加日志,显示ID列表及数量 - 在获取客户ID列表后增加日志输出,便于调试追踪- 在过滤出未下单客户ID后添加日志,展示未下单客户数量及详情
Showing
1 changed file
with
4 additions
and
0 deletions
| ... | @@ -314,9 +314,12 @@ public class ClientCustomerServiceImpl implements ClientCustomerService { | ... | @@ -314,9 +314,12 @@ public class ClientCustomerServiceImpl implements ClientCustomerService { |
| 314 | @Override | 314 | @Override |
| 315 | public TodayOrderDto getTodayOrderStatisticForHis(String token) { | 315 | public TodayOrderDto getTodayOrderStatisticForHis(String token) { |
| 316 | final var currentCustomers = clientCustomerServiceHttpClient.getCurrentClientCustomer(token, true); | 316 | final var currentCustomers = clientCustomerServiceHttpClient.getCurrentClientCustomer(token, true); |
| 317 | + log.info("currentCustomers size:{}", currentCustomers.size()); | ||
| 317 | final var hisCustomerIds = currentCustomers.stream().map(CurrentClientCustomerDto::getId).distinct().collect(Collectors.toList()); | 318 | final var hisCustomerIds = currentCustomers.stream().map(CurrentClientCustomerDto::getId).distinct().collect(Collectors.toList()); |
| 319 | + log.info("hisCustomerIds size:{} {}", hisCustomerIds.size(), hisCustomerIds); | ||
| 318 | final var currentClientCustomers = clientCustomerServiceRpcClient.getClientCustomersByHISCustomerIds(hisCustomerIds).getResponsesList(); | 320 | final var currentClientCustomers = clientCustomerServiceRpcClient.getClientCustomersByHISCustomerIds(hisCustomerIds).getResponsesList(); |
| 319 | final var customerIds = currentClientCustomers.stream().map(SingleClientCustomerRpcResponse::getId).distinct().collect(Collectors.toList()); | 321 | final var customerIds = currentClientCustomers.stream().map(SingleClientCustomerRpcResponse::getId).distinct().collect(Collectors.toList()); |
| 322 | + log.info("customerIds size:{} {}", customerIds.size(), customerIds); | ||
| 320 | final var mappingHisCustomerIds = currentClientCustomers.stream().map(SingleClientCustomerRpcResponse::getHISCustomerId).collect(Collectors.toList()); | 323 | final var mappingHisCustomerIds = currentClientCustomers.stream().map(SingleClientCustomerRpcResponse::getHISCustomerId).collect(Collectors.toList()); |
| 321 | final var notOrderedHisCustomers = currentCustomers.stream().filter(c -> !mappingHisCustomerIds.contains(c.getId())).collect(Collectors.toList()); | 324 | final var notOrderedHisCustomers = currentCustomers.stream().filter(c -> !mappingHisCustomerIds.contains(c.getId())).collect(Collectors.toList()); |
| 322 | final var operatorLoginInfo = LoginContextHolder.getLoginInfo(); | 325 | final var operatorLoginInfo = LoginContextHolder.getLoginInfo(); |
| ... | @@ -339,6 +342,7 @@ public class ClientCustomerServiceImpl implements ClientCustomerService { | ... | @@ -339,6 +342,7 @@ public class ClientCustomerServiceImpl implements ClientCustomerService { |
| 339 | } | 342 | } |
| 340 | List<Integer> uniqueOrderedCustomerIds = orderedResponseList.stream().map(SingleClientCustomerOrderRpcResponse::getCustomerId).distinct().collect(Collectors.toList()); | 343 | List<Integer> uniqueOrderedCustomerIds = orderedResponseList.stream().map(SingleClientCustomerOrderRpcResponse::getCustomerId).distinct().collect(Collectors.toList()); |
| 341 | List<Integer> notOrderedCustomerIds = customerIds.stream().filter(id -> !uniqueOrderedCustomerIds.contains(id)).collect(Collectors.toList()); | 344 | List<Integer> notOrderedCustomerIds = customerIds.stream().filter(id -> !uniqueOrderedCustomerIds.contains(id)).collect(Collectors.toList()); |
| 345 | + log.info("notOrderedCustomerIds size:{} {}", notOrderedCustomerIds.size(), notOrderedCustomerIds); | ||
| 342 | // 根据customerIds 获取到menuRef列表 | 346 | // 根据customerIds 获取到menuRef列表 |
| 343 | final var menuRefs = menuServiceRpcClient.getClientCustomerMenuRefsByCustomerIds(operatorLoginInfo.getEnterpriseId(), notOrderedCustomerIds).getResponsesList(); | 347 | final var menuRefs = menuServiceRpcClient.getClientCustomerMenuRefsByCustomerIds(operatorLoginInfo.getEnterpriseId(), notOrderedCustomerIds).getResponsesList(); |
| 344 | final var menuIds = menuRefs.stream().map(SingleClientCustomerMenuRefRpcResponse::getMenuId).collect(Collectors.toList()); | 348 | final var menuIds = menuRefs.stream().map(SingleClientCustomerMenuRefRpcResponse::getMenuId).collect(Collectors.toList()); | ... | ... |
-
Please register or login to post a comment