Authored by chenchao

fix timeout of seller see buyer not pay order

... ... @@ -2,6 +2,7 @@ package com.yohoufo.order.service.impl;
import com.yohobuy.ufo.model.order.bo.ButtonShowBo;
import com.yohobuy.ufo.model.order.bo.OrderInfo;
import com.yohobuy.ufo.model.order.common.OrderCodeType;
import com.yohobuy.ufo.model.order.common.OrderStatus;
import com.yohobuy.ufo.model.order.common.SkupStatus;
import com.yohobuy.ufo.model.order.common.TabType;
... ... @@ -91,11 +92,32 @@ public abstract class AbsOrderViewService {
return leftTime;
}
Integer getPayLeftTime4Seller(OrderCodeType orderCodeType, Integer orderStatus, int createTime){
if (orderCodeType == null){
return null;
}
Integer leftTime = null;
Integer timeout = OrderInfo.PAY_TIME_SECOND;
if (orderCodeType == OrderCodeType.BUYER_TYPE){
timeout = OrderInfo.PAY_TIME_SECOND;
}
if (orderCodeType == OrderCodeType.SELLER_TYPE){
timeout = OrderInfo.SELLER_PAY_TIMEOUT;
}
boolean isFiredCal = (orderStatus == OrderStatus.WAITING_PAY.getCode())
|| (orderStatus == SkupStatus.CAN_NOT_SELL.getCode());
if(isFiredCal){
leftTime = calLeftTime(timeout, createTime);
}
return leftTime;
}
Integer getPayLeftTime(TabType actor, Integer orderStatus, int createTime){
boolean isBuyer = actor.equals(TabType.BUY);
boolean isSeller = actor.equals(TabType.SELL);
Integer leftTime = null;
int timeout = OrderInfo.PAY_TIME_SECOND;
boolean isFiredCal = (isBuyer && orderStatus == OrderStatus.WAITING_PAY.getCode())
|| (isSeller && orderStatus == SkupStatus.CAN_NOT_SELL.getCode());
if(isFiredCal){
... ...
... ... @@ -292,8 +292,8 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
.build();
// 待付款时 或待发货,剩余时间
Integer leftTime = getPayLeftTime(TabType.SELL, skupStatus.getCode(), order.getCreateTime());
Integer leftTime = getPayLeftTime4Seller(OrderCodeType.SELLER_TYPE,
skupStatus.getCode(), order.getCreateTime());
statusDetail.setLeftTime(leftTime);
return statusDetail;
... ... @@ -341,7 +341,6 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
orderDetailInfo.setUserAddress(addressInfo);
//卖家
assembleSoldPrdCompute(orderDetailInfo, order.getUid(), sellerOrderGoods.getId());
OrderDetailInfo.StatusDetail statusDetail = getStatusDetail(order, skupStatus);
if(SHOW_OVER_FLOW_PRICE_STATUS.contains(skupStatus.getCode())) {
... ... @@ -404,11 +403,15 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
@Override
protected void resetDynamicProporties(OrderDetailInfo orderDetailInfo) {
Integer leftTime = getLeftTime(TabType.SELL, orderDetailInfo.getUid(), orderDetailInfo.getOrderCode(),
orderDetailInfo.getStatusDetail().getStatus(), orderDetailInfo.getSecendLevelCreateTime());
orderDetailInfo.getStatusDetail().setLeftTime(leftTime);
long orderCode = orderDetailInfo.getOrderCode();
CodeMeta codeMeta = orderCodeGenerator.expId(orderCode);
//TabType tabType = TabType.SELL;
Integer orderStatus = orderDetailInfo.getStatusDetail().getStatus();
if (codeMeta!=null) {
OrderCodeType orderCodeType = OrderCodeType.getOrderCodeType(codeMeta.getType());
Integer leftTime = getPayLeftTime4Seller(orderCodeType, orderStatus, orderDetailInfo.getSecendLevelCreateTime());
orderDetailInfo.getStatusDetail().setLeftTime(leftTime);
}
}
@Override
... ...
... ... @@ -144,12 +144,13 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde
list.forEach(oli -> {
long orderCode = oli.getOrderCode();
CodeMeta codeMeta = orderCodeGenerator.expId(orderCode);
TabType tabType = TabType.SELL;
//TabType tabType = TabType.SELL;
Integer orderStatus = oli.getStatus();
if (codeMeta!=null && codeMeta.getType() == OrderCodeType.BUYER_TYPE.getType()){
tabType = TabType.BUY;
if (codeMeta!=null){
OrderCodeType orderCodeType = OrderCodeType.getOrderCodeType(codeMeta.getType());
oli.setLeftTime(getPayLeftTime4Seller(orderCodeType, orderStatus, oli.getSecendLevelCreateTime()));
}
oli.setLeftTime(getPayLeftTime(tabType, orderStatus, oli.getSecendLevelCreateTime()));
if(SellerOrderListType.WAITING_PAY.getType() == type) {
BuyerOrderGoods bog = buyerOrderGoodsMapper.selectByOrderCode(oli.getBuyerUid(), oli.getOrderCode());
... ...