Authored by chenchao

fix penalty 4 buyer

... ... @@ -4,7 +4,9 @@ import com.yohobuy.ufo.model.order.bo.ButtonShowBo;
import com.yohobuy.ufo.model.order.bo.OrderInfo;
import com.yohobuy.ufo.model.order.bo.TimeoutBo;
import com.yohobuy.ufo.model.order.common.*;
import com.yohoufo.dal.order.TradeBillsMapper;
import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.TradeBills;
import com.yohoufo.order.common.Payment;
import com.yohoufo.order.constants.ViewType;
import com.yohoufo.order.model.dto.BuyerPenaltyCalResult;
... ... @@ -35,13 +37,16 @@ public abstract class AbsOrderViewService {
private OrdersPayService ordersPayService;
@Autowired
private BuyerCancelCompensateComputeHandler buyerCancelCompensateComputeHandler;
BuyerCancelCompensateComputeHandler buyerCancelCompensateComputeHandler;
@Autowired
OrderCodeGenerator orderCodeGenerator;
@Autowired
private OrderTimeoutFactory orderTimeoutFactory;
OrderTimeoutFactory orderTimeoutFactory;
@Autowired
TradeBillsMapper tradeBillsMapper;
abstract Logger getLogger();
... ... @@ -116,6 +121,18 @@ public abstract class AbsOrderViewService {
return confirmTips;
}
double queryBuyerPenaltyAmount(Long orderCode){
TradeBills condition = new TradeBills();
condition.setOrderCode(orderCode);
condition.setTradeType(3);
List<TradeBills> tbs = tradeBillsMapper.selectByKeyProps(condition);
double penaltyAmount = 0D;
if (tbs != null && tbs.size() > 0){
TradeBills ptb = tbs.get(0);
penaltyAmount = ptb.getAmount() == null ? penaltyAmount : ptb.getAmount().doubleValue();
}
return penaltyAmount;
}
String formatDetailDesc(BuyerOrder buyerOrder, String temp){
Object[] formatParms = new Object[1];
... ... @@ -125,8 +142,7 @@ public abstract class AbsOrderViewService {
if (orderStatus == OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.getCode()
|| orderStatus == OrderStatus.BUYER_CANCEL_BEFORE_SELLER_DELIVER.getCode()) {
BuyerPenaltyCalResult bpcr = buyerCancelCompensateComputeHandler.calBuyerPenaltyCalResult(buyerOrder, OrderStatus.getOrderStatus(orderStatus));
formatParms[0] = bpcr.getPenaltyAmount();
formatParms[0] = queryBuyerPenaltyAmount(buyerOrder.getOrderCode());
detailDesc = MessageFormatter.arrayFormat(temp, formatParms).getMessage();
}
}catch (Exception ex){
... ...
... ... @@ -90,8 +90,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
@Autowired
private OrderOverTimeService orderOverTimeService;
@Autowired
private TradeBillsMapper tradeBillsMapper;
private static List<SkupStatus> noNeedShowOrderCode = Arrays.asList(SkupStatus.CAN_NOT_SELL,SkupStatus.CAN_SELL,
... ... @@ -414,18 +413,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
private double queryBuyerPenaltyAmount(Long orderCode){
TradeBills condition = new TradeBills();
condition.setOrderCode(orderCode);
condition.setTradeType(3);
List<TradeBills> tbs = tradeBillsMapper.selectByKeyProps(condition);
double penaltyAmount = 0D;
if (tbs != null && tbs.size() > 0){
TradeBills ptb = tbs.get(0);
penaltyAmount = ptb.getAmount() == null ? penaltyAmount : ptb.getAmount().doubleValue();
}
return penaltyAmount;
}
private String formatDetailDesc(BuyerOrder buyerOrder,OrderStatus orderStatus, TabType tabType){
String detailDesc = orderStatus.getDetailDesc(tabType);
... ...