...
|
...
|
@@ -2,7 +2,8 @@ package com.yohoufo.order.service.support; |
|
|
|
|
|
import com.yohoufo.dal.order.model.SellerOrderGoods;
|
|
|
import com.yohoufo.order.constants.OrderConstant;
|
|
|
import com.yohoufo.order.response.ShoppingPaymentResponse;
|
|
|
import com.yohoufo.order.response.GoodsInfo;
|
|
|
import com.yohoufo.order.response.PaymentResponse;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
...
|
...
|
@@ -17,9 +18,9 @@ public class ShoppingSupport { |
|
|
* 支付方式
|
|
|
* @return
|
|
|
*/
|
|
|
public ShoppingPaymentResponse.PaymentWay getPaymentWay() {
|
|
|
public PaymentResponse.PaymentWay getPaymentWay() {
|
|
|
// 支付方式: 在线支付
|
|
|
ShoppingPaymentResponse.PaymentWay paymentWay = new ShoppingPaymentResponse.PaymentWay();
|
|
|
PaymentResponse.PaymentWay paymentWay = new PaymentResponse.PaymentWay();
|
|
|
paymentWay.setPaymentType(OrderConstant.PAYMENT_ONLINE);
|
|
|
paymentWay.setPaymentTypeName(OrderConstant.PAYMENT_ONLINE_NAME);
|
|
|
return paymentWay;
|
...
|
...
|
@@ -30,9 +31,9 @@ public class ShoppingSupport { |
|
|
* 配送方式
|
|
|
* @return
|
|
|
*/
|
|
|
public ShoppingPaymentResponse.DeliveryWay getDeliverWay() {
|
|
|
public PaymentResponse.DeliveryWay getDeliverWay() {
|
|
|
// 快递方式
|
|
|
ShoppingPaymentResponse.DeliveryWay deliveryWay = new ShoppingPaymentResponse.DeliveryWay();
|
|
|
PaymentResponse.DeliveryWay deliveryWay = new PaymentResponse.DeliveryWay();
|
|
|
deliveryWay.setDeliveryWayId(OrderConstant.DELIVERY_WAY_SF);
|
|
|
deliveryWay.setDeliveryWayCost(OrderConstant.DELIVERY_WAY_SF_COST);
|
|
|
deliveryWay.setDeliveryWayName(OrderConstant.DELIVERY_WAY_SF_NAME);
|
...
|
...
|
@@ -45,15 +46,15 @@ public class ShoppingSupport { |
|
|
* @param skup
|
|
|
* @return
|
|
|
*/
|
|
|
public ShoppingPaymentResponse.Goods getGoodsInfo(SellerOrderGoods skup) {
|
|
|
ShoppingPaymentResponse.Goods goods = new ShoppingPaymentResponse.Goods();
|
|
|
public GoodsInfo getGoodsInfo(SellerOrderGoods skup) {
|
|
|
GoodsInfo goods = new GoodsInfo();
|
|
|
goods.setProductName(skup.getProductName());
|
|
|
goods.setColorId(skup.getColorId() == null ? 0 : skup.getColorId());
|
|
|
goods.setColor(skup.getColorName());
|
|
|
goods.setColorName(skup.getColorName());
|
|
|
goods.setSizeId(skup.getSizeId() == null ? 0:skup.getSizeId());
|
|
|
goods.setSizeName(skup.getSizeName());
|
|
|
goods.setSalePrice(skup.getGoodsPrice());
|
|
|
goods.setGoodsImg(skup.getImageUrl());
|
|
|
goods.setGoodPrice(skup.getGoodsPrice() == null ? "0" : skup.getGoodsPrice().toPlainString());
|
|
|
goods.setGoodImg(skup.getImageUrl());
|
|
|
return goods;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -62,16 +63,16 @@ public class ShoppingSupport { |
|
|
* @param skup
|
|
|
* @return
|
|
|
*/
|
|
|
public List<ShoppingPaymentResponse.PromotionFormula> getPromotionFormula(SellerOrderGoods skup) {
|
|
|
ShoppingPaymentResponse.PromotionFormula formula1 = new ShoppingPaymentResponse.PromotionFormula();
|
|
|
public List<PaymentResponse.PromotionFormula> getPromotionFormula(SellerOrderGoods skup) {
|
|
|
PaymentResponse.PromotionFormula formula1 = new PaymentResponse.PromotionFormula();
|
|
|
formula1.setPromotion(OrderConstant.GOODS_PRICE);
|
|
|
formula1.setPromotionAmount(OrderConstant.MONEY_SIGN + skup.getGoodsPrice());
|
|
|
|
|
|
ShoppingPaymentResponse.PromotionFormula formula2 = new ShoppingPaymentResponse.PromotionFormula();
|
|
|
PaymentResponse.PromotionFormula formula2 = new PaymentResponse.PromotionFormula();
|
|
|
formula2.setPromotion(OrderConstant.DELIVERY_DESC);
|
|
|
formula2.setPromotionAmount(OrderConstant.PLUS_SIGN + OrderConstant.MONEY_SIGN + OrderConstant.DELIVERY_WAY_SF_COST);
|
|
|
|
|
|
ShoppingPaymentResponse.PromotionFormula formula3 = new ShoppingPaymentResponse.PromotionFormula();
|
|
|
PaymentResponse.PromotionFormula formula3 = new PaymentResponse.PromotionFormula();
|
|
|
formula3.setPromotion(OrderConstant.GOODS_REAL_PRICE);
|
|
|
formula3.setPromotionAmount(OrderConstant.MONEY_SIGN + skup.getGoodsPrice().add(new BigDecimal(OrderConstant.DELIVERY_WAY_SF_COST)));
|
|
|
|
...
|
...
|
|