manailin
2021-06-12 eefbb8708d62ce3ca9b0f00402d586c78716af77
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
@@ -798,8 +798,41 @@
        return R.ok(this.baseMapper.getPopulationTotalByAdmin(communityId));
    }
    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));
    @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;
    }
}