Commit 2237c945ad55e7c5e5a2f55fb6468ac3a7cc262a
1 parent
0a7f6652a1
Exists in
master
and in
6 other branches
update
Showing 2 changed files with 55 additions and 31 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CouponPrintController.java
View file @
2237c94
| ... | ... | @@ -43,6 +43,7 @@ |
| 43 | 43 | @ResponseBody |
| 44 | 44 | @TokenRequired |
| 45 | 45 | public BaseObjectResponse printTrigger(HttpServletRequest request) { |
| 46 | + System.out.println("hospitalId="+request.getParameter("hospitalId")+" ;patientUserId="+request.getParameter("patientUserId")); | |
| 46 | 47 | if(shanDong_DeZhou_fuYou_hopitalId.equals(request.getParameter("hospitalId"))){//山东德州妇幼 |
| 47 | 48 | Patients patient = patientsService.findOnePatientById(request.getParameter("patientUserId")); |
| 48 | 49 | String area = request.getParameter("area"); |
| 49 | 50 | |
| ... | ... | @@ -58,10 +59,11 @@ |
| 58 | 59 | Integer CZZKL =100;//充值折扣率 |
| 59 | 60 | Integer YE = KMJE;//余额 |
| 60 | 61 | String result = HospitalCouponPrintUtils.getDZdjq(cardType, cardNum, sendReason, sendPersonName, patientUserName, DateUtil.getyyyy_MM_dd(new Date()),remark, JSFS, KMJE, XSJE, CZZKL, YE); |
| 61 | - if("调用程序出错".equals(result)){ | |
| 62 | - return RespBuilder.buildErro(ResponseCode.ERROR); | |
| 62 | + System.out.println("result="+result); | |
| 63 | + if("0".equals(result)){ | |
| 64 | + return RespBuilder.buildErro(ResponseCode.SUCCESS); | |
| 63 | 65 | }else{ |
| 64 | - return RespBuilder.buildErro(ResponseCode.SUCCESS); | |
| 66 | + return RespBuilder.buildErro(ResponseCode.ERROR); | |
| 65 | 67 | } |
| 66 | 68 | }else{ |
| 67 | 69 | return RespBuilder.buildErro(ResponseCode.SUCCESS); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/HospitalCouponPrintUtils.java
View file @
2237c94
| ... | ... | @@ -10,6 +10,9 @@ |
| 10 | 10 | |
| 11 | 11 | import com.lyms.platform.common.utils.PropertiesUtils; |
| 12 | 12 | |
| 13 | +import java.util.HashMap; | |
| 14 | +import java.util.Map; | |
| 15 | + | |
| 13 | 16 | /** |
| 14 | 17 | * Created by Administrator on 2017/5/16. |
| 15 | 18 | */ |
| 16 | 19 | |
| 17 | 20 | |
| 18 | 21 | |
| ... | ... | @@ -35,37 +38,56 @@ |
| 35 | 38 | * @return |
| 36 | 39 | */ |
| 37 | 40 | public static String getDZdjq(String KLX,String KH,String FKYY,String FKR,String LKR,String FKSJ,String BZ,String JSFS,Integer KMJE,Integer XSJE,Integer CZZKL,Integer YE){ |
| 38 | - String s2=null; | |
| 39 | - String result1=null; | |
| 40 | - try { | |
| 41 | - final String CONTENT_TYPE_TEXT_JSON = "text/json"; | |
| 42 | - DefaultHttpClient client = new DefaultHttpClient( | |
| 43 | - new PoolingClientConnectionManager()); | |
| 44 | - String url = DJQ_URL; | |
| 45 | - 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; | |
| 46 | - HttpPost httpPost = new HttpPost(url); | |
| 47 | - httpPost.setHeader("Content-Type", "application/text;charset=UTF-8"); | |
| 48 | - StringEntity se = new StringEntity(js); | |
| 49 | - se.setContentType(CONTENT_TYPE_TEXT_JSON); | |
| 50 | - httpPost.setEntity(se); | |
| 51 | - CloseableHttpResponse response2 = null; | |
| 52 | - response2 = client.execute(httpPost); | |
| 53 | - HttpEntity entity2 = null; | |
| 54 | - entity2 = response2.getEntity(); | |
| 55 | - s2= EntityUtils.toString(entity2, "UTF-8"); | |
| 56 | 41 | |
| 42 | + Map<String,String> params = new HashMap<>(); | |
| 43 | + params.put("KLX",KLX); | |
| 44 | + params.put("KH",KH); | |
| 45 | + params.put("FKYY",FKYY); | |
| 46 | + params.put("FKR",FKR); | |
| 47 | + params.put("LKR",LKR); | |
| 48 | + params.put("FKSJ",FKSJ); | |
| 49 | + params.put("BZ",BZ); | |
| 50 | + params.put("JSFS",JSFS); | |
| 51 | + params.put("KMJE",KMJE.toString()); | |
| 52 | + params.put("XSJE",XSJE.toString()); | |
| 53 | + params.put("CZZKL",CZZKL.toString()); | |
| 54 | + params.put("YE",YE.toString()); | |
| 57 | 55 | |
| 56 | + String result = HttpClientUtil.doPost(DJQ_URL, params, "UTF-8"); | |
| 57 | + System.out.println("result== "+result); | |
| 58 | + return result; | |
| 58 | 59 | |
| 59 | - }catch (Exception e){ | |
| 60 | - e.printStackTrace(); | |
| 61 | - } | |
| 62 | - if(s2!=null){ | |
| 63 | - result1="{\"success\":\"1\",\"message\":\"成功\"}"; | |
| 64 | - return result1; | |
| 65 | - }else { | |
| 66 | - result1="{\"success\":\"0\",\"message\":\"数据库插入失败\"}"; | |
| 67 | - return result1; | |
| 68 | - } | |
| 60 | +// String s2=null; | |
| 61 | +// String result1=null; | |
| 62 | +// try { | |
| 63 | +// final String CONTENT_TYPE_TEXT_JSON = "text/json"; | |
| 64 | +// DefaultHttpClient client = new DefaultHttpClient( | |
| 65 | +// new PoolingClientConnectionManager()); | |
| 66 | +// String url = DJQ_URL; | |
| 67 | +// 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; | |
| 68 | +// HttpPost httpPost = new HttpPost(url); | |
| 69 | +// httpPost.setHeader("Content-Type", "application/text;charset=UTF-8"); | |
| 70 | +// StringEntity se = new StringEntity(js); | |
| 71 | +// se.setContentType(CONTENT_TYPE_TEXT_JSON); | |
| 72 | +// httpPost.setEntity(se); | |
| 73 | +// CloseableHttpResponse response2 = null; | |
| 74 | +// response2 = client.execute(httpPost); | |
| 75 | +// HttpEntity entity2 = null; | |
| 76 | +// entity2 = response2.getEntity(); | |
| 77 | +// s2= EntityUtils.toString(entity2, "UTF-8"); | |
| 78 | +// | |
| 79 | +// | |
| 80 | +// | |
| 81 | +// }catch (Exception e){ | |
| 82 | +// e.printStackTrace(); | |
| 83 | +// } | |
| 84 | +// if(s2!=null){ | |
| 85 | +// result1="{\"success\":\"1\",\"message\":\"成功\"}"; | |
| 86 | +// return result1; | |
| 87 | +// }else { | |
| 88 | +// result1="{\"success\":\"0\",\"message\":\"数据库插入失败\"}"; | |
| 89 | +// return result1; | |
| 90 | +// } | |
| 69 | 91 | |
| 70 | 92 | } |
| 71 | 93 |