Commit 60ad4eb0 authored by Junling Bu's avatar Junling Bu
Browse files

update[litemall-wx-api]:实现简单的运费计算,即满88则运费0,否则运费8。

parent da447795
...@@ -362,10 +362,6 @@ public class WxCartController { ...@@ -362,10 +362,6 @@ public class WxCartController {
} }
} }
// 根据收货地址计算运费
BigDecimal freightPrice = new BigDecimal(0.00);
// 获取可用的优惠券信息 // 获取可用的优惠券信息
// 使用优惠券减免的金额 // 使用优惠券减免的金额
BigDecimal couponPrice = new BigDecimal(0.00); BigDecimal couponPrice = new BigDecimal(0.00);
...@@ -388,6 +384,12 @@ public class WxCartController { ...@@ -388,6 +384,12 @@ public class WxCartController {
checkedGoodsPrice = checkedGoodsPrice.add(cart.getRetailPrice().multiply(new BigDecimal(cart.getNumber()))); checkedGoodsPrice = checkedGoodsPrice.add(cart.getRetailPrice().multiply(new BigDecimal(cart.getNumber())));
} }
// 根据订单商品总价计算运费,满88则免运费,否则8元;
BigDecimal freightPrice = new BigDecimal(0.00);
if(checkedGoodsPrice.compareTo(new BigDecimal(88.00)) == -1){
freightPrice = new BigDecimal(8.00);
}
// 可以使用的其他钱,例如用户积分 // 可以使用的其他钱,例如用户积分
BigDecimal integralPrice = new BigDecimal(0.00); BigDecimal integralPrice = new BigDecimal(0.00);
......
...@@ -198,9 +198,6 @@ public class WxOrderController { ...@@ -198,9 +198,6 @@ public class WxOrderController {
// 收货地址 // 收货地址
LitemallAddress checkedAddress = addressService.findById(addressId); LitemallAddress checkedAddress = addressService.findById(addressId);
// 根据收货地址计算运费
BigDecimal freightPrice = new BigDecimal(0.00);
// 获取可用的优惠券信息 // 获取可用的优惠券信息
// 使用优惠券减免的金额 // 使用优惠券减免的金额
BigDecimal couponPrice = new BigDecimal(0.00); BigDecimal couponPrice = new BigDecimal(0.00);
...@@ -223,6 +220,12 @@ public class WxOrderController { ...@@ -223,6 +220,12 @@ public class WxOrderController {
checkedGoodsPrice = checkedGoodsPrice.add(cart.getRetailPrice().multiply(new BigDecimal(cart.getNumber()))); checkedGoodsPrice = checkedGoodsPrice.add(cart.getRetailPrice().multiply(new BigDecimal(cart.getNumber())));
} }
// 根据订单商品总价计算运费,满88则免运费,否则8元;
BigDecimal freightPrice = new BigDecimal(0.00);
if(checkedGoodsPrice.compareTo(new BigDecimal(88.00)) == -1){
freightPrice = new BigDecimal(8.00);
}
// 可以使用的其他钱,例如用户积分 // 可以使用的其他钱,例如用户积分
BigDecimal integralPrice = new BigDecimal(0.00); BigDecimal integralPrice = new BigDecimal(0.00);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment