Authored by chenjian

门店订单再次购买按钮处理

... ... @@ -161,7 +161,7 @@ public abstract class AbsOrderDetailService extends AbsOrderViewService implemen
orderDetailInfo.setOrderCode(orderCode = buyerOrder.getOrderCode());
orderDetailInfo.setSubmitOrderTimeStr(DateUtil.formatDate(buyerOrder.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS));
List<ButtonShowBo> buttonShowList = orderStatus.getDetailButtons(tabType);
orderDetailInfo.setButtons(formatButtons(buyerOrder, buttonShowList==null? Lists.newArrayList() : new ArrayList<>(buttonShowList)));
orderDetailInfo.setButtons(formatButtons(buyerOrder, buttonShowList==null? Lists.newArrayList() : new ArrayList<>(buttonShowList), 2));
// 买家 买家订单号 需要处理立即支付
// 卖家 卖家订单号 不存在立即支付的按钮
... ...
... ... @@ -159,7 +159,7 @@ public abstract class AbsOrderListService extends AbsOrderViewService implements
// 按钮显示
List<ButtonShowBo> buttonShowBos = orderStatus.getListButtons(tabType);
orderListInfo.setButtons(formatButtons(buyerOrder, buttonShowBos == null ? new ArrayList<>() : new ArrayList<>(buttonShowBos)));
orderListInfo.setButtons(formatButtons(buyerOrder, buttonShowBos == null ? new ArrayList<>() : new ArrayList<>(buttonShowBos), 1));
// 当剩余时间小于0
if (!CollectionUtils.isEmpty(orderListInfo.getButtons())){
... ...
... ... @@ -33,12 +33,19 @@ public abstract class AbsOrderViewService {
abstract Logger getLogger();
List<ButtonShowBo> formatButtons(BuyerOrder buyerOrder, List<ButtonShowBo> buttons){
/**
*
* @param buyerOrder
* @param buttons
* @param actType 1:订单列表; 2:订单详情
* @return
*/
List<ButtonShowBo> formatButtons(BuyerOrder buyerOrder, List<ButtonShowBo> buttons, int actType){
if (CollectionUtils.isEmpty(buttons)){
return buttons;
}
disableBuyAgainIfOffline(buyerOrder, buttons);
disableBuyAgainIfOffline(buyerOrder, buttons, actType);
//TODO optimized first query out status of order need BuyerPenaltyCalResult
int orderStatusCode = buyerOrder.getStatus();
... ... @@ -73,12 +80,14 @@ public abstract class AbsOrderViewService {
* 门店订单,不需要“再次购买”,替换为“查看详情”
* @param buyerOrder
* @param buttons
* @param actType 1:订单列表; 2:订单详情
*/
private void disableBuyAgainIfOffline(final BuyerOrder buyerOrder, final List<ButtonShowBo> buttons) {
private void disableBuyAgainIfOffline(final BuyerOrder buyerOrder, final List<ButtonShowBo> buttons, int actType) {
if(BuyerOrderUtils.isOffline(buyerOrder.getAttributes())
&& buttons != null && buttons.contains(ButtonShow.BUY_AGAIN.getBo())) {
buttons.remove(ButtonShow.BUY_AGAIN.getBo());
if(!buttons.contains(ButtonShow.SHOW_DETAIL.getBo())) {
//订单列表“再次购买”替换为“查看详情”,订单详情“再次购买”直接去掉
if(actType == 1 && !buttons.contains(ButtonShow.SHOW_DETAIL.getBo())) {
buttons.add(ButtonShow.SHOW_DETAIL.getBo());
}
}
... ...