|
@@ -45,14 +45,15 @@ public class ThmzApiTests {
|
|
|
private HttpEntity entity;
|
|
|
private String postResult = null;
|
|
|
|
|
|
- public static void main(String[] args) throws JSONException {
|
|
|
+ @Test
|
|
|
+ public void testQueryPatientInfo() throws JSONException {
|
|
|
|
|
|
- String loginURL = "https://172.16.30.33:8089/thmz/api/v1";
|
|
|
+ String loginURL = "http://172.16.30.33:8089/thmz/api/v1/queryPatientInfo";
|
|
|
// 创建一个httppost请求
|
|
|
httppost = new HttpPost(loginURL);
|
|
|
JSONObject jsonParam = new JSONObject();
|
|
|
jsonParam.put("patIdType", "11");
|
|
|
- jsonParam.put("patIdNo","4301181199608207363");
|
|
|
+ jsonParam.put("patIdNo","430181199608207363");
|
|
|
|
|
|
try {
|
|
|
|
|
@@ -72,4 +73,211 @@ public class ThmzApiTests {
|
|
|
httppost.releaseConnection();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void testsave() throws JSONException {
|
|
|
+
|
|
|
+ String loginURL = "http://172.16.30.33:8089/thmz/api/v1/savePatientInfo";
|
|
|
+ // 创建一个httppost请求
|
|
|
+ httppost = new HttpPost(loginURL);
|
|
|
+ JSONObject jsonParam = new JSONObject();
|
|
|
+ jsonParam.put("patType", "1");
|
|
|
+ jsonParam.put("patName","刘阳");
|
|
|
+ jsonParam.put("patSex", "F");
|
|
|
+ jsonParam.put("patAge","25");
|
|
|
+ jsonParam.put("patBirth", "1996-08-20");
|
|
|
+ jsonParam.put("patAddress","湖南长沙浏阳");
|
|
|
+ jsonParam.put("patMobile", "19908495280");
|
|
|
+ jsonParam.put("patIdType", "1");
|
|
|
+ jsonParam.put("patIdNo","512501197203035172");
|
|
|
+ try {
|
|
|
+
|
|
|
+ StringEntity entity = new StringEntity(jsonParam.toString(), "utf-8");// 解决中文乱码问题
|
|
|
+ entity.setContentEncoding("UTF-8");
|
|
|
+ entity.setContentType("application/json");
|
|
|
+ httppost.setEntity(entity);
|
|
|
+ response = httpClient.execute(httppost);
|
|
|
+ String strResult = EntityUtils.toString(response.getEntity());
|
|
|
+ System.out.println("查看返回的结果:" + strResult);
|
|
|
+
|
|
|
+
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ httppost.releaseConnection();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void testCancel() throws JSONException {
|
|
|
+
|
|
|
+ String loginURL = "http://172.16.30.33:8089/thmz/api/v1/cancelBoundPatCardNoInfo";
|
|
|
+ // 创建一个httppost请求
|
|
|
+ httppost = new HttpPost(loginURL);
|
|
|
+ JSONObject jsonParam = new JSONObject();
|
|
|
+ jsonParam.put("patType", "1");
|
|
|
+ jsonParam.put("patName","刘阳");
|
|
|
+ jsonParam.put("patSex", "F");
|
|
|
+ jsonParam.put("patAge","25");
|
|
|
+ jsonParam.put("patBirth", "1996-08-20");
|
|
|
+ jsonParam.put("patAddress","湖南长沙浏阳");
|
|
|
+ jsonParam.put("patMobile", "19908495280");
|
|
|
+ jsonParam.put("patIdType", "1");
|
|
|
+ jsonParam.put("patIdNo","512501197203035172");
|
|
|
+ jsonParam.put("patCardNo","388894-4");
|
|
|
+ try {
|
|
|
+ StringEntity entity = new StringEntity(jsonParam.toString(), "utf-8");// 解决中文乱码问题
|
|
|
+ entity.setContentEncoding("UTF-8");
|
|
|
+ entity.setContentType("application/json");
|
|
|
+ httppost.setEntity(entity);
|
|
|
+ response = httpClient.execute(httppost);
|
|
|
+ String strResult = EntityUtils.toString(response.getEntity());
|
|
|
+ System.out.println("查看返回的结果:" + strResult);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ httppost.releaseConnection();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void testBoundPatCardNoInfo() throws JSONException {
|
|
|
+
|
|
|
+ String loginURL = "http://172.16.30.33:8089/thmz/api/v1/boundPatCardNoInfo";
|
|
|
+ // 创建一个httppost请求
|
|
|
+ httppost = new HttpPost(loginURL);
|
|
|
+ JSONObject jsonParam = new JSONObject();
|
|
|
+ jsonParam.put("patType", "1");
|
|
|
+ jsonParam.put("patName","刘阳");
|
|
|
+ jsonParam.put("patSex", "F");
|
|
|
+ jsonParam.put("patAge","25");
|
|
|
+ jsonParam.put("patBirth", "1996-08-20");
|
|
|
+ jsonParam.put("patAddress","湖南长沙浏阳");
|
|
|
+ jsonParam.put("patMobile", "19908495280");
|
|
|
+ jsonParam.put("patIdType", "1");
|
|
|
+ jsonParam.put("patIdNo","512501197203035172");
|
|
|
+ jsonParam.put("patCardNo","388894-4");
|
|
|
+ try {
|
|
|
+ StringEntity entity = new StringEntity(jsonParam.toString(), "utf-8");// 解决中文乱码问题
|
|
|
+ entity.setContentEncoding("UTF-8");
|
|
|
+ entity.setContentType("application/json");
|
|
|
+ httppost.setEntity(entity);
|
|
|
+ response = httpClient.execute(httppost);
|
|
|
+ String strResult = EntityUtils.toString(response.getEntity());
|
|
|
+ System.out.println("查看返回的结果:" + strResult);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ httppost.releaseConnection();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void getMzChargeDetailForUnPaid() throws JSONException {
|
|
|
+
|
|
|
+ String loginURL = "http://172.16.30.33:8089/thmz/api/v1/getMzChargeDetailForUnPaid";
|
|
|
+ // 创建一个httppost请求
|
|
|
+ httppost = new HttpPost(loginURL);
|
|
|
+ JSONObject jsonParam = new JSONObject();
|
|
|
+ jsonParam.put("patCardType", "1");
|
|
|
+ jsonParam.put("patCardNo","00263311");
|
|
|
+ try {
|
|
|
+ StringEntity entity = new StringEntity(jsonParam.toString(), "utf-8");// 解决中文乱码问题
|
|
|
+ entity.setContentEncoding("UTF-8");
|
|
|
+ entity.setContentType("application/json");
|
|
|
+ httppost.setEntity(entity);
|
|
|
+ response = httpClient.execute(httppost);
|
|
|
+ String strResult = EntityUtils.toString(response.getEntity());
|
|
|
+ System.out.println("查看返回的结果:" + strResult);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ httppost.releaseConnection();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void getChargeDetailByHisOrdNum() throws JSONException {
|
|
|
+
|
|
|
+ String loginURL = "http://172.16.30.33:8089/thmz/api/v1/getChargeDetailByHisOrdNum";
|
|
|
+ // 创建一个httppost请求
|
|
|
+ httppost = new HttpPost(loginURL);
|
|
|
+ JSONObject jsonParam = new JSONObject();
|
|
|
+ jsonParam.put("patCardType", "1");
|
|
|
+ jsonParam.put("patCardNo","00263311");
|
|
|
+ jsonParam.put("hisOrdNum","290509-4_843_1");
|
|
|
+ try {
|
|
|
+ StringEntity entity = new StringEntity(jsonParam.toString(), "utf-8");// 解决中文乱码问题
|
|
|
+ entity.setContentEncoding("UTF-8");
|
|
|
+ entity.setContentType("application/json");
|
|
|
+ httppost.setEntity(entity);
|
|
|
+ response = httpClient.execute(httppost);
|
|
|
+ String strResult = EntityUtils.toString(response.getEntity());
|
|
|
+ System.out.println("查看返回的结果:" + strResult);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ httppost.releaseConnection();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void payChargeDetailFormHaiCi() throws JSONException {
|
|
|
+
|
|
|
+ String loginURL = "http://172.16.30.33:8089/thmz/api/v1/payChargeDetailFormHaiCi";
|
|
|
+ // 创建一个httppost请求
|
|
|
+ httppost = new HttpPost(loginURL);
|
|
|
+ JSONObject jsonParam = new JSONObject();
|
|
|
+ jsonParam.put("patCardType", "1");
|
|
|
+ jsonParam.put("patCardNo","00263311");
|
|
|
+ jsonParam.put("hisOrdNum","290509-4_843_1");
|
|
|
+ jsonParam.put("psOrdNum", "1111111115555566666666666");
|
|
|
+ jsonParam.put("payMode","WX");
|
|
|
+ jsonParam.put("payAmt","84560");
|
|
|
+ jsonParam.put("agtOrdNum", "25555665544554471");
|
|
|
+ jsonParam.put("payTime","2020-02-18 15:22:26");
|
|
|
+ try {
|
|
|
+ StringEntity entity = new StringEntity(jsonParam.toString(), "utf-8");// 解决中文乱码问题
|
|
|
+ entity.setContentEncoding("UTF-8");
|
|
|
+ entity.setContentType("application/json");
|
|
|
+ httppost.setEntity(entity);
|
|
|
+ response = httpClient.execute(httppost);
|
|
|
+ String strResult = EntityUtils.toString(response.getEntity());
|
|
|
+ System.out.println("查看返回的结果:" + strResult);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ httppost.releaseConnection();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void getPayStatus() throws JSONException {
|
|
|
+
|
|
|
+ String loginURL = "http://172.16.30.33:8089/thmz/api/v1/getPayStatus";
|
|
|
+ // 创建一个httppost请求
|
|
|
+ httppost = new HttpPost(loginURL);
|
|
|
+ JSONObject jsonParam = new JSONObject();
|
|
|
+ jsonParam.put("hisOrdNum","290509-4_844_1");
|
|
|
+ jsonParam.put("psOrdNum", "1111111115555566666666626");
|
|
|
+ jsonParam.put("payMode","WX");
|
|
|
+ jsonParam.put("payAmt","84560");
|
|
|
+ jsonParam.put("agtOrdNum", "25555665544554411");
|
|
|
+ jsonParam.put("payTime","2020-02-18 15:22:26");
|
|
|
+ try {
|
|
|
+ StringEntity entity = new StringEntity(jsonParam.toString(), "utf-8");// 解决中文乱码问题
|
|
|
+ entity.setContentEncoding("UTF-8");
|
|
|
+ entity.setContentType("application/json");
|
|
|
+ httppost.setEntity(entity);
|
|
|
+ response = httpClient.execute(httppost);
|
|
|
+ String strResult = EntityUtils.toString(response.getEntity());
|
|
|
+ System.out.println("查看返回的结果:" + strResult);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ httppost.releaseConnection();
|
|
|
+ }
|
|
|
}
|