From f0094b9778e6eceb4c0fc6b826246b7fdebd8928 Mon Sep 17 00:00:00 2001 From: liquanyu Date: Sat, 6 Nov 2021 11:28:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=BF=E5=BE=B7his?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lyms/hospitalapi/cdfy/CdfyHisService.java | 76 +++++++++++----------- 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/platform-operate-api/src/main/java/com/lyms/hospitalapi/cdfy/CdfyHisService.java b/platform-operate-api/src/main/java/com/lyms/hospitalapi/cdfy/CdfyHisService.java index 8dafc0d..f558a8d 100644 --- a/platform-operate-api/src/main/java/com/lyms/hospitalapi/cdfy/CdfyHisService.java +++ b/platform-operate-api/src/main/java/com/lyms/hospitalapi/cdfy/CdfyHisService.java @@ -78,24 +78,24 @@ public class CdfyHisService { String url = "http://10.0.200.2:9090/his/getCdFyIdByVcCardNo?vcCardNo="+vcCardNo; DefaultHttpClient client = new DefaultHttpClient(new PoolingClientConnectionManager()); try { - HttpPost httpPost = new HttpPost(url); - /*StringEntity se = new StringEntity(vcCardNo,"UTF-8"); - se.setContentType("text/json"); - httpPost.setEntity(se);*/ - //执行post请求 - HttpResponse respon = client.execute(httpPost); - if(respon != null && respon.getStatusLine().getStatusCode() == 200){ - String result= EntityUtils.toString(respon.getEntity()); - System.out.print(result); - // 生成 JSON 对象 - JSONObject obj = JSONObject.parseObject(result); - if(obj!=null){ - id = obj.getString("id"); - } +// HttpPost httpPost = new HttpPost(url); +// /*StringEntity se = new StringEntity(vcCardNo,"UTF-8"); +// se.setContentType("text/json"); +// httpPost.setEntity(se);*/ +// //执行post请求 +// HttpResponse respon = client.execute(httpPost); +// if(respon != null && respon.getStatusLine().getStatusCode() == 200){ +// String result= EntityUtils.toString(respon.getEntity()); +// System.out.print(result); +// // 生成 JSON 对象 +// JSONObject obj = JSONObject.parseObject(result); +// if(obj!=null){ +// id = obj.getString("id"); +// } return id == null ? vcCardNo : id; - }else{ - System.out.println("传输失败!"); - } +// }else{ +// System.out.println("传输失败!"); +// } }catch (Exception e){ ExceptionUtils.catchException(e,"承德就诊卡号获取病人id异常"); return vcCardNo; @@ -104,31 +104,33 @@ public class CdfyHisService { client.close(); } - return vcCardNo; + //return vcCardNo; } public String getIdByVcCardNo2(String vcCardNo, String phone, String cardNo){ String id = null; String url = "http://10.0.200.2:9090/his/getCdFyIdByVcCardNo2?vcCardNo="+vcCardNo+"&phone="+phone+"&cardNo="+cardNo; DefaultHttpClient client = new DefaultHttpClient(new PoolingClientConnectionManager()); try { - HttpPost httpPost = new HttpPost(url); - /*StringEntity se = new StringEntity(vcCardNo,"UTF-8"); - se.setContentType("text/json"); - httpPost.setEntity(se);*/ - //执行post请求 - HttpResponse respon = client.execute(httpPost); - if(respon != null && respon.getStatusLine().getStatusCode() == 200){ - String result= EntityUtils.toString(respon.getEntity()); - System.out.print(result); - // 生成 JSON 对象 - JSONObject obj = JSONObject.parseObject(result); - if(obj!=null){ - id = obj.getString("id"); - } - return id == null ? vcCardNo : id; - }else{ - System.out.println("传输失败!"); - } +// HttpPost httpPost = new HttpPost(url); +// /*StringEntity se = new StringEntity(vcCardNo,"UTF-8"); +// se.setContentType("text/json"); +// httpPost.setEntity(se);*/ +// //执行post请求 +// HttpResponse respon = client.execute(httpPost); +// if(respon != null && respon.getStatusLine().getStatusCode() == 200){ +// String result= EntityUtils.toString(respon.getEntity()); +// System.out.print(result); +// // 生成 JSON 对象 +// JSONObject obj = JSONObject.parseObject(result); +// if(obj!=null){ +// id = obj.getString("id"); +// } +// return id == null ? vcCardNo : id; +// }else{ +// System.out.println("传输失败!"); +// } + return id == null ? vcCardNo : id; + }catch (Exception e){ ExceptionUtils.catchException(e,"承德就诊卡号获取病人id异常"); return vcCardNo; @@ -137,7 +139,7 @@ public class CdfyHisService { client.close(); } - return vcCardNo; + //return vcCardNo; } } -- 1.8.3.1