...
|
...
|
@@ -26,13 +26,10 @@ import java.util.stream.Collectors; |
|
|
/**
|
|
|
* Created by chenchao on 2018/9/19.
|
|
|
*/
|
|
|
public abstract class AbsOrderListService implements IOrderListService{
|
|
|
public abstract class AbsOrderListService extends AbsOrderViewService implements IOrderListService{
|
|
|
|
|
|
private final Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
|
|
@Autowired
|
|
|
private OrdersPayService ordersPayService;
|
|
|
|
|
|
abstract List<Integer> initOrderListRequest(OrderListRequest request);
|
|
|
|
|
|
abstract int getTotal(int uid, List<Integer> statusQuery);
|
...
|
...
|
@@ -43,13 +40,7 @@ public abstract class AbsOrderListService implements IOrderListService{ |
|
|
|
|
|
abstract List<SellerOrderGoods> getBaseOrderGoodsList(List<Integer> skups);
|
|
|
|
|
|
Long getDeliverLeftTime(int buyerUid, long orderCode, Integer orderStatus){
|
|
|
if (OrderStatus.HAS_PAYED.getCode() == orderStatus){
|
|
|
return ordersPayService.getDeliverLeftTime(buyerUid, orderCode);
|
|
|
}else{
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 订单列表
|
|
|
* @param request
|
...
|
...
|
@@ -102,9 +93,7 @@ public abstract class AbsOrderListService implements IOrderListService{ |
|
|
|
|
|
}
|
|
|
|
|
|
protected int calLeftTime(int creatTime){
|
|
|
return OrderInfo.PAY_TIME_SECOND - (DateUtil.getCurrentTimeSecond() - creatTime);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取返回结果
|
|
|
* @param buyerOrderGoodsMap
|
...
|
...
|
@@ -123,8 +112,10 @@ public abstract class AbsOrderListService implements IOrderListService{ |
|
|
* 3.查询 seller_order_goods
|
|
|
*/
|
|
|
OrderListInfo orderListInfo = new OrderListInfo();
|
|
|
orderListInfo.setUid(buyerOrder.getUid());
|
|
|
orderListInfo.setOrderCode(buyerOrder.getOrderCode());
|
|
|
Integer buyerUid;
|
|
|
Long orderCode;
|
|
|
orderListInfo.setUid(buyerUid=buyerOrder.getUid());
|
|
|
orderListInfo.setOrderCode(orderCode=buyerOrder.getOrderCode());
|
|
|
orderListInfo.setRealPrice(buyerOrder.getAmount() == null ? "" : buyerOrder.getAmount().toPlainString());
|
|
|
// 订单中状态显示
|
|
|
orderListInfo.setStatus(buyerOrder.getStatus() == null ? -1 : buyerOrder.getStatus());
|
...
|
...
|
@@ -132,7 +123,7 @@ public abstract class AbsOrderListService implements IOrderListService{ |
|
|
|
|
|
if (orderStatus == null){
|
|
|
logger.warn("getOrderList orderStatus not exist, uid is {}, orderCode is {}, status is {}",
|
|
|
buyerOrder.getUid(), orderListInfo.getOrderCode(), buyerOrder.getStatus());
|
|
|
buyerUid,orderCode, buyerOrder.getStatus());
|
|
|
return null;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -142,10 +133,8 @@ public abstract class AbsOrderListService implements IOrderListService{ |
|
|
orderListInfo.setButtons(orderStatus.getListButtons(tabType));
|
|
|
|
|
|
// 当订单状态是待付款, 显示leftTime
|
|
|
if (orderListInfo.getStatus() == OrderStatus.WAITING_PAY.getCode()){
|
|
|
orderListInfo.setLeftTime(calLeftTime(buyerOrder.getCreateTime()));
|
|
|
}
|
|
|
|
|
|
Integer leftTime = getLeftTime(tabType, buyerUid, orderCode, buyerOrder.getStatus(), buyerOrder.getCreateTime());
|
|
|
orderListInfo.setLeftTime(leftTime);
|
|
|
BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMap.get(buyerOrder.getOrderCode());
|
|
|
if (buyerOrderGoods == null){
|
|
|
logger.warn("getOrderList buyer goods not exist, uid is {}, orderCode is {}",
|
...
|
...
|
@@ -173,9 +162,6 @@ public abstract class AbsOrderListService implements IOrderListService{ |
|
|
orderListInfo.setGoodsInfo(goodsInfo);
|
|
|
orderListInfo.setSecendLevelCreateTime(buyerOrder.getCreateTime());
|
|
|
orderListInfo.setCreateTime(DateUtil.formatDate(buyerOrder.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS));
|
|
|
//
|
|
|
orderListInfo.setDeliverLeftTime(getDeliverLeftTime(buyerOrder.getUid(), buyerOrder.getOrderCode(),
|
|
|
buyerOrder.getStatus()));
|
|
|
return orderListInfo;
|
|
|
}
|
|
|
|
...
|
...
|
|