|
@@ -1151,30 +1151,30 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
|
|
}
|
|
}
|
|
FsCoupon coupon = couponService.selectFsCouponByCouponId(userCoupon.getCouponId());
|
|
FsCoupon coupon = couponService.selectFsCouponByCouponId(userCoupon.getCouponId());
|
|
if (coupon.getCouponType().equals(1)) {
|
|
if (coupon.getCouponType().equals(1)) {
|
|
- if (coupon.getMinPrice().compareTo(order.getPayPrice()) == 1) {
|
|
|
|
|
|
+ if (coupon.getMinPrice().compareTo(order.getPayMoney()) == 1) {
|
|
return R.error("此优惠券不可用");
|
|
return R.error("此优惠券不可用");
|
|
}
|
|
}
|
|
- if (coupon.getPrice().compareTo(order.getPayPrice()) >= 0) {
|
|
|
|
|
|
+ if (coupon.getPrice().compareTo(order.getPayMoney()) >= 0) {
|
|
data.put("payMoney", new BigDecimal(0));
|
|
data.put("payMoney", new BigDecimal(0));
|
|
data.put("discountMoney", coupon.getPrice());
|
|
data.put("discountMoney", coupon.getPrice());
|
|
} else {
|
|
} else {
|
|
- data.put("payMoney", order.getPayPrice().subtract(coupon.getPrice()));
|
|
|
|
|
|
+ data.put("payMoney", order.getPayMoney().subtract(coupon.getPrice()));
|
|
data.put("discountMoney", coupon.getPrice());
|
|
data.put("discountMoney", coupon.getPrice());
|
|
|
|
|
|
}
|
|
}
|
|
} else if (coupon.getCouponType().equals(2)) {
|
|
} else if (coupon.getCouponType().equals(2)) {
|
|
data.put("payMoney", new BigDecimal(0));
|
|
data.put("payMoney", new BigDecimal(0));
|
|
- data.put("discountMoney", order.getPayPrice());
|
|
|
|
|
|
+ data.put("discountMoney", order.getPayMoney());
|
|
} else if (coupon.getCouponType().equals(3)) {
|
|
} else if (coupon.getCouponType().equals(3)) {
|
|
return R.error("此优惠券不可用于问诊订单");
|
|
return R.error("此优惠券不可用于问诊订单");
|
|
|
|
|
|
} else if (coupon.getCouponType().equals(4)) {
|
|
} else if (coupon.getCouponType().equals(4)) {
|
|
- BigDecimal payMoney = order.getPayPrice().multiply(coupon.getRate()).divide(new BigDecimal(100));
|
|
|
|
|
|
+ BigDecimal payMoney = order.getPayMoney().multiply(coupon.getRate()).divide(new BigDecimal(100));
|
|
data.put("payMoney", payMoney);
|
|
data.put("payMoney", payMoney);
|
|
data.put("discountMoney", coupon.getPrice().subtract(payMoney));
|
|
data.put("discountMoney", coupon.getPrice().subtract(payMoney));
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- data.put("payMoney", order.getPayPrice());
|
|
|
|
|
|
+ data.put("payMoney", order.getPayMoney());
|
|
data.put("discountMoney", new BigDecimal(0));
|
|
data.put("discountMoney", new BigDecimal(0));
|
|
}
|
|
}
|
|
return R.ok().put("data", data);
|
|
return R.ok().put("data", data);
|