//package cn.hnthyy.thmz;
//
//
//import org.apache.http.HttpEntity;
//import org.apache.http.HttpResponse;
//import org.apache.http.client.HttpClient;
//import org.apache.http.client.methods.HttpPost;
//import org.apache.http.entity.StringEntity;
//import org.apache.http.impl.client.DefaultHttpClient;
//import org.apache.http.util.EntityUtils;
//import org.json.JSONException;
//import org.json.JSONObject;
//import org.junit.Test;
//import org.junit.runner.RunWith;
//import org.springframework.boot.test.context.SpringBootTest;
//import org.springframework.test.context.junit4.SpringRunner;
//
//import java.util.HashMap;
//import java.util.Map;
//
//
//@RunWith(SpringRunner.class)
//@SpringBootTest
//public class ThmzApiTests {
////    private String url = "https://localhost:8089/thmz/api/v1";
////    private String charset = "utf-8";
////    private HttpClientUtil httpClientUtil = new HttpClientUtil();
////
////    @Test
////    public void testQueryUserInfo(){
////        String httpOrgCreateTest = url + "/queryPatientInfo";
////        Map<String,String> createMap = new HashMap<>();
////        createMap.put("patIdType","11");
////        createMap.put("patIdNo","4301181199608207363");
////        String httpOrgCreateTestRtn = httpClientUtil.doPost(httpOrgCreateTest,createMap,charset);
////        System.out.println("result:"+httpOrgCreateTestRtn);
////    }
//
//    /**
//     * 定义所需的变量
//     */
//    private static HttpClient httpClient = new DefaultHttpClient();
//    private static HttpPost httppost;
//    private static HttpResponse response;
//    private HttpEntity entity;
//    private String postResult = null;
//
//   // @Test
//    public void testQueryPatientInfo() throws JSONException {
//
//        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","430181199608207363");
//
//        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 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_301_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();
//    }
//}
