Authored by tanling

Arrays.asList->list非空判断

... ... @@ -53,11 +53,13 @@ public interface AbsSellerOrderViewService {
// 按钮显示
List<ButtonShowBo> buttons = null;
if(ViewType.LIST == viewType){
buttons = new ArrayList<>(skupStatus.getListButtons(lst));
List<ButtonShowBo> buttonShowBos = skupStatus.getListButtons(lst);
buttons = buttonShowBos == null ? new ArrayList<>() : new ArrayList<>(buttonShowBos);
}
if (ViewType.DETAIL == viewType){
buttons = new ArrayList<>(skupStatus.getDetailButtons(lst));
List<ButtonShowBo> buttonShowBos = skupStatus.getDetailButtons(lst);
buttons = buttonShowBos == null ? null : new ArrayList<>(buttonShowBos);
}
// 支付剩余时间无,则干掉支付按钮
... ...
package com.yohoufo.order.service.impl;
import com.google.common.collect.Lists;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yohobuy.ufo.model.order.bo.ButtonShowBo;
import com.yohobuy.ufo.model.order.bo.OrderInfo;
import com.yohobuy.ufo.model.order.bo.SoldPrdComputeBo;
import com.yohobuy.ufo.model.order.common.ButtonShow;
... ... @@ -24,6 +26,7 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.List;
/**
* Created by chenchao on 2018/9/20.
... ... @@ -157,7 +160,8 @@ public abstract class AbsOrderDetailService extends AbsOrderViewService implemen
orderDetailInfo.setUid(buyerUid = buyerOrder.getUid());
orderDetailInfo.setOrderCode(orderCode = buyerOrder.getOrderCode());
orderDetailInfo.setSubmitOrderTimeStr(DateUtil.formatDate(buyerOrder.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS));
orderDetailInfo.setButtons(formatButtons(orderStatus, new ArrayList<>(orderStatus.getDetailButtons(tabType))));
List<ButtonShowBo> buttonShowList = orderStatus.getDetailButtons(tabType);
orderDetailInfo.setButtons(formatButtons(orderStatus, buttonShowList==null? Lists.newArrayList() : new ArrayList<>(buttonShowList)));
// 买家 买家订单号 需要处理立即支付
// 卖家 卖家订单号 不存在立即支付的按钮
... ...
package com.yohoufo.order.service.impl;
import com.google.common.collect.Lists;
import com.yohobuy.ufo.model.order.bo.ButtonShowBo;
import com.yohobuy.ufo.model.order.bo.GoodsInfo;
import com.yohobuy.ufo.model.order.common.ButtonShow;
import com.yohobuy.ufo.model.order.common.OrderStatus;
... ... @@ -152,7 +153,9 @@ public abstract class AbsOrderListService extends AbsOrderViewService implements
orderListInfo.setLeftTime(leftTime);
// 按钮显示
orderListInfo.setButtons(formatButtons(orderStatus, new ArrayList<>(orderStatus.getListButtons(tabType))));
List<ButtonShowBo> buttonShowBos = orderStatus.getListButtons(tabType);
orderListInfo.setButtons(formatButtons(orderStatus, buttonShowBos == null ? new ArrayList<>() : new ArrayList<>(buttonShowBos)));
// 当剩余时间小于0
if (!CollectionUtils.isEmpty(orderListInfo.getButtons())){
... ...
... ... @@ -335,7 +335,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
Integer leftTime = calLeftTime(OrderInfo.SELLER_PAY_TIMEOUT, order.getCreateTime());
List<ButtonShowBo> buttons = getButtons(ViewType.DETAIL, storageNum, sellerType, order.getPayment(), skupStatus, leftTime);
orderDetailInfo.setButtons(new ArrayList<>(buttons));
orderDetailInfo.setButtons(buttons== null ? new ArrayList<>() : new ArrayList<>(buttons));
orderDetailInfo.setSubmitOrderTimeStr(DateUtil.formatDate(order.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS));
orderDetailInfo.setUserAddress(addressInfo);
//卖家
... ...
package com.yohoufo.order.service.impl;
import com.google.common.base.Splitter;
import com.google.common.collect.Lists;
import com.yohobuy.ufo.model.order.bo.ButtonShowBo;
import com.yohobuy.ufo.model.order.bo.GoodsInfo;
import com.yohobuy.ufo.model.order.bo.ProductInfo;
... ... @@ -363,7 +364,7 @@ public class SkupListService {
// 按钮显示
List<ButtonShowBo> buttons = Arrays.asList(ButtonShow.STORAGE_MANAGE.getBo());
orderListInfo.setButtons(buttons);
orderListInfo.setButtons(buttons == null ? new ArrayList<>(): new ArrayList<>(buttons));
//
GoodsInfo productInfo = new GoodsInfo();
productInfo.setColorName(sellerOrderGoods.getColorName());
... ... @@ -403,7 +404,7 @@ public class SkupListService {
// 按钮显示
List<ButtonShowBo> buttons = skupStatus.getListButtons(sellerType);
orderListInfo.setButtons(buttons);
orderListInfo.setButtons(buttons == null ? Lists.newArrayList() : new ArrayList<>(buttons));
//
GoodsInfo productInfo = new GoodsInfo();
productInfo.setColorId(sellerOrderGoods.getColorId());
... ...