罗元桥
2021-06-22 c6512655e722d9ca80dd8c34b79f6d3923ecf86c
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java
@@ -2,6 +2,7 @@
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -15,6 +16,7 @@
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;
import com.panzhihua.common.utlis.LngLatUtils;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_grid.dao.*;
@@ -56,6 +58,8 @@
    private EventGridMemberRelationMapper eventGridMemberRelationMapper;
    @Resource
    private EventGridDataService eventGridDataService;
    @Resource
    private EventResourceMapper eventResourceMapper;
    /**
     * 分页查找事件
@@ -2071,5 +2075,33 @@
        }
        IPage<EventListVO> eventPageList = this.baseMapper.getScreenEventList(new Page(eventListDTO.getPageNum(),eventListDTO.getPageSize()),eventListDTO);
        return R.ok(eventPageList);
    @Override
    public List<EventDetailsVO> getUnUploadEvent() {
        List<EventDetailsVO> eventDetailsVOList =new ArrayList<>();
        List<EventDO> unEventList = baseMapper.selectList(
                new QueryWrapper<EventDO>()
                        .eq("upload", false)
        );
        unEventList.forEach(eventDO -> {
            eventDetailsVOList.add(eventDetails(eventDO.getId()).getData());
        });
        return eventDetailsVOList;
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public Boolean updateLcUploadFlag(Long id) {
        EventDO event = baseMapper.selectById(id);
        event.setUpload(true);
        baseMapper.updateById(event);
        EventResourceDO eventResourceDO =new EventResourceDO();
        eventResourceDO.setUpload(true);
        int flag = eventResourceMapper.update(eventResourceDO, new QueryWrapper<EventResourceDO>()
                .eq("ref_id", id));
        if(flag>0){
            return true;
        }
        return false;
    }
}