huanghongfa
2021-07-02 ffcd3e31c9938eb256d616c80edbe1821e9fb2bf
springcloud_k8s_panzhihuazhihuishequ/service_grid/src/main/java/com/panzhihua/service_grid/api/StatisticsApi.java
@@ -1,12 +1,11 @@
package com.panzhihua.service_grid.api;
import com.panzhihua.common.model.dtos.grid.GridEventStatisticsDTO;
import com.panzhihua.common.model.dtos.grid.MemberStatisticsAdminDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.service_grid.service.EventService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -18,8 +17,43 @@
    @Resource
    private EventService eventService;
    /**
     * 后台管理-统计模块
     * @param communityId   社区id
     * @return  统计信息
     */
    @GetMapping("/admin/eventStatistics")
    public R eventStatistics(@RequestParam("communityId") Long communityId){
        return eventService.eventStatistics(communityId);
    }
    /**
     * 后台管理-网格员统计
     * @param statisticsAdminDTO    请求参数
     * @return  网格员统计信息
     */
    @PostMapping("/admin/gridMemberStatistics")
    public R gridMemberStatistics(@RequestBody MemberStatisticsAdminDTO statisticsAdminDTO){
        return eventService.gridMemberStatistics(statisticsAdminDTO);
    }
    /**
     * 根据网格id查询网格统计数据
     * @param gridId    网格id
     * @return  网格统计数据
     */
    @PostMapping("/getGridEventStatistics")
    public R getGridEventStatisticsByApp(@RequestParam("gridId") Long gridId){
        return eventService.getGridEventStatisticsByApp(gridId);
    }
    /**
     * 查询网格事件统计数据
     * @param statisticsDTO 请求参数
     * @return  网格事件统计数据
     */
    @PostMapping("/event/getGridEventStatistics")
    public R getGridEventDetailStatisticsByApp(@RequestBody GridEventStatisticsDTO statisticsDTO){
        return eventService.getGridEventDetailStatisticsByApp(statisticsDTO);
    }
}