From 37dc9e7223861440996e42672519056ec433dad0 Mon Sep 17 00:00:00 2001 From: lizhicheng Date: Wed, 9 Nov 2022 14:59:54 +0800 Subject: [PATCH] =?UTF-8?q?yawei=E5=BE=85=E5=8A=9E=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ResourceController.java | 46 ++++++++++++++++--- 1 file changed, 39 insertions(+), 7 deletions(-) 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 c569d0d9..e6a572f7 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 @@ -558,21 +558,53 @@ public class ResourceController { " \n" + " \n" + // " e8d2fb43-f512-4918-ab47-1141b925af10\n" + - String.format("%s", sysUser.getGuid()) + - String.format("%d", page) + - String.format("%d", size) + - title != null ? String.format("%s", title) : "" + + String.format(" %s", sysUser.getGuid()) + + String.format(" %d\n", page) + + String.format(" %d\n", size) + + String.format(" %s\n", title==null ? "" : title) + " \n" + " \n" + ""; HttpHeaders requestHeaders = new HttpHeaders(); - requestHeaders.set("SOAPAction", "http://tempuri.org/ZWCJ_mainPort"); + requestHeaders.set("SOAPAction", "http://tempuri.org/ZySPPort"); requestHeaders.setContentType(new MediaType("text", "xml", Charset.forName("utf-8"))); HttpEntity requestEntity = new HttpEntity<>(parame, requestHeaders); try { String body = restTemplate.postForEntity(url, requestEntity, String.class).getBody(); - String startTag = ""; - String endTag = ""; + String startTag = ""; + String endTag = ""; + String json = body.substring(body.indexOf(startTag) + startTag.length(), body.indexOf(endTag)); + HashMap result = JSON.parseObject(json, HashMap.class); + + return new Result().ok(result); + } catch (Exception e) { + e.printStackTrace(); + return new Result().ok(new ArrayList(0)); + } + } + + @GetMapping("ZywMessage/yaweiApproveDetails") + @ApiOperation("数据资源审批详情转发") + @LogOperation("数据资源审批详情转发") + public Result yaweiApproveDetails(@ApiParam("申请guid") String applyGuid, @ApiParam("部门guid") String deptGuid) { + String url = "http://15.72.158.81/zyjk/ZywMessage.asmx?op=ZyShowrecord"; + String parame = "\n" + + "\n" + + " \n" + + " \n" + + String.format(" %s\n", applyGuid) + + String.format(" %s\n", deptGuid) + + " \n" + + " \n" + + ""; + HttpHeaders requestHeaders = new HttpHeaders(); + requestHeaders.set("SOAPAction", "http://tempuri.org/ZyShowrecord"); + requestHeaders.setContentType(new MediaType("text", "xml", Charset.forName("utf-8"))); + HttpEntity requestEntity = new HttpEntity<>(parame, requestHeaders); + try { + String body = restTemplate.postForEntity(url, requestEntity, String.class).getBody(); + String startTag = ""; + String endTag = ""; String json = body.substring(body.indexOf(startTag) + startTag.length(), body.indexOf(endTag)); HashMap result = JSON.parseObject(json, HashMap.class);