| | |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.account.api.model.TAppUserVipDetail; |
| | | import com.ruoyi.account.api.query.ExchangeRecordGoodsQuery; |
| | | import com.ruoyi.account.api.vo.CouponListVOVO; |
| | | import com.ruoyi.other.api.vo.CouponListVOVO; |
| | | import com.ruoyi.account.api.vo.ExchangeRecordVO; |
| | | import com.ruoyi.account.mapper.TAppCouponMapper; |
| | | import com.ruoyi.account.mapper.TAppUserMapper; |
| | |
| | | private ChargingOrderClient chargingOrderClient; |
| | | @Autowired |
| | | private TAppUserVipDetailService tAppUserVipDetailService; |
| | | @Autowired |
| | | private TAppUserMapper tAppUserMapper; |
| | | @Autowired |
| | | private TokenService tokenService; |
| | | |
| | | @Override |
| | | public PageInfo<ExchangeRecordVO> pagelist(ExchangeRecordGoodsQuery dto) { |
| | |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private TAppUserMapper tAppUserMapper; |
| | | |
| | | @Override |
| | | public PageInfo<CouponListVOVO> couponList(CouponListDto dto) { |
| | | // todo token获取用户id |
| | | Long userId = 11L; |
| | | dto.setUserId(userId); |
| | | dto.setUserId(tokenService.getLoginUserApplet().getUserId()); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | PageInfo<CouponListVOVO> pageInfo = new PageInfo<>(dto.getPageCurr(),dto.getPageSize()); |
| | | List<CouponListVOVO> list = this.baseMapper.couponList(pageInfo,dto.getUserId()); |
| | |
| | | break; |
| | | } |
| | | } |
| | | // 通过集合的money字段 将money从大到小排序 |
| | | data.sort(Comparator.comparing(CouponListVOVO::getMoney).reversed()); |
| | | // 通过集合的money、isUse字段 将money、isUse从大到小排序 将不可用的排在最后 |
| | | data.sort(Comparator.comparing(CouponListVOVO::getMoney).reversed().thenComparing(CouponListVOVO::getIsUse)); |
| | | pageInfo.setRecords(data); |
| | | return pageInfo; |
| | | } |