From 99f77afaaee87c3b9d7a5e48862908b72a947f7b Mon Sep 17 00:00:00 2001 From: cloudroam <cloudroam> Date: 星期五, 17 一月 2025 08:59:55 +0800 Subject: [PATCH] fix:修改密码 --- src/main/java/com/mzl/flower/service/impl/map/MapTengxunServiceImpl.java | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/mzl/flower/service/impl/map/MapTengxunServiceImpl.java b/src/main/java/com/mzl/flower/service/impl/map/MapTengxunServiceImpl.java index 51722a5..4c4bd15 100644 --- a/src/main/java/com/mzl/flower/service/impl/map/MapTengxunServiceImpl.java +++ b/src/main/java/com/mzl/flower/service/impl/map/MapTengxunServiceImpl.java @@ -36,9 +36,7 @@ @Override public void getAdministrativeDivision() { - // TODO: 获取行政区域数据 String administrativeDivisionsUrl = tengxunMapProperties.getAdministrativeDivisionsUrl(); - System.out.println(administrativeDivisionsUrl); //可以单独传入http参数,这样参数会自动做URL编码,拼接在URL中 HashMap<String, Object> paramMap = new HashMap<>(); @@ -53,13 +51,22 @@ List<TengxunDistrict> allDistricts = response.getResult(); // 将腾讯地图返回的数据格式转换成标准的三层结构 - List<TengxunDistrict> formatterDistrict =normalizeTreeToThreeLevels(allDistricts); +// List<TengxunDistrict> formatterDistrict =normalizeTreeToThreeLevels(allDistricts); +// +// List<TengxunDistrict> allTengxunDistricts = new ArrayList<>(); +// // 递归遍历所有的节点,然后把所有节点加入到 allDistricts 列表中 +// for (TengxunDistrict tengxunDistrict : formatterDistrict){ +// addDistrictToList(tengxunDistrict, null, allTengxunDistricts); // 从根节点开始,父节点 ID 为 null +// } + +// List<TengxunDistrict> formatterDistrict =normalizeTreeToThreeLevels(allDistricts); List<TengxunDistrict> allTengxunDistricts = new ArrayList<>(); // 递归遍历所有的节点,然后把所有节点加入到 allDistricts 列表中 - for (TengxunDistrict tengxunDistrict : formatterDistrict){ + for (TengxunDistrict tengxunDistrict : allDistricts){ addDistrictToList(tengxunDistrict, null, allTengxunDistricts); // 从根节点开始,父节点 ID 为 null } + List<DistrictTengxunDO> districtTengxunDOList= ConverterUtil.transList(allTengxunDistricts, DistrictTengxunDO.class); districtTengxunService.saveRemoteDistricts(districtTengxunDOList); -- Gitblit v1.9.3