Authored by chenchao

fix left time of seller deliver

... ... @@ -114,7 +114,10 @@ public abstract class AbsOrderListService extends AbsOrderViewService implements
OrderListInfo orderListInfo = new OrderListInfo();
Integer buyerUid;
Long orderCode;
orderListInfo.setUid(buyerUid=buyerOrder.getUid());
orderListInfo.setBuyerUid(buyerUid);
orderListInfo.setSellerUid(buyerOrder.getSellerUid());
orderListInfo.setOrderCode(orderCode=buyerOrder.getOrderCode());
orderListInfo.setRealPrice(buyerOrder.getAmount() == null ? "" : buyerOrder.getAmount().toPlainString());
// 订单中状态显示
... ... @@ -165,5 +168,5 @@ public abstract class AbsOrderListService extends AbsOrderViewService implements
return orderListInfo;
}
protected abstract void resetDynamicProporties(List<OrderListInfo> list);
protected abstract void resetDynamicProporties(List<OrderListInfo> list,int type);
}
... ...
... ... @@ -90,7 +90,7 @@ public class BuyerOrderListServiceImpl extends AbsOrderListService implements IO
}
@Override
protected void resetDynamicProporties(List<OrderListInfo> list) {
protected void resetDynamicProporties(List<OrderListInfo> list, int type) {
if(CollectionUtils.isNotEmpty(list)){
list.forEach(oli -> {
Integer leftTime = getLeftTime(TabType.BUY, oli.getUid(), oli.getOrderCode(), oli.getStatus(),
... ...
... ... @@ -290,7 +290,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
.total(orderListVo.getTotal())
.pagetotal(orderListVo.getPagetotal());
List<OrderListInfo> oliList = orderListVo.getOrderList();
buyerOrderListService.resetDynamicProporties(oliList);
buyerOrderListService.resetDynamicProporties(oliList, request.getType());
return respBuilder.data(oliList).build();
}
PageResp orderListInfoRsp = buyerOrderListService.getOrderList(request);
... ...
... ... @@ -75,7 +75,7 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde
.total(orderListVo.getTotal())
.pagetotal(orderListVo.getPagetotal());
List<OrderListInfo> oliList = orderListVo.getOrderList();
resetDynamicProporties(oliList);
resetDynamicProporties(oliList, request.getType());
return respBuilder.data(oliList).build();
}
PageResp orderListInfoRsp;
... ... @@ -132,23 +132,24 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde
}
@Override
protected void resetDynamicProporties(List<OrderListInfo> list) {
protected void resetDynamicProporties(List<OrderListInfo> list, int type) {
if(CollectionUtils.isNotEmpty(list)){
list.forEach(oli -> {
if (oli.getStatus() == SkupStatus.CAN_NOT_SELL.getCode()){
oli.setLeftTime(calLeftTime(oli.getSecendLevelCreateTime()));
}
List<BuyerOrderGoods> bogList = buyerOrderGoodsMapper.selectBySkups(Arrays.asList(oli.getGoodsInfo().getSkup()));
if (CollectionUtils.isNotEmpty(bogList)){
//存在时说明已经有买家下单 当前状态来自于买家订单
BuyerOrderGoods bog = bogList.get(0);
int status = oli.getStatus();
Integer leftTime = getDeliverLeftTime(bog.getUid(), bog.getOrderCode(), status);
if (leftTime != null) {
oli.setLeftTime(leftTime);
if(SellerOrderListType.WAITING_PAY.getType() == type) {
BuyerOrderGoods bog = buyerOrderGoodsMapper.selectByOrderCode(oli.getBuyerUid(), oli.getOrderCode());
if (Objects.nonNull(bog)) {
//存在时说明已经有买家下单 当前状态来自于买家订单
int status = oli.getStatus();
Integer leftTime = getDeliverLeftTime(bog.getUid(), bog.getOrderCode(), status);
if (leftTime != null) {
oli.setLeftTime(leftTime);
}
}
}
});
}
}
... ...