Explorar o código

统计接口计算新增日志

donglang hai 1 mes
pai
achega
ef83d7a0f2

+ 5 - 1
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/app/GatekeeperOrderService.java

@@ -490,6 +490,7 @@ public class GatekeeperOrderService {
             return resp;
         }
         List<GatekeeperOrderResp> gatekeeperOrderPageResult = getGatekeeperOrderPageResult(orderList);
+        log.info("统计查询门卫订单数据:{}, size:{}", JSON.toJSONString(gatekeeperOrderPageResult), gatekeeperOrderPageResult.size());
         resp.setOrderStatusStatistics(calculateStatusStatistics(gatekeeperOrderPageResult));
         return resp;
 
@@ -535,6 +536,7 @@ public class GatekeeperOrderService {
      * @return
      */
     private static List<StatisticsWaybillResp.OrderBillStatusStatistics> calculateStatusStatistics(List<GatekeeperOrderResp> gatekeeperOrderList) {
+        log.info("开始统计计算,param:{}", JSON.toJSONString(gatekeeperOrderList));
         //车辆停留超时配置
         double configHours = 2000;
 
@@ -553,7 +555,7 @@ public class GatekeeperOrderService {
         // 进行状态聚合
         List<StatisticsWaybillResp.OrderBillStatusStatistics> aggregatedList = aggregateRules.entrySet().stream()
                 .map(rule -> {
-                    String[] aggregateInfo = rule.getKey();
+                    String[] aggregateInfo = rule. getKey();
                     List<String> originalStatuses = rule.getValue();
                     long totalNum = 0;
 
@@ -577,6 +579,7 @@ public class GatekeeperOrderService {
                         totalNum = originalStatuses.stream()
                                 .mapToLong(status -> statusCountMap.getOrDefault(status, 0L))
                                 .sum();
+                        log.info("{}状态统计,num:{}", JSON.toJSONString(aggregateInfo[1]), totalNum);
                     }
 
                     // 构建聚合结果对象
@@ -588,6 +591,7 @@ public class GatekeeperOrderService {
                 })
                 .sorted(Comparator.comparing(StatisticsWaybillResp.OrderBillStatusStatistics::getOrderStatus))
                 .collect(Collectors.toList());
+        log.info("统计计算完成,result:{}", JSON.toJSONString(aggregatedList));
         return aggregatedList;
     }