|
|
|
@ -58,10 +58,10 @@ import java.util.*;
|
|
|
|
|
public class FontController {
|
|
|
|
|
@Value("${pdfWater}")
|
|
|
|
|
private String pdfWater;
|
|
|
|
|
@Value("${RoomDetailsUrl}")
|
|
|
|
|
private String RoomDetailsUrl;
|
|
|
|
|
@Value("${RoomDetailsUrlName}")
|
|
|
|
|
private String RoomDetailsUrlName;
|
|
|
|
|
// @Value("${RoomDetailsUrl}")
|
|
|
|
|
// private String RoomDetailsUrl;
|
|
|
|
|
// @Value("${RoomDetailsUrlName}")
|
|
|
|
|
// private String RoomDetailsUrlName;
|
|
|
|
|
@Value("${allAddortIds}")
|
|
|
|
|
private String allAddortIds;
|
|
|
|
|
@Value("${POWER_URLHEAD}")
|
|
|
|
@ -808,262 +808,262 @@ public class FontController {
|
|
|
|
|
return map;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 调用第三方接口获取唯一标识patientid
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
* @throws Exception
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value = "getRoomDetails")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public String selRoomDetails(EsbPublicVo esbPublicVo,SecureloginVo secureloginVo, HttpServletRequest request) throws Exception {
|
|
|
|
|
//创建连接工厂
|
|
|
|
|
String patientId1 = esbPublicVo.getPatientId();
|
|
|
|
|
System.out.println("patientId1:::::"+patientId1);
|
|
|
|
|
JAXDynamicClientFactory dcf = JAXDynamicClientFactory.newInstance();
|
|
|
|
|
//创建客户端 wsUrl为webService接口地址
|
|
|
|
|
Client client = dcf.createClient(RoomDetailsUrl);
|
|
|
|
|
String xmlStr = createXml(patientId1);
|
|
|
|
|
Object[] objects = client.invoke(RoomDetailsUrlName, xmlStr);
|
|
|
|
|
//销毁连接
|
|
|
|
|
client.destroy();
|
|
|
|
|
//接收结果
|
|
|
|
|
String result = objects[0].toString();
|
|
|
|
|
System.out.println("result::::::"+result);
|
|
|
|
|
String patientId=null;
|
|
|
|
|
if (StringUtils.isNotBlank(result)) {
|
|
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
|
|
map = parseXml2Map(result, map);
|
|
|
|
|
//获取序列号
|
|
|
|
|
patientId = map.get("Body.ResultContent.patientid");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
// 获得Http客户端
|
|
|
|
|
CloseableHttpClient httpClient = HttpClientBuilder.create().build();
|
|
|
|
|
// 创建Post请求
|
|
|
|
|
HttpPost httpPost = new HttpPost("http://10.100.12.12:37727/api/account/securelogin");
|
|
|
|
|
//json格式转换
|
|
|
|
|
JSONObject jsonParam = new JSONObject();
|
|
|
|
|
jsonParam.put("idp","NSDP");
|
|
|
|
|
jsonParam.put("secret", "Secret");
|
|
|
|
|
jsonParam.put("userName","002030");
|
|
|
|
|
jsonParam.put("password", "123456");
|
|
|
|
|
jsonParam.put("scopes", "openid profile cr-api roles");
|
|
|
|
|
jsonParam.put("key", patientId1);
|
|
|
|
|
System.out.println(jsonParam);
|
|
|
|
|
StringEntity entity = new StringEntity(jsonParam.toString(), "UTF-8");
|
|
|
|
|
httpPost.setEntity(entity);
|
|
|
|
|
httpPost.setHeader("Content-Type","application/json");
|
|
|
|
|
// 响应模型
|
|
|
|
|
CloseableHttpResponse response = null;
|
|
|
|
|
HttpEntity responseEntity=null;
|
|
|
|
|
String token="";
|
|
|
|
|
String s ="";
|
|
|
|
|
try {
|
|
|
|
|
// 由客户端执行(发送)Post请求
|
|
|
|
|
response = httpClient.execute(httpPost);
|
|
|
|
|
// 从响应模型中获取响应实体
|
|
|
|
|
responseEntity=response.getEntity();
|
|
|
|
|
System.out.println("响应状态为:" + response.getStatusLine());
|
|
|
|
|
if (responseEntity != null) {
|
|
|
|
|
Map<String,Object> mapType = JSON.parseObject(EntityUtils.toString(responseEntity),Map.class);
|
|
|
|
|
token = mapType.get("token").toString();
|
|
|
|
|
System.out.println("token:::"+token);
|
|
|
|
|
s = StringUtils.substringAfter(token, " ");
|
|
|
|
|
System.out.println("s:::"+s);
|
|
|
|
|
}
|
|
|
|
|
} catch (ClientProtocolException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} finally {
|
|
|
|
|
try {
|
|
|
|
|
// 释放资源
|
|
|
|
|
if (httpClient != null) {
|
|
|
|
|
httpClient.close();
|
|
|
|
|
}
|
|
|
|
|
if (response != null) {
|
|
|
|
|
response.close();
|
|
|
|
|
}
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
String pdfUrl="http://10.100.12.3:33600/view/subjects/"+patientId+"/records/"+secureloginVo.getVisitId()+"?token="+s+"&token_type=Bearer";
|
|
|
|
|
return pdfUrl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* *//*
|
|
|
|
|
* <Request>
|
|
|
|
|
<Header>
|
|
|
|
|
<SourceSystem>HIS</SourceSystem>
|
|
|
|
|
<MessageId>D561C89A-6320-4b27-83DE-A6169B1D0761</MessageId>
|
|
|
|
|
<CreateTime>2021-07-18 11:12:41</CreateTime>
|
|
|
|
|
<MethodName>Get360PatientId</MethodName>
|
|
|
|
|
</Header>
|
|
|
|
|
<Body>
|
|
|
|
|
<PatientId>0000623132</PatientId>
|
|
|
|
|
</Body>
|
|
|
|
|
</Request>
|
|
|
|
|
* */
|
|
|
|
|
public static String createXml(String patientId1) {
|
|
|
|
|
String strXML = null;
|
|
|
|
|
try {
|
|
|
|
|
// /**
|
|
|
|
|
// * 调用第三方接口获取唯一标识patientid
|
|
|
|
|
// *
|
|
|
|
|
// * @return
|
|
|
|
|
// * @throws Exception
|
|
|
|
|
// */
|
|
|
|
|
// @RequestMapping(value = "getRoomDetails")
|
|
|
|
|
// @ResponseBody
|
|
|
|
|
// public String selRoomDetails(EsbPublicVo esbPublicVo,SecureloginVo secureloginVo, HttpServletRequest request) throws Exception {
|
|
|
|
|
// //创建连接工厂
|
|
|
|
|
// String patientId1 = esbPublicVo.getPatientId();
|
|
|
|
|
// System.out.println("patientId1:::::"+patientId1);
|
|
|
|
|
// JAXDynamicClientFactory dcf = JAXDynamicClientFactory.newInstance();
|
|
|
|
|
// //创建客户端 wsUrl为webService接口地址
|
|
|
|
|
// Client client = dcf.createClient(RoomDetailsUrl);
|
|
|
|
|
// String xmlStr = createXml(patientId1);
|
|
|
|
|
// Object[] objects = client.invoke(RoomDetailsUrlName, xmlStr);
|
|
|
|
|
// //销毁连接
|
|
|
|
|
// client.destroy();
|
|
|
|
|
// //接收结果
|
|
|
|
|
// String result = objects[0].toString();
|
|
|
|
|
// System.out.println("result::::::"+result);
|
|
|
|
|
// String patientId=null;
|
|
|
|
|
// if (StringUtils.isNotBlank(result)) {
|
|
|
|
|
// Map<String, String> map = new HashMap<>();
|
|
|
|
|
// map = parseXml2Map(result, map);
|
|
|
|
|
// //获取序列号
|
|
|
|
|
// patientId = map.get("Body.ResultContent.patientid");
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// // 获得Http客户端
|
|
|
|
|
// CloseableHttpClient httpClient = HttpClientBuilder.create().build();
|
|
|
|
|
// // 创建Post请求
|
|
|
|
|
// HttpPost httpPost = new HttpPost("http://10.100.12.12:37727/api/account/securelogin");
|
|
|
|
|
// //json格式转换
|
|
|
|
|
// JSONObject jsonParam = new JSONObject();
|
|
|
|
|
// jsonParam.put("idp","NSDP");
|
|
|
|
|
// jsonParam.put("secret", "Secret");
|
|
|
|
|
// jsonParam.put("userName","002030");
|
|
|
|
|
// jsonParam.put("password", "123456");
|
|
|
|
|
// jsonParam.put("scopes", "openid profile cr-api roles");
|
|
|
|
|
// jsonParam.put("key", patientId1);
|
|
|
|
|
// System.out.println(jsonParam);
|
|
|
|
|
// StringEntity entity = new StringEntity(jsonParam.toString(), "UTF-8");
|
|
|
|
|
// httpPost.setEntity(entity);
|
|
|
|
|
// httpPost.setHeader("Content-Type","application/json");
|
|
|
|
|
// // 响应模型
|
|
|
|
|
// CloseableHttpResponse response = null;
|
|
|
|
|
// HttpEntity responseEntity=null;
|
|
|
|
|
// String token="";
|
|
|
|
|
// String s ="";
|
|
|
|
|
// try {
|
|
|
|
|
// // 由客户端执行(发送)Post请求
|
|
|
|
|
// response = httpClient.execute(httpPost);
|
|
|
|
|
// // 从响应模型中获取响应实体
|
|
|
|
|
// responseEntity=response.getEntity();
|
|
|
|
|
// System.out.println("响应状态为:" + response.getStatusLine());
|
|
|
|
|
// if (responseEntity != null) {
|
|
|
|
|
// Map<String,Object> mapType = JSON.parseObject(EntityUtils.toString(responseEntity),Map.class);
|
|
|
|
|
// token = mapType.get("token").toString();
|
|
|
|
|
// System.out.println("token:::"+token);
|
|
|
|
|
// s = StringUtils.substringAfter(token, " ");
|
|
|
|
|
// System.out.println("s:::"+s);
|
|
|
|
|
// }
|
|
|
|
|
// } catch (ClientProtocolException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// } catch (IOException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// } finally {
|
|
|
|
|
// try {
|
|
|
|
|
// // 释放资源
|
|
|
|
|
// if (httpClient != null) {
|
|
|
|
|
// httpClient.close();
|
|
|
|
|
// }
|
|
|
|
|
// if (response != null) {
|
|
|
|
|
// response.close();
|
|
|
|
|
// }
|
|
|
|
|
// } catch (IOException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// String pdfUrl="http://10.100.12.3:33600/view/subjects/"+patientId+"/records/"+secureloginVo.getVisitId()+"?token="+s+"&token_type=Bearer";
|
|
|
|
|
// return pdfUrl;
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// /* *//*
|
|
|
|
|
// * <Request>
|
|
|
|
|
// <Header>
|
|
|
|
|
// <SourceSystem>HIS</SourceSystem>
|
|
|
|
|
// <MessageId>D561C89A-6320-4b27-83DE-A6169B1D0761</MessageId>
|
|
|
|
|
// <CreateTime>2021-07-18 11:12:41</CreateTime>
|
|
|
|
|
// <MethodName>Get360PatientId</MethodName>
|
|
|
|
|
// </Header>
|
|
|
|
|
// <Body>
|
|
|
|
|
// <PatientId>0000623132</PatientId>
|
|
|
|
|
// </Body>
|
|
|
|
|
//</Request>
|
|
|
|
|
// * */
|
|
|
|
|
// public static String createXml(String patientId1) {
|
|
|
|
|
// String strXML = null;
|
|
|
|
|
// try {
|
|
|
|
|
//// Document document = DocumentHelper.createDocument();
|
|
|
|
|
//// org.dom4j.Element request = document.addElement("Request");
|
|
|
|
|
//// org.dom4j.Element header = request.addElement("Header");
|
|
|
|
|
//// org.dom4j.Element sourceSystem = header.addElement("SourceSystem");
|
|
|
|
|
//// org.dom4j.Element messageId = header.addElement("MessageId");
|
|
|
|
|
//// org.dom4j.Element createTime = header.addElement("CreateTime");
|
|
|
|
|
//// org.dom4j.Element methodName = header.addElement("MethodName");
|
|
|
|
|
//// sourceSystem.setText("record");
|
|
|
|
|
//// messageId.setText(UUID.randomUUID().toString().toUpperCase());
|
|
|
|
|
//// createTime.setText(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
|
|
|
|
//// methodName.setText("Get360PatientId");
|
|
|
|
|
//// org.dom4j.Element body = request.addElement("Body");
|
|
|
|
|
//// Element patientIdEle = body.addElement("PatientId");
|
|
|
|
|
//// patientIdEle.setText(patientId);
|
|
|
|
|
//// return document.toString();
|
|
|
|
|
// Document document = DocumentHelper.createDocument();
|
|
|
|
|
// org.dom4j.Element request = document.addElement("Request");
|
|
|
|
|
// org.dom4j.Element header = request.addElement("Header");
|
|
|
|
|
// org.dom4j.Element sourceSystem = header.addElement("SourceSystem");
|
|
|
|
|
// org.dom4j.Element messageId = header.addElement("MessageId");
|
|
|
|
|
// org.dom4j.Element createTime = header.addElement("CreateTime");
|
|
|
|
|
// org.dom4j.Element methodName = header.addElement("MethodName");
|
|
|
|
|
// sourceSystem.setText("record");
|
|
|
|
|
// messageId.setText(UUID.randomUUID().toString().toUpperCase());
|
|
|
|
|
// createTime.setText(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
|
|
|
|
|
// methodName.setText("Get360PatientId");
|
|
|
|
|
// org.dom4j.Element body = request.addElement("Body");
|
|
|
|
|
// Element patientIdEle = body.addElement("PatientId");
|
|
|
|
|
// patientIdEle.setText(patientId);
|
|
|
|
|
// return document.toString();
|
|
|
|
|
Document document = DocumentHelper.createDocument();
|
|
|
|
|
//创建根节点
|
|
|
|
|
Element request = document.addElement("Request");
|
|
|
|
|
//添加子节点
|
|
|
|
|
Element header = request.addElement("Header");
|
|
|
|
|
//给Header标签添加子节点
|
|
|
|
|
Element sourceSystem = header.addElement("SourceSystem");
|
|
|
|
|
Element messageId = header.addElement("MessageId");
|
|
|
|
|
Element createTime = header.addElement("CreateTime");
|
|
|
|
|
Element methodName = header.addElement("MethodName");
|
|
|
|
|
//给Request标签添加子节点
|
|
|
|
|
Element body = request.addElement("Body");
|
|
|
|
|
//给Body标签添加子节点
|
|
|
|
|
Element patientIdEle = body.addElement("PatientId");
|
|
|
|
|
//给xml赋值
|
|
|
|
|
sourceSystem.addText("CaseSys");
|
|
|
|
|
UUID guid = UUID.randomUUID();
|
|
|
|
|
messageId.addText(guid.toString());
|
|
|
|
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
createTime.addText(df.format(new Date()));
|
|
|
|
|
methodName.addText("Get360PatientId");
|
|
|
|
|
patientIdEle.addText(patientId1);
|
|
|
|
|
strXML = document.asXML();
|
|
|
|
|
System.out.println("strXML:::::" + strXML);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
System.out.println("生成rssNew.xml失败");
|
|
|
|
|
}
|
|
|
|
|
return strXML;
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 获取token
|
|
|
|
|
* @return
|
|
|
|
|
* @throws
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value="getToken")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public void selToken(SecureloginVo secureloginVo, HttpServletRequest request){
|
|
|
|
|
System.out.println(secureloginVo.getKey());
|
|
|
|
|
// 获得Http客户端
|
|
|
|
|
CloseableHttpClient httpClient = HttpClientBuilder.create().build();
|
|
|
|
|
// 创建Post请求
|
|
|
|
|
HttpPost httpPost = new HttpPost("http://10.100.12.12:37727/api/account/securelogin");
|
|
|
|
|
secureloginVo.setIDP("NSDP");
|
|
|
|
|
secureloginVo.setSecret("Secret");
|
|
|
|
|
// Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER");
|
|
|
|
|
// secureloginVo.setUserName(user.getUserName());
|
|
|
|
|
secureloginVo.setUserName("002030");
|
|
|
|
|
secureloginVo.setPassword("123456");
|
|
|
|
|
secureloginVo.setScopes("openid profile cr-api roles");
|
|
|
|
|
|
|
|
|
|
//json格式转换
|
|
|
|
|
String jsonString = JSON.toJSONString(secureloginVo);
|
|
|
|
|
StringEntity entity = new StringEntity(jsonString, "UTF-8");
|
|
|
|
|
// post请求是将参数放在请求体里面传过去的;这里将entity放入post请求体中
|
|
|
|
|
httpPost.setEntity(entity);
|
|
|
|
|
httpPost.setHeader("Content-Type", "application/json;charset=utf8");
|
|
|
|
|
// 响应模型
|
|
|
|
|
CloseableHttpResponse response = null;
|
|
|
|
|
try {
|
|
|
|
|
// 由客户端执行(发送)Post请求
|
|
|
|
|
response = httpClient.execute(httpPost);
|
|
|
|
|
// 从响应模型中获取响应实体
|
|
|
|
|
HttpEntity responseEntity = response.getEntity();
|
|
|
|
|
System.out.println("responseEntity::::"+responseEntity);
|
|
|
|
|
System.out.println("响应状态为:" + response.getStatusLine());
|
|
|
|
|
if (responseEntity != null) {
|
|
|
|
|
System.out.println("响应内容长度为:" + responseEntity.getContentLength());
|
|
|
|
|
System.out.println("响应内容为:" + EntityUtils.toString(responseEntity));
|
|
|
|
|
}
|
|
|
|
|
} catch (ClientProtocolException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} finally {
|
|
|
|
|
try {
|
|
|
|
|
// 释放资源
|
|
|
|
|
if (httpClient != null) {
|
|
|
|
|
httpClient.close();
|
|
|
|
|
}
|
|
|
|
|
if (response != null) {
|
|
|
|
|
response.close();
|
|
|
|
|
}
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 获取二维码
|
|
|
|
|
* @return
|
|
|
|
|
* @throws
|
|
|
|
|
*/
|
|
|
|
|
@RequestMapping(value="getQRcode")
|
|
|
|
|
@ResponseBody
|
|
|
|
|
public void getQRcode(QRcode qRcode, HttpServletRequest request) {
|
|
|
|
|
// 获得Http客户端
|
|
|
|
|
CloseableHttpClient httpClient = HttpClientBuilder.create().build();
|
|
|
|
|
// 创建Post请求
|
|
|
|
|
HttpPost httpPost = new HttpPost("https://zh.fstth.cn");
|
|
|
|
|
qRcode.setType(3);
|
|
|
|
|
qRcode.setProjectUid("cloudkey-fstth");
|
|
|
|
|
qRcode.setApplicationId("fstth-wzh");
|
|
|
|
|
//json格式转换
|
|
|
|
|
String jsonString = JSON.toJSONString(qRcode);
|
|
|
|
|
StringEntity entity = new StringEntity(jsonString, "UTF-8");
|
|
|
|
|
// post请求是将参数放在请求体里面传过去的;这里将entity放入post请求体中
|
|
|
|
|
httpPost.setEntity(entity);
|
|
|
|
|
httpPost.setHeader("Content-Type", "application/json;charset=utf8");
|
|
|
|
|
// 响应模型
|
|
|
|
|
CloseableHttpResponse response = null;
|
|
|
|
|
try {
|
|
|
|
|
// 由客户端执行(发送)Post请求
|
|
|
|
|
response = httpClient.execute(httpPost);
|
|
|
|
|
// 从响应模型中获取响应实体
|
|
|
|
|
HttpEntity responseEntity = response.getEntity();
|
|
|
|
|
System.out.println("responseEntity::::" + responseEntity);
|
|
|
|
|
System.out.println("响应状态为:" + response.getStatusLine());
|
|
|
|
|
if (responseEntity != null) {
|
|
|
|
|
System.out.println("响应内容长度为:" + responseEntity.getContentLength());
|
|
|
|
|
System.out.println("响应内容为:" + EntityUtils.toString(responseEntity));
|
|
|
|
|
}
|
|
|
|
|
} catch (ClientProtocolException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
} finally {
|
|
|
|
|
try {
|
|
|
|
|
// 释放资源
|
|
|
|
|
if (httpClient != null) {
|
|
|
|
|
httpClient.close();
|
|
|
|
|
}
|
|
|
|
|
if (response != null) {
|
|
|
|
|
response.close();
|
|
|
|
|
}
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// //创建根节点
|
|
|
|
|
// Element request = document.addElement("Request");
|
|
|
|
|
// //添加子节点
|
|
|
|
|
// Element header = request.addElement("Header");
|
|
|
|
|
// //给Header标签添加子节点
|
|
|
|
|
// Element sourceSystem = header.addElement("SourceSystem");
|
|
|
|
|
// Element messageId = header.addElement("MessageId");
|
|
|
|
|
// Element createTime = header.addElement("CreateTime");
|
|
|
|
|
// Element methodName = header.addElement("MethodName");
|
|
|
|
|
// //给Request标签添加子节点
|
|
|
|
|
// Element body = request.addElement("Body");
|
|
|
|
|
// //给Body标签添加子节点
|
|
|
|
|
// Element patientIdEle = body.addElement("PatientId");
|
|
|
|
|
// //给xml赋值
|
|
|
|
|
// sourceSystem.addText("CaseSys");
|
|
|
|
|
// UUID guid = UUID.randomUUID();
|
|
|
|
|
// messageId.addText(guid.toString());
|
|
|
|
|
// SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
// createTime.addText(df.format(new Date()));
|
|
|
|
|
// methodName.addText("Get360PatientId");
|
|
|
|
|
// patientIdEle.addText(patientId1);
|
|
|
|
|
// strXML = document.asXML();
|
|
|
|
|
// System.out.println("strXML:::::" + strXML);
|
|
|
|
|
// } catch (Exception e) {
|
|
|
|
|
// System.out.println("生成rssNew.xml失败");
|
|
|
|
|
// }
|
|
|
|
|
// return strXML;
|
|
|
|
|
// }
|
|
|
|
|
// /**
|
|
|
|
|
// * 获取token
|
|
|
|
|
// * @return
|
|
|
|
|
// * @throws
|
|
|
|
|
// */
|
|
|
|
|
// @RequestMapping(value="getToken")
|
|
|
|
|
// @ResponseBody
|
|
|
|
|
// public void selToken(SecureloginVo secureloginVo, HttpServletRequest request){
|
|
|
|
|
// System.out.println(secureloginVo.getKey());
|
|
|
|
|
// // 获得Http客户端
|
|
|
|
|
// CloseableHttpClient httpClient = HttpClientBuilder.create().build();
|
|
|
|
|
// // 创建Post请求
|
|
|
|
|
// HttpPost httpPost = new HttpPost("http://10.100.12.12:37727/api/account/securelogin");
|
|
|
|
|
// secureloginVo.setIDP("NSDP");
|
|
|
|
|
// secureloginVo.setSecret("Secret");
|
|
|
|
|
//// Power_User user = (Power_User)request.getSession().getAttribute("CURRENT_USER");
|
|
|
|
|
//// secureloginVo.setUserName(user.getUserName());
|
|
|
|
|
// secureloginVo.setUserName("002030");
|
|
|
|
|
// secureloginVo.setPassword("123456");
|
|
|
|
|
// secureloginVo.setScopes("openid profile cr-api roles");
|
|
|
|
|
//
|
|
|
|
|
// //json格式转换
|
|
|
|
|
// String jsonString = JSON.toJSONString(secureloginVo);
|
|
|
|
|
// StringEntity entity = new StringEntity(jsonString, "UTF-8");
|
|
|
|
|
// // post请求是将参数放在请求体里面传过去的;这里将entity放入post请求体中
|
|
|
|
|
// httpPost.setEntity(entity);
|
|
|
|
|
// httpPost.setHeader("Content-Type", "application/json;charset=utf8");
|
|
|
|
|
// // 响应模型
|
|
|
|
|
// CloseableHttpResponse response = null;
|
|
|
|
|
// try {
|
|
|
|
|
// // 由客户端执行(发送)Post请求
|
|
|
|
|
// response = httpClient.execute(httpPost);
|
|
|
|
|
// // 从响应模型中获取响应实体
|
|
|
|
|
// HttpEntity responseEntity = response.getEntity();
|
|
|
|
|
// System.out.println("responseEntity::::"+responseEntity);
|
|
|
|
|
// System.out.println("响应状态为:" + response.getStatusLine());
|
|
|
|
|
// if (responseEntity != null) {
|
|
|
|
|
// System.out.println("响应内容长度为:" + responseEntity.getContentLength());
|
|
|
|
|
// System.out.println("响应内容为:" + EntityUtils.toString(responseEntity));
|
|
|
|
|
// }
|
|
|
|
|
// } catch (ClientProtocolException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// } catch (IOException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// } finally {
|
|
|
|
|
// try {
|
|
|
|
|
// // 释放资源
|
|
|
|
|
// if (httpClient != null) {
|
|
|
|
|
// httpClient.close();
|
|
|
|
|
// }
|
|
|
|
|
// if (response != null) {
|
|
|
|
|
// response.close();
|
|
|
|
|
// }
|
|
|
|
|
// } catch (IOException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// /**
|
|
|
|
|
// * 获取二维码
|
|
|
|
|
// * @return
|
|
|
|
|
// * @throws
|
|
|
|
|
// */
|
|
|
|
|
// @RequestMapping(value="getQRcode")
|
|
|
|
|
// @ResponseBody
|
|
|
|
|
// public void getQRcode(QRcode qRcode, HttpServletRequest request) {
|
|
|
|
|
// // 获得Http客户端
|
|
|
|
|
// CloseableHttpClient httpClient = HttpClientBuilder.create().build();
|
|
|
|
|
// // 创建Post请求
|
|
|
|
|
// HttpPost httpPost = new HttpPost("https://zh.fstth.cn");
|
|
|
|
|
// qRcode.setType(3);
|
|
|
|
|
// qRcode.setProjectUid("cloudkey-fstth");
|
|
|
|
|
// qRcode.setApplicationId("fstth-wzh");
|
|
|
|
|
// //json格式转换
|
|
|
|
|
// String jsonString = JSON.toJSONString(qRcode);
|
|
|
|
|
// StringEntity entity = new StringEntity(jsonString, "UTF-8");
|
|
|
|
|
// // post请求是将参数放在请求体里面传过去的;这里将entity放入post请求体中
|
|
|
|
|
// httpPost.setEntity(entity);
|
|
|
|
|
// httpPost.setHeader("Content-Type", "application/json;charset=utf8");
|
|
|
|
|
// // 响应模型
|
|
|
|
|
// CloseableHttpResponse response = null;
|
|
|
|
|
// try {
|
|
|
|
|
// // 由客户端执行(发送)Post请求
|
|
|
|
|
// response = httpClient.execute(httpPost);
|
|
|
|
|
// // 从响应模型中获取响应实体
|
|
|
|
|
// HttpEntity responseEntity = response.getEntity();
|
|
|
|
|
// System.out.println("responseEntity::::" + responseEntity);
|
|
|
|
|
// System.out.println("响应状态为:" + response.getStatusLine());
|
|
|
|
|
// if (responseEntity != null) {
|
|
|
|
|
// System.out.println("响应内容长度为:" + responseEntity.getContentLength());
|
|
|
|
|
// System.out.println("响应内容为:" + EntityUtils.toString(responseEntity));
|
|
|
|
|
// }
|
|
|
|
|
// } catch (ClientProtocolException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// } catch (IOException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// } finally {
|
|
|
|
|
// try {
|
|
|
|
|
// // 释放资源
|
|
|
|
|
// if (httpClient != null) {
|
|
|
|
|
// httpClient.close();
|
|
|
|
|
// }
|
|
|
|
|
// if (response != null) {
|
|
|
|
|
// response.close();
|
|
|
|
|
// }
|
|
|
|
|
// } catch (IOException e) {
|
|
|
|
|
// e.printStackTrace();
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|