消费返现 用户校验
This commit is contained in:
parent
8d41b4c2a9
commit
9881e50176
|
|
@ -17,6 +17,9 @@ import com.czg.market.dto.MkConsumeDiscountDTO;
|
|||
import com.czg.market.entity.*;
|
||||
import com.czg.market.service.MkConsumeCashbackRecordService;
|
||||
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.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.core.update.UpdateWrapper;
|
||||
|
|
@ -48,6 +51,8 @@ public class MkConsumeCashbackServiceImpl extends ServiceImpl<MkConsumeCashbackM
|
|||
private ShopInfoService shopInfoService;
|
||||
@DubboReference
|
||||
private ShopUserService shopUserService;
|
||||
@DubboReference
|
||||
private OrderInfoService orderInfoService;
|
||||
@Resource
|
||||
private MkConsumeCashbackRecordService consumeCashbackRecordService;
|
||||
|
||||
|
|
@ -105,6 +110,17 @@ public class MkConsumeCashbackServiceImpl extends ServiceImpl<MkConsumeCashbackM
|
|||
}
|
||||
log.info("消费返现2, orderId: {}, orderNo: {}, config: {}", orderId, orderNo, config);
|
||||
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();
|
||||
log.info("消费返现2, orderId: {}, cashbackStepList:{}", orderId, cashbackStepList);
|
||||
if (CollUtil.isNotEmpty(cashbackStepList)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue