| | |
| | | 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) { |
| | |
| | | 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); |
| | | } |