Authored by wujiexiang

求购 -- 卖家支付

  1 +package com.yohoufo.order.service;
  2 +
  3 +import com.alibaba.fastjson.JSON;
  4 +import com.alibaba.fastjson.JSONObject;
  5 +import com.yoho.core.common.utils.DateUtil;
  6 +import com.yoho.core.dal.datasource.annotation.Database;
  7 +import com.yoho.error.ServiceError;
  8 +import com.yoho.error.exception.ServiceException;
  9 +import com.yohobuy.ufo.model.order.bo.OrderInfo;
  10 +import com.yohobuy.ufo.model.order.common.OrderCodeType;
  11 +import com.yohobuy.ufo.model.order.common.SellerOrderStatus;
  12 +import com.yohobuy.ufo.model.order.common.SkupStatus;
  13 +import com.yohoufo.common.alarm.EventBusPublisher;
  14 +import com.yohoufo.dal.order.SellerOrderGoodsMapper;
  15 +import com.yohoufo.dal.order.SellerOrderMapper;
  16 +import com.yohoufo.dal.order.SellerOrderMetaMapper;
  17 +import com.yohoufo.dal.order.model.SellerOrder;
  18 +import com.yohoufo.dal.order.model.SellerOrderGoods;
  19 +import com.yohoufo.dal.order.model.SellerOrderMeta;
  20 +import com.yohoufo.order.common.ActionStatusHold;
  21 +import com.yohoufo.order.constants.MetaKey;
  22 +import com.yohoufo.order.event.SellerBidOrderPaySuccessEvent;
  23 +import com.yohoufo.order.model.request.PaymentRequest;
  24 +import com.yohoufo.order.model.response.PrepayResponse;
  25 +import com.yohoufo.order.mq.DelayTime;
  26 +import com.yohoufo.order.service.cache.CacheCleaner;
  27 +import com.yohoufo.order.service.impl.TradeBillsService;
  28 +import com.yohoufo.order.service.proxy.SellerNoticeFacade;
  29 +import com.yohoufo.order.service.seller.SellerGoodsStatusFlowService;
  30 +import com.yohoufo.order.utils.LoggerUtils;
  31 +import org.apache.commons.lang3.StringUtils;
  32 +import org.slf4j.Logger;
  33 +import org.springframework.beans.factory.annotation.Autowired;
  34 +import org.springframework.stereotype.Service;
  35 +
  36 +import java.util.Objects;
  37 +
  38 +@Service
  39 +public class SellerBidOrderPaymentService extends AbstractOrderPaymentService {
  40 + private final Logger logger = LoggerUtils.getSellerOrderLogger();
  41 +
  42 + @Autowired
  43 + SellerOrderMapper sellerOrderMapper;
  44 +
  45 + @Autowired
  46 + private SellerOrderGoodsMapper sellerOrderGoodsMapper;
  47 +
  48 + @Autowired
  49 + SellerOrderMetaMapper sellerOrderMetaMapper;
  50 +
  51 + @Autowired
  52 + private CacheCleaner cacheCleaner;
  53 +
  54 + @Autowired
  55 + private SellerNoticeFacade sellerNoticeFacade;
  56 +
  57 + @Autowired
  58 + private SellerGoodsStatusFlowService sellerGoodsStatusFlowService;
  59 +
  60 + @Autowired
  61 + private TradeBillsService tradeBillsService;
  62 +
  63 + /**
  64 + * 更新订单状态
  65 + *
  66 + * @param orderInfo
  67 + */
  68 + @Override
  69 + public int updateOrderStatusPaid(OrderInfo orderInfo) {
  70 + //
  71 + logger.info("in update seller OrderStatus after Paid, orderInfo {}", orderInfo);
  72 + Long orderCode = orderInfo.getOrderCode();
  73 +
  74 + SellerOrder sellerOrder = new SellerOrder();
  75 + sellerOrder.setOrderCode(orderCode);
  76 + sellerOrder.setUid(orderInfo.getUid());
  77 + SellerOrderStatus soTargetStatus = SellerOrderStatus.HAS_PAYED;
  78 + sellerOrder.setStatus(soTargetStatus.getCode());
  79 +
  80 + orderInfo.setStatus(soTargetStatus.getCode());
  81 + sellerOrder.setUpdateTime(DateUtil.getCurrentTimeSecond());
  82 + sellerOrder.setExceptStatus(SellerOrderStatus.WAITING_PAY.getCode());
  83 + int updateCnt = sellerOrderMapper.updateByOrderCode(sellerOrder);
  84 + if (1 == updateCnt) {
  85 + //
  86 + SellerOrderGoods targetSog = new SellerOrderGoods();
  87 + targetSog.setId(orderInfo.getSkup());
  88 + targetSog.setStatus(SkupStatus.SELL_OUT.getCode());
  89 + sellerOrderGoodsMapper.updateByPrimaryKeySelective(targetSog);
  90 + }
  91 + return updateCnt;
  92 + }
  93 +
  94 +
  95 + @Override
  96 + public void processAfterPay(OrderInfo orderInfo) {
  97 + logger.info("SellerBidOrderPaymentService.processAfterPay in, orderInfo is {}", orderInfo);
  98 + //
  99 + int sellerUid = orderInfo.getUid();
  100 + Long orderCode = orderInfo.getOrderCode();
  101 +
  102 + Integer payment = orderInfo.getPayment();
  103 + tradeBillsService.addPayEnsureRecord(orderInfo.getUid(), orderInfo.getSkup(), orderCode, payment,
  104 + orderInfo.getAmount());
  105 +
  106 + SellerOrder sellerOrder = sellerOrderMapper.selectByOrderCode(orderCode);
  107 + SellerOrderGoods sellerOrderGoods = null;
  108 + if (Objects.nonNull(sellerOrder)) {
  109 + sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(sellerOrder.getSkup());
  110 + String prdName = sellerOrderGoods.getProductName();
  111 + String sizeName = sellerOrderGoods.getSizeName();
  112 + Integer productId = sellerOrderGoods.getProductId();
  113 +
  114 + //async
  115 + SkupStatus skupStatus = SkupStatus.CAN_SELL;
  116 + sellerGoodsStatusFlowService.pushStatusFlowEvent(sellerOrderGoods.getId(), skupStatus.getCode());
  117 + //卖家bid订单保证金支付完成事件
  118 + EventBusPublisher.publishEvent(SellerBidOrderPaySuccessEvent.builder().uid(sellerUid).skup(sellerOrderGoods.getId()).build());
  119 +
  120 + sellerNoticeFacade.saleShelf(sellerUid, prdName, sizeName, productId, sellerOrderGoods.getAttributes());
  121 +
  122 + //
  123 + cacheCleaner.cleanSellerOrderDetailAndList(sellerOrderGoods, sellerOrder.getOrderCode());
  124 + }
  125 + }
  126 +
  127 +
  128 + /**
  129 + * 订单是否是待支付状态
  130 + *
  131 + * @param orderInfo
  132 + * @return
  133 + */
  134 + public boolean isOrderWaitingPay(OrderInfo orderInfo) {
  135 + if (isWaitingPay(orderInfo.getStatus())) {
  136 + return true;
  137 + }
  138 +
  139 + return false;
  140 + }
  141 +
  142 + /**
  143 + * 订单是否 已支付 状态
  144 + *
  145 + * @param orderInfo
  146 + * @return
  147 + */
  148 + public boolean isOrderPaid(OrderInfo orderInfo) {
  149 +
  150 + if (orderInfo.getStatus() == null ||
  151 + !Objects.equals(SellerOrderStatus.HAS_PAYED.getCode(), orderInfo.getStatus().intValue())) {
  152 + return false;
  153 + }
  154 +
  155 + return true;
  156 + }
  157 +
  158 +
  159 + public boolean canRefund(OrderInfo orderInfo) {
  160 + Integer sourceStatus = orderInfo.getSourceStatus();
  161 + if (sourceStatus != null &&
  162 + ActionStatusHold.getSellerCanRefundEarnestMoneyStatus().contains(sourceStatus.intValue())) {
  163 + return true;
  164 + }
  165 +
  166 + return false;
  167 + }
  168 +
  169 +
  170 + /**
  171 + * 保存前回预支付结果
  172 + *
  173 + * @param orderInfo
  174 + * @param response
  175 + */
  176 + public void saveAppPayRequest(OrderInfo orderInfo, PrepayResponse response) {
  177 +
  178 + SellerOrderMeta buyerOrderMeta = new SellerOrderMeta();
  179 + buyerOrderMeta.setUid(orderInfo.getUid());
  180 + buyerOrderMeta.setSkup(orderInfo.getSkup());
  181 + buyerOrderMeta.setMetaKey(MetaKey.APP_PAY_REQUEST);
  182 + buyerOrderMeta.setMetaValue(JSONObject.toJSONString(response));
  183 +
  184 + // 记录appPayRequest
  185 + sellerOrderMetaMapper.insert(buyerOrderMeta);
  186 + }
  187 +
  188 +
  189 + /**
  190 + * 获取前回的访问结果
  191 + *
  192 + * @param request
  193 + * @return
  194 + */
  195 + public PrepayResponse getAppPayRequest(PaymentRequest request) {
  196 + SellerOrderMeta buyerOrderMeta = sellerOrderMetaMapper.selectByMetaKey(request.getUid(), request.getSkup(), MetaKey.APP_PAY_REQUEST);
  197 +
  198 + if (buyerOrderMeta == null || StringUtils.isEmpty(buyerOrderMeta.getMetaValue())) {
  199 + return null;
  200 + }
  201 + try {
  202 + PrepayResponse response = JSON.parseObject(buyerOrderMeta.getMetaValue(), PrepayResponse.class);
  203 + return response;
  204 + } catch (Exception e) {
  205 +
  206 + }
  207 + return null;
  208 + }
  209 +
  210 +
  211 + /**
  212 + * 预支付方式更新
  213 + *
  214 + * @param orderInfo
  215 + */
  216 + public void updatePayment(OrderInfo orderInfo, int payment) {
  217 +
  218 + SellerOrder sellerOrder = new SellerOrder();
  219 + // 更新预支付方式
  220 + sellerOrder.setId(orderInfo.getId());
  221 + sellerOrder.setPayment(payment);
  222 + sellerOrder.setUpdateTime(DateUtil.getCurrentTimeSecond());
  223 + sellerOrderMapper.updateByPrimaryKeySelective(sellerOrder);
  224 +
  225 + }
  226 +
  227 +
  228 + /**
  229 + * 检查状态
  230 + *
  231 + * @param orderInfo
  232 + */
  233 + public void checkOrderStatus(OrderInfo orderInfo) {
  234 + // 订单不是未付款的状态
  235 + if (!isWaitingPay(orderInfo.getStatus())) {
  236 + logger.warn("payment status not allow {}, orderCode is {}, uid is {}", orderInfo.getStatus(),
  237 + orderInfo.getOrderCode(), orderInfo.getUid());
  238 + throw new ServiceException(ServiceError.ORDER_PAY_NOT_ALLOW);
  239 + }
  240 + }
  241 +
  242 +
  243 + @Override
  244 + public boolean isTimeoutCancelStatus(OrderInfo orderInfo) {
  245 + if (orderInfo.getStatus() != null &&
  246 + (orderInfo.getStatus().intValue() == SellerOrderStatus.TIMEOUT_CANCEL.getCode() || orderInfo.getStatus().intValue() == SellerOrderStatus.SELf_CANCEL_PAY.getCode())) {
  247 + return true;
  248 + }
  249 +
  250 + return false;
  251 + }
  252 +
  253 + /**
  254 + * 获取订单情报
  255 + *
  256 + * @param orderCode
  257 + * @return
  258 + */
  259 + public OrderInfo getOrderInfo(long orderCode, int uid) {
  260 +
  261 + SellerOrder sellerOrder = checkAndGetSellerOrder(orderCode);
  262 +
  263 + SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(sellerOrder.getSkup());
  264 +
  265 + OrderInfo orderInfo = buildOrderInfo(orderCode, uid, sellerOrder);
  266 + if (sellerOrderGoods != null) {
  267 + orderInfo.setAttributes(sellerOrderGoods.getAttributes());
  268 + }
  269 +
  270 + return orderInfo;
  271 + }
  272 +
  273 + private OrderInfo buildOrderInfo(long orderCode, int uid, SellerOrder sellerOrder) {
  274 + OrderInfo orderInfo = OrderInfo.builder()
  275 + .id(sellerOrder.getId())
  276 + .sellerUid(sellerOrder.getUid())
  277 + .uid(uid)
  278 + .orderCode(orderCode)
  279 + .payment(sellerOrder.getPayment())
  280 + .skup(sellerOrder.getSkup())
  281 + .status(sellerOrder.getStatus())
  282 + .orderCodeType(OrderCodeType.SELLER_TYPE)
  283 + .createTime(sellerOrder.getCreateTime())
  284 + .amount(sellerOrder.getEarnestMoney())
  285 + .payExpireTime(DelayTime.SELLER_ORDER_WAITING_PAY)
  286 + .payExpire(sellerOrder.getCreateTime() + covertFen(DelayTime.SELLER_ORDER_WAITING_PAY))
  287 + .build();
  288 + return orderInfo;
  289 + }
  290 +
  291 + /**
  292 + * 获取订单情报
  293 + *
  294 + * @param orderCode
  295 + * @return
  296 + */
  297 + @Database(ForceMaster = true)
  298 + @Override
  299 + public OrderInfo getOrderInfo(long orderCode) {
  300 +
  301 + SellerOrder sellerOrder = checkAndGetSellerOrder(orderCode);
  302 +
  303 + OrderInfo orderInfo = OrderInfo.builder()
  304 + .uid(sellerOrder.getUid())
  305 + .orderCode(orderCode)
  306 + .payment(sellerOrder.getPayment())
  307 + .skup(sellerOrder.getSkup())
  308 + .status(sellerOrder.getStatus())
  309 + .orderCodeType(OrderCodeType.SELLER_TYPE)
  310 + .amount(sellerOrder.getEarnestMoney())
  311 + .sourceStatus(sellerOrder.getStatus())
  312 + .createTime(sellerOrder.getCreateTime())
  313 + .build();
  314 + return orderInfo;
  315 + }
  316 +
  317 + private SellerOrder checkAndGetSellerOrder(long orderCode) {
  318 + SellerOrder sellerOrder = sellerOrderMapper.selectByOrderCode(orderCode);
  319 +
  320 + if (sellerOrder == null) {
  321 + logger.warn("getOrderInfo order not exist, orderCode is {}", orderCode);
  322 + throw new ServiceException(ServiceError.ORDER_NULL);
  323 + }
  324 +
  325 + return sellerOrder;
  326 + }
  327 +
  328 + /**
  329 + * 定金状态
  330 + *
  331 + * @param orderCode
  332 + * @return
  333 + */
  334 + public boolean isSupport(long orderCode) {
  335 + SellerOrder sellerOrder = checkAndGetSellerOrder(orderCode);
  336 + if (isWaitingPay(sellerOrder.getStatus())) {
  337 + SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(sellerOrder.getSkup());
  338 + return sellerOrderGoods.isBidSkup();
  339 + } else {
  340 + return false;
  341 + }
  342 + }
  343 +
  344 +
  345 + private boolean isWaitingPay(Integer status) {
  346 + return status != null && SellerOrderStatus.WAITING_PAY.getCode() == status;
  347 + }
  348 +}
@@ -7,7 +7,6 @@ import com.yoho.core.dal.datasource.annotation.Database; @@ -7,7 +7,6 @@ import com.yoho.core.dal.datasource.annotation.Database;
7 import com.yoho.error.ServiceError; 7 import com.yoho.error.ServiceError;
8 import com.yoho.error.exception.ServiceException; 8 import com.yoho.error.exception.ServiceException;
9 import com.yohobuy.ufo.model.order.common.SkupStatus; 9 import com.yohobuy.ufo.model.order.common.SkupStatus;
10 -import com.yohobuy.ufo.model.order.common.TabType;  
11 import com.yohoufo.common.alarm.EventBusPublisher; 10 import com.yohoufo.common.alarm.EventBusPublisher;
12 import com.yohoufo.dal.order.SellerOrderGoodsMapper; 11 import com.yohoufo.dal.order.SellerOrderGoodsMapper;
13 import com.yohoufo.dal.order.SellerOrderMapper; 12 import com.yohoufo.dal.order.SellerOrderMapper;
@@ -20,13 +19,11 @@ import com.yohobuy.ufo.model.order.common.OrderCodeType; @@ -20,13 +19,11 @@ import com.yohobuy.ufo.model.order.common.OrderCodeType;
20 import com.yohobuy.ufo.model.order.common.SellerOrderStatus; 19 import com.yohobuy.ufo.model.order.common.SellerOrderStatus;
21 import com.yohoufo.order.constants.MetaKey; 20 import com.yohoufo.order.constants.MetaKey;
22 import com.yohobuy.ufo.model.order.bo.OrderInfo; 21 import com.yohobuy.ufo.model.order.bo.OrderInfo;
23 -import com.yohoufo.order.event.SellerBidOrderPaySuccessEvent;  
24 import com.yohoufo.order.event.SellerOrderPriceChangeEvent; 22 import com.yohoufo.order.event.SellerOrderPriceChangeEvent;
25 import com.yohoufo.order.model.request.PaymentRequest; 23 import com.yohoufo.order.model.request.PaymentRequest;
26 import com.yohoufo.order.model.response.PrepayResponse; 24 import com.yohoufo.order.model.response.PrepayResponse;
27 import com.yohoufo.order.mq.DelayTime; 25 import com.yohoufo.order.mq.DelayTime;
28 import com.yohoufo.order.service.cache.CacheCleaner; 26 import com.yohoufo.order.service.cache.CacheCleaner;
29 -import com.yohoufo.order.service.cache.CacheKeyBuilder;  
30 import com.yohoufo.order.service.proxy.SellerNoticeFacade; 27 import com.yohoufo.order.service.proxy.SellerNoticeFacade;
31 import com.yohoufo.order.service.seller.SkupService; 28 import com.yohoufo.order.service.seller.SkupService;
32 import com.yohoufo.order.service.impl.TradeBillsService; 29 import com.yohoufo.order.service.impl.TradeBillsService;
@@ -38,8 +35,6 @@ import org.apache.commons.lang3.StringUtils; @@ -38,8 +35,6 @@ import org.apache.commons.lang3.StringUtils;
38 import org.slf4j.Logger; 35 import org.slf4j.Logger;
39 import org.springframework.beans.factory.annotation.Autowired; 36 import org.springframework.beans.factory.annotation.Autowired;
40 import org.springframework.stereotype.Service; 37 import org.springframework.stereotype.Service;
41 -  
42 -import java.util.Arrays;  
43 import java.util.Objects; 38 import java.util.Objects;
44 39
45 40
@@ -143,11 +138,6 @@ public class SellerOrderPaymentService extends AbstractOrderPaymentService { @@ -143,11 +138,6 @@ public class SellerOrderPaymentService extends AbstractOrderPaymentService {
143 logger.info("in processAfterPay change price processAfterChangePriceOrderPaid occur error , after syncPrdStatus 2 can-sell, invoke asyncHook, orderInfo {}", orderInfo); 138 logger.info("in processAfterPay change price processAfterChangePriceOrderPaid occur error , after syncPrdStatus 2 can-sell, invoke asyncHook, orderInfo {}", orderInfo);
144 asyncHook.callBack(); 139 asyncHook.callBack();
145 } 140 }
146 -  
147 - //卖家bid订单保证金支付完成事件  
148 - if (sellerOrderGoods.isBidSkup()) {  
149 - EventBusPublisher.publishEvent(SellerBidOrderPaySuccessEvent.builder().uid(sellerUid).skup(sellerOrderGoods.getId()).build());  
150 - }  
151 } 141 }
152 142
153 sellerNoticeFacade.saleShelf(sellerUid, prdName,sizeName,productId,sellerOrderGoods.getAttributes()); 143 sellerNoticeFacade.saleShelf(sellerUid, prdName,sizeName,productId,sellerOrderGoods.getAttributes());
@@ -29,6 +29,9 @@ public class OrderPaymentServiceFactory { @@ -29,6 +29,9 @@ public class OrderPaymentServiceFactory {
29 SellerOrderPaymentService sellerOrderPaymentService; 29 SellerOrderPaymentService sellerOrderPaymentService;
30 30
31 @Autowired 31 @Autowired
  32 + SellerBidOrderPaymentService sellerBidOrderPaymentService;
  33 +
  34 + @Autowired
32 MerchantOrderPaymentService merchantOrderPaymentService; 35 MerchantOrderPaymentService merchantOrderPaymentService;
33 36
34 @Autowired 37 @Autowired
@@ -66,7 +69,11 @@ public class OrderPaymentServiceFactory { @@ -66,7 +69,11 @@ public class OrderPaymentServiceFactory {
66 paymentService = this.buyerOrderPaymentService; 69 paymentService = this.buyerOrderPaymentService;
67 } 70 }
68 } else if (codeMeta.getType() == OrderCodeType.SELLER_TYPE.getType()) { 71 } else if (codeMeta.getType() == OrderCodeType.SELLER_TYPE.getType()) {
  72 + if (sellerBidOrderPaymentService.isSupport(orderCode)) {
  73 + paymentService = this.sellerBidOrderPaymentService;
  74 + } else {
69 paymentService = this.sellerOrderPaymentService; 75 paymentService = this.sellerOrderPaymentService;
  76 + }
70 } else if (codeMeta.getType() == OrderCodeType.SELLER_RECHARGE_EARNEST_TYPE.getType()) { 77 } else if (codeMeta.getType() == OrderCodeType.SELLER_RECHARGE_EARNEST_TYPE.getType()) {
71 paymentService = this.merchantOrderPaymentService; 78 paymentService = this.merchantOrderPaymentService;
72 } else if (codeMeta.getType() == OrderCodeType.STORAGE_MANAGEMENT.getType()) { 79 } else if (codeMeta.getType() == OrderCodeType.STORAGE_MANAGEMENT.getType()) {
@@ -401,6 +401,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I @@ -401,6 +401,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
401 orderDetailInfo.setIsAdvance(OrderAssist.getSkupIsAdvance(soga)); 401 orderDetailInfo.setIsAdvance(OrderAssist.getSkupIsAdvance(soga));
402 orderDetailInfo.setAttributes(soga); 402 orderDetailInfo.setAttributes(soga);
403 orderDetailInfo.setStatusDetail(statusDetail); 403 orderDetailInfo.setStatusDetail(statusDetail);
  404 + orderDetailInfo.setBidType(sellerOrderGoods.getBidType());
404 return orderDetailInfo; 405 return orderDetailInfo;
405 } 406 }
406 407
@@ -567,21 +568,24 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I @@ -567,21 +568,24 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
567 Integer createTime = null; 568 Integer createTime = null;
568 OrderCodeType orderCodeType = OrderCodeType.getOrderCodeType(codeMeta.getType()); 569 OrderCodeType orderCodeType = OrderCodeType.getOrderCodeType(codeMeta.getType());
569 OrderAttributes oa = null; 570 OrderAttributes oa = null;
  571 + TimeoutBo timeoutBo = null;
570 if(orderCodeType.getType() == OrderCodeType.BUYER_TYPE.getType()){ 572 if(orderCodeType.getType() == OrderCodeType.BUYER_TYPE.getType()){
571 BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode); 573 BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
572 buyerUid = buyerOrder.getUid(); 574 buyerUid = buyerOrder.getUid();
573 orderStatus = buyerOrder.getStatus(); 575 orderStatus = buyerOrder.getStatus();
574 createTime = buyerOrder.getCreateTime(); 576 createTime = buyerOrder.getCreateTime();
575 oa = OrderAttributes.getOrderAttributes(buyerOrder.getAttributes()); 577 oa = OrderAttributes.getOrderAttributes(buyerOrder.getAttributes());
576 - }else{  
577 - orderStatus = orderDetailInfo.getStatusDetail().getStatus();  
578 - createTime = orderDetailInfo.getSecendLevelCreateTime();  
579 - }  
580 - TimeoutBo timeoutBo = getTimeoutBo(buyerUid, orderCode, 578 + timeoutBo = getTimeoutBo(buyerUid, orderCode,
581 orderDetailInfo.getBidType(), 579 orderDetailInfo.getBidType(),
582 createTime, 580 createTime,
583 orderStatus, 581 orderStatus,
584 oa, TabType.SELL); 582 oa, TabType.SELL);
  583 + }else{
  584 + orderStatus = orderDetailInfo.getStatusDetail().getStatus();
  585 + createTime = orderDetailInfo.getSecendLevelCreateTime();
  586 + timeoutBo = calTimeout(TabType.SELL, buyerUid, orderCode,
  587 + orderStatus, createTime, oa);
  588 + }
585 Integer leftTime = timeoutBo.getLeftTime(); 589 Integer leftTime = timeoutBo.getLeftTime();
586 orderDetailInfo.getStatusDetail().setLeftTime(leftTime); 590 orderDetailInfo.getStatusDetail().setLeftTime(leftTime);
587 591