| | |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springblade.common.constant.DictConstant; |
| | | import org.springblade.common.node.TreeStringNode; |
| | | import org.springblade.common.utils.ComplexNumberStringComparator; |
| | | import org.springblade.common.utils.NodeTreeUtil; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.modules.category.dto.CategoryLabelDTO; |
| | |
| | | import org.springblade.modules.doorplateAddress.vo.DoorplateAddressVOTree; |
| | | import org.springblade.modules.doorplateAddress.vo.FuncNode; |
| | | import org.springblade.modules.grid.entity.GridEntity; |
| | | import org.springblade.modules.grid.entity.GridmanEntity; |
| | | import org.springblade.modules.grid.service.IGridService; |
| | | import org.springblade.modules.grid.service.IGridmanService; |
| | | import org.springblade.modules.house.entity.HouseEntity; |
| | | import org.springblade.modules.house.service.IHouseRentalService; |
| | | import org.springblade.modules.house.service.IHouseService; |
| | |
| | | import org.springblade.modules.house.vo.HouseholdVO; |
| | | import org.springblade.modules.place.entity.PlaceEntity; |
| | | import org.springblade.modules.place.service.IPlaceService; |
| | | import org.springblade.modules.system.entity.Region; |
| | | import org.springblade.modules.system.service.IRegionService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | |
| | | @Autowired |
| | | private IGridService gridService; |
| | | |
| | | @Autowired |
| | | private IGridmanService gridmanService; |
| | | |
| | | @Autowired |
| | | private IRegionService regionService; |
| | | |
| | | @Autowired |
| | | private IDistrictService districtService; |
| | |
| | | */ |
| | | private void getGridInfoByGridman(HouseParam houseParam) { |
| | | if (houseParam.getRoleName().equals("网格员")) { |
| | | QueryWrapper<GridEntity> wrapper = new QueryWrapper<>(); |
| | | QueryWrapper<GridmanEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("is_deleted", 0) |
| | | .eq("user_id", AuthUtil.getUserId()); |
| | | List<GridEntity> list = gridService.list(wrapper); |
| | | List<GridmanEntity> list = gridmanService.list(wrapper); |
| | | if (list.size() > 0) { |
| | | GridEntity gridEntity = list.get(0); |
| | | if (!Strings.isBlank(gridEntity.getCommunityName())) { |
| | | houseParam.setCommunityName(gridEntity.getCommunityName().split("居民委员会")[0]); |
| | | GridmanEntity gridmanEntity = list.get(0); |
| | | GridEntity gridEntity = gridService.getById(gridmanEntity.getGridId()); |
| | | // 查询居委会 |
| | | Region region = regionService.getById(gridEntity.getCommunityCode()); |
| | | if (null != region) { |
| | | houseParam.setCommunityName(region.getName()); |
| | | } |
| | | if (!Strings.isBlank(gridEntity.getGridName())) { |
| | | houseParam.setGridName(gridEntity.getGridName()); |
| | |
| | | List<TreeStringNode> aoiList = new ArrayList<>(); |
| | | List<TreeStringNode> shopList = new ArrayList<>(); |
| | | // 根据社区名称查询楼栋或者商铺的集合 |
| | | |
| | | List<TreeStringNode> list = baseMapper.getBuildingList(houseParam, stringList); |
| | | // 排序 StringUtils.getDigits(X.getName()) 取出数字排序 |
| | | List<TreeStringNode> sortList = list.stream().sorted(Comparator.comparing(X -> StringUtils.getDigits(X.getName()))).collect(Collectors.toList()); |
| | | List<TreeStringNode> sortList = list.stream(). |
| | | sorted(new Comparator<TreeStringNode>() { |
| | | @Override |
| | | public int compare(TreeStringNode o1, TreeStringNode o2) { |
| | | return ComplexNumberStringComparator.compare(o1.getName(),o2.getName()); |
| | | } |
| | | }).collect(Collectors.toList()); |
| | | if (list.size() > 0) { |
| | | for (TreeStringNode treeNode : sortList) { |
| | | if (treeNode.getAddressType() == 1) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 数据处理 |
| | | * 房屋数据处理 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object dataHandle() { |
| | | // 处理户室数据 |
| | | public Object houseDataHandle() { |
| | | // 处理房屋数据 |
| | | handleHouseData(); |
| | | |
| | | return null; |
| | |
| | | * 处理房屋数据 |
| | | */ |
| | | private void handleHouseData() { |
| | | // 查询所有户室数据 |
| | | // 查询所有户室数据(未入库的) |
| | | List<DoorplateAddressEntity> list = baseMapper.getHouseList(); |
| | | // 需要新增的房屋 list |
| | | List<HouseEntity> houseList = new ArrayList<>(); |
| | |
| | | houseEntity.setCreateTime(new Date()); |
| | | houseEntity.setUpdateUser(AuthUtil.getUserId().toString()); |
| | | houseEntity.setUpdateTime(new Date()); |
| | | // 设置来源 1:地址总表 2:国控采集 |
| | | houseEntity.setSource(1); |
| | | // 加入集合 |
| | | houseList.add(houseEntity); |
| | | } |
| | |
| | | List<DistrictEntity> aoiList = new ArrayList<>(); |
| | | // 将小区数据保存到小区表中 |
| | | for (DoorplateAddressEntity addressEntity : list) { |
| | | DistrictEntity districtEntity = new DistrictEntity(); |
| | | districtEntity.setCommunityCode(addressEntity.getNeiCode()); |
| | | districtEntity.setAoiCode(addressEntity.getAoiCode()); |
| | | districtEntity.setName(addressEntity.getAoiName()); |
| | | districtEntity.setAddress(addressEntity.getAddressName()); |
| | | districtEntity.setLng(addressEntity.getX()); |
| | | districtEntity.setLat(addressEntity.getY()); |
| | | // 加入集合 |
| | | aoiList.add(districtEntity); |
| | | // 查询小区是否已存在,不存在则插入,否则不新增 |
| | | QueryWrapper<DistrictEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("aoi_code",addressEntity.getAoiCode()) |
| | | .eq("is_deleted",0); |
| | | DistrictEntity one = districtService.getOne(wrapper); |
| | | if (null==one) { |
| | | DistrictEntity districtEntity = new DistrictEntity(); |
| | | districtEntity.setCommunityCode(addressEntity.getNeiCode()); |
| | | districtEntity.setAoiCode(addressEntity.getAoiCode()); |
| | | districtEntity.setName(addressEntity.getAoiName()); |
| | | districtEntity.setAddress(addressEntity.getAddressName()); |
| | | districtEntity.setLng(addressEntity.getX()); |
| | | districtEntity.setLat(addressEntity.getY()); |
| | | // 加入集合 |
| | | districtService.save(districtEntity); |
| | | // aoiList.add(districtEntity); |
| | | } |
| | | } |
| | | // 批量插入 |
| | | districtService.saveBatch(aoiList); |
| | | // districtService.saveBatch(aoiList); |
| | | // 返回 |
| | | return null; |
| | | } |
| | |
| | | List<DoorplateAddressEntity> list = baseMapper.getPlaceList(); |
| | | // 创建场所集合对象 |
| | | List<PlaceEntity> placeList = new ArrayList<>(); |
| | | // 将小区数据保存到小区表中 |
| | | // 将场所数据保存到场所表中 |
| | | for (DoorplateAddressEntity addressEntity : list) { |
| | | PlaceEntity placeEntity = new PlaceEntity(); |
| | | placeEntity.setHouseCode(addressEntity.getAddressCode()); |
| | |
| | | placeEntity.setLng(addressEntity.getX()); |
| | | placeEntity.setLat(addressEntity.getY()); |
| | | placeEntity.setLocaltion(addressEntity.getAddressName()); |
| | | placeEntity.setLat(addressEntity.getY()); |
| | | // 设置来源( 1:地址总表 2:国控采集) |
| | | placeEntity.setSource(1); |
| | | // 加入集合 |
| | | placeList.add(placeEntity); |
| | | } |