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);
@@ -214,16 +204,25 @@
        list.forEach(vo -> {
            ComMngVillageDO comMngVillageDO = new ComMngVillageDO();
            BeanUtils.copyProperties(vo, comMngVillageDO);
            if(StringUtils.isNotEmpty(vo.getType())){
                if("城镇".equals(vo.getType())){
                    comMngVillageDO.setType(1);
                }
                else {
                    comMngVillageDO.setType(2);
                }
            }
            comMngVillageDO.setCommunityId(comActDO.getCommunityId());
            comMngVillageDO.setStreetId(comActDO.getStreetId());
            StringBuilder path = new StringBuilder();
            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);
        return R.ok("共计导入实有房屋数量:" + comMngVillageDOS.size());
        return R.ok("共计导入实有小区数量:" + comMngVillageDOS.size());
    }
    @Override
@@ -284,6 +283,12 @@
            new Page(villageListAppDTO.getPageNum(), villageListAppDTO.getPageSize()), villageListAppDTO));
    }
    @Override
    public R getGridVillageListApp(ComMngVillageListAppDTO villageListAppDTO) {
        return R.ok(this.baseMapper.getGridVillageList(
                new Page(villageListAppDTO.getPageNum(), villageListAppDTO.getPageSize()), villageListAppDTO));
    }
    /**
     * 综治app-根据小区id查询小区下楼栋列表
     *