|
@@ -15,6 +15,7 @@ import org.apache.commons.logging.Log;
|
|
|
import org.apache.commons.logging.LogFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.time.Duration;
|
|
@@ -59,6 +60,7 @@ public class OrderInfoService {
|
|
|
return orderInfoDao.get(id);
|
|
|
}
|
|
|
|
|
|
+ @Transactional
|
|
|
public OrderInfo createOrderByProductId(Long productId, List<ProductCoupon> productCouponList) {
|
|
|
|
|
|
long userId = ContextUtils.getUserContext().getUserId();
|
|
@@ -215,7 +217,7 @@ public class OrderInfoService {
|
|
|
if (productCoupon.getType() == 1) {
|
|
|
// 门槛
|
|
|
BigDecimal threshold = productCoupon.getThreshold();
|
|
|
- if (price.compareTo(threshold) > 0) {
|
|
|
+ if (price.compareTo(threshold) >= 0) {
|
|
|
// 优惠金额
|
|
|
return productCoupon.getCouponAmount();
|
|
|
}
|