huanghongfa
2021-06-07 bd3a56723062aad602636ee47c91fccf2b2868f6
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/service/impl/EventServiceImpl.java
@@ -11,10 +11,7 @@
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.grid.EventDetailsVO;
import com.panzhihua.common.model.vos.grid.EventResourceVO;
import com.panzhihua.common.model.vos.grid.EventTransferRecordVO;
import com.panzhihua.common.model.vos.grid.EventVO;
import com.panzhihua.common.model.vos.grid.*;
import com.panzhihua.common.service.community.CommunityService;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_grid.dao.*;
@@ -647,9 +644,9 @@
    @Override
    public R republishEvent(CommonEventRepublishDTO commonEventRepublishDTO) {
        EventDO eventDO = this.getBaseMapper().selectById(commonEventRepublishDTO.getId());
        boolean canRepublishByUser = eventDO.getEventStatus()==4;
        boolean canRepublishByUser = eventDO.getEventStatus()==4||eventDO.getEventStatus()==1;
        if(!canRepublishByUser){
            return R.fail("当前不是撤销状态");
            return R.fail("当前不是撤销/草稿状态");
        }
        eventDO.setEventStatus(2);//2 发布
@@ -1622,4 +1619,52 @@
    public R gridMemberStatistics(MemberStatisticsAdminDTO statisticsAdminDTO){
        return R.ok(eventGridMemberRelationMapper.gridMemberStatistics(new Page(statisticsAdminDTO.getPageNum(),statisticsAdminDTO.getPageSize()),statisticsAdminDTO));
    }
    /**
     * 根据网格id查询网格统计数据
     * @param gridId    网格id
     * @return  网格统计数据
     */
    @Override
    public R getGridEventStatisticsByApp(Long gridId){
        return R.ok(this.baseMapper.getGridEventStatisticsByApp(gridId));
    }
    /**
     * 查询网格事件统计数据
     * @param statisticsDTO 请求参数
     * @return  网格事件统计数据
     */
    @Override
    public R getGridEventDetailStatisticsByApp(GridEventStatisticsDTO statisticsDTO){
        GridEventStatisticsDetailVO statisticsDetailVO = this.baseMapper.getGridEventDetailStatisticsByApp(statisticsDTO);
        if(statisticsDetailVO == null){
            statisticsDetailVO = new GridEventStatisticsDetailVO();
        }
        if(statisticsDetailVO.getEventSSPTotal() == null){
            statisticsDetailVO.setEventSSPTotal(0);
        }
        if(statisticsDetailVO.getNoEventSSPTotal() == null){
            statisticsDetailVO.setNoEventSSPTotal(0);
        }
        if(statisticsDetailVO.getEventZFTotal() == null){
            statisticsDetailVO.setEventZFTotal(0);
        }
        if(statisticsDetailVO.getNoEventZFTotal() == null){
            statisticsDetailVO.setNoEventZFTotal(0);
        }
        //统计数据
        Integer sum = statisticsDetailVO.getEventTFTotal() + statisticsDetailVO.getEventMDTotal() + statisticsDetailVO.getEventZATotal()
                + statisticsDetailVO.getEventBWDTotal() + statisticsDetailVO.getEventTSTotal() + statisticsDetailVO.getEventGGTotal()
                + statisticsDetailVO.getEventXCTotal() + statisticsDetailVO.getEventSSPTotal() + statisticsDetailVO.getEventZFTotal();
        statisticsDetailVO.setSum(sum);
        Integer noSum = statisticsDetailVO.getNoEventTFTotal() + statisticsDetailVO.getNoEventMDTotal() + statisticsDetailVO.getNoEventZATotal()
                + statisticsDetailVO.getNoEventBWDTotal() + statisticsDetailVO.getNoEventTSTotal() + statisticsDetailVO.getNoEventGGTotal()
                + statisticsDetailVO.getNoEventSSPTotal() + statisticsDetailVO.getNoEventZFTotal();
        statisticsDetailVO.setNoSum(noSum);
        return R.ok(statisticsDetailVO);
    }
}