diff --git a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/api/controller/SystemApiController.java b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/api/controller/SystemApiController.java index f7d807d..f709268 100644 --- a/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/api/controller/SystemApiController.java +++ b/nursing-unit-system/nu-system-biz/src/main/java/org/jeecg/modules/api/controller/SystemApiController.java @@ -1129,4 +1129,32 @@ public class SystemApiController { } } } + + /** + * 获取机构对应媒体资源访问地址 + */ + @GetMapping("/getMediaUrlByOrgCode") + public Result getMediaUrlByOrgCode(@RequestParam("orgCode") String orgCode) { + Map result = Maps.newHashMap(); + //查询源数据平台的接口api地址 + { + //各平台api地址都存在管理系统中 管理系统api地址在系统参数配置中 “ope_open_url” + JSONObject opeOpenUrl = sysConfigApi.getByKeyByDS("master", "ope_open_url"); + String opeApiAddress = opeOpenUrl.getString("configValue"); + if (opeApiAddress.endsWith("/")) { + opeApiAddress = opeApiAddress.substring(0, opeApiAddress.length() - 1); + } + String bizApiAddress = opeApiAddress + "/api/baseInfo/getMediaUrlByOrgCode?orgCode=" + orgCode; + + try { + String res = HttpRequestUtil.doGet(bizApiAddress, HttpRequestUtil.createDefaultHeaders()); + JSONObject jsonResponse = JSON.parseObject(res); + JSONObject result_ = jsonResponse.getJSONObject("result"); + result.put("mediaUrl", result_.getString("mediaUrl")); + return Result.ok(result); + } catch (Exception e) { + return Result.ok(result); + } + } + } }