Authored by LUOXC

寄存订单不可以修改地址

... ... @@ -30,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.function.Predicate;
/**
* Created by chao.chen on 2018/11/26.
... ... @@ -176,6 +177,12 @@ public abstract class AbsOrderViewService {
}
}
public void removeButtonIf(boolean condition, List<ButtonShowBo> buttons, ButtonShow removedButton) {
if (condition) {
buttons.removeIf(x -> x != null && removedButton.getCode().equals(x.getCode()));
}
}
protected abstract String buildOrderTypeTag(Integer orderAttr, SkupType skupType);
}
... ...
... ... @@ -2,6 +2,7 @@ package com.yohoufo.order.service.impl;
import com.yohobuy.ufo.model.order.bo.CustomsClearanceResult;
import com.yohobuy.ufo.model.order.bo.TimeoutBo;
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;
... ... @@ -226,6 +227,8 @@ public class BuyerOrderDetailService extends AbsOrderDetailService implements IO
orderDetailInfo.getStatusDetail().setLeftTime(leftTime);
}
removeButtonIfRequired(leftTime, orderStatusCode, orderDetailInfo.getButtons());
// 寄存订单不可以修改地址
removeButtonIf(BuyerOrderUtils.isDeposit(oac), orderDetailInfo.getButtons(),ButtonShow.MODIFY_ADDRESS);
}
... ...
... ... @@ -4,6 +4,7 @@ import com.google.common.collect.Maps;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yohobuy.ufo.model.order.bo.TimeoutBo;
import com.yohobuy.ufo.model.order.common.ButtonShow;
import com.yohobuy.ufo.model.order.common.OrderAttributes;
import com.yohobuy.ufo.model.order.common.OrderListType;
import com.yohobuy.ufo.model.order.common.TabType;
... ... @@ -154,10 +155,8 @@ public class BuyerOrderListServiceImpl extends AbsOrderListService implements IO
oli.setLeftTime(leftTime);
oli.setTimeLimit(timeoutBo.getTimelimit());
removeButtonIfRequired(leftTime, oli.getStatus(), oli.getButtons());
/*
if (oli.getLeftTime()!=null && oli.getLeftTime()<=0){
oli.getButtons().removeIf(x-> x!=null && ButtonShow.NOW_BUY.getCode().equals(x.getCode()));
}*/
// 寄存订单不可以修改地址
removeButtonIf(BuyerOrderUtils.isDeposit(oli.getAttributes()), oli.getButtons(),ButtonShow.MODIFY_ADDRESS);
});
}
}
... ...