Authored by chenchao

remove cancel button of paid overseas order

... ... @@ -304,5 +304,6 @@ public abstract class AbsOrderDetailService extends AbsOrderViewService implemen
*/
protected abstract void resetDynamicProporties(OrderDetailInfo orderDetailInfo,String appVersion);
@Override
abstract Logger getLogger();
}
... ...
... ... @@ -275,6 +275,9 @@ public abstract class AbsOrderListService extends AbsOrderViewService implements
}
private List<ButtonShowBo> convertOperatable(List<ButtonShowBo> buttonShowBos){
return buttonShowBos == null ? new ArrayList<>(2) : new ArrayList<>(buttonShowBos);
}
/**
* 获取返回结果
... ... @@ -335,9 +338,8 @@ public abstract class AbsOrderListService extends AbsOrderViewService implements
return null;
}
// 按钮显示
List<ButtonShowBo> buttonShowBos = orderStatus.getListButtons(tabType);
orderListInfo.setButtons(formatButtons(buyerOrder, buyerOrderGoods, buttonShowBos == null ? new ArrayList<>() : new ArrayList<>(buttonShowBos), ViewType.LIST));
List<ButtonShowBo> buttonShowBos = convertOperatable(orderStatus.getListButtons(tabType));
orderListInfo.setButtons(formatButtons(buyerOrder, buyerOrderGoods, buttonShowBos, ViewType.LIST));
// 当剩余时间小于0
if (!CollectionUtils.isEmpty(orderListInfo.getButtons())){
... ...
... ... @@ -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())) {
... ...
... ... @@ -180,11 +180,6 @@ public class BuyerOrderDetailService extends AbsOrderDetailService implements IO
Integer oac = orderDetailInfo.getAttributes();
OrderAttributes oa = OrderAttributes.getOrderAttributes(oac);
Integer leftTime = null;
/*
Integer leftTime = getLeftTime(TabType.BUY, orderDetailInfo.getUid(), orderDetailInfo.getOrderCode(),
orderDetailInfo.getStatusDetail().getStatus(),
orderDetailInfo.getSecendLevelCreateTime(), oa);
*/
int orderStatusCode = orderDetailInfo.getStatusDetail().getStatus();
TimeoutBo timeoutBo = calTimeout(TabType.BUY, orderDetailInfo.getUid(), orderDetailInfo.getOrderCode(),
orderStatusCode,
... ... @@ -193,13 +188,7 @@ public class BuyerOrderDetailService extends AbsOrderDetailService implements IO
leftTime = timeoutBo.getLeftTime();
orderDetailInfo.getStatusDetail().setLeftTime(leftTime);
}
/*
boolean isWaitingPay = OrderStatus.WAITING_PAY.getCode() == orderStatusCode;
if (isWaitingPay && leftTime!=null && leftTime<=0){
orderDetailInfo.getButtons().removeIf(x -> x!=null && ButtonShow.NOW_BUY.getCode().equals(x.getCode()));
}*/
removeButtonIfRequired(leftTime, orderStatusCode, orderDetailInfo.getButtons());
}
... ...
... ... @@ -645,6 +645,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
PageResp orderListInfoRsp = buyerOrderListService.getOrderList(request, isPlatform);
if (orderListInfoRsp != null){
orderListVo = OrderListVo.builder().page(orderListInfoRsp.getPage())
.pageSize(orderListInfoRsp.getPageSize())
.orderList(orderListInfoRsp.getData())
... ...