消费返现 用户校验
This commit is contained in:
@@ -17,6 +17,9 @@ import com.czg.market.dto.MkConsumeDiscountDTO;
|
|||||||
import com.czg.market.entity.*;
|
import com.czg.market.entity.*;
|
||||||
import com.czg.market.service.MkConsumeCashbackRecordService;
|
import com.czg.market.service.MkConsumeCashbackRecordService;
|
||||||
import com.czg.market.vo.MkConsumeCashbackVO;
|
import com.czg.market.vo.MkConsumeCashbackVO;
|
||||||
|
import com.czg.order.entity.OrderInfo;
|
||||||
|
import com.czg.order.service.OrderInfoService;
|
||||||
|
import com.czg.service.market.enums.OrderStatusEnums;
|
||||||
import com.czg.utils.AssertUtil;
|
import com.czg.utils.AssertUtil;
|
||||||
import com.mybatisflex.core.query.QueryWrapper;
|
import com.mybatisflex.core.query.QueryWrapper;
|
||||||
import com.mybatisflex.core.update.UpdateWrapper;
|
import com.mybatisflex.core.update.UpdateWrapper;
|
||||||
@@ -48,6 +51,8 @@ public class MkConsumeCashbackServiceImpl extends ServiceImpl<MkConsumeCashbackM
|
|||||||
private ShopInfoService shopInfoService;
|
private ShopInfoService shopInfoService;
|
||||||
@DubboReference
|
@DubboReference
|
||||||
private ShopUserService shopUserService;
|
private ShopUserService shopUserService;
|
||||||
|
@DubboReference
|
||||||
|
private OrderInfoService orderInfoService;
|
||||||
@Resource
|
@Resource
|
||||||
private MkConsumeCashbackRecordService consumeCashbackRecordService;
|
private MkConsumeCashbackRecordService consumeCashbackRecordService;
|
||||||
|
|
||||||
@@ -105,6 +110,17 @@ public class MkConsumeCashbackServiceImpl extends ServiceImpl<MkConsumeCashbackM
|
|||||||
}
|
}
|
||||||
log.info("消费返现2, orderId: {}, orderNo: {}, config: {}", orderId, orderNo, config);
|
log.info("消费返现2, orderId: {}, orderNo: {}, config: {}", orderId, orderNo, config);
|
||||||
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 ("new".equals(config.getApplicableUser())) {
|
||||||
|
long count = orderInfoService.count(new QueryWrapper().eq(OrderInfo::getUserId, shopUser.getUserId())
|
||||||
|
.eq(OrderInfo::getShopId, shopUser.getSourceShopId()).eq(OrderInfo::getStatus, OrderStatusEnums.DONE));
|
||||||
|
if (count > 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else if ("vip".equals(config.getApplicableUser()) && shopUser.getIsVip() != 1) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
List<MkConsumeCashbackStep> cashbackStepList = config.getCashbackStepList();
|
List<MkConsumeCashbackStep> cashbackStepList = config.getCashbackStepList();
|
||||||
log.info("消费返现2, orderId: {}, cashbackStepList:{}", orderId, cashbackStepList);
|
log.info("消费返现2, orderId: {}, cashbackStepList:{}", orderId, cashbackStepList);
|
||||||
if (CollUtil.isNotEmpty(cashbackStepList)) {
|
if (CollUtil.isNotEmpty(cashbackStepList)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user