...
|
...
|
@@ -24,6 +24,7 @@ import org.springframework.stereotype.Service; |
|
|
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Objects;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -70,6 +71,7 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde |
|
|
List<SellerOrder> sellerOrders = sellerOrderMapper.selectBySkups(skupList);
|
|
|
List<OrderListInfo> data = sellerOrders.parallelStream()
|
|
|
.map(sellerOrder -> buildOrderListInfo(skupSellerOrderGoodsMap.get(sellerOrder.getSkup()), sellerOrder))
|
|
|
.filter(oli -> Objects.nonNull(oli))
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
PageResp orderListInfoRsp = respBuilder.data(data).build();
|
...
|
...
|
@@ -80,30 +82,32 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde |
|
|
}
|
|
|
|
|
|
OrderListInfo buildOrderListInfo(SellerOrderGoods sellerOrderGoods,
|
|
|
SellerOrder buyerOrder) {
|
|
|
SellerOrder sellerOrder) {
|
|
|
|
|
|
OrderListInfo orderListInfo = new OrderListInfo();
|
|
|
orderListInfo.setUid(buyerOrder.getUid());
|
|
|
orderListInfo.setOrderCode(buyerOrder.getOrderCode());
|
|
|
orderListInfo.setUid(sellerOrder.getUid());
|
|
|
orderListInfo.setOrderCode(sellerOrder.getOrderCode());
|
|
|
orderListInfo.setRealPrice(sellerOrderGoods.getGoodsPrice().toPlainString());
|
|
|
// 订单中状态显示
|
|
|
orderListInfo.setStatus(buyerOrder.getStatus() == null ? -1 : buyerOrder.getStatus());
|
|
|
SkupStatus orderStatus = SkupStatus.getSkupStatus(orderListInfo.getStatus());
|
|
|
orderListInfo.setStatus(sellerOrder.getStatus() == null ? -1 : sellerOrder.getStatus());
|
|
|
|
|
|
if (orderStatus == null){
|
|
|
log.warn("getOrderList orderStatus not exist, uid is {}, orderCode is {}, status is {}",
|
|
|
buyerOrder.getUid(), orderListInfo.getOrderCode(), buyerOrder.getStatus());
|
|
|
SellerOrderStatus sellerOrderStatus = SellerOrderStatus.getSellerOrderStatus(orderListInfo.getStatus());
|
|
|
SkupStatus skupStatus = sellerOrderStatus.getSkupStatus();
|
|
|
|
|
|
if (skupStatus == null){
|
|
|
log.warn("get seller Order List skupStatus not exist, uid is {}, orderCode is {}, status is {}",
|
|
|
sellerOrder.getUid(), orderListInfo.getOrderCode(), sellerOrder.getStatus());
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
orderListInfo.setStatuStr(orderStatus.getDesc());
|
|
|
orderListInfo.setStatuStr(skupStatus.getDesc());
|
|
|
|
|
|
// 按钮显示
|
|
|
orderListInfo.setButtons(orderStatus.getListButtons());
|
|
|
orderListInfo.setButtons(skupStatus.getListButtons());
|
|
|
|
|
|
// 当订单状态是待付款, 显示leftTime
|
|
|
if (orderListInfo.getStatus() == SellerOrderStatus.WAITING_PAY.getCode()){
|
|
|
orderListInfo.setLeftTime(DateUtil.getCurrentTimeSecond() - buyerOrder.getCreateTime());
|
|
|
orderListInfo.setLeftTime(DateUtil.getCurrentTimeSecond() - sellerOrder.getCreateTime());
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
|