101captain
2022-05-19 19f39f95190ae02a90b07c97bc9e5cb54de383a4
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
@@ -855,7 +855,10 @@
                // 判断实有人口是否已存在
                log.info("开始查询实有人口是否已存在");
                ComMngPopulationDO populationDO = null;
                String populationKey = vo.getCardNo();
                String populationKey = cardNoAES;
                if(vo.getCardNo().equals("510402197505075515")){
                    System.out.println("111");
                }
                if (!isOnly(populationKey, populationMap)) {
                    // 存在实有人口信息,则更新
                    populationDO = (ComMngPopulationDO)populationMap.get(populationKey);
@@ -865,7 +868,7 @@
                    // 不存在实有人口,则新增
                    populationDO = savePopulationDO(vo, populationActVO, comMngVillageDO, userId);
                    saveList.add(populationDO);
                    populationMap.put(populationDO.getCardNo(),populationDO);
                    populationMap.put(populationKey,populationDO);
                }
                log.info("查询实有人口是否已存在完成");
@@ -909,6 +912,7 @@
                        }
                        cpopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag));
                        cpopulationCommunityTagsDO.setCreateBy(userId);
                        populationCommunityMap.put(populationCommunityKey,cpopulationCommunityTagsDO);
                        savePopulationCommunityList.add(cpopulationCommunityTagsDO);
                    }else {
                        // 实有人口存在于当前社区,则更新
@@ -6430,7 +6434,11 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R deletePopulations(List<Long> ids, Long communityId) {
        comMngPopulationCommunityTagsDAO.deletePopulationRelation(ids,communityId);
        for(Long id:ids){
            comMngPopulationCommunityTagsDAO.delete(new QueryWrapper<ComMngPopulationCommunityTagsDO>().lambda().eq(ComMngPopulationCommunityTagsDO::getPopulationId,id));
            comMngPopulationDAO.deleteById(id);
            comMngPopulationHouseUserDAO.delete(new QueryWrapper<ComMngPopulationHouseUserDO>().lambda().eq(ComMngPopulationHouseUserDO::getPopulId,id));
        }
        return R.ok();
    }