...
|
...
|
@@ -9,6 +9,7 @@ import com.yohobuy.ufo.model.order.constants.OrderConstant; |
|
|
import com.yohobuy.ufo.model.order.constants.SkupType;
|
|
|
import com.yohobuy.ufo.model.order.resp.ExpressInfoDetail;
|
|
|
import com.yohobuy.ufo.model.order.vo.AddressInfo;
|
|
|
import com.yohoufo.common.utils.BigDecimalHelper;
|
|
|
import com.yohoufo.common.utils.DateUtil;
|
|
|
import com.yohoufo.dal.order.*;
|
|
|
import com.yohoufo.dal.order.model.*;
|
...
|
...
|
@@ -18,6 +19,7 @@ import com.yohoufo.order.constants.MetaKey; |
|
|
import com.yohoufo.order.constants.ViewType;
|
|
|
import com.yohoufo.order.convert.GoodsInfoConvertor;
|
|
|
import com.yohoufo.order.convert.SellerOrderConvertor;
|
|
|
import com.yohoufo.order.model.dto.BuyerPenaltyCalResult;
|
|
|
import com.yohoufo.order.model.dto.SellerOrderComputeResult;
|
|
|
import com.yohoufo.order.model.request.OrderRequest;
|
|
|
import com.yohoufo.order.model.response.OrderDetailInfo;
|
...
|
...
|
@@ -25,6 +27,7 @@ import com.yohoufo.order.mq.DelayTime; |
|
|
import com.yohoufo.order.service.AbsSellerOrderViewService;
|
|
|
import com.yohoufo.order.service.IOrderDetailService;
|
|
|
import com.yohoufo.order.service.cache.OrderCacheService;
|
|
|
import com.yohoufo.order.service.handler.BuyerCancelCompensateComputeHandler;
|
|
|
import com.yohoufo.order.service.impl.processor.SellerOrderPrepareProcessor;
|
|
|
import com.yohoufo.order.service.proxy.DeliveryMinutesService;
|
|
|
import com.yohoufo.order.service.proxy.ProductProxyService;
|
...
|
...
|
@@ -87,10 +90,12 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
|
|
@Autowired
|
|
|
private SellerOrderPrepareProcessor sellerOrderPrepareProcessor;
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
private OrderOverTimeService orderOverTimeService;
|
|
|
|
|
|
@Autowired
|
|
|
private BuyerCancelCompensateComputeHandler buyerCancelCompensateComputeHandler;
|
|
|
|
|
|
private static List<SkupStatus> noNeedShowOrderCode = Arrays.asList(SkupStatus.CAN_NOT_SELL,SkupStatus.CAN_SELL,
|
|
|
SkupStatus.SELF_CANCEL_PAY, SkupStatus.TIMEOUT_CANCEL,
|
|
|
SkupStatus.SELLER_CANCEL_SELL, SkupStatus.YOHO_CANCEL_SELL);
|
...
|
...
|
@@ -386,11 +391,9 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
|
|
OrderDetailInfo.StatusDetail statusDetail = OrderDetailInfo.StatusDetail.builder()
|
|
|
.status(orderStatus.getCode())
|
|
|
.statuStr(orderStatus.getStatusStr(tabType))
|
|
|
.detailDesc(orderStatus.getDetailDesc(tabType))
|
|
|
.build();
|
|
|
|
|
|
if(orderStatus.getCode() == OrderStatus.HAS_PAYED.getCode() || orderStatus.getCode() == OrderStatus.SEND_OUT_TIMEOUT.getCode()){
|
|
|
//TimeoutBo timeoutBo = ordersPayService.getDeliverLeftTime(buyerOrder.getUid(), buyerOrder.getOrderCode());
|
|
|
|
|
|
//orderOverTimeService
|
|
|
OrderOverTime orderOverTime = Optional.ofNullable(buyerOrder.getOrderCode()).map(orderOverTimeService::selectByOrderCode).orElse(null);
|
...
|
...
|
@@ -405,20 +408,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
|
|
}
|
|
|
}
|
|
|
OrderAttributes oa = OrderAttributes.getOrderAttributes(buyerOrder.getAttributes());
|
|
|
/*
|
|
|
if(orderStatus == OrderStatus.HAS_PAYED){
|
|
|
Integer deliverLeftTime = getDeliverLeftTime(buyerOrder.getUid(), buyerOrder.getOrderCode(), buyerOrder.getStatus(), oa);
|
|
|
if (deliverLeftTime != null){
|
|
|
statusDetail.setLeftTime(deliverLeftTime);
|
|
|
}
|
|
|
}
|
|
|
if(orderStatus == OrderStatus.WAITING_PAY){
|
|
|
Integer leftTime = getLeftTime(tabType,buyerOrder.getUid(), buyerOrder.getOrderCode(),
|
|
|
orderStatus.getCode(), buyerOrder.getCreateTime(), oa);
|
|
|
if (Objects.nonNull(leftTime)){
|
|
|
statusDetail.setLeftTime(leftTime);
|
|
|
}
|
|
|
}*/
|
|
|
|
|
|
Integer buyerUid = buyerOrder.getUid();
|
|
|
Long orderCode = buyerOrder.getOrderCode();
|
|
|
int orderStatusCode = orderStatus.getCode();
|
...
|
...
|
@@ -430,9 +420,26 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I |
|
|
if(ActionStatusHold.getSellerShowExpressStatusList().contains(orderStatus.getCode())){
|
|
|
statusDetail.setExpressShow(true);
|
|
|
}
|
|
|
//.detailDesc(orderStatus.getDetailDesc(tabType))
|
|
|
String detailDesc = formatDetailDesc(buyerOrder, orderStatus, tabType);
|
|
|
|
|
|
statusDetail.setDetailDesc(detailDesc);
|
|
|
return statusDetail;
|
|
|
}
|
|
|
|
|
|
private String formatDetailDesc(BuyerOrder buyerOrder,OrderStatus orderStatus, TabType tabType){
|
|
|
String detailDesc = orderStatus.getDetailDesc(tabType);
|
|
|
if (Objects.nonNull(orderStatus)
|
|
|
&& (OrderStatus.BUYER_CANCEL_BEFORE_SELLER_DELIVER.equals(orderStatus)
|
|
|
|| OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.equals(orderStatus))){
|
|
|
BuyerPenaltyCalResult bpcr ;
|
|
|
final OrderStatus targetStatus = orderStatus;
|
|
|
bpcr = buyerCancelCompensateComputeHandler.calBuyerPenaltyCalResult(buyerOrder, targetStatus);
|
|
|
detailDesc = String.format(detailDesc, BigDecimalHelper.halfUp(bpcr.getPenaltyAmount()).doubleValue());
|
|
|
}
|
|
|
return detailDesc;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
protected void resetDynamicProporties(OrderDetailInfo orderDetailInfo) {
|
|
|
Long orderCode = orderDetailInfo.getOrderCode();
|
...
|
...
|
|