| | |
| | | tempList.add(funcNode); |
| | | }); |
| | | // 排序 |
| | | List<FuncNode> sortList = tempList.stream().sorted(Comparator.comparing(X -> X.getUnitName())).collect(Collectors.toList()); |
| | | sortUnit(tempList,list); |
| | | // List<FuncNode> sortList = tempList.stream().sorted(Comparator.comparing(X -> X.getUnitName())).collect(Collectors.toList()); |
| | | // list.addAll(sortList); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 单元排序 |
| | | * @param tempList |
| | | * @param list |
| | | */ |
| | | private void sortUnit(List<FuncNode> tempList,List<FuncNode> list) { |
| | | // 遍历 |
| | | if(tempList.size()>1){ |
| | | for (FuncNode funcNode : tempList) { |
| | | if (funcNode.getUnitName().contains("一")){ |
| | | funcNode.setSort(1); |
| | | } |
| | | if (funcNode.getUnitName().contains("二")){ |
| | | funcNode.setSort(2); |
| | | } |
| | | if (funcNode.getUnitName().contains("三")){ |
| | | funcNode.setSort(3); |
| | | } |
| | | if (funcNode.getUnitName().contains("四")){ |
| | | funcNode.setSort(4); |
| | | } |
| | | if (funcNode.getUnitName().contains("五")){ |
| | | funcNode.setSort(5); |
| | | } |
| | | if (funcNode.getUnitName().contains("六")){ |
| | | funcNode.setSort(6); |
| | | } |
| | | } |
| | | // 排序 |
| | | List<FuncNode> sortList = tempList.stream().sorted(Comparator.comparing(X -> X.getSort())).collect(Collectors.toList()); |
| | | list.addAll(sortList); |
| | | } |
| | | } |
| | |
| | | if (list.size()>0) { |
| | | // 将场所数据保存到场所表中 |
| | | for (DoorplateAddressEntity addressEntity : list) { |
| | | PlaceEntity placeEntity = new PlaceEntity(); |
| | | placeEntity.setHouseCode(addressEntity.getAddressCode()); |
| | | placeEntity.setPlaceName(addressEntity.getPoi()); |
| | | placeEntity.setLng(addressEntity.getX()); |
| | | placeEntity.setLat(addressEntity.getY()); |
| | | placeEntity.setLocaltion(addressEntity.getAddressName()); |
| | | // 设置来源( 1:地址总表 2:国控采集) |
| | | placeEntity.setSource(1); |
| | | // 加入集合 |
| | | placeList.add(placeEntity); |
| | | // pio 名称不为空的进行插入操作 |
| | | if (!Strings.isBlank(addressEntity.getPoi())) { |
| | | PlaceEntity placeEntity = new PlaceEntity(); |
| | | placeEntity.setHouseCode(addressEntity.getAddressCode()); |
| | | placeEntity.setPlaceName(addressEntity.getPoi()); |
| | | placeEntity.setLng(addressEntity.getX()); |
| | | placeEntity.setLat(addressEntity.getY()); |
| | | placeEntity.setLocaltion(addressEntity.getAddressName()); |
| | | // 设置来源( 1:地址总表 2:国控采集) |
| | | placeEntity.setSource(1); |
| | | // 加入集合 |
| | | placeList.add(placeEntity); |
| | | } |
| | | } |
| | | // 批量插入 |
| | | placeService.saveBatch(placeList); |