浏览代码

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

Conflicts:
	patient-co-figure/src/main/java/com/yihu/figure/config/SwaggerConfig.java
yeshijie 8 年之前
父节点
当前提交
9a3e49ab27

+ 0 - 21
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/guahao/GuahaoXMService.java

@ -128,27 +128,6 @@ public class GuahaoXMService implements IGuahaoService {
        return code;
    }
    private String transforDate(String time){
        if(!StringUtils.isEmpty(time)&&time.contains("/")){
            String[] date = time.split(" ");
            if(date.length==2){
                String da = date[0];
                String dat[] = da.split("/");
                if(dat.length==3){
                    time = dat[0]+"-"+trans(dat[1])+"-"+trans(dat[2])+" "+date[1];
                }
            }
        }
        return time;
    }
    public  String trans(String str){
        if(StringUtils.isEmpty(str)){
            return str;
        }
        return str.length()==1?("0"+str):str;
    }
    /**
     * 预约排班xml转列表
     */

+ 0 - 36
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/HttpClientUtil.java

@ -70,42 +70,6 @@ public class HttpClientUtil {
		return null;
	}
	public static String post(String url, List<NameValuePair> params, String chatSet,String userAgent) {
		// 创建默认的httpClient实例.
		CloseableHttpClient httpclient = HttpClients.createDefault();
		// 创建httppost
		HttpPost httppost = new HttpPost(url);
		UrlEncodedFormEntity uefEntity;
		try {
			uefEntity = new UrlEncodedFormEntity(params, chatSet);
			httppost.setEntity(uefEntity);
			httppost.setHeader("user-agent",userAgent);
			CloseableHttpResponse response = httpclient.execute(httppost);
			try {
				HttpEntity entity = response.getEntity();
				if (entity != null) {
					return EntityUtils.toString(entity, chatSet);
				}
			} finally {
				response.close();
			}
		} catch (ClientProtocolException e) {
			e.printStackTrace();
		} catch (UnsupportedEncodingException e1) {
			e1.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			// 关闭连接,释放资源
			try {
				httpclient.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return null;
	}
	/**
	 * http post调用方法
	 * @param url

+ 0 - 39
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/HttpUtil.java

@ -59,45 +59,6 @@ public class HttpUtil {
		return result;
	}
	public static String sendGet(String url, String param,String userAgent) {
		String result = "";
		BufferedReader in = null;
		try {
			String urlNameString = url + "?" + param;
			URL realUrl = new URL(urlNameString);
			// 打开和URL之间的连接
			URLConnection connection = realUrl.openConnection();
			// 设置通用的请求属性
			connection.setRequestProperty("accept", "*/*");
			connection.setRequestProperty("connection", "Keep-Alive");
			if(userAgent==null){
				connection.setRequestProperty("user-agent", "{imei:\"xxxx\"}");
			}else{
				connection.setRequestProperty("user-agent", userAgent);
			}
			// 建立实际的连接
			connection.connect();
			// 定义 BufferedReader输入流来读取URL的响应
			in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
			String line;
			while ((line = in.readLine()) != null) {
				result += line;
			}
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				if (in != null) {
					in.close();
				}
			} catch (Exception e2) {
				e2.printStackTrace();
			}
		}
		return result;
	}
	/**
	 * 向指定 URL 发送POST方法的请求
	 *

+ 8 - 0
patient-co-wlyy/src/main/webapp/WEB-INF/spring-mvc.xml

@ -77,6 +77,14 @@
	</bean>
	
	<mvc:interceptors>
		<mvc:interceptor>
	        <mvc:mapping path="/patient/**"/>
	        <bean class="com.yihu.wlyy.interceptors.PatientInterceptor"/>
	    </mvc:interceptor>
	    <mvc:interceptor>
	        <mvc:mapping path="/doctor/**"/>
	        <bean class="com.yihu.wlyy.interceptors.DoctorInterceptor"/>
	    </mvc:interceptor>
	    <mvc:interceptor>
	        <mvc:mapping path="/user/**"/>
	        <bean class="com.yihu.wlyy.interceptors.UserInterceptor"/>