|
@@ -225,22 +225,25 @@ public class CouponCommonServiceImpl implements CouponCommonService {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
- if (coupon.getIsValidTime()) {
|
|
|
|
|
- if (coupon.getValidStartTime() == null || coupon.getValidEndTime() == null || (coupon.getValidStartTime().getTime() > coupon.getValidEndTime().getTime())) {
|
|
|
|
|
- throw BusinessRuntimeException.getInstance("请输入正确的有效起始和截止时间");
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- if (coupon.getValidDays() == null && coupon.getValidHours() == null) {
|
|
|
|
|
- throw BusinessRuntimeException.getInstance("请选择对应领取后有效时间");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ if (coupon.getIsValidTime() == null) {
|
|
|
|
|
+ coupon.setIsValidTime(false);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (coupon.getIsValidTime()) {
|
|
|
|
|
+ if (coupon.getValidStartTime() == null || coupon.getValidEndTime() == null || (coupon.getValidStartTime().getTime() > coupon.getValidEndTime().getTime())) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("请输入正确的有效起始和截止时间");
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (coupon.getValidDays() == null && coupon.getValidHours() == null) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("请选择对应领取后有效时间");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if (coupon.getValidDays() != null || coupon.getValidDays() < 0) {
|
|
|
|
|
- throw BusinessRuntimeException.getInstance("请输入正确的有效天数");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (coupon.getValidDays() != null && coupon.getValidDays() < 0) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("请输入正确的有效天数");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if (coupon.getValidHours() != null || coupon.getValidHours() < 0) {
|
|
|
|
|
- throw BusinessRuntimeException.getInstance("请输入正确的有效小时");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (coupon.getValidHours() != null && coupon.getValidHours() < 0) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("请输入正确的有效小时");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if (StrUtil.isNotEmpty(coupon.getExCode())) {
|
|
if (StrUtil.isNotEmpty(coupon.getExCode())) {
|