Browse Source

超时drg

xiaochan 2 years ago
parent
commit
4ed51cb2be

+ 3 - 1
src/main/java/thyyxxk/webserver/service/externalhttp/DrgWebServices.java

@@ -1,6 +1,7 @@
 package thyyxxk.webserver.service.externalhttp;
 
 import com.alibaba.fastjson.JSONObject;
+import com.dtflys.forest.annotation.BaseRequest;
 import com.dtflys.forest.annotation.JSONBody;
 import com.dtflys.forest.annotation.Post;
 import thyyxxk.webserver.entity.vo.DrgGroupTestVO;
@@ -10,6 +11,7 @@ import thyyxxk.webserver.entity.vo.DrgGroupTestVO;
  * @Date: 2022/12/8
  * @Description:
  */
+@BaseRequest(timeout = 5000)
 public interface DrgWebServices {
 
     @Post(url = "http://172.16.32.126:8080/drg_web/localHelp/drg_dagns/list.action")
@@ -21,7 +23,7 @@ public interface DrgWebServices {
     @Post(url = "http://172.16.32.126:8082/etlClient/callHisData.action", async = true)
     void etlClient(@JSONBody JSONObject obj);
 
-    @Post(url = "http://172.16.32.126:8080/drg_web/drgGroupThird/getAllDrgResults.action", timeout = 3000)
+    @Post(url = "http://172.16.32.126:8080/drg_web/drgGroupThird/getAllDrgResults.action")
     JSONObject getDrgCaseQualityControlGroup(@JSONBody JSONObject obj);
 
 }

+ 8 - 1
src/main/java/thyyxxk/webserver/service/inpatient/DismissService.java

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.client.SimpleClientHttpRequestFactory;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.client.RestTemplate;
@@ -55,7 +56,13 @@ public class DismissService {
         params.put("hospital_id", SiUtil.INSTITUTION_ID);
         params.put("scene_type", "6");
         params.put("visit_id", visitId);
-        JSONObject response = new RestTemplate().postForObject(url, params, JSONObject.class);
+
+
+        SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
+        requestFactory.setConnectTimeout(5000);
+        requestFactory.setReadTimeout(5000);
+
+        JSONObject response = new RestTemplate(requestFactory).postForObject(url, params, JSONObject.class);
         log.info("创智出院预审:【{}】,【{}】", visitId, response);
         if (null == response) {
             return ResultVoUtil.success();