|
@@ -118,7 +118,12 @@ public class CouponPkgServiceImpl extends ServiceImpl<CouponPkgMapper, CouponPkg
|
|
|
throw new ServiceException("券包ID不正确");
|
|
|
}
|
|
|
|
|
|
- if (!CouponPkgStatusEnum.PUT_INIT.getValue().equals(couponPkgParam.getStatus())) {
|
|
|
+ CouponPkg couponPkg = this.getById(couponPkgParam.getId());
|
|
|
+ if (Objects.isNull(couponPkg)) {
|
|
|
+ throw new ServiceException("券包不存在");
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!CouponPkgStatusEnum.PUT_INIT.getValue().equals(couponPkg.getStatus())) {
|
|
|
throw new ServiceException("券包只有待上架才可编辑");
|
|
|
}
|
|
|
|
|
@@ -133,9 +138,9 @@ public class CouponPkgServiceImpl extends ServiceImpl<CouponPkgMapper, CouponPkg
|
|
|
.eq(CouponPkgItem::getCouponPkgId, couponPkgParam.getId()));
|
|
|
|
|
|
// 更新券包
|
|
|
- CouponPkg couponPkg = new CouponPkg();
|
|
|
+ couponPkg = new CouponPkg();
|
|
|
BeanUtils.copyProperties(couponPkgParam, couponPkg);
|
|
|
- couponPkgParam.setPicUrl("coupon_def.jpeg");
|
|
|
+ couponPkg.setPicUrl("coupon_def.jpeg");
|
|
|
this.updateById(couponPkg);
|
|
|
|
|
|
// 创建券包明细
|
|
@@ -163,7 +168,7 @@ public class CouponPkgServiceImpl extends ServiceImpl<CouponPkgMapper, CouponPkg
|
|
|
|
|
|
CouponPkg couponPkg = new CouponPkg();
|
|
|
BeanUtils.copyProperties(couponPkgParam, couponPkg);
|
|
|
- couponPkgParam.setPicUrl("coupon_def.jpeg");
|
|
|
+ couponPkg.setPicUrl("coupon_def.jpeg");
|
|
|
this.save(couponPkg);
|
|
|
|
|
|
List<CouponPkgItem> params = new ArrayList<>();
|