puhanshu
2021-12-31 4836dc00a01668693659bf6a5a0b3ecd09ce7aef
大屏事件接口新增
9个文件已修改
84 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/GridsGovernanceStatisticsVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventGridIncidentStatisticsVO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/BigScreenStatisticsApi.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/BigScreenStatisticsApi.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/BigScreenStatisticsService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BigScreenStatisticsServiceImpl.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComMngPopulationDOMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/bigscreen/GridsGovernanceStatisticsVO.java
@@ -85,9 +85,6 @@
    @ApiModelProperty("小区列表数据")
    private List<CivilVillageStatisticsVO> villageStatisticsList;
    @ApiModelProperty("社区事件数据")
    private List<EventGridIncidentStatisticsVO> gridIncidentList;
    @ApiModelProperty("人口统计")
    private ScreenDrawEventPopulationTotalVO drawEventPopulationTotalVO;
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventGridIncidentStatisticsVO.java
@@ -1,5 +1,6 @@
package com.panzhihua.common.model.vos.community.screen.event;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
@@ -40,6 +41,7 @@
    private Integer status;
    @ApiModelProperty("事件创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date createAt;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -7712,4 +7712,13 @@
     */
    @PostMapping("/screen/index/volunteerActList")
    R indexVolunteerActList(@RequestBody PageBaseDTO pageBaseDTO);
    /**
     * 清网治格-根据事件分类获取近1月的社区事件数据
     * @param type
     * @param communityId
     * @return
     */
    @GetMapping("/screen/event/list")
    R getEventList(@RequestParam(value = "type") Integer type, @RequestParam(value = "communityId") Long communityId);
}
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/BigScreenStatisticsApi.java
@@ -7,6 +7,8 @@
import com.panzhihua.common.model.vos.community.ComActActivityVO;
import com.panzhihua.common.model.vos.community.bigscreen.BigScreenResidentActStatisticsInfo;
import com.panzhihua.common.model.vos.community.bigscreen.BigScreenVolunteerActStatisticsInfo;
import com.panzhihua.common.model.vos.community.screen.event.EventGridIncidentStatisticsVO;
import io.swagger.annotations.ApiImplicitParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@@ -537,4 +539,11 @@
    public R list() {
        return communityService.communitySwitchList();
    }
    @ApiOperation(value = "清网治格-根据事件分类获取近1月的社区事件数据", response = EventGridIncidentStatisticsVO.class)
    @ApiImplicitParam(name = "type", value = "事件状态(1治安防控、2民生服务、3矛盾劝解、4不稳定因素、5突发事件报告、6特殊人群服务、9防灾减灾、10其他", required = true)
    @GetMapping("/event/list")
    public R getEventList(@RequestParam(value = "type") Integer type) {
        return communityService.getEventList(type, this.getCommunityId());
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/BigScreenStatisticsApi.java
@@ -335,4 +335,15 @@
    public R indexVolunteerActList(@RequestBody PageBaseDTO pageBaseDTO) {
        return bigScreenStatisticsService.indexVolunteerActList(pageBaseDTO);
    }
    /**
     * 清网治格-根据事件分类获取近1月的社区事件数据
     * @param type
     * @param communityId
     * @return
     */
    @GetMapping("/event/list")
    public R getEventList(@RequestParam(value = "type") Integer type, @RequestParam(value = "communityId") Long communityId) {
        return bigScreenStatisticsService.getEventList(type, communityId);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java
@@ -667,7 +667,7 @@
    IndexDynamic indexDynamic(Long communityId);
    /**
     * 大屏事件数据
     * 大屏30天內事件数据
     * @param communityId
     * @return
     */
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/BigScreenStatisticsService.java
@@ -151,4 +151,12 @@
     * @return
     */
    R indexVolunteerActList(PageBaseDTO pageBaseDTO);
    /**
     * 清网治格-根据事件分类获取近1月的社区事件数据
     * @param type
     * @param communityId
     * @return
     */
    R getEventList(Integer type, Long communityId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BigScreenStatisticsServiceImpl.java
@@ -265,17 +265,6 @@
            });
        }
        statisticsVO.setVillageStatisticsList(villageStatisticsList);
        // 查询社区事件列表
        List<EventGridIncidentStatisticsVO> gridIncidentList = comMngPopulationDAO.getGridsGovernanceEventList(communityId);
        if (!gridIncidentList.isEmpty()) {
            gridIncidentList.forEach(e -> {
                if (e.getEventType().equals(2)) {
                    String[] lngLatString = e.getLatLng().split(",");
                    e.setLatLng(lngLatString[1] + "," + lngLatString[0]);
                }
            });
        }
        statisticsVO.setGridIncidentList(gridIncidentList);
        //事件分析新增折线数据
        Date nowDate = new Date();
        List<StatisticsCommVO> eventAddPolylineData = comPropertyDao.getEventAddPolylineData(communityId);
@@ -833,6 +822,29 @@
        return R.ok(comActActivityDAO.indexActList(page, pageBaseDTO, false));
    }
    /**
     * 清网治格-根据事件分类获取近1月的社区事件数据
     * @param type
     * @param communityId
     * @return
     */
    @Override
    public R getEventList(Integer type, Long communityId) {
        // 查询社区事件列表
        List<EventGridIncidentStatisticsVO> gridIncidentList = comMngPopulationDAO.getGridsGovernanceEventList(communityId);
        List<EventGridIncidentStatisticsVO> returnGridIncidentList = new ArrayList<>();
        if (!gridIncidentList.isEmpty()) {
            gridIncidentList.forEach(e -> {
                if (e.getEventType().equals(2)) {
                    String[] lngLatString = e.getLatLng().split(",");
                    e.setLatLng(lngLatString[1] + "," + lngLatString[0]);
                }
            });
            returnGridIncidentList = gridIncidentList.stream().filter(e -> type.equals(e.getType())).collect(Collectors.toList());
        }
        return R.ok(returnGridIncidentList);
    }
    private Page retrievePage(PageBaseDTO pageBaseDTO) {
        Long pageNum = pageBaseDTO.getPageNum();
        Long size = pageBaseDTO.getPageSize();
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComMngPopulationDOMapper.xml
@@ -1088,7 +1088,8 @@
        ELSE 2 END `status`
        FROM `event` AS e
        LEFT JOIN event_grid_data AS egd ON egd.id = e.grid_id
        WHERE e.event_category = 1 AND e.event_type IN ( 1, 2, 3, 5, 6 ) AND e.event_status = 2 AND egd.grid_community_id = ${communityId}
        WHERE e.event_category = 1 AND e.event_type IN ( 1, 2, 3, 5, 6 )
        AND e.event_status = 2 AND egd.grid_community_id = ${communityId} AND TO_DAYS(NOW()) - TO_DAYS(e.create_at) &lt;= 30
        UNION ALL SELECT
        CASE
        WHEN classify_id = 4 THEN 1
@@ -1102,6 +1103,7 @@
        CASE
        WHEN handle_status = 2 THEN 1
        ELSE 2 END `status`
        FROM com_act_easy_photo WHERE community_id = ${communityId} AND `status` IN (1,2,4) AND del_tag = 0 AND classify_id IN (1,3,4,5,6,7,8)
        FROM com_act_easy_photo WHERE community_id = ${communityId} AND `status` IN (1,2,4)
        AND del_tag = 0 AND classify_id IN (1,3,4,5,6,7,8) AND TO_DAYS(NOW()) - TO_DAYS(create_at) &lt;= 30
    </select>
</mapper>