|
|
@@ -86,7 +86,12 @@ public class VipFrontServiceImpl implements VipFrontService {
|
|
|
public VipDeductDto checkAndGetOrderDeductMoney(Long userId) {
|
|
|
List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
List<Long> vipSkuIds = vipGoodsSkuMapper.selectList(null).stream().map(VipGoodsSku::getSkuId).collect(Collectors.toList());
|
|
|
- Number count = beanSearcher.searchCount(GroupsRelationView.class, MapUtils.builder().field(GroupsRelationView::getUserId, userIdList).op(Operator.InList).field(GroupsRelationView::getSkuId, vipSkuIds).op(Operator.InList).field(GroupsRelationView::getExpiryTime, DateTime.now()).op(Operator.GreaterThan).build());
|
|
|
+ Number count = beanSearcher.searchCount(GroupsRelationView.class, MapUtils.builder()
|
|
|
+ .field(GroupsRelationView::getUserId, userIdList).op(Operator.InList)
|
|
|
+ .field(GroupsRelationView::getSkuId, vipSkuIds).op(Operator.InList)
|
|
|
+ .field(GroupsRelationView::getExpiryTime, DateTime.now()).op(Operator.GreaterThan)
|
|
|
+ .field(GroupsRelationView::getIsVip, false)
|
|
|
+ .build());
|
|
|
if (count.intValue() == 0) {
|
|
|
throw BusinessRuntimeException.getInstance("暂无可抵扣AI车票");
|
|
|
}
|
|
|
@@ -114,7 +119,13 @@ public class VipFrontServiceImpl implements VipFrontService {
|
|
|
BigDecimal deductMoney = BigDecimal.ZERO;
|
|
|
BigDecimal vipMoney = getVipMoney();
|
|
|
for (Long vipSkuId : vipSkuIds) {
|
|
|
- GroupsRelationView relation = beanSearcher.searchFirst(GroupsRelationView.class, MapUtils.builder().field(GroupsRelationView::getSkuId, vipSkuId).field(GroupsRelationView::getUserId, userIdList).op(Operator.InList).orderBy(GroupsRelationView::getExpiryTime).desc().build());
|
|
|
+ GroupsRelationView relation = beanSearcher.searchFirst(GroupsRelationView.class, MapUtils.builder()
|
|
|
+ .field(GroupsRelationView::getSkuId, vipSkuId)
|
|
|
+ .field(GroupsRelationView::getUserId, userIdList)
|
|
|
+ .field(GroupsRelationView::getIsVip, false)
|
|
|
+ .field(GroupsRelationView::getExpiryTime, DateTime.now()).op(Operator.GreaterThan)
|
|
|
+ .op(Operator.InList).orderBy(GroupsRelationView::getExpiryTime).desc()
|
|
|
+ .build());
|
|
|
if (relation != null) {
|
|
|
Long goodsId = relation.getGoodsId();
|
|
|
Long relationId = relation.getId();
|