diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/HospitalCouponPrintUtils.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/HospitalCouponPrintUtils.java new file mode 100644 index 0000000..d765f36 --- /dev/null +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/HospitalCouponPrintUtils.java @@ -0,0 +1,58 @@ +package com.lyms.platform.operate.web.utils; + +import com.lyms.platform.common.utils.PropertiesUtils; +import org.apache.http.HttpEntity; +import org.apache.http.NameValuePair; +import org.apache.http.client.HttpClient; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.impl.conn.PoolingClientConnectionManager; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * Created by Administrator on 2017/5/16. + */ +public class HospitalCouponPrintUtils { + + public static final String DJQ_URL = PropertiesUtils.getPropertyValue("djq_url"); + + 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){ + String s2=null; + try { + final String CONTENT_TYPE_TEXT_JSON = "text/json"; + DefaultHttpClient client = new DefaultHttpClient( + new PoolingClientConnectionManager()); + String url = DJQ_URL; + 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; + HttpPost httpPost = new HttpPost(url); + httpPost.setHeader("Content-Type", "application/text;charset=UTF-8"); + StringEntity se = new StringEntity(js); + se.setContentType(CONTENT_TYPE_TEXT_JSON); + httpPost.setEntity(se); + CloseableHttpResponse response2 = null; + response2 = client.execute(httpPost); + HttpEntity entity2 = null; + entity2 = response2.getEntity(); + s2= EntityUtils.toString(entity2, "UTF-8"); + + + + }catch (Exception e){ + e.printStackTrace(); + } + if(s2!=null){ + return s2; + }else + return "调用程序出错"; + + } + +} diff --git a/platform-operate-api/src/main/resources/config.properties b/platform-operate-api/src/main/resources/config.properties index 12eb325..e859665 100644 --- a/platform-operate-api/src/main/resources/config.properties +++ b/platform-operate-api/src/main/resources/config.properties @@ -2,6 +2,9 @@ #center_base_url=http://sms.healthbaby.com.cn/v1/ center_base_url=http://sms.api.stage.platform.healthbaby.com.cn/v1/ +#德州代金券地址 +djq_url= + #区域平台访问短信中心的token center_token=e0c56363-00d6-42ee-bbe0-23c553583062 @@ -70,4 +73,4 @@ jdbc.6.password=Welcome1 remote.url.type=1 platform.operate.api.1.url=http://localhost:9091/ platform.operate.api.2.url=https://dev-rp.healthbaby.com.cn/ -platform.operate.api.3.url=https://dev-rp.healthbaby.com.cn/ \ No newline at end of file +platform.operate.api.3.url=https://dev-rp.healthbaby.com.cn/