Authored by chenchao

fix list or detail view

@@ -26,7 +26,9 @@ public class ActionStatusHold { @@ -26,7 +26,9 @@ public class ActionStatusHold {
26 static { 26 static {
27 sellerCanRefundStatus = Arrays.asList(SellerOrderStatus.YOHO_CANCEL_SELL.getCode(), 27 sellerCanRefundStatus = Arrays.asList(SellerOrderStatus.YOHO_CANCEL_SELL.getCode(),
28 SellerOrderStatus.FINISH.getCode(), 28 SellerOrderStatus.FINISH.getCode(),
29 - SellerOrderStatus.PLAY_SELF.getCode()); 29 + SellerOrderStatus.PLAY_SELF.getCode(),
  30 + SellerOrderStatus.BUYER_CANCEL_BEFORE_SELLER_DELIVER.getCode(),
  31 + SellerOrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode());
30 } 32 }
31 33
32 public static List<Integer> getSellerCanRefundEarnestMoneyStatus(){ 34 public static List<Integer> getSellerCanRefundEarnestMoneyStatus(){
@@ -3,6 +3,7 @@ package com.yohoufo.order.service; @@ -3,6 +3,7 @@ package com.yohoufo.order.service;
3 import com.alibaba.fastjson.JSON; 3 import com.alibaba.fastjson.JSON;
4 import com.alibaba.fastjson.JSONObject; 4 import com.alibaba.fastjson.JSONObject;
5 import com.yoho.core.common.utils.DateUtil; 5 import com.yoho.core.common.utils.DateUtil;
  6 +import com.yoho.core.dal.datasource.annotation.Database;
6 import com.yoho.error.ServiceError; 7 import com.yoho.error.ServiceError;
7 import com.yoho.error.exception.ServiceException; 8 import com.yoho.error.exception.ServiceException;
8 import com.yohobuy.ufo.model.order.common.TabType; 9 import com.yohobuy.ufo.model.order.common.TabType;
@@ -255,6 +256,7 @@ public class SellerOrderPaymentService extends AbstractOrderPaymentService { @@ -255,6 +256,7 @@ public class SellerOrderPaymentService extends AbstractOrderPaymentService {
255 * @param orderCode 256 * @param orderCode
256 * @return 257 * @return
257 */ 258 */
  259 + @Database(ForceMaster = true)
258 public OrderInfo getOrderInfo(long orderCode) { 260 public OrderInfo getOrderInfo(long orderCode) {
259 261
260 SellerOrder sellerOrder = sellerOrderMapper.selectByOrderCode(orderCode); 262 SellerOrder sellerOrder = sellerOrderMapper.selectByOrderCode(orderCode);
@@ -145,7 +145,7 @@ public abstract class AbsOrderDetailService extends AbsOrderViewService implemen @@ -145,7 +145,7 @@ public abstract class AbsOrderDetailService extends AbsOrderViewService implemen
145 orderDetailInfo.setUid(buyerUid = buyerOrder.getUid()); 145 orderDetailInfo.setUid(buyerUid = buyerOrder.getUid());
146 orderDetailInfo.setOrderCode(orderCode = buyerOrder.getOrderCode()); 146 orderDetailInfo.setOrderCode(orderCode = buyerOrder.getOrderCode());
147 orderDetailInfo.setSubmitOrderTimeStr(DateUtil.formatDate(buyerOrder.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS)); 147 orderDetailInfo.setSubmitOrderTimeStr(DateUtil.formatDate(buyerOrder.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS));
148 - orderDetailInfo.setButtons(orderStatus.getDetailButtons(tabType)); 148 + orderDetailInfo.setButtons(formatButtons(orderStatus, orderStatus.getDetailButtons(tabType)));
149 OrderDetailInfo.StatusDetail statusDetail = getStatusDetail(buyerOrder, orderStatus, tabType); 149 OrderDetailInfo.StatusDetail statusDetail = getStatusDetail(buyerOrder, orderStatus, tabType);
150 orderDetailInfo.setStatusDetail(statusDetail); 150 orderDetailInfo.setStatusDetail(statusDetail);
151 //good info 151 //good info
@@ -130,7 +130,7 @@ public abstract class AbsOrderListService extends AbsOrderViewService implements @@ -130,7 +130,7 @@ public abstract class AbsOrderListService extends AbsOrderViewService implements
130 orderListInfo.setStatuStr(orderStatus.getStatusStr(tabType)); 130 orderListInfo.setStatuStr(orderStatus.getStatusStr(tabType));
131 131
132 // 按钮显示 132 // 按钮显示
133 - orderListInfo.setButtons(orderStatus.getListButtons(tabType)); 133 + orderListInfo.setButtons(formatButtons(orderStatus, orderStatus.getListButtons(tabType)));
134 134
135 // 当订单状态是待付款, 显示leftTime 135 // 当订单状态是待付款, 显示leftTime
136 Integer leftTime = getLeftTime(tabType, buyerUid, orderCode, buyerOrder.getStatus(), buyerOrder.getCreateTime()); 136 Integer leftTime = getLeftTime(tabType, buyerUid, orderCode, buyerOrder.getStatus(), buyerOrder.getCreateTime());
1 package com.yohoufo.order.service.impl; 1 package com.yohoufo.order.service.impl;
2 2
  3 +import com.yohobuy.ufo.model.order.bo.ButtonShowBo;
3 import com.yohobuy.ufo.model.order.bo.OrderInfo; 4 import com.yohobuy.ufo.model.order.bo.OrderInfo;
4 import com.yohobuy.ufo.model.order.common.OrderStatus; 5 import com.yohobuy.ufo.model.order.common.OrderStatus;
5 import com.yohobuy.ufo.model.order.common.SkupStatus; 6 import com.yohobuy.ufo.model.order.common.SkupStatus;
6 import com.yohobuy.ufo.model.order.common.TabType; 7 import com.yohobuy.ufo.model.order.common.TabType;
7 import com.yohoufo.common.utils.DateUtil; 8 import com.yohoufo.common.utils.DateUtil;
  9 +import org.apache.commons.collections.CollectionUtils;
  10 +import org.slf4j.helpers.MessageFormatter;
8 import org.springframework.beans.factory.annotation.Autowired; 11 import org.springframework.beans.factory.annotation.Autowired;
9 12
  13 +import java.util.List;
  14 +
10 /** 15 /**
11 * Created by chao.chen on 2018/11/26. 16 * Created by chao.chen on 2018/11/26.
12 */ 17 */
@@ -15,6 +20,56 @@ public abstract class AbsOrderViewService { @@ -15,6 +20,56 @@ public abstract class AbsOrderViewService {
15 @Autowired 20 @Autowired
16 private OrdersPayService ordersPayService; 21 private OrdersPayService ordersPayService;
17 22
  23 + @Autowired
  24 + OrderDynamicConfig orderDynamicConfig;
  25 +
  26 +
  27 + List<ButtonShowBo> formatButtons(OrderStatus orderStatus, List<ButtonShowBo> buttons){
  28 + if (CollectionUtils.isEmpty(buttons)){
  29 + return buttons;
  30 + }
  31 + for(ButtonShowBo buttonShowBo : buttons){
  32 + buttonShowBo.setConfirmTips(formatconfirmTips(orderStatus.getCode(), buttonShowBo.getConfirmTips()));
  33 + }
  34 + return buttons;
  35 + }
  36 +
  37 + String formatconfirmTips(int orderStatusCode, String temp){
  38 + Object[] formatParms = new Object[1];
  39 + String confirmTips = temp;
  40 + if(orderStatusCode == OrderStatus.HAS_PAYED.getCode()){
  41 + OrderDynamicConfig.BuyerCancelCompensateNode bccn = orderDynamicConfig.getBeforeSellerDeliverBCCN();
  42 + formatParms[0] = bccn.getBuyerCompensateMoney();
  43 + confirmTips = MessageFormatter.arrayFormat(temp, formatParms).getMessage();
  44 +
  45 + }
  46 + if(orderStatusCode == OrderStatus.SELLER_SEND_OUT.getCode()){
  47 + OrderDynamicConfig.BuyerCancelCompensateNode bccn = orderDynamicConfig.getBeforeDepotReceiveBCCN();
  48 + formatParms[0] = bccn.getBuyerCompensateMoney();
  49 + confirmTips = MessageFormatter.arrayFormat(temp, formatParms).getMessage();
  50 +
  51 + }
  52 + return confirmTips;
  53 + }
  54 +
  55 +
  56 + String formatDetailDesc(OrderStatus orderStatus, String temp){
  57 + Object[] formatParms = new Object[1];
  58 + String detailDesc = temp;
  59 + if(orderStatus.getCode() == OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode()){
  60 + OrderDynamicConfig.BuyerCancelCompensateNode bccn = orderDynamicConfig.getBeforeDepotReceiveBCCN();
  61 + formatParms[0] = bccn.getBuyerCompensateMoney();
  62 + detailDesc = MessageFormatter.arrayFormat(temp, formatParms).getMessage();
  63 +
  64 + }
  65 + if(orderStatus.getCode() == OrderStatus.BUYER_CANCEL_BEFORE_SELLER_DELIVER.getCode()){
  66 + OrderDynamicConfig.BuyerCancelCompensateNode bccn = orderDynamicConfig.getBeforeSellerDeliverBCCN();
  67 + formatParms[0] = bccn.getBuyerCompensateMoney();
  68 + detailDesc = MessageFormatter.arrayFormat(temp, formatParms).getMessage();
  69 + }
  70 + return detailDesc;
  71 + }
  72 +
18 Integer getLeftTime(TabType actor, Integer uid, Long orderCode, Integer orderStatus, Integer createTime){ 73 Integer getLeftTime(TabType actor, Integer uid, Long orderCode, Integer orderStatus, Integer createTime){
19 Integer leftTime =null; 74 Integer leftTime =null;
20 Integer payLeftTime = getPayLeftTime(actor, orderStatus, 75 Integer payLeftTime = getPayLeftTime(actor, orderStatus,
  1 +package com.yohoufo.order.service.impl;
  2 +
  3 +import com.yohobuy.ufo.model.order.bo.ButtonShowBo;
  4 +import com.yohobuy.ufo.model.order.common.OrderCodeType;
  5 +import com.yohobuy.ufo.model.order.common.SellerType;
  6 +import com.yohobuy.ufo.model.order.common.SkupStatus;
  7 +
  8 +import java.util.List;
  9 +
  10 +/**
  11 + * Created by chao.chen on 2018/11/26.
  12 + */
  13 +public interface AbsSellerOrderViewService {
  14 +
  15 + default List<ButtonShowBo> getButtons(Integer storageNum, SellerType st, Integer payment, SkupStatus skupStatus){
  16 + //异常扯淡,兼容老数据,
  17 + boolean isEntry = (st == SellerType.ENTRY
  18 + && payment != null
  19 + && OrderCodeType.SELLER_RECHARGE_EARNEST_TYPE.getType() == payment) ;
  20 + SellerType lst = isEntry ? SellerType.ENTRY : SellerType.COMMON;
  21 + if (storageNum == 1 && isEntry){
  22 + lst = SellerType.ONE_PRD_ENTRY;
  23 + }
  24 + // 按钮显示
  25 + List<ButtonShowBo> buttons;
  26 + buttons = skupStatus.getListButtons(lst);
  27 +
  28 + return buttons;
  29 + }
  30 +}
1 package com.yohoufo.order.service.impl; 1 package com.yohoufo.order.service.impl;
2 2
3 import com.yohobuy.ufo.model.order.common.OrderStatus; 3 import com.yohobuy.ufo.model.order.common.OrderStatus;
  4 +import com.yohobuy.ufo.model.order.common.SellerOrderStatus;
4 import com.yohobuy.ufo.model.order.common.SkupStatus; 5 import com.yohobuy.ufo.model.order.common.SkupStatus;
5 import com.yohobuy.ufo.model.order.common.TabType; 6 import com.yohobuy.ufo.model.order.common.TabType;
6 import com.yohoufo.common.utils.DateUtil; 7 import com.yohoufo.common.utils.DateUtil;
@@ -94,6 +95,10 @@ public class BuyerOrderCancelService { @@ -94,6 +95,10 @@ public class BuyerOrderCancelService {
94 targetGoods.setExceptStatus(SkupStatus.SELL_OUT.getCode()); 95 targetGoods.setExceptStatus(SkupStatus.SELL_OUT.getCode());
95 sellerOrderGoodsMapper.updateStatusBySkpu(targetGoods); 96 sellerOrderGoodsMapper.updateStatusBySkpu(targetGoods);
96 97
  98 + SellerOrder soc = new SellerOrder();
  99 + soc.setStatus(SellerOrderStatus.BUYER_CANCEL_BEFORE_SELLER_DELIVER.getCode());
  100 + soc.setUpdateTime(DateUtil.getCurrentTimeSecond());
  101 + sellerOrderMapper.updateBySkups(soc, Arrays.asList(skup));
97 //TODO 整个过程异步去执行(考虑退费依赖订单状态) 102 //TODO 整个过程异步去执行(考虑退费依赖订单状态)
98 //(退费)退保证金给卖家 103 //(退费)退保证金给卖家
99 //(转账)瓜分指定赔偿款给卖家和平台 104 //(转账)瓜分指定赔偿款给卖家和平台
@@ -136,6 +141,11 @@ public class BuyerOrderCancelService { @@ -136,6 +141,11 @@ public class BuyerOrderCancelService {
136 targetGoods.setExceptStatus(SkupStatus.SELL_OUT.getCode()); 141 targetGoods.setExceptStatus(SkupStatus.SELL_OUT.getCode());
137 sellerOrderGoodsMapper.updateStatusBySkpu(targetGoods); 142 sellerOrderGoodsMapper.updateStatusBySkpu(targetGoods);
138 143
  144 + SellerOrder soc = new SellerOrder();
  145 + soc.setStatus(SellerOrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode());
  146 + soc.setUpdateTime(DateUtil.getCurrentTimeSecond());
  147 + sellerOrderMapper.updateBySkups(soc, Arrays.asList(skup));
  148 +
139 //整个过程异步去执行(考虑退费依赖订单状态) 149 //整个过程异步去执行(考虑退费依赖订单状态)
140 //(退费)退保证金给卖家 150 //(退费)退保证金给卖家
141 //(转账)瓜分指定赔偿款给卖家和平台 151 //(转账)瓜分指定赔偿款给卖家和平台
@@ -23,6 +23,7 @@ import com.yohoufo.order.service.IOrderDetailService; @@ -23,6 +23,7 @@ import com.yohoufo.order.service.IOrderDetailService;
23 import com.yohoufo.order.service.handler.BuyerConfirmHandler; 23 import com.yohoufo.order.service.handler.BuyerConfirmHandler;
24 import com.yohoufo.order.utils.OrderDetailDescHelper; 24 import com.yohoufo.order.utils.OrderDetailDescHelper;
25 import org.apache.commons.lang3.StringUtils; 25 import org.apache.commons.lang3.StringUtils;
  26 +import org.slf4j.helpers.MessageFormatter;
26 import org.springframework.beans.factory.annotation.Autowired; 27 import org.springframework.beans.factory.annotation.Autowired;
27 import org.springframework.stereotype.Service; 28 import org.springframework.stereotype.Service;
28 29
@@ -125,9 +126,10 @@ public class BuyerOrderDetailService extends AbsOrderDetailService implements IO @@ -125,9 +126,10 @@ public class BuyerOrderDetailService extends AbsOrderDetailService implements IO
125 OrderDetailInfo.StatusDetail statusDetail = OrderDetailInfo.StatusDetail.builder() 126 OrderDetailInfo.StatusDetail statusDetail = OrderDetailInfo.StatusDetail.builder()
126 .status(orderStatus.getCode()) 127 .status(orderStatus.getCode())
127 .statuStr(orderStatus.getStatusStr(tabType)) 128 .statuStr(orderStatus.getStatusStr(tabType))
128 - .detailDesc(orderStatus.getDetailDesc(tabType))  
129 - .build();  
130 129
  130 + .build();
  131 + String detailDesc = formatDetailDesc(orderStatus, orderStatus.getDetailDesc(tabType));
  132 + statusDetail.setDetailDesc(detailDesc);
131 // 待付款时,剩余时间 133 // 待付款时,剩余时间
132 Integer leftTime = getLeftTime(tabType,buyerOrder.getUid(), buyerOrder.getOrderCode(), orderStatus.getCode(), buyerOrder.getCreateTime()); 134 Integer leftTime = getLeftTime(tabType,buyerOrder.getUid(), buyerOrder.getOrderCode(), orderStatus.getCode(), buyerOrder.getCreateTime());
133 statusDetail.setLeftTime(leftTime); 135 statusDetail.setLeftTime(leftTime);
@@ -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.yoho.error.ServiceError; 3 import com.yoho.error.ServiceError;
4 import com.yoho.error.exception.ServiceException; 4 import com.yoho.error.exception.ServiceException;
  5 +import com.yohobuy.ufo.model.order.bo.MerchantOrderAttachInfo;
5 import com.yohobuy.ufo.model.order.common.*; 6 import com.yohobuy.ufo.model.order.common.*;
6 import com.yohoufo.common.alarm.EventBusPublisher; 7 import com.yohoufo.common.alarm.EventBusPublisher;
7 import com.yohoufo.common.alarm.SmsAlarmEvent; 8 import com.yohoufo.common.alarm.SmsAlarmEvent;
@@ -10,14 +11,8 @@ import com.yohoufo.dal.order.BuyerOrderGoodsMapper; @@ -10,14 +11,8 @@ import com.yohoufo.dal.order.BuyerOrderGoodsMapper;
10 import com.yohoufo.dal.order.BuyerOrderMapper; 11 import com.yohoufo.dal.order.BuyerOrderMapper;
11 import com.yohoufo.dal.order.SellerOrderGoodsMapper; 12 import com.yohoufo.dal.order.SellerOrderGoodsMapper;
12 import com.yohoufo.dal.order.SellerOrderMapper; 13 import com.yohoufo.dal.order.SellerOrderMapper;
13 -import com.yohoufo.dal.order.model.BuyerOrder;  
14 -import com.yohoufo.dal.order.model.BuyerOrderGoods;  
15 -import com.yohoufo.dal.order.model.SellerOrder;  
16 -import com.yohoufo.dal.order.model.SellerOrderGoods;  
17 -import com.yohoufo.order.common.ActionStatusHold;  
18 -import com.yohoufo.order.common.BillTradeStatus;  
19 -import com.yohoufo.order.common.RefundCase;  
20 -import com.yohoufo.order.common.TransferCase; 14 +import com.yohoufo.dal.order.model.*;
  15 +import com.yohoufo.order.common.*;
21 import com.yohoufo.order.constants.AlarmConfig; 16 import com.yohoufo.order.constants.AlarmConfig;
22 import com.yohoufo.order.event.BillLogEvent; 17 import com.yohoufo.order.event.BillLogEvent;
23 import com.yohoufo.order.event.ErpCancelSellerOrderEvent; 18 import com.yohoufo.order.event.ErpCancelSellerOrderEvent;
@@ -502,9 +497,18 @@ public class SellerOrderCancelService { @@ -502,9 +497,18 @@ public class SellerOrderCancelService {
502 cacheCleaner.cleanList(sellerUid, TabType.SELL.getValue()); 497 cacheCleaner.cleanList(sellerUid, TabType.SELL.getValue());
503 cacheCleaner.cleanSellerDetail(psog); 498 cacheCleaner.cleanSellerDetail(psog);
504 double earnestMoney = sellerOrder.getEarnestMoney().doubleValue(); 499 double earnestMoney = sellerOrder.getEarnestMoney().doubleValue();
505 - PaymentRequest refundReq = PaymentRequest.builder().uid(sellerOrder.getUid()) 500 +
  501 +
  502 + PaymentRequest refundReq = PaymentRequest.builder().uid(sellerUid)
506 .orderCode(orderCode) 503 .orderCode(orderCode)
507 .refundAmount(earnestMoney).build(); 504 .refundAmount(earnestMoney).build();
  505 + Integer payment = sellerOrder.getPayment();
  506 + if(Objects.nonNull(payment) && payment == Payment.WALLET.getCode() ){
  507 + MerchantOrderAttachInfo moai = MerchantOrderAttachInfo.builder().uid(sellerUid)
  508 + .orderCode(orderCode).skup(skup).earnestMoney(sellerOrder.getEarnestMoney())
  509 + .type(SellerWalletDetail.Type.SYSTEM_OFF.getValue()).build();
  510 + refundReq.setRefundattch(moai);
  511 + }
508 512
509 BillLogEvent.BillLogEventBuilder bleb = BillLogEvent.builder() 513 BillLogEvent.BillLogEventBuilder bleb = BillLogEvent.builder()
510 .sellerUid(sellerUid).orderCode(orderCode) 514 .sellerUid(sellerUid).orderCode(orderCode)
@@ -3,6 +3,7 @@ package com.yohoufo.order.service.impl; @@ -3,6 +3,7 @@ package com.yohoufo.order.service.impl;
3 import com.alibaba.fastjson.JSONObject; 3 import com.alibaba.fastjson.JSONObject;
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.ButtonShowBo;
6 import com.yohobuy.ufo.model.order.bo.SoldPrdComputeBo; 7 import com.yohobuy.ufo.model.order.bo.SoldPrdComputeBo;
7 import com.yohobuy.ufo.model.order.common.*; 8 import com.yohobuy.ufo.model.order.common.*;
8 import com.yohobuy.ufo.model.order.constants.OrderConstant; 9 import com.yohobuy.ufo.model.order.constants.OrderConstant;
@@ -46,7 +47,7 @@ import java.util.Objects; @@ -46,7 +47,7 @@ import java.util.Objects;
46 * Created by chenchao on 2018/9/20. 47 * Created by chenchao on 2018/9/20.
47 */ 48 */
48 @Service 49 @Service
49 -public class SellerOrderDetailService extends AbsOrderDetailService implements IOrderDetailService { 50 +public class SellerOrderDetailService extends AbsOrderDetailService implements IOrderDetailService,AbsSellerOrderViewService {
50 51
51 final Logger logger = LoggerFactory.getLogger(getClass()); 52 final Logger logger = LoggerFactory.getLogger(getClass());
52 53
@@ -328,7 +329,9 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I @@ -328,7 +329,9 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
328 OrderDetailInfo orderDetailInfo = new OrderDetailInfo(); 329 OrderDetailInfo orderDetailInfo = new OrderDetailInfo();
329 orderDetailInfo.setUid(order.getUid()); 330 orderDetailInfo.setUid(order.getUid());
330 orderDetailInfo.setOrderCode(getOrderCode(skupStatus, order)); 331 orderDetailInfo.setOrderCode(getOrderCode(skupStatus, order));
331 - orderDetailInfo.setButtons(skupStatus.getDetailButtons(sellerType)); 332 + Integer storageNum = sellerOrderGoods.getNum();
  333 + List<ButtonShowBo> buttons = getButtons(storageNum, sellerType, order.getPayment(), skupStatus);
  334 + orderDetailInfo.setButtons(buttons);
332 orderDetailInfo.setSubmitOrderTimeStr(DateUtil.formatDate(order.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS)); 335 orderDetailInfo.setSubmitOrderTimeStr(DateUtil.formatDate(order.getCreateTime(), DateUtil.yyyy_MM_dd_HH_mm_SS));
333 orderDetailInfo.setUserAddress(addressInfo); 336 orderDetailInfo.setUserAddress(addressInfo);
334 //卖家 337 //卖家
@@ -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.yoho.error.ServiceError; 3 import com.yoho.error.ServiceError;
4 import com.yoho.error.exception.ServiceException; 4 import com.yoho.error.exception.ServiceException;
  5 +import com.yohobuy.ufo.model.order.bo.ButtonShowBo;
5 import com.yohobuy.ufo.model.order.bo.GoodsInfo; 6 import com.yohobuy.ufo.model.order.bo.GoodsInfo;
6 import com.yohobuy.ufo.model.order.common.*; 7 import com.yohobuy.ufo.model.order.common.*;
7 import com.yohobuy.ufo.model.order.constants.OrderConstant; 8 import com.yohobuy.ufo.model.order.constants.OrderConstant;
@@ -39,7 +40,7 @@ import java.util.stream.Collectors; @@ -39,7 +40,7 @@ import java.util.stream.Collectors;
39 */ 40 */
40 @Service 41 @Service
41 @Slf4j 42 @Slf4j
42 -public class SellerOrderListService extends AbsOrderListService implements IOrderListService { 43 +public class SellerOrderListService extends AbsOrderListService implements IOrderListService,AbsSellerOrderViewService {
43 44
44 @Autowired 45 @Autowired
45 private SellerOrderMapper sellerOrderMapper; 46 private SellerOrderMapper sellerOrderMapper;
@@ -187,6 +188,10 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde @@ -187,6 +188,10 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde
187 return map; 188 return map;
188 } 189 }
189 190
  191 +
  192 +
  193 +
  194 +
190 OrderListInfo buildOrderListInfo(SellerOrderGoods sellerOrderGoods, 195 OrderListInfo buildOrderListInfo(SellerOrderGoods sellerOrderGoods,
191 SellerOrder sellerOrder, SellerType st, Map<Integer,String> overPriceTipsMap) { 196 SellerOrder sellerOrder, SellerType st, Map<Integer,String> overPriceTipsMap) {
192 197
@@ -205,20 +210,19 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde @@ -205,20 +210,19 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde
205 // 订单中状态显示 210 // 订单中状态显示
206 orderListInfo.setStatus(skupStatus.getCode()); 211 orderListInfo.setStatus(skupStatus.getCode());
207 orderListInfo.setStatuStr(skupStatus.getDesc()); 212 orderListInfo.setStatuStr(skupStatus.getDesc());
208 - //异常扯淡,兼容老数据,  
209 - final SellerType lst = (st == SellerType.ENTRY  
210 - && sellerOrder.getPayment()!=null  
211 - && OrderCodeType.SELLER_RECHARGE_EARNEST_TYPE.getType() == sellerOrder.getPayment()) ?  
212 - SellerType.ENTRY : SellerType.COMMON;  
213 - // 按钮显示  
214 - orderListInfo.setButtons(skupStatus.getListButtons(lst)); 213 + Integer storageNum = sellerOrderGoods.getNum();
215 214
  215 + // 按钮显示
  216 + List<ButtonShowBo> buttons;
  217 + buttons = getButtons(storageNum, st, sellerOrder.getPayment(), skupStatus);
  218 + orderListInfo.setButtons(buttons);
216 // 当订单状态是待付款, 显示leftTime 219 // 当订单状态是待付款, 显示leftTime
217 if (sellerOrderGoods.getStatus() == SkupStatus.CAN_NOT_SELL.getCode()){ 220 if (sellerOrderGoods.getStatus() == SkupStatus.CAN_NOT_SELL.getCode()){
218 orderListInfo.setLeftTime(calLeftTime(sellerOrder.getCreateTime())); 221 orderListInfo.setLeftTime(calLeftTime(sellerOrder.getCreateTime()));
219 } 222 }
220 orderListInfo.setSkup(sellerOrderGoods.getId()); 223 orderListInfo.setSkup(sellerOrderGoods.getId());
221 orderListInfo.setEarnestMoney(sellerOrder.getEarnestMoney()); 224 orderListInfo.setEarnestMoney(sellerOrder.getEarnestMoney());
  225 +
222 // 226 //
223 GoodsInfo goodsInfo = new GoodsInfo(); 227 GoodsInfo goodsInfo = new GoodsInfo();
224 goodsInfo.setColorName(sellerOrderGoods.getColorName()); 228 goodsInfo.setColorName(sellerOrderGoods.getColorName());
@@ -229,7 +233,7 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde @@ -229,7 +233,7 @@ public class SellerOrderListService extends AbsOrderListService implements IOrde
229 goodsInfo.setGoodPrice(sellerOrderGoods.getGoodsPrice().toPlainString()); 233 goodsInfo.setGoodPrice(sellerOrderGoods.getGoodsPrice().toPlainString());
230 goodsInfo.setStorageId(sellerOrderGoods.getStorageId()); 234 goodsInfo.setStorageId(sellerOrderGoods.getStorageId());
231 goodsInfo.setBatchNo(sellerOrderGoods.getBatchNo()); 235 goodsInfo.setBatchNo(sellerOrderGoods.getBatchNo());
232 - goodsInfo.setStorageNum(sellerOrderGoods.getNum()); 236 + goodsInfo.setStorageNum(storageNum);
233 goodsInfo.setSkupList(sellerOrderGoods.getSkupList()); 237 goodsInfo.setSkupList(sellerOrderGoods.getSkupList());
234 orderListInfo.setGoodsInfo(goodsInfo); 238 orderListInfo.setGoodsInfo(goodsInfo);
235 orderListInfo.setSecendLevelCreateTime(sellerOrder.getCreateTime()); 239 orderListInfo.setSecendLevelCreateTime(sellerOrder.getCreateTime());