Authored by chenchao

Merge branch 'hotfix1211buyerorderTimeout' into test6.8.3

@@ -2,6 +2,7 @@ package com.yohoufo.order.service.impl; @@ -2,6 +2,7 @@ package com.yohoufo.order.service.impl;
2 2
3 import com.yohobuy.ufo.model.order.bo.ButtonShowBo; 3 import com.yohobuy.ufo.model.order.bo.ButtonShowBo;
4 import com.yohobuy.ufo.model.order.bo.OrderInfo; 4 import com.yohobuy.ufo.model.order.bo.OrderInfo;
  5 +import com.yohobuy.ufo.model.order.common.OrderCodeType;
5 import com.yohobuy.ufo.model.order.common.OrderStatus; 6 import com.yohobuy.ufo.model.order.common.OrderStatus;
6 import com.yohobuy.ufo.model.order.common.SkupStatus; 7 import com.yohobuy.ufo.model.order.common.SkupStatus;
7 import com.yohobuy.ufo.model.order.common.TabType; 8 import com.yohobuy.ufo.model.order.common.TabType;
@@ -93,11 +94,32 @@ public abstract class AbsOrderViewService { @@ -93,11 +94,32 @@ public abstract class AbsOrderViewService {
93 return leftTime; 94 return leftTime;
94 } 95 }
95 96
  97 + Integer getPayLeftTime4Seller(OrderCodeType orderCodeType, Integer orderStatus, int createTime){
  98 + if (orderCodeType == null){
  99 + return null;
  100 + }
  101 + Integer leftTime = null;
  102 + Integer timeout = OrderInfo.PAY_TIME_SECOND;
  103 + if (orderCodeType == OrderCodeType.BUYER_TYPE){
  104 + timeout = OrderInfo.PAY_TIME_SECOND;
  105 + }
  106 + if (orderCodeType == OrderCodeType.SELLER_TYPE){
  107 + timeout = OrderInfo.SELLER_PAY_TIMEOUT;
  108 + }
  109 + boolean isFiredCal = (orderStatus == OrderStatus.WAITING_PAY.getCode())
  110 + || (orderStatus == SkupStatus.CAN_NOT_SELL.getCode());
  111 + if(isFiredCal){
  112 + leftTime = calLeftTime(timeout, createTime);
  113 + }
  114 + return leftTime;
  115 + }
  116 +
96 Integer getPayLeftTime(TabType actor, Integer orderStatus, int createTime){ 117 Integer getPayLeftTime(TabType actor, Integer orderStatus, int createTime){
97 boolean isBuyer = actor.equals(TabType.BUY); 118 boolean isBuyer = actor.equals(TabType.BUY);
98 boolean isSeller = actor.equals(TabType.SELL); 119 boolean isSeller = actor.equals(TabType.SELL);
99 Integer leftTime = null; 120 Integer leftTime = null;
100 int timeout = OrderInfo.PAY_TIME_SECOND; 121 int timeout = OrderInfo.PAY_TIME_SECOND;
  122 +
101 boolean isFiredCal = (isBuyer && orderStatus == OrderStatus.WAITING_PAY.getCode()) 123 boolean isFiredCal = (isBuyer && orderStatus == OrderStatus.WAITING_PAY.getCode())
102 || (isSeller && orderStatus == SkupStatus.CAN_NOT_SELL.getCode()); 124 || (isSeller && orderStatus == SkupStatus.CAN_NOT_SELL.getCode());
103 if(isFiredCal){ 125 if(isFiredCal){
@@ -274,8 +274,8 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I @@ -274,8 +274,8 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
274 .build(); 274 .build();
275 275
276 // 待付款时 或待发货,剩余时间 276 // 待付款时 或待发货,剩余时间
277 -  
278 - Integer leftTime = getPayLeftTime(TabType.SELL, skupStatus.getCode(), order.getCreateTime()); 277 + Integer leftTime = getPayLeftTime4Seller(OrderCodeType.SELLER_TYPE,
  278 + skupStatus.getCode(), order.getCreateTime());
279 statusDetail.setLeftTime(leftTime); 279 statusDetail.setLeftTime(leftTime);
280 280
281 return statusDetail; 281 return statusDetail;
@@ -323,7 +323,6 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I @@ -323,7 +323,6 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
323 orderDetailInfo.setUserAddress(addressInfo); 323 orderDetailInfo.setUserAddress(addressInfo);
324 //卖家 324 //卖家
325 assembleSoldPrdCompute(orderDetailInfo, order.getUid(), sellerOrderGoods.getId()); 325 assembleSoldPrdCompute(orderDetailInfo, order.getUid(), sellerOrderGoods.getId());
326 -  
327 OrderDetailInfo.StatusDetail statusDetail = getStatusDetail(order, skupStatus); 326 OrderDetailInfo.StatusDetail statusDetail = getStatusDetail(order, skupStatus);
328 327
329 if(SHOW_OVER_FLOW_PRICE_STATUS.contains(skupStatus.getCode())) { 328 if(SHOW_OVER_FLOW_PRICE_STATUS.contains(skupStatus.getCode())) {
@@ -383,11 +382,15 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I @@ -383,11 +382,15 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
383 382
384 @Override 383 @Override
385 protected void resetDynamicProporties(OrderDetailInfo orderDetailInfo) { 384 protected void resetDynamicProporties(OrderDetailInfo orderDetailInfo) {
386 -  
387 - Integer leftTime = getLeftTime(TabType.SELL, orderDetailInfo.getUid(), orderDetailInfo.getOrderCode(),  
388 - orderDetailInfo.getStatusDetail().getStatus(), orderDetailInfo.getSecendLevelCreateTime());  
389 -  
390 - orderDetailInfo.getStatusDetail().setLeftTime(leftTime); 385 + long orderCode = orderDetailInfo.getOrderCode();
  386 + CodeMeta codeMeta = orderCodeGenerator.expId(orderCode);
  387 + //TabType tabType = TabType.SELL;
  388 + Integer orderStatus = orderDetailInfo.getStatusDetail().getStatus();
  389 + if (codeMeta!=null) {
  390 + OrderCodeType orderCodeType = OrderCodeType.getOrderCodeType(codeMeta.getType());
  391 + Integer leftTime = getPayLeftTime4Seller(orderCodeType, orderStatus, orderDetailInfo.getSecendLevelCreateTime());
  392 + orderDetailInfo.getStatusDetail().setLeftTime(leftTime);
  393 + }
391 } 394 }
392 395
393 @Override 396 @Override
@@ -163,12 +163,13 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde @@ -163,12 +163,13 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde
163 list.forEach(oli -> { 163 list.forEach(oli -> {
164 long orderCode = oli.getOrderCode(); 164 long orderCode = oli.getOrderCode();
165 CodeMeta codeMeta = orderCodeGenerator.expId(orderCode); 165 CodeMeta codeMeta = orderCodeGenerator.expId(orderCode);
166 - TabType tabType = TabType.SELL; 166 + //TabType tabType = TabType.SELL;
167 Integer orderStatus = oli.getStatus(); 167 Integer orderStatus = oli.getStatus();
168 - if (codeMeta!=null && codeMeta.getType() == OrderCodeType.BUYER_TYPE.getType()){  
169 - tabType = TabType.BUY; 168 + if (codeMeta!=null){
  169 + OrderCodeType orderCodeType = OrderCodeType.getOrderCodeType(codeMeta.getType());
  170 + oli.setLeftTime(getPayLeftTime4Seller(orderCodeType, orderStatus, oli.getSecendLevelCreateTime()));
170 } 171 }
171 - oli.setLeftTime(getPayLeftTime(tabType, orderStatus, oli.getSecendLevelCreateTime())); 172 +
172 173
173 if(SellerOrderListType.WAITING_PAY.getType() == type) { 174 if(SellerOrderListType.WAITING_PAY.getType() == type) {
174 BuyerOrderGoods bog = buyerOrderGoodsMapper.selectByOrderCode(oli.getBuyerUid(), oli.getOrderCode()); 175 BuyerOrderGoods bog = buyerOrderGoodsMapper.selectByOrderCode(oli.getBuyerUid(), oli.getOrderCode());