|
@@ -59,6 +59,39 @@ public class OrderClubServiceImpl implements OrderClubService {
|
|
|
@Resource
|
|
|
private OrderCommonService orderCommonService;
|
|
|
|
|
|
+ /**
|
|
|
+ * 获取各状态订单数量
|
|
|
+ *
|
|
|
+ * @param userId 用户id
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ResponseJson<Map<String, Object>> getOrderCount(Integer userId) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ //全部数量
|
|
|
+ Integer totalCount = orderClubMapper.getOrderCount(userId, 0);
|
|
|
+ map.put("totalCount", totalCount);
|
|
|
+ //待确认数量
|
|
|
+ Integer confirmedCount = orderClubMapper.getOrderCount(userId, 1);
|
|
|
+ map.put("confirmedCount", confirmedCount);
|
|
|
+ //待付款数量
|
|
|
+ Integer paymentCount = orderClubMapper.getOrderCount(userId, 2);
|
|
|
+ paymentCount = paymentCount == null ? 0 : paymentCount;
|
|
|
+ map.put("paymentCount", paymentCount);
|
|
|
+ //待发货数量
|
|
|
+ Integer waitShipmentsCount = orderClubMapper.getOrderCount(userId, 3);
|
|
|
+ waitShipmentsCount = waitShipmentsCount == null ? 0 : waitShipmentsCount;
|
|
|
+ map.put("waitShipmentsCount", waitShipmentsCount);
|
|
|
+ //已发货数量
|
|
|
+ Integer shipmentsCount = orderClubMapper.getOrderCount(userId, 4);
|
|
|
+ shipmentsCount = shipmentsCount == null ? 0 : shipmentsCount;
|
|
|
+ map.put("shipmentsCount", shipmentsCount);
|
|
|
+ //退货款数量
|
|
|
+ Integer salesReturnCount = orderClubMapper.getOrderCount(userId, 5);
|
|
|
+ salesReturnCount = salesReturnCount == null ? 0 : salesReturnCount;
|
|
|
+ map.put("salesReturnCount", salesReturnCount);
|
|
|
+ return ResponseJson.success(map);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 机构订单列表
|
|
|
*
|