huanghongfa
2021-12-14 1290d964677db8bf9137715116dfce8b06bcfac1
大屏实有人口模块接口
4个文件已添加
8个文件已修改
478 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventPopulationBasicsStatisticsVO.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventPopulationSpecialStatisticsVO.java 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventPopulationStatisticsVO.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventPopulationStreetVO.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/BigScreenStatisticsApi.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/BigScreenStatisticsApi.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngPopulationService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComMngPopulationDOMapper.xml 244 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/zuul/src/main/java/com/panzhihua/zuul/filters/JWTAuthenticationTokenFilter.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventPopulationBasicsStatisticsVO.java
New file
@@ -0,0 +1,33 @@
package com.panzhihua.common.model.vos.community.screen.event;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @title: EventComprehensiveGovernanceStatisticsVO
 * @projectName: 成都呐喊信息技术有限公司-智慧社区项目
 * @description: 西区大数据分析平台-综合治理信息
 * @author: lyq
 * @date: 2021/12/14 10:53
 */
@Data
@ApiModel("西区大数据分析平台-一标三实基础信息")
public class EventPopulationBasicsStatisticsVO {
    @ApiModelProperty("社区id")
    private Long communityId;
    @ApiModelProperty("社区名称")
    private String communityName;
    @ApiModelProperty("人口数量")
    private Integer populationNum = 0;
    @ApiModelProperty("小区数量")
    private Integer villageNum = 0;
    @ApiModelProperty("房屋数量")
    private Integer houseNum = 0;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventPopulationSpecialStatisticsVO.java
New file
@@ -0,0 +1,63 @@
package com.panzhihua.common.model.vos.community.screen.event;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @title: EventComprehensiveGovernanceStatisticsVO
 * @projectName: 成都呐喊信息技术有限公司-智慧社区项目
 * @description: 西区大数据分析平台-综合治理信息
 * @author: lyq
 * @date: 2021/12/14 10:53
 */
@Data
@ApiModel("西区大数据分析平台-一标三实特殊人群信息")
public class EventPopulationSpecialStatisticsVO {
    @ApiModelProperty("残疾人")
    private Integer cjTotal = 0;
    @ApiModelProperty("低保户")
    private Integer dbTotal = 0;
    @ApiModelProperty("高龄老人")
    private Integer glTotal = 0;
    @ApiModelProperty("特殊情况")
    private Integer tsTotal = 0;
    @ApiModelProperty("特扶家庭")
    private Integer tfTotal = 0;
    @ApiModelProperty("退役军人")
    private Integer tyTotal = 0;
    @ApiModelProperty("退休人员")
    private Integer txTotal = 0;
    @ApiModelProperty(value = "吸毒人员",hidden = true)
    private Integer xdTotal = 0;
    @ApiModelProperty(value = "社区矫正人员",hidden = true)
    private Integer jzTotal = 0;
    @ApiModelProperty(value = "邪教人员",hidden = true)
    private Integer xjTotal = 0;
    @ApiModelProperty(value = "刑释人员",hidden = true)
    private Integer xsTotal = 0;
    @ApiModelProperty(value = "上访人员",hidden = true)
    private Integer sfTotal = 0;
    @ApiModelProperty(value = "重精人员",hidden = true)
    private Integer zjTotal = 0;
    @ApiModelProperty("老年人(》=60)")
    private Integer lnTotal = 0;
    @ApiModelProperty("其他")
    private Integer otherTotal = 0;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventPopulationStatisticsVO.java
New file
@@ -0,0 +1,35 @@
package com.panzhihua.common.model.vos.community.screen.event;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
 * @title: EventComprehensiveGovernanceStatisticsVO
 * @projectName: 成都呐喊信息技术有限公司-智慧社区项目
 * @description: 西区大数据分析平台-综合治理信息
 * @author: lyq
 * @date: 2021/12/14 10:53
 */
@Data
@ApiModel("西区大数据分析平台-一标三实信息")
public class EventPopulationStatisticsVO {
    @ApiModelProperty("人口数据")
    private List<EventPopulationBasicsStatisticsVO> basicsList;
    @ApiModelProperty("特殊人口数据")
    private EventPopulationSpecialStatisticsVO specialStatisticsVo;
    @ApiModelProperty("人口数量")
    private Integer populationNum = 0;
    @ApiModelProperty("小区数量")
    private Integer villageNum = 0;
    @ApiModelProperty("房屋数量")
    private Integer houseNum = 0;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/event/EventPopulationStreetVO.java
New file
@@ -0,0 +1,25 @@
package com.panzhihua.common.model.vos.community.screen.event;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
 * @title: EventComprehensiveGovernanceStatisticsVO
 * @projectName: 成都呐喊信息技术有限公司-智慧社区项目
 * @description: 西区大数据分析平台-综合治理信息
 * @author: lyq
 * @date: 2021/12/14 10:53
 */
@Data
@ApiModel("西区大数据分析平台-街道列表信息")
public class EventPopulationStreetVO {
    @ApiModelProperty("街道id")
    private Long streetId;
    @ApiModelProperty("街道名称")
    private String name;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -7428,4 +7428,14 @@
     */
    @GetMapping("/screen/getWestScreenStatics")
    R westScreenStatics();
    /**
     * 西区大屏一标三实数据
     * @return  西区大屏一标三实数据
     */
    @GetMapping("/screen/getComprehensivePopulationStatics")
    R getComprehensivePopulationStatics(@RequestParam("streetId") Long streetId);
    @GetMapping("/screen/getComprehensiveStreetList")
    R getComprehensiveStreetList();
}
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/BigScreenStatisticsApi.java
@@ -198,4 +198,16 @@
    public R getComprehensiveGovernanceStatics() {
        return gridService.getComprehensiveGovernanceStatics();
    }
    @ApiOperation(value = "西区大数据分析平台-一标三实栏", response = EventPopulationStatisticsVO.class)
    @GetMapping("/comprehensive/population")
    public R getComprehensivePopulationStatics(@RequestParam(value = "streetId",required = false,defaultValue = "0") Long streetId) {
        return communityService.getComprehensivePopulationStatics(streetId);
    }
    @ApiOperation(value = "西区大数据分析平台-西区街道列表", response = EventPopulationStreetVO.class)
    @GetMapping("/comprehensive/street/list")
    public R getComprehensiveStreetList() {
        return communityService.getComprehensiveStreetList();
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/BigScreenStatisticsApi.java
@@ -87,4 +87,14 @@
        return comMngPopulationService.westScreenStatics();
    }
    @GetMapping("/getComprehensivePopulationStatics")
    public R getComprehensivePopulationStatics(@RequestParam("streetId") Long streetId){
        return comMngPopulationService.getComprehensivePopulationStatics(streetId);
    }
    @GetMapping("/getComprehensiveStreetList")
    public R getComprehensiveStreetList(){
        return comMngPopulationService.getComprehensiveStreetList();
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java
@@ -637,4 +637,14 @@
     * @return
     */
    WestScreenStatics westScreenStatics();
    List<EventPopulationBasicsStatisticsVO> getBasicsList(@Param("streetId") Long streetId);
    EventPopulationSpecialStatisticsVO getPopulationSpecial(@Param("streetId") Long streetId);
    List<String> getPopulationListCardNo(@Param("streetId") Long streetId);
    Integer getPopulationAge(@Param("streetId") Long streetId);
    List<EventPopulationStreetVO> getComprehensiveStreetList();
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngPopulationService.java
@@ -527,4 +527,8 @@
     * @return
     */
    R westScreenStatics();
    R getComprehensivePopulationStatics(Long streetId);
    R getComprehensiveStreetList();
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
@@ -7743,6 +7743,36 @@
        return R.ok(this.comMngPopulationDAO.westScreenStatics());
    }
    @Override
    public R getComprehensivePopulationStatics(Long streetId){
        EventPopulationStatisticsVO statisticsVo = new EventPopulationStatisticsVO();
        //查询人口数据
        List<EventPopulationBasicsStatisticsVO> basicsList = comMngPopulationDAO.getBasicsList(streetId);
        if(basicsList != null){
            for (EventPopulationBasicsStatisticsVO basics : basicsList) {
                statisticsVo.setPopulationNum(statisticsVo.getPopulationNum() + basics.getPopulationNum());
                statisticsVo.setVillageNum(statisticsVo.getVillageNum() + basics.getVillageNum());
                statisticsVo.setHouseNum(statisticsVo.getHouseNum() + basics.getHouseNum());
            }
            statisticsVo.setBasicsList(basicsList);
        }
        //查询特殊人群数据
        EventPopulationSpecialStatisticsVO populationSpecial = comMngPopulationDAO.getPopulationSpecial(streetId);
        if(populationSpecial != null){
            populationSpecial.setOtherTotal(populationSpecial.getZjTotal() + populationSpecial.getSfTotal()
                    + populationSpecial.getXsTotal() + populationSpecial.getXjTotal()
                    + populationSpecial.getJzTotal() + populationSpecial.getXdTotal());
            populationSpecial.setLnTotal(comMngPopulationDAO.getPopulationAge(streetId));
            statisticsVo.setSpecialStatisticsVo(populationSpecial);
        }
        return R.ok(statisticsVo);
    }
    @Override
    public R getComprehensiveStreetList(){
        return R.ok(comMngPopulationDAO.getComprehensiveStreetList());
    }
    private void setMistake(ComMngPopulationMistakeExcelVO mvo, ComMngPopulationServeExcelVO vo) {
        mvo.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCnDescByName(vo.getPoliticalOutlook()));
        mvo.setIsRent(PopulHouseUseEnum.getCnDescByName(vo.getIsRent()));
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComMngPopulationDOMapper.xml
@@ -826,4 +826,248 @@
                (select count(*) from com_act_reserve t LEFT JOIN com_act_reserve_record t1 on t.id = t1.reserve_id where title like '%居家隔离%' or title like  '%返攀登记%' and t1.status = 2 )  reserve,
                (select count(*) from com_act_activity where status !=6) activity
        </select>
    <select id="getBasicsList" resultType="com.panzhihua.common.model.vos.community.screen.event.EventPopulationBasicsStatisticsVO">
        SELECT
            ca.community_id,
            ca.`name` AS communityName,
            (
            SELECT
                count( cmpct.id )
            FROM
                com_mng_population_community_tags AS cmpct
                LEFT JOIN com_mng_population AS cmp ON cmp.id = cmpct.population_id
            WHERE
                cmpct.community_id = ca.community_id
            ) AS populationNum,
            ( SELECT count( village_id ) FROM com_mng_village AS cmv WHERE cmv.community_id = ca.community_id ) AS villageNum,
            (select count(id) from com_mng_population_house as cmph where cmph.community_id = ca.community_id) as houseNum
        FROM
            com_act AS ca
            LEFT JOIN com_street AS cs ON cs.street_id = ca.street_id
            <where>
                <if test="streetId != null and streetId != 0">
                    and cs.street_id = 19
                </if>
            </where>
        order by cs.street_id desc,populationNum desc
    </select>
    <select id="getPopulationSpecial" resultType="com.panzhihua.common.model.vos.community.screen.event.EventPopulationSpecialStatisticsVO">
        SELECT
            count( cmpct.id ) AS cjTotal,
            (
            SELECT
            count( cmpct1.id )
        FROM
            com_mng_population_community_tags AS cmpct1
            LEFT JOIN com_act AS ca1 ON ca1.community_id = cmpct1.community_id
            LEFT JOIN com_street AS cs1 ON cs1.street_id = ca1.street_id
        WHERE
             cmpct1.label LIKE '%低保户%'
            <if test="streetId != null and streetId != 0">
                and cs1.street_id = #{streetId}
            </if>
            ) as dbTotal ,
            (
            SELECT
            count( cmpct2.id )
        FROM
            com_mng_population_community_tags AS cmpct2
            LEFT JOIN com_act AS ca2 ON ca2.community_id = cmpct2.community_id
            LEFT JOIN com_street AS cs2 ON cs2.street_id = ca2.street_id
        WHERE
            cmpct2.label LIKE '%高龄老人%'
        <if test="streetId != null and streetId != 0">
            and cs2.street_id = #{streetId}
        </if>
            ) as glTotal ,
            (
            SELECT
            count( cmpct3.id )
        FROM
            com_mng_population_community_tags AS cmpct3
            LEFT JOIN com_act AS ca3 ON ca3.community_id = cmpct3.community_id
            LEFT JOIN com_street AS cs3 ON cs3.street_id = ca3.street_id
        WHERE
             cmpct3.label LIKE '%特殊情况(重大病史/孕)%'
        <if test="streetId != null and streetId != 0">
            and cs3.street_id = #{streetId}
        </if>
            ) as tsTotal ,
            (
            SELECT
            count( cmpct4.id )
        FROM
            com_mng_population_community_tags AS cmpct4
            LEFT JOIN com_act AS ca4 ON ca4.community_id = cmpct4.community_id
            LEFT JOIN com_street AS cs4 ON cs4.street_id = ca4.street_id
        WHERE
            cmpct4.label LIKE '%特扶家庭%'
        <if test="streetId != null and streetId != 0">
            and cs4.street_id = #{streetId}
        </if>
            ) as tfTotal,
            (
            SELECT
            count( cmpct5.id )
        FROM
            com_mng_population_community_tags AS cmpct5
            LEFT JOIN com_act AS ca5 ON ca5.community_id = cmpct5.community_id
            LEFT JOIN com_street AS cs5 ON cs5.street_id = ca5.street_id
        WHERE
            cmpct5.label LIKE '%退役军人%'
        <if test="streetId != null and streetId != 0">
            and cs5.street_id = #{streetId}
        </if>
            ) as tyTotal,
            (
            SELECT
            count( cmpct6.id )
        FROM
            com_mng_population_community_tags AS cmpct6
            LEFT JOIN com_act AS ca6 ON ca6.community_id = cmpct6.community_id
            LEFT JOIN com_street AS cs6 ON cs6.street_id = ca6.street_id
            left join com_mng_population as cmp6 on cmp6.id = cmpct6.population_id
        WHERE
            cmpct6.label LIKE '%养老金人员%'
        <if test="streetId != null and streetId != 0">
            and cs6.street_id = #{streetId}
        </if>
            AND cmp6.death = 0
            ) as txTotal,
            (
            SELECT
            count( cmpct7.id )
        FROM
            com_mng_population_community_tags AS cmpct7
            LEFT JOIN com_act AS ca7 ON ca7.community_id = cmpct7.community_id
            LEFT JOIN com_street AS cs7 ON cs7.street_id = ca7.street_id
        WHERE
            cmpct7.label LIKE '%吸毒人员%'
        <if test="streetId != null and streetId != 0">
            and cs7.street_id = #{streetId}
        </if>
            ) as xdTotal,
            (
            SELECT
            count( cmpct8.id )
        FROM
            com_mng_population_community_tags AS cmpct8
            LEFT JOIN com_act AS ca8 ON ca8.community_id = cmpct8.community_id
            LEFT JOIN com_street AS cs8 ON cs8.street_id = ca8.street_id
        WHERE
            cmpct8.label LIKE '%社区矫正%'
        <if test="streetId != null and streetId != 0">
            and cs8.street_id = #{streetId}
        </if>
            ) as jzTotal,
            (
            SELECT
            count( cmpct9.id )
        FROM
            com_mng_population_community_tags AS cmpct9
            LEFT JOIN com_act AS ca9 ON ca9.community_id = cmpct9.community_id
            LEFT JOIN com_street AS cs9 ON cs9.street_id = ca9.street_id
        WHERE
            cmpct9.label LIKE '%邪教人员%'
        <if test="streetId != null and streetId != 0">
            and cs9.street_id = #{streetId}
        </if>
            ) as xjTotal,
            (
            SELECT
            count( cmpct10.id )
        FROM
            com_mng_population_community_tags AS cmpct10
            LEFT JOIN com_act AS ca10 ON ca10.community_id = cmpct10.community_id
            LEFT JOIN com_street AS cs10 ON cs10.street_id = ca10.street_id
        WHERE
            cmpct10.label LIKE '%刑释人员%'
        <if test="streetId != null and streetId != 0">
            and cs10.street_id = #{streetId}
        </if>
            ) as xsTotal,
            (
            SELECT
            count( cmpct11.id )
        FROM
            com_mng_population_community_tags AS cmpct11
            LEFT JOIN com_act AS ca11 ON ca11.community_id = cmpct11.community_id
            LEFT JOIN com_street AS cs11 ON cs11.street_id = ca11.street_id
        WHERE
            cmpct11.label LIKE '%上访人员%'
        <if test="streetId != null and streetId != 0">
            and cs11.street_id = #{streetId}
        </if>
            ) as sfTotal,
            (
            SELECT
            count( cmpct12.id )
        FROM
            com_mng_population_community_tags AS cmpct12
            LEFT JOIN com_act AS ca12 ON ca12.community_id = cmpct12.community_id
            LEFT JOIN com_street AS cs12 ON cs12.street_id = ca12.street_id
        WHERE
            cmpct12.label LIKE '%精神障碍患者%'
        <if test="streetId != null and streetId != 0">
            and cs12.street_id = #{streetId}
        </if>
            ) as zjTotal
        FROM
            com_mng_population_community_tags AS cmpct
            LEFT JOIN com_act AS ca ON ca.community_id = cmpct.community_id
            LEFT JOIN com_street AS cs ON cs.street_id = ca.street_id
        WHERE
            cmpct.label LIKE '%残疾人%'
        <if test="streetId != null and streetId != 0">
            and cs.street_id = #{streetId}
        </if>
    </select>
    <select id="getPopulationListCardNo" resultType="string">
        SELECT
            cmp.card_no
        FROM
            com_mng_population_community_tags AS cmpct
            LEFT JOIN com_mng_population AS cmp ON cmp.id = cmpct.population_id
            LEFT JOIN com_act AS ca ON ca.community_id = cmpct.community_id
            LEFT JOIN com_street AS cs ON cs.street_id = ca.street_id
        <where>
            <if test="streetId != null and streetId != 0">
                and cs.street_id = #{streetId}
            </if>
        </where>
    </select>
    <select id="getPopulationAge" resultType="integer">
        select count(age) from (
            SELECT
            YEAR (now()) - YEAR (substring(cmp.card_no_str, 7, 8)) age
        FROM
            com_mng_population_community_tags AS cmpct
            LEFT JOIN com_mng_population AS cmp ON cmp.id = cmpct.population_id
            LEFT JOIN com_act AS ca ON ca.community_id = cmpct.community_id
            LEFT JOIN com_street AS cs ON cs.street_id = ca.street_id
        <where>
            <if test="streetId != null and streetId != 0">
                and cs.street_id = #{streetId}
            </if>
        </where>
            having age >= 60
        ) as ageDual
    </select>
    <select id="getComprehensiveStreetList" resultType="com.panzhihua.common.model.vos.community.screen.event.EventPopulationStreetVO">
        SELECT
            street_id,
            `name`
        FROM
            com_street
        WHERE
            area_code = '510423'
        ORDER BY
            create_at DESC
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/zuul/src/main/java/com/panzhihua/zuul/filters/JWTAuthenticationTokenFilter.java
@@ -271,6 +271,8 @@
                noLoginUrl.add("/api/applets/renting/houses/nearby");
                noLoginUrl.add("/api/applets/renting/houses/houseList");
                noLoginUrl.add("/api/applets/renting/houses/getConfig");
                noLoginUrl.add("/api/communitybackstage/screen/comprehensive/street/list");
                noLoginUrl.add("/api/communitybackstage/screen/comprehensive/population");
                if (noLoginUrl.contains(requestURI)) {
                    List<SimpleGrantedAuthority> authorities = new ArrayList<>();
                    authorities.add(new SimpleGrantedAuthority(SecurityConstants.ROLE_APPLETS));