Pārlūkot izejas kodu

1、增加无纸化接口

liuqq 3 gadi atpakaļ
vecāks
revīzija
4b8c82bce7

+ 52 - 0
src/main/java/com/diagbot/facade/his/RecordFacade.java

@@ -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 "";
+        }
+    }
+
+
+}

+ 10 - 0
src/main/java/com/diagbot/vo/his/RecordVO.java

@@ -0,0 +1,10 @@
+package com.diagbot.vo.his;
+
+import lombok.Data;
+
+@Data
+public class RecordVO {
+    private String doctorNo;//医生工号
+    private String status;//默认为0
+    private String fileCode;//病案主键
+}

+ 12 - 0
src/main/java/com/diagbot/web/DataViewController.java

@@ -7,8 +7,10 @@ import com.diagbot.dto.RespDTO;
 import com.diagbot.dto.his.DoctorHosDTO;
 import com.diagbot.facade.his.DoctorHosFacade;
 import com.diagbot.facade.his.FeedbackHosFacade;
+import com.diagbot.facade.his.RecordFacade;
 import com.diagbot.vo.his.DoctorHosVO;
 import com.diagbot.vo.his.FeedbackHosVO;
+import com.diagbot.vo.his.RecordVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -38,6 +40,9 @@ public class DataViewController {
     @Autowired
     private FeedbackHosFacade feedbackHosFacade;
 
+    @Autowired
+    private RecordFacade recordFacade;
+
     @ApiOperation(value = "获取HIS医生信息")
     @PostMapping("/getDoctorHos")
     @SysLogger("getDoctorHos")
@@ -81,5 +86,12 @@ public class DataViewController {
         return feedbackHosFacade.statusQuery(feedbackHosVO);
     }
 
+    @ApiOperation(value = "数字化病案调阅系统")
+    @PostMapping("/getUrl")
+    @SysLogger("getUrl")
+    public RespDTO getUrl(@RequestBody RecordVO recordVO){
+        return RespDTO.onSuc(recordFacade.getUrl(recordVO));
+    }
+
 
 }