...
|
...
|
@@ -6,13 +6,16 @@ import com.yohobuy.ufo.model.order.common.ButtonShow; |
|
|
import com.yohobuy.ufo.model.order.common.OrderAttributes;
|
|
|
import com.yohobuy.ufo.model.order.common.OrderStatus;
|
|
|
import com.yohobuy.ufo.model.order.common.TabType;
|
|
|
import com.yohobuy.ufo.model.order.constants.RegionEnum;
|
|
|
import com.yohoufo.dal.order.model.BuyerOrder;
|
|
|
import com.yohobuy.ufo.model.order.common.Payment;
|
|
|
import com.yohoufo.dal.order.model.BuyerOrderGoods;
|
|
|
import com.yohoufo.order.common.ActionStatusHold;
|
|
|
import com.yohoufo.order.constants.ViewType;
|
|
|
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.seller.support.SkupTypeCodeSupport;
|
|
|
import com.yohoufo.order.service.support.BuyerOrderButtonFormatFunction;
|
|
|
import com.yohoufo.order.service.wrapper.OrderTimeoutContext;
|
|
|
import com.yohoufo.order.service.wrapper.OrderTimeoutFactory;
|
...
|
...
|
@@ -49,7 +52,20 @@ public abstract class AbsOrderViewService { |
|
|
return (buttons, buyerOrder, buyerOrderGoods, viewType) -> formatButtons(buyerOrder, buyerOrderGoods, buttons, viewType);
|
|
|
}
|
|
|
|
|
|
private void removeUnnecessaryButton(BuyerOrder buyerOrder, List<ButtonShowBo> buttons, ViewType viewType){
|
|
|
disableBuyAgainIfOffline(buyerOrder, buttons, viewType);
|
|
|
//
|
|
|
remoreCancelButtonOfPaidOverseasOrder(buyerOrder, buttons);
|
|
|
}
|
|
|
|
|
|
private void remoreCancelButtonOfPaidOverseasOrder(BuyerOrder buyerOrder, List<ButtonShowBo> buttons){
|
|
|
Integer orderAttrCode = buyerOrder.getAttributes();
|
|
|
SkupTypeCodeSupport.CodeNode codeNode = SkupTypeCodeSupport.explain(orderAttrCode);
|
|
|
boolean isOverseasOrder = codeNode.getRegion() == RegionEnum.HONGKONG.getCode();
|
|
|
if (isOverseasOrder && ActionStatusHold.isBuyerPaid(buyerOrder.getStatus())){
|
|
|
buttons.removeIf(btn-> Objects.nonNull(btn) && ButtonShow.CANCEL_ORDER.getCode().equals(btn.getCode()));
|
|
|
}
|
|
|
}
|
|
|
/**
|
|
|
*
|
|
|
* @param buyerOrder
|
...
|
...
|
@@ -62,7 +78,7 @@ public abstract class AbsOrderViewService { |
|
|
return buttons;
|
|
|
}
|
|
|
|
|
|
disableBuyAgainIfOffline(buyerOrder, buttons, viewType);
|
|
|
removeUnnecessaryButton(buyerOrder, buttons, viewType);
|
|
|
|
|
|
//TODO optimized first query out status of order need BuyerPenaltyCalResult
|
|
|
int orderStatusCode = buyerOrder.getStatus();
|
...
|
...
|
@@ -101,7 +117,7 @@ public abstract class AbsOrderViewService { |
|
|
*/
|
|
|
private void disableBuyAgainIfOffline(final BuyerOrder buyerOrder, final List<ButtonShowBo> buttons, ViewType viewType) {
|
|
|
if(BuyerOrderUtils.isOffline(buyerOrder.getAttributes())
|
|
|
&& buttons != null && buttons.contains(ButtonShow.BUY_AGAIN.getBo())) {
|
|
|
&& buttons.contains(ButtonShow.BUY_AGAIN.getBo())) {
|
|
|
buttons.remove(ButtonShow.BUY_AGAIN.getBo());
|
|
|
//订单列表“再次购买”替换为“查看详情”,订单详情“再次购买”直接去掉
|
|
|
if(ViewType.LIST == viewType && !buttons.contains(ButtonShow.SHOW_DETAIL.getBo())) {
|
...
|
...
|
|