|
@@ -184,6 +184,9 @@ public class CouponLogic {
|
|
if (!CollectionUtils.isEmpty(couponBean.getCouponWebsitList()))
|
|
if (!CollectionUtils.isEmpty(couponBean.getCouponWebsitList()))
|
|
couponBean.setBuyType("WEBSIT");
|
|
couponBean.setBuyType("WEBSIT");
|
|
|
|
|
|
|
|
+ if (couponService.lambdaQuery().eq(Coupon::getCouponName,couponBean.getCouponName()).count() > 0)
|
|
|
|
+ throw new RemoteServiceException("存在优惠券名称相同");
|
|
|
|
+
|
|
couponService.save(couponBean);
|
|
couponService.save(couponBean);
|
|
String couponId = couponBean.getCouponId();
|
|
String couponId = couponBean.getCouponId();
|
|
|
|
|
|
@@ -409,6 +412,12 @@ public class CouponLogic {
|
|
Coupon coupon = couponService.getById(couponBean.getCouponId());
|
|
Coupon coupon = couponService.getById(couponBean.getCouponId());
|
|
couponBean.setCreateTime(null);
|
|
couponBean.setCreateTime(null);
|
|
|
|
|
|
|
|
+ if (couponService.lambdaQuery().eq(Coupon::getCouponName,couponBean.getCouponName())
|
|
|
|
+ .ne(Coupon::getCouponId,couponBean.getCouponId())
|
|
|
|
+ .count() > 0)
|
|
|
|
+ throw new RemoteServiceException("存在优惠券名称相同");
|
|
|
|
+
|
|
|
|
+
|
|
couponCompanyService.lambdaUpdate().eq(CouponCompany::getCouponId,coupon.getCouponId()).remove();
|
|
couponCompanyService.lambdaUpdate().eq(CouponCompany::getCouponId,coupon.getCouponId()).remove();
|
|
for (CouponCompany couponCompany : couponBean.getCouponCompanyList()) {
|
|
for (CouponCompany couponCompany : couponBean.getCouponCompanyList()) {
|
|
AdminCompany adminCompany = adminCompanyService.getById(couponCompany.getCompanyId());
|
|
AdminCompany adminCompany = adminCompanyService.getById(couponCompany.getCompanyId());
|