yawei待办详情

This commit is contained in:
lizhicheng 2022-11-09 14:59:54 +08:00
parent 8763e4c6f6
commit 37dc9e7223
1 changed files with 39 additions and 7 deletions

View File

@ -559,20 +559,52 @@ public class ResourceController {
" <ZySPPort xmlns=\"http://tempuri.org/\">\n" +
// " <userguid>e8d2fb43-f512-4918-ab47-1141b925af10</userguid>\n" +
String.format(" <userguid>%s</userguid>", sysUser.getGuid()) +
String.format("<pagenum>%d</pagenum>", page) +
String.format("<pagesize>%d</pagesize>", size) +
title != null ? String.format("<title>%s</title>", title) : "" +
String.format(" <pagenum>%d</pagenum>\n", page) +
String.format(" <pagesize>%d</pagesize>\n", size) +
String.format(" <title>%s</title>\n", title==null ? "" : title) +
" </ZySPPort>\n" +
" </soap:Body>\n" +
"</soap:Envelope>";
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<String> requestEntity = new HttpEntity<>(parame, requestHeaders);
try {
String body = restTemplate.postForEntity(url, requestEntity, String.class).getBody();
String startTag = "<ZWCJ_mainPortResult>";
String endTag = "</ZWCJ_mainPortResult>";
String startTag = "<ZySPPortResult>";
String endTag = "</ZySPPortResult>";
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 = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" +
" <soap:Body>\n" +
" <ZyShowrecord xmlns=\"http://tempuri.org/\">\n" +
String.format(" <guid>%s</guid>\n", applyGuid) +
String.format(" <bmguid>%s</bmguid>\n", deptGuid) +
" </ZyShowrecord>\n" +
" </soap:Body>\n" +
"</soap:Envelope>";
HttpHeaders requestHeaders = new HttpHeaders();
requestHeaders.set("SOAPAction", "http://tempuri.org/ZyShowrecord");
requestHeaders.setContentType(new MediaType("text", "xml", Charset.forName("utf-8")));
HttpEntity<String> requestEntity = new HttpEntity<>(parame, requestHeaders);
try {
String body = restTemplate.postForEntity(url, requestEntity, String.class).getBody();
String startTag = "<ZyShowrecordResult>";
String endTag = "</ZyShowrecordResult>";
String json = body.substring(body.indexOf(startTag) + startTag.length(), body.indexOf(endTag));
HashMap result = JSON.parseObject(json, HashMap.class);