Authored by LUOXC

寄存订单不可以修改地址

@@ -30,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired; @@ -30,6 +30,7 @@ import org.springframework.beans.factory.annotation.Autowired;
30 import java.util.ArrayList; 30 import java.util.ArrayList;
31 import java.util.List; 31 import java.util.List;
32 import java.util.Objects; 32 import java.util.Objects;
  33 +import java.util.function.Predicate;
33 34
34 /** 35 /**
35 * Created by chao.chen on 2018/11/26. 36 * Created by chao.chen on 2018/11/26.
@@ -176,6 +177,12 @@ public abstract class AbsOrderViewService { @@ -176,6 +177,12 @@ public abstract class AbsOrderViewService {
176 } 177 }
177 } 178 }
178 179
  180 + public void removeButtonIf(boolean condition, List<ButtonShowBo> buttons, ButtonShow removedButton) {
  181 + if (condition) {
  182 + buttons.removeIf(x -> x != null && removedButton.getCode().equals(x.getCode()));
  183 + }
  184 + }
  185 +
179 protected abstract String buildOrderTypeTag(Integer orderAttr, SkupType skupType); 186 protected abstract String buildOrderTypeTag(Integer orderAttr, SkupType skupType);
180 187
181 } 188 }
@@ -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.CustomsClearanceResult; 3 import com.yohobuy.ufo.model.order.bo.CustomsClearanceResult;
4 import com.yohobuy.ufo.model.order.bo.TimeoutBo; 4 import com.yohobuy.ufo.model.order.bo.TimeoutBo;
  5 +import com.yohobuy.ufo.model.order.common.ButtonShow;
5 import com.yohobuy.ufo.model.order.common.OrderAttributes; 6 import com.yohobuy.ufo.model.order.common.OrderAttributes;
6 import com.yohobuy.ufo.model.order.common.OrderStatus; 7 import com.yohobuy.ufo.model.order.common.OrderStatus;
7 import com.yohobuy.ufo.model.order.common.TabType; 8 import com.yohobuy.ufo.model.order.common.TabType;
@@ -226,6 +227,8 @@ public class BuyerOrderDetailService extends AbsOrderDetailService implements IO @@ -226,6 +227,8 @@ public class BuyerOrderDetailService extends AbsOrderDetailService implements IO
226 orderDetailInfo.getStatusDetail().setLeftTime(leftTime); 227 orderDetailInfo.getStatusDetail().setLeftTime(leftTime);
227 } 228 }
228 removeButtonIfRequired(leftTime, orderStatusCode, orderDetailInfo.getButtons()); 229 removeButtonIfRequired(leftTime, orderStatusCode, orderDetailInfo.getButtons());
  230 + // 寄存订单不可以修改地址
  231 + removeButtonIf(BuyerOrderUtils.isDeposit(oac), orderDetailInfo.getButtons(),ButtonShow.MODIFY_ADDRESS);
229 } 232 }
230 233
231 234
@@ -4,6 +4,7 @@ import com.google.common.collect.Maps; @@ -4,6 +4,7 @@ import com.google.common.collect.Maps;
4 import com.yoho.error.ServiceError; 4 import com.yoho.error.ServiceError;
5 import com.yoho.error.exception.ServiceException; 5 import com.yoho.error.exception.ServiceException;
6 import com.yohobuy.ufo.model.order.bo.TimeoutBo; 6 import com.yohobuy.ufo.model.order.bo.TimeoutBo;
  7 +import com.yohobuy.ufo.model.order.common.ButtonShow;
7 import com.yohobuy.ufo.model.order.common.OrderAttributes; 8 import com.yohobuy.ufo.model.order.common.OrderAttributes;
8 import com.yohobuy.ufo.model.order.common.OrderListType; 9 import com.yohobuy.ufo.model.order.common.OrderListType;
9 import com.yohobuy.ufo.model.order.common.TabType; 10 import com.yohobuy.ufo.model.order.common.TabType;
@@ -154,10 +155,8 @@ public class BuyerOrderListServiceImpl extends AbsOrderListService implements IO @@ -154,10 +155,8 @@ public class BuyerOrderListServiceImpl extends AbsOrderListService implements IO
154 oli.setLeftTime(leftTime); 155 oli.setLeftTime(leftTime);
155 oli.setTimeLimit(timeoutBo.getTimelimit()); 156 oli.setTimeLimit(timeoutBo.getTimelimit());
156 removeButtonIfRequired(leftTime, oli.getStatus(), oli.getButtons()); 157 removeButtonIfRequired(leftTime, oli.getStatus(), oli.getButtons());
157 - /*  
158 - if (oli.getLeftTime()!=null && oli.getLeftTime()<=0){  
159 - oli.getButtons().removeIf(x-> x!=null && ButtonShow.NOW_BUY.getCode().equals(x.getCode()));  
160 - }*/ 158 + // 寄存订单不可以修改地址
  159 + removeButtonIf(BuyerOrderUtils.isDeposit(oli.getAttributes()), oli.getButtons(),ButtonShow.MODIFY_ADDRESS);
161 }); 160 });
162 } 161 }
163 } 162 }