|
@@ -69,6 +69,24 @@ public class SysCouponServiceImpl extends BaseServiceImpl<Integer, SysCoupon> i
|
|
|
}
|
|
|
sysCouponDao.update(oldCoupon);
|
|
|
}else{
|
|
|
+ switch (sysCoupon.getType()){
|
|
|
+ case DISCOUNT:
|
|
|
+ if(Objects.isNull(sysCoupon.getFaceValue())){
|
|
|
+ throw new BizException("请指定折扣比例");
|
|
|
+ }
|
|
|
+ sysCoupon.setFaceValue(null);
|
|
|
+ break;
|
|
|
+ case FULL_REDUCTION:
|
|
|
+ if(Objects.isNull(sysCoupon.getFaceValue())){
|
|
|
+ throw new BizException("请指定优惠金额");
|
|
|
+ }
|
|
|
+ if(Objects.isNull(sysCoupon.getFullAmount())){
|
|
|
+ throw new BizException("请指定达标金额");
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ throw new BizException("请指定优惠券类型");
|
|
|
+ }
|
|
|
switch (sysCoupon.getEffectiveType()){
|
|
|
case DAYS:
|
|
|
if(Objects.isNull(sysCoupon.getDeadline())){
|