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