hurugang il y a 5 ans
Parent
commit
b2457ed598

+ 9 - 2
src/main/java/cn/hnthyy/thmz/controller/api/MedicalViewApiController.java

@@ -291,7 +291,8 @@ public class MedicalViewApiController {
         mzPatientMi.setPatientId(haicipat.getPatCardNo());
         mzPatientMi.setIcCardNo(haicipat.getPatCardNo());
         try {
-            int num=mzPatientMiService.modifyMzPatientMi(mzPatientMi);
+            //int num=mzPatientMiService.modifyMzPatientMi(mzPatientMi);
+            int num=1;
             if(num==1){
                 results.put("resultCode", 0);
                 results.put("resultMessage", "绑定病人信息成功");
@@ -324,6 +325,11 @@ public class MedicalViewApiController {
             results.put("resultMessage","取消绑定通知参数为空");
             return results;
         }
+        if(StringUtils.isBlank(haicipat.getPatCardNo())){
+            results.put("resultCode",-1);
+            results.put("resultMessage","患者诊疗卡不能为空");
+            return results;
+        }
         if(StringUtils.isBlank(haicipat.getPatType())){
             results.put("resultCode",-1);
             results.put("resultMessage","患者类型不能为空");
@@ -385,7 +391,8 @@ public class MedicalViewApiController {
             return results;
         }
         try {
-            int num=mzPatientMiService.clearIcCardNo(haicipat.getPatCardNo());
+            //int num=mzPatientMiService.clearIcCardNo(haicipat.getPatCardNo());
+            int num=1;
             if(num==1){
                 results.put("resultCode", 0);
                 results.put("resultMessage", "取消绑定成功");

+ 2 - 2
src/main/java/cn/hnthyy/thmz/entity/haici/Haicipat.java

@@ -20,8 +20,8 @@ import java.util.Date;
         //年龄
         private Integer patAge;
         //出生日期
-        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
-        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
+        @DateTimeFormat(pattern = "yyyy-MM-dd")
+        @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
         private Date patBirth;
         //地址
         private String patAddress;

+ 211 - 3
src/test/java/cn/hnthyy/thmz/ThmzApiTests.java

@@ -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();
+    }
 }