Merge remote-tracking branch 'origin/prod' into prod
This commit is contained in:
@@ -124,11 +124,9 @@ public class MkConsumeCashbackServiceImpl extends ServiceImpl<MkConsumeCashbackM
|
|||||||
ShopUser shopUser = shopUserService.getOne(new QueryWrapper().eq(ShopUser::getMainShopId, mainShopId).eq(ShopUser::getUserId, userId));
|
ShopUser shopUser = shopUserService.getOne(new QueryWrapper().eq(ShopUser::getMainShopId, mainShopId).eq(ShopUser::getUserId, userId));
|
||||||
if (StrUtil.isNotBlank(config.getApplicableUser()) && !"all".equals(config.getApplicableUser())) {
|
if (StrUtil.isNotBlank(config.getApplicableUser()) && !"all".equals(config.getApplicableUser())) {
|
||||||
if ("new".equals(config.getApplicableUser())) {
|
if ("new".equals(config.getApplicableUser())) {
|
||||||
long count = orderInfoService.count(new QueryWrapper().eq(OrderInfo::getUserId, shopUser.getUserId())
|
boolean exists = orderInfoService.exists(new QueryWrapper().eq(OrderInfo::getUserId, shopUser.getUserId())
|
||||||
.eq(OrderInfo::getShopId, shopId).eq(OrderInfo::getStatus, OrderStatusEnums.DONE));
|
.eq(OrderInfo::getShopId, shopId).eq(OrderInfo::getStatus, OrderStatusEnums.DONE.getCode()));
|
||||||
log.info("消费返现 new用户校验1, orderId: {}, count: {}", orderId, count);
|
if (exists) {
|
||||||
if (count > 0L) {
|
|
||||||
log.info("消费返现 new用户校验2, orderId: {}, count: {}", orderId, count);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if ("vip".equals(config.getApplicableUser()) && shopUser.getIsVip() != 1) {
|
} else if ("vip".equals(config.getApplicableUser()) && shopUser.getIsVip() != 1) {
|
||||||
|
|||||||
@@ -70,15 +70,15 @@ public class MkShopConsumeDiscountRecordServiceImpl extends ServiceImpl<MkShopCo
|
|||||||
throw new ApiNotPrintException("随机立减配置错误");
|
throw new ApiNotPrintException("随机立减配置错误");
|
||||||
}
|
}
|
||||||
ShopUser shopUser = shopUserService.getShopUserInfo(shopId, userId);
|
ShopUser shopUser = shopUserService.getShopUserInfo(shopId, userId);
|
||||||
long count = orderInfoService.count(new QueryWrapper().eq(OrderInfo::getUserId, shopUser.getUserId())
|
boolean exists = orderInfoService.exists(new QueryWrapper().eq(OrderInfo::getUserId, shopUser.getUserId())
|
||||||
.eq(OrderInfo::getShopId, shopUser.getSourceShopId()).eq(OrderInfo::getStatus, OrderStatusEnums.DONE));
|
.eq(OrderInfo::getShopId, shopUser.getSourceShopId()).eq(OrderInfo::getStatus, OrderStatusEnums.DONE.getCode()));
|
||||||
AssertUtil.isTrue(count > 0, "新客立减仅限新用户使用");
|
AssertUtil.isTrue(exists, "新客立减仅限新用户使用");
|
||||||
|
|
||||||
|
|
||||||
long recordCount = count(new QueryWrapper().eq(MkShopConsumeDiscountRecord::getShopId, shopId).eq(MkShopConsumeDiscountRecord::getShopUserId, shopUser.getId())
|
boolean exists1 = exists(new QueryWrapper().eq(MkShopConsumeDiscountRecord::getShopId, shopId).eq(MkShopConsumeDiscountRecord::getShopUserId, shopUser.getId())
|
||||||
.eq(MkShopConsumeDiscountRecord::getIsUse, 1));
|
.eq(MkShopConsumeDiscountRecord::getIsUse, 1));
|
||||||
|
|
||||||
AssertUtil.isTrue(recordCount > 0, "新客立减已使用");
|
AssertUtil.isTrue(exists1, "新客立减已使用");
|
||||||
|
|
||||||
return consumeDiscountVO;
|
return consumeDiscountVO;
|
||||||
}
|
}
|
||||||
@@ -115,9 +115,9 @@ public class MkShopConsumeDiscountRecordServiceImpl extends ServiceImpl<MkShopCo
|
|||||||
}
|
}
|
||||||
return discountRecord;
|
return discountRecord;
|
||||||
}
|
}
|
||||||
long count = orderInfoService.count(new QueryWrapper().eq(OrderInfo::getUserId, shopUser.getUserId())
|
boolean exists = orderInfoService.exists(new QueryWrapper().eq(OrderInfo::getUserId, shopUser.getUserId())
|
||||||
.eq(OrderInfo::getShopId, shopUser.getSourceShopId()).eq(OrderInfo::getStatus, OrderStatusEnums.DONE));
|
.eq(OrderInfo::getShopId, shopUser.getSourceShopId()).eq(OrderInfo::getStatus, OrderStatusEnums.DONE.getCode()));
|
||||||
if (count > 0) {
|
if (exists) {
|
||||||
// throw new ApiNotPrintException("新客立减仅新用户可用");
|
// throw new ApiNotPrintException("新客立减仅新用户可用");
|
||||||
log.info("新客立减仅限新用户使用");
|
log.info("新客立减仅限新用户使用");
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -112,13 +112,13 @@ public class ShopCouponServiceImpl extends ServiceImpl<ShopCouponMapper, ShopCou
|
|||||||
if (!"all".equals(coupon.getGetUserType())) {
|
if (!"all".equals(coupon.getGetUserType())) {
|
||||||
if ("new".equals(coupon.getGetUserType())) {
|
if ("new".equals(coupon.getGetUserType())) {
|
||||||
isNotNewUser = false;
|
isNotNewUser = false;
|
||||||
long count = orderInfoService.count(new QueryWrapper().eq(OrderInfo::getUserId, userId)
|
boolean exists = orderInfoService.exists(new QueryWrapper().eq(OrderInfo::getUserId, userId)
|
||||||
.eq(OrderInfo::getShopId, shopId).eq(OrderInfo::getStatus, OrderStatusEnums.DONE));
|
.eq(OrderInfo::getShopId, shopId).eq(OrderInfo::getStatus, OrderStatusEnums.DONE.getCode()));
|
||||||
if (count > 0) {
|
if (exists) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
long count1 = recordService.count(new QueryWrapper().eq(MkShopCouponRecord::getCouponSyncId, coupon.getSyncId()));
|
boolean exists1 = recordService.exists(new QueryWrapper().eq(MkShopCouponRecord::getCouponSyncId, coupon.getSyncId()));
|
||||||
if (count1 > 0) {
|
if (exists1) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else if ("vip".equals(coupon.getGetUserType()) && shopUser.getIsVip() != 1) {
|
} else if ("vip".equals(coupon.getGetUserType()) && shopUser.getIsVip() != 1) {
|
||||||
|
|||||||
Reference in New Issue
Block a user