刘韬 5 years ago
parent
commit
11369d3918

+ 4 - 11
DataFusion/src/com/zskk/control/ViewController.java

@@ -106,17 +106,10 @@ public class ViewController extends Controller {
 	
 	public void testTask2() {
 		try {
-			WeixinService wService = ServiceFactory.getService(WeixinService.class);
-			if (wService == null) {
-				renderText("kkk");
-
-			}
-			else {
-				renderText("nnn");
-
-			}
-//			String ssString = wService.requestWeixinQrcode("57f67d04ffdc4d91");
-//			renderText(ssString);
+			WeixinService wService = new WeixinService();
+			
+			String ssString = wService.requestWeixinQrcode("57f67d04ffdc4d91");
+			renderText(ssString);
 		} catch (Exception e) {
 			// TODO: handle exception
 			renderText(e.toString());

+ 4 - 6
DataFusion/src/com/zskk/service/WeixinService.java

@@ -24,16 +24,14 @@ public class WeixinService {
 	private static final String CAHR_CODE = "UTF-8";
 
 	// 获取访问TOKEN
-	private static final String WEIXIN_QRCODE = "http://wechat.pacsonline.cn/wx_patient/api/unifyGetWxQrcode?reportId=";
+	private static final String WEIXIN_QRCODE = "http://wechat.pacsonline.cn/wx_patient/api/unifyGetWxQrcode?reportId=%s";
 
 	/*
 	 * 获取用户信息
 	 */
 	public String requestWeixinQrcode(String reportid) {
-		String url = reportid;
-//		String content = doGet(url);
-		String content = "";
-
+		String url = String.format(WEIXIN_QRCODE, reportid);
+		String content = doGet(url);
 		return content;
 	}
 	
@@ -41,7 +39,7 @@ public class WeixinService {
 		StringBuilder apiLog = new StringBuilder();
 		apiLog.append(url).append("\t").append("params:").append("");
 		CloseableHttpClient client = HttpClients.custom().setConnectionManager(POOL_CM).build();
-		String content = "1"; // 返回内容
+		String content = null; // 返回内容
 		try {
 			HttpGet get = new HttpGet(url);