101captain
2021-12-31 b9700539eb386beb62799ebab87556ee7fb36ed4
12/31 3122bug处理
3个文件已修改
35 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/index/IndexPopulationAgeStatisticsVO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/index/IndexPopulationAgeStatisticsVO.java
@@ -10,7 +10,7 @@
@ApiModel("大屏首页实有人口年龄段数据统计返回参数")
public class IndexPopulationAgeStatisticsVO {
    @ApiModelProperty("年龄段(1、0-16  2、16-27 3、27-35 4、35-45 5、45-55 6、55以上)")
    @ApiModelProperty("年龄段(1、0-18  2、19-30 3、31-40 4、41-50 5、51-59 7、60-79 8.80-89 6.89以上)")
    private Integer type;
    @ApiModelProperty("数量")
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java
@@ -417,17 +417,21 @@
    Long countUsedCommunityPopulation(@Param("communityId") Long communityId);
    @Select("SELECT " + "(SELECT COUNT(aa.age) FROM "
        + "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population as cmp left join com_mng_population_community_tags as cmpct on cmp.id = cmpct.population_id WHERE cmpct.community_id = ${communityId}) as aa where aa.age<= 16) as age16,"
        + "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population as cmp left join com_mng_population_community_tags as cmpct on cmp.id = cmpct.population_id WHERE cmpct.community_id = ${communityId}) as aa where aa.age<= 18) as age16,"
        + "(SELECT COUNT(aa.age) FROM "
        + "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id =  #{communityId}) AS aa WHERE aa.age > 16 and aa.age<= 27) AS age27,"
        + "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id =  #{communityId}) AS aa WHERE aa.age > 19 and aa.age<= 30) AS age27,"
        + "(SELECT COUNT(aa.age) FROM "
        + "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = ${communityId}) AS aa WHERE aa.age > 27 and aa.age<= 35) AS age35,"
        + "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = ${communityId}) AS aa WHERE aa.age > 31 and aa.age<= 40) AS age35,"
        + "(SELECT COUNT(aa.age) FROM "
        + "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = ${communityId}) AS aa WHERE aa.age > 35 and aa.age<= 45) AS age45,"
        + "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = ${communityId}) AS aa WHERE aa.age > 41 and aa.age<= 50) AS age45,"
        + "(SELECT COUNT(aa.age) FROM "
        + "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = ${communityId}) AS aa WHERE aa.age > 45 and aa.age<= 55) AS age55,"
        + "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = ${communityId}) AS aa WHERE aa.age > 51 and aa.age<= 59) AS age55,"
        + "(SELECT COUNT(aa.age) FROM "
        + "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = ${communityId}) AS aa WHERE aa.age > 55) AS age55over")
        + "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = ${communityId}) AS aa WHERE aa.age >= 60 and aa.age<= 79) AS age65,"
        + "(SELECT COUNT(aa.age) FROM "
        + "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = ${communityId}) AS aa WHERE aa.age >= 80 and aa.age<= 89) AS age75,"
        + "(SELECT COUNT(aa.age) FROM "
        + "(SELECT (SELECT  TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = ${communityId}) AS aa WHERE aa.age > 89) AS age55over")
    Map<String, Long> indexCountByAge(@Param("communityId") Long communityId);
    @Select("SELECT " + " id, " + " su.nick_name AS userName, " + " su.image_url, " + " caep.create_at, "
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
@@ -6904,13 +6904,16 @@
        IndexPopulationAgeStatisticsVO ageStatisticsVO4 = new IndexPopulationAgeStatisticsVO();
        IndexPopulationAgeStatisticsVO ageStatisticsVO5 = new IndexPopulationAgeStatisticsVO();
        IndexPopulationAgeStatisticsVO ageStatisticsVO6 = new IndexPopulationAgeStatisticsVO();
        IndexPopulationAgeStatisticsVO ageStatisticsVO7 = new IndexPopulationAgeStatisticsVO();
        IndexPopulationAgeStatisticsVO ageStatisticsVO8 = new IndexPopulationAgeStatisticsVO();
        ageStatisticsVO1.setType(1);
        ageStatisticsVO2.setType(2);
        ageStatisticsVO3.setType(3);
        ageStatisticsVO4.setType(4);
        ageStatisticsVO5.setType(5);
        ageStatisticsVO6.setType(6);
        ageStatisticsVO7.setType(7);
        ageStatisticsVO8.setType(8);
        if (ageMap.isEmpty()) {
            ageStatisticsVO1.setSum(0);
            ageStatisticsVO2.setSum(0);
@@ -6918,9 +6921,11 @@
            ageStatisticsVO4.setSum(0);
            ageStatisticsVO5.setSum(0);
            ageStatisticsVO6.setSum(0);
            ageStatisticsVO7.setSum(0);
            ageStatisticsVO8.setSum(0);
        } else {
            int count=ageMap.get("age16").intValue()+ageMap.get("age27").intValue()+ageMap.get("age35").intValue()
                    +ageMap.get("age45").intValue()+ageMap.get("age55").intValue()+ageMap.get("age55over").intValue();
                    +ageMap.get("age45").intValue()+ageMap.get("age55").intValue()+ageMap.get("age55over").intValue()+ageMap.get("age65").intValue()+ageMap.get("age75").intValue();
            ageStatisticsVO1.setSum(ageMap.get("age16").intValue());
            ageStatisticsVO1.setPercent(BigDecimal.valueOf(ageMap.get("age16").intValue()*100d/count).setScale(2,BigDecimal.ROUND_HALF_UP));
            ageStatisticsVO2.setSum(ageMap.get("age27").intValue());
@@ -6933,6 +6938,10 @@
            ageStatisticsVO5.setPercent(BigDecimal.valueOf(ageMap.get("age55").intValue()*100d/count).setScale(2,BigDecimal.ROUND_HALF_UP));
            ageStatisticsVO6.setSum(ageMap.get("age55over").intValue());
            ageStatisticsVO6.setPercent(BigDecimal.valueOf(ageMap.get("age55over").intValue()*100d/count).setScale(2,BigDecimal.ROUND_HALF_UP));
            ageStatisticsVO7.setSum(ageMap.get("age65").intValue());
            ageStatisticsVO7.setPercent(BigDecimal.valueOf(ageMap.get("age65").intValue()*100d/count).setScale(2,BigDecimal.ROUND_HALF_UP));
            ageStatisticsVO8.setSum(ageMap.get("age75").intValue());
            ageStatisticsVO8.setPercent(BigDecimal.valueOf(ageMap.get("age75").intValue()*100d/count).setScale(2,BigDecimal.ROUND_HALF_UP));
        }
        agePopulationList.add(ageStatisticsVO1);
@@ -6941,6 +6950,8 @@
        agePopulationList.add(ageStatisticsVO4);
        agePopulationList.add(ageStatisticsVO5);
        agePopulationList.add(ageStatisticsVO6);
        agePopulationList.add(ageStatisticsVO7);
        agePopulationList.add(ageStatisticsVO8);
        return agePopulationList;
    }
@@ -7832,7 +7843,7 @@
        if (!userTagList.isEmpty()) {
            userTagList.forEach(userTag -> {
                if (userTag != null) {
                    if(userTag.getTagName().equals("高龄老人")||userTag.getTagName().equals("残疾人")||userTag.getTagName().equals("低保户")||userTag.getTagName().equals("退役军人")||userTag.getTagName().equals("养老金人员")||userTag.getTagName().equals("低收入")){
                    if(userTag.getTagName().equals("高龄老人")||userTag.getTagName().equals("残疾人")||userTag.getTagName().equals("低保户")||userTag.getTagName().equals("退役军人")||userTag.getTagName().equals("养老金人员")||userTag.getTagName().equals("低收入人群")){
                        IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO();
                        specialStatisticsVO.setTitle(userTag.getTagName());
                        Integer count =0;