Authored by chenchao

optimized left time 4 seller order list

... ... @@ -4,7 +4,6 @@ import com.yohobuy.ufo.model.order.bo.ButtonShowBo;
import com.yohobuy.ufo.model.order.bo.OrderInfo;
import com.yohobuy.ufo.model.order.bo.TimeoutBo;
import com.yohobuy.ufo.model.order.common.*;
import com.yohoufo.common.utils.DateUtil;
import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.order.common.Payment;
import com.yohoufo.order.constants.ViewType;
... ... @@ -12,8 +11,10 @@ import com.yohoufo.order.model.dto.BuyerPenaltyCalResult;
import com.yohoufo.order.model.response.OrderDetailInfo;
import com.yohoufo.order.service.handler.BuyerCancelCompensateComputeHandler;
import com.yohoufo.order.service.support.codegenerator.OrderCodeGenerator;
import com.yohoufo.order.service.support.codegenerator.bean.CodeMeta;
import com.yohoufo.order.service.wrapper.*;
import com.yohoufo.order.service.wrapper.OrderTimeoutContext;
import com.yohoufo.order.service.wrapper.OrderTimeoutFactory;
import com.yohoufo.order.service.wrapper.SellerOrderTimeoutWrapper;
import com.yohoufo.order.service.wrapper.TimeoutWrapper;
import com.yohoufo.order.utils.BuyerOrderUtils;
import com.yohoufo.order.utils.TimeUtils;
import org.apache.commons.collections.CollectionUtils;
... ... @@ -209,6 +210,7 @@ public abstract class AbsOrderViewService {
return leftTime;
}
@Deprecated
Integer getPayLeftTime(TabType actor, Integer orderStatus, int createTime){
boolean isBuyer = actor.equals(TabType.BUY);
boolean isSeller = actor.equals(TabType.SELL);
... ... @@ -223,6 +225,7 @@ public abstract class AbsOrderViewService {
return leftTime;
}
@Deprecated
Integer getDeliverLeftTime(int buyerUid, long orderCode, Integer orderStatus, OrderAttributes oa){
Integer leftTime = null;
if (OrderStatus.HAS_PAYED.getCode() == orderStatus){
... ... @@ -232,14 +235,6 @@ public abstract class AbsOrderViewService {
return leftTime;
}
Integer getDeliverTimeLimit(int buyerUid, long orderCode, Integer orderStatus, OrderAttributes oa){
Integer timeLimit = null;
if (OrderStatus.HAS_PAYED.getCode() == orderStatus){
TimeoutBo timeoutBo = ordersPayService.getDeliverLeftTime(buyerUid, orderCode, oa);
timeLimit = timeoutBo.getTimelimit();
}
return timeLimit;
}
... ...
... ... @@ -4,7 +4,6 @@ import com.google.common.collect.Maps;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yohobuy.ufo.model.order.bo.TimeoutBo;
import com.yohobuy.ufo.model.order.common.ButtonShow;
import com.yohobuy.ufo.model.order.common.OrderAttributes;
import com.yohobuy.ufo.model.order.common.OrderListType;
import com.yohobuy.ufo.model.order.common.TabType;
... ...
... ... @@ -30,6 +30,8 @@ import com.yohoufo.order.service.cache.OrderCacheService;
import com.yohoufo.order.service.proxy.ProductProxyService;
import com.yohoufo.order.service.proxy.UserProxyService;
import com.yohoufo.order.service.support.codegenerator.bean.CodeMeta;
import com.yohoufo.order.service.wrapper.BuyerOrderDeliverTimeoutWrapper;
import com.yohoufo.order.service.wrapper.BuyerOrderTimeoutWrapper;
import com.yohoufo.order.service.wrapper.SellerOrderTimeoutWrapper;
import com.yohoufo.order.utils.LoggerUtils;
import com.yohoufo.order.utils.OrderAssist;
... ... @@ -197,8 +199,14 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde
BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
if (Objects.nonNull(buyerOrder)) {
//存在时说明已经有买家下单 当前状态来自于买家订单
Integer buyerUid;
Integer buyerUid = buyerOrder.getUid();
OrderAttributes oa = OrderAttributes.getOrderAttributes(buyerOrder.getAttributes());
TimeoutBo timeoutBo = calTimeout(TabType.SELL, buyerUid, orderCode, orderStatus, buyerOrder.getCreateTime(), oa);
if (Objects.nonNull(timeoutBo)){
oli.setLeftTime(timeoutBo.getLeftTime());
oli.setTimeLimit(timeoutBo.getTimelimit());
}
/*
Integer leftTime = getDeliverLeftTime(buyerUid=buyerOrder.getUid(), orderCode, orderStatus, oa);
if (leftTime != null) {
oli.setLeftTime(leftTime);
... ... @@ -207,7 +215,7 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde
Integer timeLimit = getDeliverTimeLimit(buyerUid, orderCode, orderStatus, oa);
if (timeLimit != null) {
oli.setTimeLimit(timeLimit);
}
}*/
}
}
});
... ...