diff --git a/pom.xml b/pom.xml index b7b3ee7..8cb7a66 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ 1.2.5 1.2 - 5.0.2.RELEASE + 5.0.3.RELEASE 3.2.8 1.2.2 1.6.4 diff --git a/src/main/java/com/emr/controller/FontController.java b/src/main/java/com/emr/controller/FontController.java index ae6888c..18c07f9 100644 --- a/src/main/java/com/emr/controller/FontController.java +++ b/src/main/java/com/emr/controller/FontController.java @@ -11,10 +11,7 @@ import com.emr.service.ipml.*; import com.emr.util.DateUtil; import com.emr.util.ExceptionPrintUtil; import com.emr.util.Msg; -import com.emr.vo.ArchiveFlowInfoVo; -import com.emr.vo.ArchiveOtherExtVo; -import com.emr.vo.EsbPublicVo; -import com.emr.vo.SecureloginVo; +import com.emr.vo.*; import net.sf.json.JSONObject; import org.apache.commons.lang3.StringUtils; import org.apache.cxf.endpoint.Client; @@ -897,7 +894,7 @@ public class FontController { } - /* + /* *//* *
HIS @@ -910,8 +907,8 @@ public class FontController { * */ - public static String createXml(String patientId1){ - String strXML =null; + public static String createXml(String patientId1) { + String strXML = null; try { // Document document = DocumentHelper.createDocument(); // org.dom4j.Element request = document.addElement("Request"); @@ -950,8 +947,8 @@ public class FontController { createTime.addText(df.format(new Date())); methodName.addText("Get360PatientId"); patientIdEle.addText(patientId1); - strXML = document.asXML(); - System.out.println("strXML:::::"+strXML); + strXML = document.asXML(); + System.out.println("strXML:::::" + strXML); } catch (Exception e) { System.out.println("生成rssNew.xml失败"); } @@ -1016,4 +1013,57 @@ public class FontController { } } + /** + * 获取二维码 + * @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(); + } + } + } + } diff --git a/src/main/java/com/emr/vo/QRcode.java b/src/main/java/com/emr/vo/QRcode.java new file mode 100644 index 0000000..ef8419c --- /dev/null +++ b/src/main/java/com/emr/vo/QRcode.java @@ -0,0 +1,40 @@ +package com.emr.vo; + +public class QRcode { + private int loginTypeBitValue; + private int type; + private String projectUid; + private String applicationId; + + public int getLoginTypeBitValue() { + return loginTypeBitValue; + } + + public void setLoginTypeBitValue(int loginTypeBitValue) { + this.loginTypeBitValue = loginTypeBitValue; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public String getProjectUid() { + return projectUid; + } + + public void setProjectUid(String projectUid) { + this.projectUid = projectUid; + } + + public String getApplicationId() { + return applicationId; + } + + public void setApplicationId(String applicationId) { + this.applicationId = applicationId; + } +}