| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.collect.ImmutableMap; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.system.mapper.TSysLiveMapper; |
| | | import com.ruoyi.system.model.TSysEducationalInfo; |
| | |
| | | import com.ruoyi.system.task.base.TimeJobType; |
| | | import com.ruoyi.system.task.jobs.LivePushJob; |
| | | import com.ruoyi.system.vo.TSysLiveVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.Date; |
| | |
| | | */ |
| | | @Service |
| | | public class TSysLiveServiceImpl extends ServiceImpl<TSysLiveMapper, TSysLive> implements TSysLiveService { |
| | | |
| | | @Autowired |
| | | private RedisCache redisCache; |
| | | |
| | | @Override |
| | | public R pushUser(String id, String pushType) { |
| | |
| | | public PageInfo<TSysLiveVO> pageList(TSysLiveQuery query) { |
| | | PageInfo<TSysLiveVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TSysLiveVO> list = this.baseMapper.pageList(query,pageInfo); |
| | | if (CollectionUtils.isEmpty(list)){ |
| | | return pageInfo; |
| | | } |
| | | // 判断状态 |
| | | for (TSysLiveVO sysLive : list) { |
| | | if(sysLive.getStartTime().isAfter(LocalDateTime.now())){ |
| | |
| | | if(sysLive.getEndTime().isBefore(LocalDateTime.now())){ |
| | | sysLive.setLiveStatus(3); |
| | | } |
| | | // 查看是否包含该值 |
| | | boolean memberInSet = redisCache.isMemberInSet(Constants.LIVE_APPOINTMENT_PUSH + sysLive.getId(), query.getAppUserId()); |
| | | sysLive.setAppointmentStatus(memberInSet ? 2 : 1); |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |