Authored by chenchao

add tariff price in order detail

@@ -180,6 +180,10 @@ public class OrderDetailInfo { @@ -180,6 +180,10 @@ public class OrderDetailInfo {
180 * 运费券金额 180 * 运费券金额
181 */ 181 */
182 String shippingCouponCutPrice; 182 String shippingCouponCutPrice;
  183 + /**
  184 + * 税费
  185 + */
  186 + String tariffPrice;
183 187
184 /** 188 /**
185 * 实付金额 189 * 实付金额
1 package com.yohoufo.order.service.impl; 1 package com.yohoufo.order.service.impl;
2 2
3 import com.google.common.collect.Lists; 3 import com.google.common.collect.Lists;
  4 +import com.yoho.core.common.utils.YHMath;
4 import com.yoho.error.ServiceError; 5 import com.yoho.error.ServiceError;
5 import com.yoho.error.exception.ServiceException; 6 import com.yoho.error.exception.ServiceException;
6 import com.yohobuy.ufo.model.order.bo.ButtonShowBo; 7 import com.yohobuy.ufo.model.order.bo.ButtonShowBo;
@@ -10,6 +11,7 @@ import com.yohobuy.ufo.model.order.bo.SoldPrdComputeBo; @@ -10,6 +11,7 @@ import com.yohobuy.ufo.model.order.bo.SoldPrdComputeBo;
10 import com.yohobuy.ufo.model.order.common.ButtonShow; 11 import com.yohobuy.ufo.model.order.common.ButtonShow;
11 import com.yohobuy.ufo.model.order.common.OrderStatus; 12 import com.yohobuy.ufo.model.order.common.OrderStatus;
12 import com.yohobuy.ufo.model.order.common.TabType; 13 import com.yohobuy.ufo.model.order.common.TabType;
  14 +import com.yohobuy.ufo.model.order.constants.RegionEnum;
13 import com.yohobuy.ufo.model.order.constants.SkupType; 15 import com.yohobuy.ufo.model.order.constants.SkupType;
14 import com.yohobuy.ufo.model.order.resp.ExpressInfoDetail; 16 import com.yohobuy.ufo.model.order.resp.ExpressInfoDetail;
15 import com.yohobuy.ufo.model.order.vo.AddressInfo; 17 import com.yohobuy.ufo.model.order.vo.AddressInfo;
@@ -27,6 +29,7 @@ import com.yohoufo.order.model.response.OrderDetailInfo; @@ -27,6 +29,7 @@ import com.yohoufo.order.model.response.OrderDetailInfo;
27 import com.yohoufo.order.service.IBuyerOrderMetaService; 29 import com.yohoufo.order.service.IBuyerOrderMetaService;
28 import com.yohoufo.order.service.IExpressInfoService; 30 import com.yohoufo.order.service.IExpressInfoService;
29 import com.yohoufo.order.service.IOrderDetailService; 31 import com.yohoufo.order.service.IOrderDetailService;
  32 +import com.yohoufo.order.service.seller.support.SkupTypeCodeSupport;
30 import com.yohoufo.order.service.support.BuyerOrderMetaMapperSupport; 33 import com.yohoufo.order.service.support.BuyerOrderMetaMapperSupport;
31 import com.yohoufo.order.utils.*; 34 import com.yohoufo.order.utils.*;
32 import lombok.Builder; 35 import lombok.Builder;
@@ -244,6 +247,11 @@ public abstract class AbsOrderDetailService extends AbsOrderViewService implemen @@ -244,6 +247,11 @@ public abstract class AbsOrderDetailService extends AbsOrderViewService implemen
244 .shippingCouponCutPrice(MathUtils.formatStr(amountDetailBo.getShippingCouponCutAmount())) 247 .shippingCouponCutPrice(MathUtils.formatStr(amountDetailBo.getShippingCouponCutAmount()))
245 .realPayPrice(buyerOrder.getAmount() == null ? "0" : buyerOrder.getAmount().toPlainString()) 248 .realPayPrice(buyerOrder.getAmount() == null ? "0" : buyerOrder.getAmount().toPlainString())
246 .build(); 249 .build();
  250 + SkupTypeCodeSupport.CodeNode codeNode = SkupTypeCodeSupport.explain(buyerOrder.getAttributes());
  251 + if (codeNode.getRegion() == RegionEnum.HONGKONG.getCode()){
  252 + double finalTariffPrice = YHMath.sub(amountDetailBo.getTariffAmount(), amountDetailBo.getTariffCutAmount());
  253 + priceInfo.setTariffPrice(MathUtils.formatStr(finalTariffPrice));
  254 + }
247 } else { 255 } else {
248 //priceInfo 256 //priceInfo
249 priceInfo = OrderDetailInfo.PriceInfo.builder() 257 priceInfo = OrderDetailInfo.PriceInfo.builder()