From fce076fc7d9495e1f246d9f68487095cd2a6eb52 Mon Sep 17 00:00:00 2001 From: = <=> Date: Tue, 17 Mar 2026 14:24:35 +0800 Subject: [PATCH] commit --- dependency-reduced-pom.xml | 2 +- .../com/budwk/app/sys/controller/SysUnitController.java | 1 + .../app/sys/services/impl/SysDataUnitPullServiceImpl.java | 4 ++-- .../app/sys/services/impl/SysDataUserPullServiceImpl.java | 4 ++-- src/main/resources/views/platform/sys/unit/unitManage.js | 3 +++ src/main/resources/views/platform/sys/user/index.html | 8 +++----- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/dependency-reduced-pom.xml b/dependency-reduced-pom.xml index b508c8a6..dbfb801e 100644 --- a/dependency-reduced-pom.xml +++ b/dependency-reduced-pom.xml @@ -2,7 +2,7 @@ 4.0.0 com.budwk - zhgh-whcp + zhgh_hdc 5.6.0-plus diff --git a/src/main/java/com/budwk/app/sys/controller/SysUnitController.java b/src/main/java/com/budwk/app/sys/controller/SysUnitController.java index 6aad02ab..b193e64d 100644 --- a/src/main/java/com/budwk/app/sys/controller/SysUnitController.java +++ b/src/main/java/com/budwk/app/sys/controller/SysUnitController.java @@ -316,6 +316,7 @@ public class SysUnitController { parentId = ""; } unit.setCreatedBy(SecurityUtil.getUserId()); + unit.setUnitTypeCode(1); sysUnitService.save(unit, parentId); return Result.success(); } catch (Exception e) { diff --git a/src/main/java/com/budwk/app/sys/services/impl/SysDataUnitPullServiceImpl.java b/src/main/java/com/budwk/app/sys/services/impl/SysDataUnitPullServiceImpl.java index 6fb1cb84..3642e9b9 100644 --- a/src/main/java/com/budwk/app/sys/services/impl/SysDataUnitPullServiceImpl.java +++ b/src/main/java/com/budwk/app/sys/services/impl/SysDataUnitPullServiceImpl.java @@ -73,7 +73,7 @@ public class SysDataUnitPullServiceImpl extends BaseServiceImpl implem ); String params = URLUtil.buildQuery(tokenParams, StandardCharsets.UTF_8); - String tokenUrl = "https://bd.whcp.edu.cn/sjjkfwpt/api/bd-api/oauth/token" + (StrUtil.isBlank(params) ? "" : "?" + params); + String tokenUrl = "https://bd.hdc.edu.cn/sjjkfwpt/api/bd-api/oauth/token" + (StrUtil.isBlank(params) ? "" : "?" + params); HttpRequest tokenHttpRequest = HttpUtil.createPost(tokenUrl); tokenHttpRequest.header("Content-Type", "application/json"); tokenHttpRequest.header("Authorization", "Basic MTE0OjU5M2UwNGI4YTE4NWRlMzkyNjY4ZmY0ZDJhZGMyZTEw"); @@ -85,7 +85,7 @@ public class SysDataUnitPullServiceImpl extends BaseServiceImpl implem JSONObject tokenJsonBody = JSONUtil.parseObj(tokenResBody); // 请求数据 - HttpRequest httpRequest = HttpUtil.createGet("https://bd.whcp.edu.cn/sjjkfwpt/api/bd-api/get/YXSDWJBSJZLB"); + HttpRequest httpRequest = HttpUtil.createGet("https://bd.hdc.edu.cn/sjjkfwpt/api/bd-api/get/YXSDWJBSJZLB"); httpRequest.form(Map.of("access_token", tokenJsonBody.getStr("access_token"), "pageSize", 100, "page", 1)); log.info("请求单位数据: {}", httpRequest); String resBody = httpRequest.execute().body(); diff --git a/src/main/java/com/budwk/app/sys/services/impl/SysDataUserPullServiceImpl.java b/src/main/java/com/budwk/app/sys/services/impl/SysDataUserPullServiceImpl.java index f2d38c82..c7df6ed4 100644 --- a/src/main/java/com/budwk/app/sys/services/impl/SysDataUserPullServiceImpl.java +++ b/src/main/java/com/budwk/app/sys/services/impl/SysDataUserPullServiceImpl.java @@ -124,7 +124,7 @@ public class SysDataUserPullServiceImpl extends BaseServiceImpl ); String params = URLUtil.buildQuery(tokenParams, StandardCharsets.UTF_8); - String tokenUrl = "https://bd.whcp.edu.cn/sjjkfwpt/api/bd-api/oauth/token" + (StrUtil.isBlank(params) ? "" : "?" + params); + String tokenUrl = "https://bd.hdc.edu.cn/sjjkfwpt/api/bd-api/oauth/token" + (StrUtil.isBlank(params) ? "" : "?" + params); HttpRequest tokenHttpRequest = HttpUtil.createPost(tokenUrl); tokenHttpRequest.header("Content-Type", "application/json"); tokenHttpRequest.header("Authorization", "Basic MTE0OjU5M2UwNGI4YTE4NWRlMzkyNjY4ZmY0ZDJhZGMyZTEw"); @@ -136,7 +136,7 @@ public class SysDataUserPullServiceImpl extends BaseServiceImpl JSONObject tokenJsonBody = JSONUtil.parseObj(tokenResBody); // 请求数据 - HttpRequest httpRequest = HttpUtil.createGet("https://bd.whcp.edu.cn/sjjkfwpt/api/bd-api/get/JZGJCSJZLB"); + HttpRequest httpRequest = HttpUtil.createGet("https://bd.hdc.edu.cn/sjjkfwpt/api/bd-api/get/JZGJCSJZLB"); httpRequest.form(Map.of("access_token", tokenJsonBody.getStr("access_token"), "pageSize", 5000, "page", 1)); log.info("请求人员数据: {}", httpRequest); diff --git a/src/main/resources/views/platform/sys/unit/unitManage.js b/src/main/resources/views/platform/sys/unit/unitManage.js index 956d3988..22675bc3 100644 --- a/src/main/resources/views/platform/sys/unit/unitManage.js +++ b/src/main/resources/views/platform/sys/unit/unitManage.js @@ -136,6 +136,9 @@ const UNIT_MANAGE_TEMPLATE = { openAdd() { this.dialogVisible = true this.formData = {} //打开新增窗口,表单先清空 + if (this.currentData && this.currentData.id) { + this.formData.parentId = this.currentData.id; + } this.parentUnit = [] this.options = [] }, diff --git a/src/main/resources/views/platform/sys/user/index.html b/src/main/resources/views/platform/sys/user/index.html index 226939a1..88491084 100644 --- a/src/main/resources/views/platform/sys/user/index.html +++ b/src/main/resources/views/platform/sys/user/index.html @@ -293,11 +293,9 @@ layout("/layouts/platform.html"){ const url = base + "/platform/sys/unit/tree" self.$axios.post(url, { pid: node.value }).then((res) => { if (res.code === 0) { - let filteredData = res.data; - if (node.level === 0 && res.data && res.data.length > 0) { - filteredData = res.data.slice(1); // 移除第一个元素 - } - resolve(filteredData); + resolve(res.data || []); + } else { + resolve([]); } }) }