101captain
2022-05-24 8c7ccc0402a105ea6b6dfd743f8cb9add2041f36
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngVillageServiceImpl.java
@@ -140,19 +140,6 @@
                    villageVO.setHouseTotal(villageTotal.getHouseTotal());
                    villageVO.setPopulationTotal(villageTotal.getPopulationTotal());
                }
                //如果小区没有名字,则将街路巷和地区号拼接起来
                if(village.getName() != null && StringUtils.isNotEmpty(village.getName())){
                    villageVO.setGroupAt(village.getName());
                }else{
                    StringBuilder sb = new StringBuilder();
                    sb.append(village.getAlley());
                    if(!village.getHouseNum().contains("号")){
                        sb.append(village.getHouseNum() + "号");
                    }
                    villageVO.setGroupAt(sb.toString());
                    villageVO.setName(sb.toString());
                }
                villageVOList.add(villageVO);
            });
            villageVOIPage.setRecords(villageVOList);
@@ -202,8 +189,11 @@
            boolean result = comMngVillageDOs.stream().anyMatch(
                village -> village.getAlley().equals(vo.getAlley()) && village.getHouseNum().equals(vo.getHouseNum()));
            if (result) {
                return R.fail("导入街路巷已存在(" + vo.getAlley() + ")");
                return R.fail("导入街路巷重复(" + vo.getAlley() + ")");
            }
            ComMngVillageDO comMngVillageDO=new ComMngVillageDO();
            BeanUtils.copyProperties(vo,comMngVillageDO);
            comMngVillageDOs.add(comMngVillageDO);
            index++;
        }
        ComActDO comActDO = comActDAO.selectById(communityId);
@@ -228,6 +218,7 @@
            path.append(vo.getAlley()).append(">").append(vo.getHouseNum()).append(">").append(vo.getGroupAt());
            comMngVillageDO.setPath(path.toString());
            comMngVillageDO.setUpdateAt(new Date());
            comMngVillageDO.setName(comMngVillageDO.getGroupAt());
            comMngVillageDOS.add(comMngVillageDO);
        });
        this.saveBatch(comMngVillageDOS);