xyh
2021-06-24 8768317130cb1943e93d4109bee9ff71aa7f669b
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java
@@ -9,9 +9,11 @@
import com.panzhihua.common.enums.EventType;
import com.panzhihua.common.exceptions.ServiceException;
import com.panzhihua.common.model.dtos.community.ComMngPopulationDTO;
import com.panzhihua.common.model.dtos.community.bigscreen.event.ScreenEventListDTO;
import com.panzhihua.common.model.dtos.grid.*;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.ComActVO;
import com.panzhihua.common.model.vos.community.screen.event.EventListVO;
import com.panzhihua.common.model.vos.grid.*;
import com.panzhihua.common.service.community.CommunityService;
import com.panzhihua.common.utlis.ExcelSelectListUtil;
@@ -58,6 +60,7 @@
    private EventGridDataService eventGridDataService;
    @Resource
    private EventResourceMapper eventResourceMapper;
    /**
     * 分页查找事件
     *
@@ -2060,6 +2063,60 @@
        return R.fail();
    }
    /**
     * 事件大屏查询事件列表
     * @param eventListDTO  请求参数
     * @return  事件列表
     */
    @Override
    public R getScreenEventList(ScreenEventListDTO eventListDTO) {
        if (eventListDTO.getEventTypes() != null && !eventListDTO.getEventTypes().isEmpty()) {
            eventListDTO.getEventTypes().forEach(eventType -> {
                if(eventType.equals(ScreenEventListDTO.eventType.xc)){
                    eventListDTO.setEventCategory(null);
                }
            });
        }
        IPage<EventListVO> eventPageList = this.baseMapper.getScreenEventList(new Page(eventListDTO.getPageNum(), eventListDTO.getPageSize()), eventListDTO);
        if(!eventPageList.getRecords().isEmpty()){
            eventPageList.getRecords().forEach(event -> {
                //查询事件关联附件
                List<EventResourceDO> eventResourceDOList =
                        eventResourceService.getBaseMapper().selectList(new LambdaQueryWrapper<EventResourceDO>()
                                .eq(EventResourceDO::getClassification, 1)
                                .eq(EventResourceDO::getRefId, event.getId())
                        );
                List<EventResourceVO> picList = new ArrayList<>();
                List<EventResourceVO> audioList = new ArrayList<>();
                List<EventResourceVO> videoList = new ArrayList<>();
                eventResourceDOList.forEach(eventResourceDO -> {
                    switch (eventResourceDO.getType()) {
                        case 1:
                            EventResourceVO picEventResourceVO = new EventResourceVO();
                            BeanUtils.copyProperties(eventResourceDO, picEventResourceVO);
                            picList.add(picEventResourceVO);
                            break;
                        case 2:
                            EventResourceVO audioResourceVO = new EventResourceVO();
                            BeanUtils.copyProperties(eventResourceDO, audioResourceVO);
                            audioList.add(audioResourceVO);
                            break;
                        case 3:
                            EventResourceVO videoResourceVO = new EventResourceVO();
                            BeanUtils.copyProperties(eventResourceDO, videoResourceVO);
                            videoList.add(videoResourceVO);
                            break;
                    }
                });
                event.setAudios(audioList);
                event.setPics(picList);
                event.setVideos(videoList);
            });
        }
        return R.ok(eventPageList);
    }
    @Override
    public List<EventDetailsVO> getUnUploadEvent() {
        List<EventDetailsVO> eventDetailsVOList =new ArrayList<>();