...
|
...
|
@@ -3,13 +3,12 @@ package com.yohoufo.order.service.impl; |
|
|
import com.google.common.collect.Lists;
|
|
|
import com.yoho.error.ServiceError;
|
|
|
import com.yoho.error.exception.ServiceException;
|
|
|
import com.yohobuy.ufo.model.order.common.OrderListType;
|
|
|
import com.yohobuy.ufo.model.order.common.OrderStatus;
|
|
|
import com.yohobuy.ufo.model.order.common.TabType;
|
|
|
import com.yohobuy.ufo.model.order.constants.BusinessClientEnum;
|
|
|
import com.yohobuy.ufo.model.order.constants.ConfirmDesc;
|
|
|
import com.yohobuy.ufo.model.order.resp.OrderCancelComputeResult;
|
|
|
import com.yohobuy.ufo.model.order.resp.OrderDetailInfo;
|
|
|
import com.yohobuy.ufo.model.order.resp.OrderListInfo;
|
|
|
import com.yohobuy.ufo.model.order.resp.PageResp;
|
|
|
import com.yohobuy.ufo.model.order.resp.*;
|
|
|
import com.yohobuy.ufo.model.order.vo.OrderListVo;
|
|
|
import com.yohoufo.dal.order.BuyerOrderGoodsMapper;
|
|
|
import com.yohoufo.dal.order.BuyerOrderMapper;
|
...
|
...
|
@@ -23,6 +22,7 @@ import com.yohoufo.order.service.IOrderListService; |
|
|
import com.yohoufo.order.service.cache.OrderCacheService;
|
|
|
import com.yohoufo.order.service.handler.BuyerCancelCompensateComputeHandler;
|
|
|
import com.yohoufo.order.utils.LoggerUtils;
|
|
|
import com.yohoufo.order.utils.OrderAssist;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
...
|
...
|
@@ -182,7 +182,9 @@ public class BuyerOrderViewService implements IOrderListService, IOrderDetailSer |
|
|
public OrderSummaryResp getOrderNumByUid(int uid, String businessClient) {
|
|
|
Integer num =orderCacheService.getOrderSummary(uid, TabType.BUY, businessClient);
|
|
|
if (num == null){
|
|
|
num = buyerOrderMapper.selectOrderNumByUid(uid);
|
|
|
final BusinessClientEnum bce = OrderAssist.findBusinessClient(businessClient);
|
|
|
List<Integer> orderTypes = OrderAssist.matchOrderTypesByBusinessClient(bce);
|
|
|
num = buyerOrderMapper.selectOrderNumByUid(uid, orderTypes);
|
|
|
}
|
|
|
if (num != null){
|
|
|
orderCacheService.cacheOrderSummary(uid, TabType.BUY, num, businessClient);
|
...
|
...
|
@@ -208,4 +210,21 @@ public class BuyerOrderViewService implements IOrderListService, IOrderDetailSer |
|
|
}
|
|
|
return null == num ? new OrderSummaryResp(statKey, 0) : new OrderSummaryResp(statKey, num);
|
|
|
}
|
|
|
|
|
|
|
|
|
public OrderCntResp getOrderCnt(OrderRequest req, OrderListType listType) {
|
|
|
logger.info("in buyer getOrderCnt req {} listType {}", req, listType);
|
|
|
OrderCntResp resp;
|
|
|
int cnt ;
|
|
|
switch (listType){
|
|
|
case ALL:
|
|
|
cnt = buyerOrderMapper.selectCntByUid(req.getUid());
|
|
|
break;
|
|
|
default:
|
|
|
cnt = 0;
|
|
|
break;
|
|
|
}
|
|
|
resp = OrderCntResp.builder().uid(req.getUid()).cnt(cnt).actor(req.getTabType()).build();
|
|
|
return resp;
|
|
|
}
|
|
|
} |
...
|
...
|
|