|
@@ -0,0 +1,52 @@
|
|
|
+package com.diagbot.facade.his;
|
|
|
+
|
|
|
+import com.diagbot.dto.RespDTO;
|
|
|
+import com.diagbot.util.StringUtil;
|
|
|
+import com.diagbot.vo.his.RecordVO;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.apache.commons.httpclient.HttpClient;
|
|
|
+import org.apache.commons.httpclient.NameValuePair;
|
|
|
+import org.apache.commons.httpclient.methods.PostMethod;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+
|
|
|
+@Component
|
|
|
+@Slf4j
|
|
|
+public class RecordFacade {
|
|
|
+
|
|
|
+ public RespDTO getUrl(RecordVO recordVO){
|
|
|
+ String url="http://132.147.254.178/UniWebBrowser/default.aspx?id=";
|
|
|
+ String key=recordVO.getDoctorNo()+"|0|"+recordVO.getFileCode().replace("_","");
|
|
|
+ String encryString="";
|
|
|
+ if(StringUtil.isNotEmpty(key)){
|
|
|
+ encryString=encryInfo(key);
|
|
|
+ }
|
|
|
+ return RespDTO.onSuc(url+encryString);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @Description:加密信息串 PJZK|0|000066466502
|
|
|
+ * @Author:liuqq
|
|
|
+ * @time: ${DATE} ${TIME}
|
|
|
+ **/
|
|
|
+ public String encryInfo(String keyString){
|
|
|
+ try{
|
|
|
+ String url = "http://132.147.254.178/DMRWebService/DmrInfoQry.asmx/GetStrEncrypt";
|
|
|
+ PostMethod postMethod = new PostMethod(url);
|
|
|
+ postMethod.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
|
|
|
+ NameValuePair[] data = {
|
|
|
+ new NameValuePair("str", keyString),//信息串,PJZK|0|000066466502
|
|
|
+ new NameValuePair("key", "zjey_1_2_3_zjey")//秘钥,默认zjey_1_2_3_zjey
|
|
|
+ };
|
|
|
+ postMethod.setRequestBody(data);
|
|
|
+ HttpClient httpClient = new HttpClient();
|
|
|
+ httpClient.executeMethod(postMethod);
|
|
|
+ String result = postMethod.getResponseBodyAsString();
|
|
|
+ return result;
|
|
|
+ }catch (Exception e){
|
|
|
+ log.error("加密信息串异常",new Throwable());
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|