101captain
2021-12-08 7659a41cc50b708e89e1f8c7fcac841da816fd2b
12/8 大屏修改提交
7个文件已修改
187 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/civil/CivilVillageStatisticsVO.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/SensitiveUtil.java 19 ●●●●● 补丁 | 查看 | 原始文档 | 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/impl/BigScreenServiceImpl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java 139 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComMngPopulationDOMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbMemberServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/screen/civil/CivilVillageStatisticsVO.java
@@ -3,9 +3,12 @@
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.panzhihua.common.model.vos.community.screen.index.IndexSpecialStatisticsVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel("民生统计小区列表返回参数")
@@ -66,4 +69,7 @@
    @ApiModelProperty("其他人员")
    private Integer otherPeopleNum;
    @ApiModelProperty("特殊人群统计模块数据")
    private List<IndexSpecialStatisticsVO> specialStatisticsList;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/SensitiveUtil.java
@@ -1,5 +1,8 @@
package com.panzhihua.common.utlis;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
 * @description: 身份证手机号脱敏处理
 * @author: Null
@@ -38,4 +41,20 @@
        return idNumber;
    }
    public static String replaceName(String str) {
        String reg = ".{1}";
        StringBuffer sb = new StringBuffer();
        Pattern p = Pattern.compile(reg);
        Matcher m = p.matcher(str);
        int i = 0;
        while (m.find()) {
            i++;
            if (i == 1)
                continue;
            m.appendReplacement(sb, "*");
        }
        m.appendTail(sb);
        return sb.toString();
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java
@@ -367,7 +367,7 @@
    CivilPopulationStatisticsVO getCivilScreenPopulation(@Param("communityId") Long communityId,
        @Param("lastMonth") Date lastMonth);
    @Select("SELECT `NAME`, " + " user_sum, " + " lng, " + " lat, " + " village_images, " + " village_id  " + "FROM "
    @Select("SELECT `NAME`, " + "0 as user_sum, " + " lng, " + " lat, " + " village_images, " + " village_id  " + "FROM "
        + " com_mng_village AS cmv  " + "WHERE " + " community_id = #{communityId}")
    List<CivilVillageStatisticsVO> getCivilScreenVillageList(@Param("communityId") Long communityId);
@@ -615,4 +615,12 @@
     * @param newUnitNo 新单元号
     */
    void updatePopulationUnit(@Param("villageId") Long villageId, @Param("floor") String floor,@Param("oldUnitNo") String oldUnitNo,@Param("newUnitNo") String newUnitNo);
    /**
     * 根据villageId查询特殊人群数
     * @param villageId
     * @param label
     * @return
     */
    Integer selectCountByVillageId(@Param("villageId") Long villageId,@Param("label")String label);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BigScreenServiceImpl.java
@@ -5,6 +5,8 @@
import javax.annotation.Resource;
import com.panzhihua.common.utlis.SensitiveUtil;
import com.panzhihua.common.utlis.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@@ -86,6 +88,11 @@
                listRt = listRt.subList(0, 3);
            }
        }
        listRt.forEach(partyBuildingMemberVO -> {
            if(StringUtils.isNotEmpty(partyBuildingMemberVO.getName())){
                partyBuildingMemberVO.setName(SensitiveUtil.replaceName(partyBuildingMemberVO.getName()));
            }
        });
        return R.ok(listRt);
    }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
@@ -7044,65 +7044,65 @@
        List<IndexSpecialStatisticsVO> specialStatisticsVOList = new ArrayList<>();
        // 查询特殊人群标签列表
        List<ComMngUserTagVO> userTagList = comMngPopulationDAO.getUserTagListByCommunityId(communityId);
        IndexSpecialStatisticsVO otherSpecialVO = new IndexSpecialStatisticsVO();
        otherSpecialVO.setTitle("其他");
        otherSpecialVO.setSum(0);
        if (!userTagList.isEmpty()) {
            userTagList.forEach(userTag -> {
                if (userTag != null) {
                    if (userTag.getSysFlag().equals(0)) {
                        Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId);
                        otherSpecialVO.setSum(otherSpecialVO.getSum() + count);
                    } else {
                        if (StringUtils.isNotEmpty(userTag.getTagName())) {
                            if (userTag.getTagName().equals("特扶家庭")) {
                                IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO();
                                specialStatisticsVO.setTitle(userTag.getTagName());
                                specialStatisticsVO.setSum(22);
                                specialStatisticsVOList.add(specialStatisticsVO);
                            } else if (userTag.getTagName().equals("低保户")) {
                                IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO();
                                specialStatisticsVO.setTitle(userTag.getTagName());
                                specialStatisticsVO.setSum(94);
                                specialStatisticsVOList.add(specialStatisticsVO);
                            } else if (userTag.getTagName().equals("低收入人群")) {
                                IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO();
                                specialStatisticsVO.setTitle(userTag.getTagName());
                                specialStatisticsVO.setSum(2);
                                specialStatisticsVOList.add(specialStatisticsVO);
                            } else if (userTag.getTagName().equals("退役军人")) {
                                IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO();
                                specialStatisticsVO.setTitle(userTag.getTagName());
                                specialStatisticsVO.setSum(264);
                                specialStatisticsVOList.add(specialStatisticsVO);
                            } else if (userTag.getTagName().equals("高龄老人")) {
                                IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO();
                                specialStatisticsVO.setTitle(userTag.getTagName());
                                specialStatisticsVO.setSum(comMngPopulationDAO.getStatisticsCount(communityId));
                                specialStatisticsVOList.add(specialStatisticsVO);
                            } else {
                                IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO();
                                specialStatisticsVO.setTitle(userTag.getTagName());
                                Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId);
                                specialStatisticsVO.setSum(count);
                                specialStatisticsVOList.add(specialStatisticsVO);
                            }
                        }
                    }
                }
            });
        }
        // 计算特殊人群总数
        specialStatisticsVOList.add(otherSpecialVO);
        Integer specialNum = 0;
        if (!specialStatisticsVOList.isEmpty()) {
            for (IndexSpecialStatisticsVO special : specialStatisticsVOList) {
                specialNum += special.getSum();
            }
        }
        civilStatisticsVO.setSpecialNum(specialNum);
        civilStatisticsVO.setSpecialStatisticsList(specialStatisticsVOList);
//        List<ComMngUserTagVO> userTagList = comMngPopulationDAO.getUserTagListByCommunityId(communityId);
//        IndexSpecialStatisticsVO otherSpecialVO = new IndexSpecialStatisticsVO();
//        otherSpecialVO.setTitle("其他");
//        otherSpecialVO.setSum(0);
//        if (!userTagList.isEmpty()) {
//            userTagList.forEach(userTag -> {
//                if (userTag != null) {
//                    if (userTag.getSysFlag().equals(0)) {
//                        Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId);
//                        otherSpecialVO.setSum(otherSpecialVO.getSum() + count);
//                    } else {
//                        if (StringUtils.isNotEmpty(userTag.getTagName())) {
//                            if (userTag.getTagName().equals("特扶家庭")) {
//                                IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO();
//                                specialStatisticsVO.setTitle(userTag.getTagName());
//                                specialStatisticsVO.setSum(22);
//                                specialStatisticsVOList.add(specialStatisticsVO);
//                            } else if (userTag.getTagName().equals("低保户")) {
//                                IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO();
//                                specialStatisticsVO.setTitle(userTag.getTagName());
//                                specialStatisticsVO.setSum(94);
//                                specialStatisticsVOList.add(specialStatisticsVO);
//                            } else if (userTag.getTagName().equals("低收入人群")) {
//                                IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO();
//                                specialStatisticsVO.setTitle(userTag.getTagName());
//                                specialStatisticsVO.setSum(2);
//                                specialStatisticsVOList.add(specialStatisticsVO);
//                            } else if (userTag.getTagName().equals("退役军人")) {
//                                IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO();
//                                specialStatisticsVO.setTitle(userTag.getTagName());
//                                specialStatisticsVO.setSum(264);
//                                specialStatisticsVOList.add(specialStatisticsVO);
//                            } else if (userTag.getTagName().equals("高龄老人")) {
//                                IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO();
//                                specialStatisticsVO.setTitle(userTag.getTagName());
//                                specialStatisticsVO.setSum(comMngPopulationDAO.getStatisticsCount(communityId));
//                                specialStatisticsVOList.add(specialStatisticsVO);
//                            } else {
//                                IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO();
//                                specialStatisticsVO.setTitle(userTag.getTagName());
//                                Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId);
//                                specialStatisticsVO.setSum(count);
//                                specialStatisticsVOList.add(specialStatisticsVO);
//                            }
//                        }
//                    }
//                }
//            });
//        }
//        // 计算特殊人群总数
//        specialStatisticsVOList.add(otherSpecialVO);
//        Integer specialNum = 0;
//        if (!specialStatisticsVOList.isEmpty()) {
//            for (IndexSpecialStatisticsVO special : specialStatisticsVOList) {
//                specialNum += special.getSum();
//            }
//        }
//        civilStatisticsVO.setSpecialNum(specialNum);
//        civilStatisticsVO.setSpecialStatisticsList(specialStatisticsVOList);
        // 计算环比上月增长率
        BigDecimal rate = BigDecimal.ZERO;
@@ -7127,6 +7127,27 @@
        // 查询小区列表
        List<CivilVillageStatisticsVO> villageStatisticsList = this.baseMapper.getCivilScreenVillageList(communityId);
        villageStatisticsList.forEach(civilVillageStatisticsVO -> {
            civilVillageStatisticsVO.setUserSum(comMngPopulationDAO.selectCount(new QueryWrapper<ComMngPopulationDO>().lambda().eq(ComMngPopulationDO::getVillageId,civilVillageStatisticsVO.getVillageId())));
            List<IndexSpecialStatisticsVO> specialStatisticsVOS = new ArrayList<>();
            IndexSpecialStatisticsVO otherSpecial = new IndexSpecialStatisticsVO();
            otherSpecial.setTitle("其他");
            otherSpecial.setSum(0);
            // 查询特殊人群标签列表
            List<ComMngUserTagVO> userTagVOS = comMngPopulationDAO.getUserTagListByCommunityId(communityId);
            userTagVOS.forEach(comMngUserTagVO -> {
              Integer count=comMngPopulationDAO.selectCountByVillageId(civilVillageStatisticsVO.getVillageId(),comMngUserTagVO.getTagName());
              IndexSpecialStatisticsVO indexSpecialStatisticsVO=new IndexSpecialStatisticsVO();
              indexSpecialStatisticsVO.setTitle(comMngUserTagVO.getTagName());
              indexSpecialStatisticsVO.setSum(count);
              otherSpecial.setSum(otherSpecial.getSum()+count);
              specialStatisticsVOS.add(indexSpecialStatisticsVO);
            });
            otherSpecial.setSum(civilVillageStatisticsVO.getUserSum()-otherSpecial.getSum());
            specialStatisticsVOS.add(otherSpecial);
            civilVillageStatisticsVO.setSpecialStatisticsList(specialStatisticsVOS);
        });
        civilStatisticsVO.setVillageStatisticsList(villageStatisticsList);
        return R.ok(civilStatisticsVO);
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComMngPopulationDOMapper.xml
@@ -637,4 +637,9 @@
    <update id="updatePopulationUnit">
        update com_mng_population set unit_no = #{newUnitNo} where village_id = #{villageId} and floor = #{floor} and unit_no = #{oldUnitNo}
    </update>
    <select id="selectCountByVillageId" resultType="Integer">
        select count(*) from com_mng_population t LEFT JOIN com_mng_population_community_tags t1 on t.id= t1.population_id
        where t.village_id=#{villageId} and t1.label like concat('%',#{label},'%')
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbMemberServiceImpl.java
@@ -391,6 +391,7 @@
        IPage<PartyCommitteeVO> iPage = comPbMemberRoleDAO.pagePartyOrganization(page, partyCommitteeVO);
        iPage.getRecords().forEach(record -> {
            record.setPhone(SensitiveUtil.desensitizedPhoneNumber(record.getPhone()));
            record.setName(SensitiveUtil.replaceName(record.getName()));
        });
        return R.ok(iPage);
    }