| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import cn.hutool.core.util.IdcardUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.area.AreaAddressVO; |
| | | import com.panzhihua.common.model.vos.community.*; |
| | | import com.panzhihua.common.model.vos.screen.ComActPopulationCultureVO; |
| | | import com.panzhihua.common.model.vos.screen.ComActPopulationScreenVO; |
| | | import com.panzhihua.common.model.vos.screen.ComMngPopulationAgeVO; |
| | | import com.panzhihua.common.model.vos.user.ComMngFamilyInfoVO; |
| | | import com.panzhihua.common.model.vos.user.ComMngHouseVo; |
| | | import com.panzhihua.common.model.vos.user.InputUserInfoVO; |
| | | import com.panzhihua.common.model.vos.user.UserElectronicFileVO; |
| | | import com.panzhihua.common.utlis.AgeUtils; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.common.model.vos.screen.ComActPopulationCultureVO; |
| | | import com.panzhihua.common.model.vos.community.bigscreen.BigScreenStatisticPartyBuild; |
| | | import com.panzhihua.common.model.vos.community.screen.civil.CivilPopulationStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.screen.civil.CivilStatisticsVO; |
| | |
| | | import com.panzhihua.common.model.vos.community.screen.index.*; |
| | | import com.panzhihua.common.model.vos.grid.EventGridDataVO; |
| | | import com.panzhihua.common.model.vos.grid.EventResourceVO; |
| | | import com.panzhihua.common.model.vos.screen.ComActPopulationCultureVO; |
| | | import com.panzhihua.common.model.vos.screen.ComActPopulationScreenVO; |
| | | import com.panzhihua.common.model.vos.screen.ComMngPopulationAgeVO; |
| | | import com.panzhihua.common.model.vos.user.*; |
| | | import com.panzhihua.common.utlis.*; |
| | | import com.panzhihua.common.utlis.AgeUtils; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.*; |
| | | import com.panzhihua.service_community.model.dos.*; |
| | | import com.panzhihua.service_community.service.ComMngPopulationHouseUserService; |
| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import javax.crypto.BadPaddingException; |
| | | import javax.crypto.IllegalBlockSizeException; |
| | | import javax.crypto.NoSuchPaddingException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.math.BigDecimal; |
| | | import java.security.InvalidKeyException; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | Long pageNum = comMngPopulationVO.getPageNum(); |
| | | Long pageSize = comMngPopulationVO.getPageSize(); |
| | | if (null == pageNum || 0 == pageNum) { |
| | | pageNum = 1l; |
| | | pageNum = 1L; |
| | | } |
| | | if (null == pageSize || 0 == pageSize) { |
| | | pageSize = 10l; |
| | | pageSize = 10L; |
| | | } |
| | | page.setSize(pageSize); |
| | | page.setCurrent(pageNum); |
| | |
| | | |
| | | /** |
| | | * 确认导入实有人口(有则更新,无则新建) |
| | | * |
| | | * @param list 用户信息 |
| | | * @param communityId 社区id |
| | | * @return 导入结果 |
| | |
| | | |
| | | /** |
| | | * 根据id修改实有人口标签 |
| | | * |
| | | * @param populationTagDTO 请求参数 |
| | | * @return 修改结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 批量删除实有人口 |
| | | * |
| | | * @param Ids |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据社区id查询所有实有人口 |
| | | * |
| | | * @param communityId 社区id |
| | | * @return 查询结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据id集合查询实有人口 |
| | | * |
| | | * @param Ids 实有人口id集合 |
| | | * @return 查询结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 删除特殊群体人员 |
| | | * |
| | | * @param id 特殊群体id |
| | | * @return 删除结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 查询实有人口电子档信息 |
| | | * |
| | | * @param populationId 实有人口id |
| | | * @return 实有人口电子档信息 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 实有人口统计 |
| | | * |
| | | * @param communityId 社区id |
| | | * @return 统计结果 |
| | | */ |
| | |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public R screenStatistic(Long communityId) { |
| | | ComActPopulationScreenVO comActPopulationScreenVO = new ComActPopulationScreenVO(); |
| | | ComMngPopulationTotalVO vo = populationDAO.getPopulationTotalByAdmin(communityId); |
| | | comActPopulationScreenVO.setTotalNum(vo.getPopulationTotal() == null ? 0 : vo.getPopulationTotal()); |
| | | comActPopulationScreenVO.setLocalNum(vo.getLocalTotal() == null ? 0 : vo.getLocalTotal().longValue()); |
| | | comActPopulationScreenVO.setOutNum(vo.getOutTotal() == null ? 0 : vo.getOutTotal().longValue()); |
| | | comActPopulationScreenVO.setSpecialNum(vo.getSpecialTotal() == null ? 0 : vo.getSpecialTotal().longValue()); |
| | | //统计已使用社区通人数 |
| | | Long count = populationDAO.countUsedCommunityPopulation(communityId); |
| | | comActPopulationScreenVO.setUsedCommunityNum(count == null ? 0 : count); |
| | | |
| | | //统计性别 |
| | | Map<String, Long> sexMap = populationDAO.countBySex(communityId); |
| | | comActPopulationScreenVO.setWoman(sexMap.get("woman") == null ? 0L : sexMap.get("woman")); |
| | | comActPopulationScreenVO.setManNum(sexMap.get("man") == null ? 0L : sexMap.get("man")); |
| | | int manPoint = (int) (((double) comActPopulationScreenVO.getManNum() / (double) comActPopulationScreenVO.getTotalNum()) * 100); |
| | | comActPopulationScreenVO.setManPoint(manPoint); |
| | | comActPopulationScreenVO.setWomanPoint(100 - manPoint); |
| | | /** |
| | | * 首页大屏统计接口 |
| | | * |
| | | * @param communityId 社区id |
| | | * @return 统计结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 事件大屏统计接口 |
| | | * |
| | | * @param communityId 社区id |
| | | * @return 统计结果 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 民生大屏统计接口 |
| | | * |
| | | * @param communityId 社区id |
| | | * @return 统计结果 |
| | | */ |
| | |
| | | } |
| | | |
| | | @Override |
| | | public R editTagPopulationByCardNo(ComMngPopulationTagCardNoDTO comMngPopulationTagCardNoDTO) { |
| | | ComMngPopulationDO comMngPopulationDO = getPopulationByCardNo(comMngPopulationTagCardNoDTO.getCardNo()); |
| | | if (comMngPopulationDO == null) { |
| | | return R.fail("未查询到人口记录"); |
| | | } |
| | | ComMngPopulationDO comMngPopulation = new ComMngPopulationDO(); |
| | | if(comMngPopulationDO.getLabel()!=null) { |
| | | if(!comMngPopulationDO.getLabel().contains(comMngPopulationTagCardNoDTO.getLabel())) { |
| | | comMngPopulation.setLabel(comMngPopulationTagCardNoDTO.getLabel().concat(",").concat(comMngPopulationDO.getLabel())); |
| | | } |
| | | }else{ |
| | | comMngPopulation.setLabel(comMngPopulationTagCardNoDTO.getLabel()); |
| | | } |
| | | comMngPopulation.setCardNo(null); |
| | | comMngPopulation.setId(comMngPopulationDO.getId()); |
| | | int nub = populationDAO.updateById(comMngPopulation); |
| | | if (nub < 1) { |
| | | return R.fail(); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | @Override |
| | | public ComMngPopulationDO getPopulationByCardNo(String cardNo) { |
| | | try { |
| | | String aesCardNo = AESUtil.encrypt128(cardNo, aesKey); |
| | | return baseMapper.selectOne( |
| | | new QueryWrapper<ComMngPopulationDO>() |
| | | .eq("card_no",aesCardNo) |
| | | ); |
| | | } catch (Exception e) { |
| | | log.error("根据身份证查询业务-加密证件信息出错"); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | @Override |
| | | public R screenStatistic(Long communityId) { |
| | | ComActPopulationScreenVO comActPopulationScreenVO = new ComActPopulationScreenVO(); |
| | | ComMngPopulationTotalVO vo = populationDAO.getPopulationTotalByAdmin(communityId); |
| | |
| | | setAgeGroup(comActPopulationScreenVO,communityId); |
| | | //统计学历 |
| | | setCultureGroup(comActPopulationScreenVO,communityId); |
| | | |
| | | //查询网格数据 |
| | | List<EventGridStatisticsVO> gridStatisticsList = this.baseMapper.getEventScreenGridData(communityId); |
| | | comActPopulationScreenVO.setGridStatisticsList(gridStatisticsList); |
| | | |
| | | //查询小区列表 |
| | | List<CivilVillageStatisticsVO> villageStatisticsList = this.baseMapper.getCivilScreenVillageList(communityId); |
| | | comActPopulationScreenVO.setVillageStatisticsList(villageStatisticsList); |
| | | |
| | | return R.ok(comActPopulationScreenVO); |
| | | } |
| | |
| | | return R.ok(statisticsVO); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | // List<ComMngPopulationHouseUserDO> distinctClass = populationHouseUserDOList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getPopulId() + ";" + o.getHouseId() + ";" + o.getId() + ";" + o.getRelation()))), ArrayList::new)); |
| | | } |
| | | |
| | | } |