|
@@ -768,13 +768,15 @@ public class LawyerConsultationOrderServiceImpl extends ServiceImpl<LawyerConsul
|
|
|
QueryWrapper<LawyerConsultationOrderVO> queryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<LawyerConsultationOrderVO> queryWrapper = new QueryWrapper<>();
|
|
|
if(StringUtils.hasText(orderStatus)){
|
|
if(StringUtils.hasText(orderStatus)){
|
|
|
queryWrapper.in("lco.order_status", Collections.singletonList(orderStatus));
|
|
queryWrapper.in("lco.order_status", Collections.singletonList(orderStatus));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ queryWrapper.in("lco.order_status", Arrays.asList("2", "3"));
|
|
|
}
|
|
}
|
|
|
- queryWrapper.in("lco.order_status", Arrays.asList("2", "3"));
|
|
|
|
|
queryWrapper.eq("lco.lawyer_user_id", lawyerId);
|
|
queryWrapper.eq("lco.lawyer_user_id", lawyerId);
|
|
|
if(StringUtils.hasText(clientUserName)){
|
|
if(StringUtils.hasText(clientUserName)){
|
|
|
queryWrapper.like("lur.user_name", clientUserName);
|
|
queryWrapper.like("lur.user_name", clientUserName);
|
|
|
}
|
|
}
|
|
|
queryWrapper.eq("lco.delete_flag", 0);
|
|
queryWrapper.eq("lco.delete_flag", 0);
|
|
|
|
|
+ queryWrapper.orderByDesc("lco.created_time");
|
|
|
|
|
|
|
|
// 时间范围查询:如果开始时间和结束时间都存在,则进行范围查询
|
|
// 时间范围查询:如果开始时间和结束时间都存在,则进行范围查询
|
|
|
if (StringUtils.hasText(startDate) && StringUtils.hasText(endDate)) {
|
|
if (StringUtils.hasText(startDate) && StringUtils.hasText(endDate)) {
|
|
@@ -791,17 +793,20 @@ public class LawyerConsultationOrderServiceImpl extends ServiceImpl<LawyerConsul
|
|
|
calculateCountdownForPendingOrders(voPage);
|
|
calculateCountdownForPendingOrders(voPage);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 统计订单总数
|
|
|
|
|
- long totalCount = voPage != null ? voPage.getTotal() : 0L;
|
|
|
|
|
- resultMap.put("lawyerOrderCount", totalCount);
|
|
|
|
|
-
|
|
|
|
|
- // 统计进行中订单数量
|
|
|
|
|
- int inProgressCount = countOrdersByStatus(lawyerId, LawyerStatusEnum.INPROGRESS.getStatus());
|
|
|
|
|
- resultMap.put("lawyerInProgressOrderCount", inProgressCount);
|
|
|
|
|
|
|
+ //获取统计信息
|
|
|
|
|
+ queryWrapper.groupBy("lco.order_status");
|
|
|
|
|
+ Map<String, Map<String, Object>> statisticsInfo = consultationOrderMapper.getLawyerStatisticsInfo(queryWrapper);
|
|
|
|
|
|
|
|
- // 统计已完成订单数量
|
|
|
|
|
- int completeCount = countOrdersByStatus(lawyerId, LawyerStatusEnum.COMPLETE.getStatus());
|
|
|
|
|
- resultMap.put("lawyerCompleteOrderCount", completeCount);
|
|
|
|
|
|
|
+// // 统计进行中订单数量
|
|
|
|
|
+// int inProgressCount = statisticsInfo.containsKey("2")?Integer.parseInt(statisticsInfo.get("2").toString()): 0;
|
|
|
|
|
+// resultMap.put("lawyerInProgressOrderCount", inProgressCount);
|
|
|
|
|
+//
|
|
|
|
|
+// // 统计已完成订单数量
|
|
|
|
|
+// int completeCount = statisticsInfo.containsKey("3")?Integer.parseInt(statisticsInfo.get("3").toString()): 0;
|
|
|
|
|
+// resultMap.put("lawyerCompleteOrderCount", completeCount);
|
|
|
|
|
+//
|
|
|
|
|
+// // 统计订单总数
|
|
|
|
|
+// resultMap.put("lawyerOrderCount", inProgressCount + completeCount);
|
|
|
|
|
|
|
|
// 设置订单列表
|
|
// 设置订单列表
|
|
|
List<LawyerConsultationOrderVO> orderList = voPage != null && voPage.getRecords() != null
|
|
List<LawyerConsultationOrderVO> orderList = voPage != null && voPage.getRecords() != null
|
|
@@ -844,21 +849,6 @@ public class LawyerConsultationOrderServiceImpl extends ServiceImpl<LawyerConsul
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * 根据律师ID和订单状态统计订单数量
|
|
|
|
|
- *
|
|
|
|
|
- * @param lawyerId 律师ID
|
|
|
|
|
- * @param orderStatus 订单状态
|
|
|
|
|
- * @return 订单数量
|
|
|
|
|
- */
|
|
|
|
|
- private int countOrdersByStatus(String lawyerId, Integer orderStatus) {
|
|
|
|
|
- LambdaQueryWrapper<LawyerConsultationOrder> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
- queryWrapper.eq(LawyerConsultationOrder::getLawyerUserId, lawyerId);
|
|
|
|
|
- queryWrapper.eq(LawyerConsultationOrder::getDeleteFlag, 0);
|
|
|
|
|
- queryWrapper.eq(LawyerConsultationOrder::getOrderStatus, orderStatus);
|
|
|
|
|
- return consultationOrderMapper.selectCount(queryWrapper);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
* 填充律师信息到订单VO
|
|
* 填充律师信息到订单VO
|
|
|
*
|
|
*
|
|
|
* @param orderVO 订单VO对象
|
|
* @param orderVO 订单VO对象
|