zhuyifan

feat(client-customer): 添加日志以追踪客户订单统计查询过程

- 在获取当前客户信息后添加日志,记录客户数量
- 在提取HIS客户ID后添加日志,显示ID列表及数量
- 在获取客户ID列表后增加日志输出,便于调试追踪- 在过滤出未下单客户ID后添加日志,展示未下单客户数量及详情
......@@ -314,9 +314,12 @@ public class ClientCustomerServiceImpl implements ClientCustomerService {
@Override
public TodayOrderDto getTodayOrderStatisticForHis(String token) {
final var currentCustomers = clientCustomerServiceHttpClient.getCurrentClientCustomer(token, true);
log.info("currentCustomers size:{}", currentCustomers.size());
final var hisCustomerIds = currentCustomers.stream().map(CurrentClientCustomerDto::getId).distinct().collect(Collectors.toList());
log.info("hisCustomerIds size:{} {}", hisCustomerIds.size(), hisCustomerIds);
final var currentClientCustomers = clientCustomerServiceRpcClient.getClientCustomersByHISCustomerIds(hisCustomerIds).getResponsesList();
final var customerIds = currentClientCustomers.stream().map(SingleClientCustomerRpcResponse::getId).distinct().collect(Collectors.toList());
log.info("customerIds size:{} {}", customerIds.size(), customerIds);
final var mappingHisCustomerIds = currentClientCustomers.stream().map(SingleClientCustomerRpcResponse::getHISCustomerId).collect(Collectors.toList());
final var notOrderedHisCustomers = currentCustomers.stream().filter(c -> !mappingHisCustomerIds.contains(c.getId())).collect(Collectors.toList());
final var operatorLoginInfo = LoginContextHolder.getLoginInfo();
......@@ -339,6 +342,7 @@ public class ClientCustomerServiceImpl implements ClientCustomerService {
}
List<Integer> uniqueOrderedCustomerIds = orderedResponseList.stream().map(SingleClientCustomerOrderRpcResponse::getCustomerId).distinct().collect(Collectors.toList());
List<Integer> notOrderedCustomerIds = customerIds.stream().filter(id -> !uniqueOrderedCustomerIds.contains(id)).collect(Collectors.toList());
log.info("notOrderedCustomerIds size:{} {}", notOrderedCustomerIds.size(), notOrderedCustomerIds);
// 根据customerIds 获取到menuRef列表
final var menuRefs = menuServiceRpcClient.getClientCustomerMenuRefsByCustomerIds(operatorLoginInfo.getEnterpriseId(), notOrderedCustomerIds).getResponsesList();
final var menuIds = menuRefs.stream().map(SingleClientCustomerMenuRefRpcResponse::getMenuId).collect(Collectors.toList());
......