|
|
package com.yohoufo.order.service.impl;
|
|
|
|
|
|
import com.yohobuy.ufo.model.order.bo.ButtonShowBo;
|
|
|
import com.yohobuy.ufo.model.order.bo.OrderInfo;
|
|
|
import com.yohobuy.ufo.model.order.common.OrderStatus;
|
|
|
import com.yohobuy.ufo.model.order.common.SkupStatus;
|
|
|
import com.yohobuy.ufo.model.order.common.TabType;
|
|
|
import com.yohoufo.common.utils.DateUtil;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.slf4j.helpers.MessageFormatter;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* Created by chao.chen on 2018/11/26.
|
|
|
*/
|
...
|
...
|
@@ -15,6 +20,56 @@ public abstract class AbsOrderViewService { |
|
|
@Autowired
|
|
|
private OrdersPayService ordersPayService;
|
|
|
|
|
|
@Autowired
|
|
|
OrderDynamicConfig orderDynamicConfig;
|
|
|
|
|
|
|
|
|
List<ButtonShowBo> formatButtons(OrderStatus orderStatus, List<ButtonShowBo> buttons){
|
|
|
if (CollectionUtils.isEmpty(buttons)){
|
|
|
return buttons;
|
|
|
}
|
|
|
for(ButtonShowBo buttonShowBo : buttons){
|
|
|
buttonShowBo.setConfirmTips(formatconfirmTips(orderStatus.getCode(), buttonShowBo.getConfirmTips()));
|
|
|
}
|
|
|
return buttons;
|
|
|
}
|
|
|
|
|
|
String formatconfirmTips(int orderStatusCode, String temp){
|
|
|
Object[] formatParms = new Object[1];
|
|
|
String confirmTips = temp;
|
|
|
if(orderStatusCode == OrderStatus.HAS_PAYED.getCode()){
|
|
|
OrderDynamicConfig.BuyerCancelCompensateNode bccn = orderDynamicConfig.getBeforeSellerDeliverBCCN();
|
|
|
formatParms[0] = bccn.getBuyerCompensateMoney();
|
|
|
confirmTips = MessageFormatter.arrayFormat(temp, formatParms).getMessage();
|
|
|
|
|
|
}
|
|
|
if(orderStatusCode == OrderStatus.SELLER_SEND_OUT.getCode()){
|
|
|
OrderDynamicConfig.BuyerCancelCompensateNode bccn = orderDynamicConfig.getBeforeDepotReceiveBCCN();
|
|
|
formatParms[0] = bccn.getBuyerCompensateMoney();
|
|
|
confirmTips = MessageFormatter.arrayFormat(temp, formatParms).getMessage();
|
|
|
|
|
|
}
|
|
|
return confirmTips;
|
|
|
}
|
|
|
|
|
|
|
|
|
String formatDetailDesc(OrderStatus orderStatus, String temp){
|
|
|
Object[] formatParms = new Object[1];
|
|
|
String detailDesc = temp;
|
|
|
if(orderStatus.getCode() == OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode()){
|
|
|
OrderDynamicConfig.BuyerCancelCompensateNode bccn = orderDynamicConfig.getBeforeDepotReceiveBCCN();
|
|
|
formatParms[0] = bccn.getBuyerCompensateMoney();
|
|
|
detailDesc = MessageFormatter.arrayFormat(temp, formatParms).getMessage();
|
|
|
|
|
|
}
|
|
|
if(orderStatus.getCode() == OrderStatus.BUYER_CANCEL_BEFORE_SELLER_DELIVER.getCode()){
|
|
|
OrderDynamicConfig.BuyerCancelCompensateNode bccn = orderDynamicConfig.getBeforeSellerDeliverBCCN();
|
|
|
formatParms[0] = bccn.getBuyerCompensateMoney();
|
|
|
detailDesc = MessageFormatter.arrayFormat(temp, formatParms).getMessage();
|
|
|
}
|
|
|
return detailDesc;
|
|
|
}
|
|
|
|
|
|
Integer getLeftTime(TabType actor, Integer uid, Long orderCode, Integer orderStatus, Integer createTime){
|
|
|
Integer leftTime =null;
|
|
|
Integer payLeftTime = getPayLeftTime(actor, orderStatus,
|
...
|
...
|
|