Commit 16f84a2829dc5d5802ad72b158ea6b9077e1c029

Authored by liquanyu
1 parent 10ef424104

update code

Showing 2 changed files with 34 additions and 33 deletions

platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CouponPrintController.java View file @ 16f84a2
... ... @@ -218,6 +218,15 @@
218 218 return objectResponse;
219 219 }
220 220  
  221 + /**
  222 + * 判断秦皇岛是否存在优惠劵
  223 + */
  224 + if (HospitalCouponPrintUtils.isExistCoupon(code))
  225 + {
  226 + return RespBuilder.buildErro(ResponseCode.COUPON_IS_USERD);
  227 + }
  228 +
  229 +
221 230 PatientsQuery patientsQuery = new PatientsQuery();
222 231 patientsQuery.setPid(couponInfo.get("pId"));
223 232 patientsQuery.setYn(YnEnums.YES.getId());
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/HospitalCouponPrintUtils.java View file @ 16f84a2
... ... @@ -62,39 +62,6 @@
62 62 String result = HttpClientUtil.doPost(DJQ_URL, params, "UTF-8");
63 63 System.out.println("result== "+result);
64 64 return result;
65   -
66   -// String s2=null;
67   -// String result1=null;
68   -// try {
69   -// final String CONTENT_TYPE_TEXT_JSON = "text/json";
70   -// DefaultHttpClient client = new DefaultHttpClient(
71   -// new PoolingClientConnectionManager());
72   -// String url = DJQ_URL;
73   -// String js = "KLX=" + KLX + "&KH=" + KH + "&FKYY=" + FKYY + "&FKR=" + FKR + "&LKR=" + LKR + "&FKSJ=" + FKSJ+"&BZ="+BZ+"&JSFS="+JSFS+"&KMJE="+KMJE+"&XSJE="+XSJE+"&XSJE="+XSJE+"&CZZKL="+CZZKL+"&YE="+YE;
74   -// HttpPost httpPost = new HttpPost(url);
75   -// httpPost.setHeader("Content-Type", "application/text;charset=UTF-8");
76   -// StringEntity se = new StringEntity(js);
77   -// se.setContentType(CONTENT_TYPE_TEXT_JSON);
78   -// httpPost.setEntity(se);
79   -// CloseableHttpResponse response2 = null;
80   -// response2 = client.execute(httpPost);
81   -// HttpEntity entity2 = null;
82   -// entity2 = response2.getEntity();
83   -// s2= EntityUtils.toString(entity2, "UTF-8");
84   -//
85   -//
86   -//
87   -// }catch (Exception e){
88   -// e.printStackTrace();
89   -// }
90   -// if(s2!=null){
91   -// result1="{\"success\":\"1\",\"message\":\"成功\"}";
92   -// return result1;
93   -// }else {
94   -// result1="{\"success\":\"0\",\"message\":\"数据库插入失败\"}";
95   -// return result1;
96   -// }
97   -
98 65 }
99 66  
100 67  
... ... @@ -108,6 +75,31 @@
108 75 String result = HttpClientUtil.doPost("http://localhost:9090/his/insertQhdfycjDjq", json, "utf-8");
109 76 System.out.println("result= "+result);
110 77 return result;
  78 + }
  79 +
  80 +
  81 + /**
  82 + * 是否存在优惠劵
  83 + * @param code
  84 + * @return
  85 + */
  86 + public static boolean isExistCoupon(String code){
  87 + try {
  88 + Map<String,String> param = new HashMap<>();
  89 + param.put("code", code);
  90 + String result = com.lyms.platform.common.utils.HttpClientUtil.doGet("http://localhost:9090/his/queryCouponByCode", param, "utf-8",null);
  91 + System.out.println("result= "+result);
  92 + if ("0".equals(result))
  93 + {
  94 + return true;
  95 + }
  96 + }
  97 + catch (Exception e)
  98 + {
  99 + return true;
  100 + }
  101 + return false;
  102 +
111 103 }
112 104 }