From 12dcb9910d556c43b802bfebbeedc0078ada3268 Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Mon, 30 May 2022 18:59:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=B0=83=E7=94=A8=E5=A4=A7?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=8E=A5=E5=8F=A3=E8=AF=B7=E6=B1=82=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../category/service/impl/CategoryServiceImpl.java | 3 ++- .../resource/controller/ResourceController.java | 13 +++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/category/service/impl/CategoryServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/category/service/impl/CategoryServiceImpl.java index 713aa041..d3de69fd 100644 --- a/renren-admin/src/main/java/io/renren/modules/category/service/impl/CategoryServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/category/service/impl/CategoryServiceImpl.java @@ -42,7 +42,7 @@ public class CategoryServiceImpl extends CrudServiceImpl list = new ArrayList<>(); categoryDao.selectByParentId(categoryDto.getId()) @@ -84,6 +84,7 @@ public class CategoryServiceImpl extends CrudServiceImpl categories = categoryDao.selectList(wrapper); ArrayList resultList = new ArrayList<>(); diff --git a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java index c98abc15..b357ccaf 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java @@ -188,11 +188,16 @@ public class ResourceController { requestHeaders.set("SOAPAction", "http://tempuri.org/ZywMessagePort"); requestHeaders.setContentType(MediaType.TEXT_XML); HttpEntity requestEntity = new HttpEntity(parame, requestHeaders); - String body = restTemplate.postForEntity(url,requestEntity,String.class).getBody(); - String json = body.substring(body.indexOf("{"), body.indexOf("}") + 1); - HashMap map = JSONObject.parseObject(json, HashMap.class); + try { + String body = restTemplate.postForEntity(url,requestEntity,String.class).getBody(); + String json = body.substring(body.indexOf("{"), body.indexOf("}") + 1); + HashMap map = JSONObject.parseObject(json, HashMap.class); + return new Result().ok(map); + } catch (Exception e) { + e.printStackTrace(); + return new Result().error(); + } - return new Result().ok(map); } @GetMapping("algorithmPage")