过滤商品券

This commit is contained in:
齐天大圣 2024-01-16 13:30:16 +08:00
parent 19f9249252
commit cac79ebfa9

View File

@ -1,5 +1,6 @@
package com.fuint.business.marketingActivity.cardFavorable.service.impl;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -23,6 +24,7 @@ import javax.annotation.Resource;
import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* (CardFavorable)表服务实现类
@ -183,6 +185,10 @@ public class CardFavorableServiceImpl extends ServiceImpl<CardFavorableMapper, C
Integer id = nowAccountInfo.getId();
cardFavorableDTOS.setId(id);
IPage<CouponVO> couponVOS = cardFavorableRecordMapper.selectAllByCondition(page,cardFavorableDTOS);
List<CouponVO> records = couponVOS.getRecords();
//有效期
List<CouponVO> collect = records.stream().filter(s -> s.getEndTime().getTime() > System.currentTimeMillis()).collect(Collectors.toList());
couponVOS.setRecords(collect);
return couponVOS;
}
}