|
|
@@ -389,12 +389,15 @@ public class DistributeServiceImpl implements DistributeService {
|
|
|
if (StrUtil.isEmpty(exCode)) {
|
|
|
throw BusinessRuntimeException.getInstance("优惠码为空");
|
|
|
}
|
|
|
- Integer count = couponDistributePopularizeMapper.selectCount(Wrappers.lambdaQuery(CouponDistributePopularize.class).ne(data.getId() != null, CouponDistributePopularize::getId, data.getId()).eq(CouponDistributePopularize::getDeleted, 1).eq(CouponDistributePopularize::getExCode, exCode));
|
|
|
+ Integer count = couponDistributePopularizeMapper.selectCount(Wrappers.lambdaQuery(CouponDistributePopularize.class).ne(data.getId() != null, CouponDistributePopularize::getId, data.getId())
|
|
|
+ .eq(CouponDistributePopularize::getDeleted, 1)
|
|
|
+ .eq(CouponDistributePopularize::getIsGeneral, false)
|
|
|
+ .eq(CouponDistributePopularize::getExCode, exCode));
|
|
|
if (count == 0) {
|
|
|
count = couponMapper.selectCount(Wrappers.lambdaQuery(Coupon.class).eq(Coupon::getExCode, exCode).eq(Coupon::getDeleted, true));
|
|
|
}
|
|
|
if (count > 0) {
|
|
|
- throw BusinessRuntimeException.getInstance("优惠码:{]已存在", exCode);
|
|
|
+ throw BusinessRuntimeException.getInstance("优惠码:{}已存在", exCode);
|
|
|
}
|
|
|
if (data.getId() != null) {
|
|
|
couponDistributePopularizeMapper.updateById(data);
|