Authored by chenchao

change owner

... ... @@ -53,4 +53,5 @@ public class AmountDetailBo {
private double depositAmount;
private double quickDeliveServiceAmount;
}
... ...
... ... @@ -200,6 +200,10 @@ public class OrderDetailInfo {
* 实付金额
*/
String realPayPrice;
String depositPrice;
String quickDeliveServicePrice;
}
... ...
... ... @@ -40,6 +40,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
/**
... ... @@ -225,7 +226,7 @@ public abstract class AbsOrderDetailService extends AbsOrderViewService implemen
GoodsInfo goodsInfo = getGoodsInfo(sellerOrderGoods);
SkupType skupType = SkupType.getSkupType(sellerOrderGoods.getAttributes());
goodsInfo.setProductName(goodsInfo.getProductName());
goodsInfo.setTypeTag(SellerGoodsHelper.buildGoodsTypeTag(skupType));
goodsInfo.setTypeTag(SellerGoodsHelper.buildGoodsTypeTag(BuyerOrderUtils.convertSkupTypeIfNeed(buyerOrder.getAttributes(), skupType)));
if(isOffline) {
goodsInfo.setTypeTag("门店订单");
}
... ... @@ -267,8 +268,19 @@ public abstract class AbsOrderDetailService extends AbsOrderViewService implemen
.activityCutPrice(MathUtils.formatStr(amountDetailBo.getActivityCutAmount()))
.couponCutPrice(MathUtils.formatStr(amountDetailBo.getCouponCutAmount()))
.shippingCouponCutPrice(MathUtils.formatStr(amountDetailBo.getShippingCouponCutAmount()))
.realPayPrice(buyerOrder.getAmount() == null ? "0" : buyerOrder.getAmount().toPlainString())
.build();
OrderAttributes oa = OrderAttributes.getOrderAttributes(buyerOrder.getAttributes());
if (Objects.equals(OrderAttributes.QUICK_DELIVER, oa)){
priceInfo.setQuickDeliveServicePrice(MathUtils.formatStr(amountDetailBo.getDepositAmount()));
}
if (Objects.equals(OrderAttributes.DEPOSITE, oa)){
priceInfo.setDepositPrice(MathUtils.formatStr(amountDetailBo.getDepositAmount()));
}
SkupTypeCodeSupport.CodeNode codeNode = SkupTypeCodeSupport.explain(buyerOrder.getAttributes());
if (codeNode.getRegion() == RegionEnum.HONGKONG.getCode()){
//tariff
... ... @@ -281,6 +293,7 @@ public abstract class AbsOrderDetailService extends AbsOrderViewService implemen
double cutShipPrice = amountDetailBo.getShippingActivityCutAmount();
priceInfo.setShippingActivityCutPrice(MathUtils.formatStr(cutShipPrice));
}
} else {
//priceInfo
priceInfo = OrderDetailInfo.PriceInfo.builder()
... ...
... ... @@ -364,11 +364,12 @@ public abstract class AbsOrderListService extends AbsOrderViewService implements
SkupType skupType = SkupType.getSkupType(sellerOrderGoods.getAttributes());
String goodsName = sellerOrderGoods.getProductName();
goodsInfo.setProductName(goodsName);
//
String typeTag;
if (isOffline){
typeTag = "门店订单";
}else{
typeTag = SellerGoodsHelper.buildGoodsTypeTag(skupType);
typeTag = SellerGoodsHelper.buildGoodsTypeTag(BuyerOrderUtils.convertSkupTypeIfNeed(buyerOrder.getAttributes(), skupType));
}
goodsInfo.setTypeTag(typeTag);
... ...
... ... @@ -680,6 +680,10 @@ public class ShoppingServiceImpl implements IShoppingService {
amountDetailBo.setDepositAmount(depositFee.getAmount());
}
SingleFeeDetail quickDeliveFee = chargeResult.getQuickDeliverServiceFee();
if (Objects.nonNull(quickDeliveFee)){
amountDetailBo.setQuickDeliveServiceAmount(quickDeliveFee.getAmount());
}
//活动券减免金额
chargeResult.getCouponPayResultList().getCouponPayResultByCouponType(CouponTypeEnum.ACTIVITY_COUPON.getCode()).
ifPresent(tempPayResult -> amountDetailBo.setCouponCutAmount(tempPayResult.getCouponAmount()));
... ...
... ... @@ -3,6 +3,7 @@ package com.yohoufo.order.utils;
import com.yohobuy.ufo.model.order.bo.OrderInfo;
import com.yohobuy.ufo.model.order.common.OrderAttributes;
import com.yohobuy.ufo.model.order.common.OrderStatus;
import com.yohobuy.ufo.model.order.constants.SkupType;
import com.yohoufo.dal.order.model.BuyerOrder;
import java.util.Objects;
... ... @@ -64,4 +65,10 @@ public class BuyerOrderUtils {
public static boolean isQuickDeliver(Integer orderAttrCode){
return Objects.nonNull(orderAttrCode) && Objects.equals(OrderAttributes.QUICK_DELIVER.getCode(), orderAttrCode);
}
public static SkupType convertSkupTypeIfNeed(Integer orderAttrCode, SkupType skupType){
boolean isDeposit = isDeposit(orderAttrCode);
return isDeposit ? SkupType.DEPOSIT : skupType;
}
}
... ...