소스 검색

调整websocket功能,增加危急值转发功能

hurugang 2 년 전
부모
커밋
1e0062c793
2개의 변경된 파일26개의 추가작업 그리고 1개의 파일을 삭제
  1. 24 0
      src/main/java/cn/hnthyy/thmz/webservice/impl/CriticalWebServiceImpl.java
  2. 2 1
      src/main/resources/application-prod.yml

+ 24 - 0
src/main/java/cn/hnthyy/thmz/webservice/impl/CriticalWebServiceImpl.java

@@ -1,6 +1,7 @@
 package cn.hnthyy.thmz.webservice.impl;
 
 
+import cn.hnthyy.thmz.Utils.HttpUtil;
 import cn.hnthyy.thmz.entity.his.mz.Employee;
 import cn.hnthyy.thmz.entity.his.zd.ZdDeptAll;
 import cn.hnthyy.thmz.entity.thmz.CriticalValue;
@@ -14,8 +15,10 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.json.JSONObject;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
+import java.net.URLEncoder;
 import java.util.*;
 
 @Slf4j
@@ -35,6 +38,9 @@ public class CriticalWebServiceImpl implements CriticalWebService {
     @Autowired
     private ZdDeptAllMapper zdDeptAllMapper;
 
+    @Value("${wxPayOrderServiceUrl}")
+    private String wxPayOrderServiceUrl;
+
     @Override
     public String criticalAccept(String accessToken, String msg) {
         log.info("收到危急值信息:----->" + msg + "<-------");
@@ -102,6 +108,7 @@ public class CriticalWebServiceImpl implements CriticalWebService {
         //主任医师
         String deptDirector = null;
         if (content.indexOf("住院号") > 0) {
+            senMessage(msg);
             //住院病人
             String inpatientNo = content.substring(content.indexOf("住院号") + 4, content.indexOf(",姓名"));
             if (StringUtils.isNotBlank(inpatientNo)) {
@@ -179,4 +186,21 @@ public class CriticalWebServiceImpl implements CriticalWebService {
         JSONObject jsonObj = new JSONObject(resultMap);
         return jsonObj.toString();
     }
+
+
+    /**
+     * 向住院系统推送危急值
+     * @param message
+     */
+    private void senMessage(String message){
+        if(StringUtils.isBlank(message)){
+            return;
+        }
+        try {
+            HttpUtil.sendHttpGet(wxPayOrderServiceUrl+"/criticalValue/pushMessage" + "?message=" + URLEncoder.encode(message, "UTF-8"), "utf-8", 3000);
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error("向住院系统推送危急值失败!");
+        }
+    }
 }

+ 2 - 1
src/main/resources/application-prod.yml

@@ -147,7 +147,8 @@ audioServiceUrl: "http://webhis.thyy.cn:8706/voice/textToSpeech"
 soap_url: "http://172.16.32.178:622/pushservice.asmx?wsdl"
 
 #websocket 地址前半部分
-webSocketHost: "ws://webhis.thyy.cn:81/thmz/"
+#webSocketHost: "ws://webhis.thyy.cn:81/thmz/"
+webSocketHost: "ws://172.16.32.161:81/thmz/"
 #门诊结算单地址
 mzjsdHost: http://webhis.thyy.cn:8080