| | |
| | | package com.xiaopeng.operation.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject;import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.xiaopeng.api.model.operation.XpWhitelist; |
| | | import com.xiaopeng.common.core.web.page.PageInfo; |
| | |
| | | LambdaQueryWrapper<XpBanner> wrapper = new LambdaQueryWrapper<>(); |
| | | wrapper.eq(XpBanner::getBannerStatus,1); |
| | | // 当前时间在开始和结束时间范围内 |
| | | wrapper.ge(XpBanner::getStartTime,System.currentTimeMillis()); |
| | | wrapper.le(XpBanner::getEndTime,System.currentTimeMillis()); |
| | | List<XpBanner> list = list(wrapper); |
| | | List<XpBanner> list = list(wrapper.last(" and now() between start_time and end_time")); |
| | | |
| | | // 组装数据 |
| | | if (list != null && !list.isEmpty()) { |
| | |
| | | vo.setId(item.getId()); |
| | | vo.setJumpType(item.getJumpType()); |
| | | vo.setJumpUrl(item.getJumpUrl()); |
| | | JSONObject jsonObject = JSON.parseArray(item.getBannerPictures()).getJSONObject(0); |
| | | vo.setImageUrl(jsonObject.getString("url")); |
| | | return vo; |
| | | }).collect(Collectors.toList()); |
| | | } |