|
|
@@ -66,6 +66,13 @@ public class CouponCommonServiceImpl implements CouponCommonService {
|
|
|
if (coupon.getId() == null || coupon.getId() < 1) {
|
|
|
throw BusinessRuntimeException.getInstance("请输入正确的优惠券id");
|
|
|
}
|
|
|
+ if (coupon.getType() == Coupon.Type.reduce) {
|
|
|
+ coupon.setDiscount(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
+ if (coupon.getType() == Coupon.Type.discount) {
|
|
|
+ coupon.setReduceCondition(BigDecimal.ZERO);
|
|
|
+ coupon.setReduceMoney(BigDecimal.ZERO);
|
|
|
+ }
|
|
|
Coupon entity = couponMapper.selectById(coupon.getId());
|
|
|
if (entity == null || !entity.getDeleted()) {
|
|
|
throw BusinessRuntimeException.getInstance("该优惠券不存在");
|