Browse Source

接口连接错误修改

wangmh 8 years ago
parent
commit
7b166c57ae

+ 23 - 22
sso-common/src/main/java/com/uas/sso/util/AccountUtils.java

@@ -407,7 +407,7 @@ public class AccountUtils {
     public static UserSpaceView findBySpaceUU(Long spaceUU) throws Exception {
         String url = AccountConfig.getUserSaveUrl();
         if (!StringUtils.isEmpty(url)) {
-            url = url + "/checkBusinessCode";
+            url = url + "/info/spaceUU";
             ModelMap data = new ModelMap();
             data.put("spaceUU", spaceUU);
             HttpUtil.ResponseWrap res = HttpUtil.doGet(url, data);
@@ -680,27 +680,28 @@ public class AccountUtils {
 		String enterUrl = AccountConfig.getContactPageUrl();
 		return enterUrl;
 	}
-//
-//	/**
-//	 * 通过关键词搜索企业信息
-//	 *
-//	 * @param keyword
-//	 * @return
-//	 * @throws Exception
-//	 */
-//	public static Page<UserSpaceDetail> getUserSpacesByKeyword(String keyword, int pageNumber, int pageSize) throws Exception {
-//		String Url = AccountConfig.getEnPartnersUrl();
-//		if (!StringUtils.isEmpty(Url)) {
-//			ResponseWrap res = HttpUtil.doGet(Url,
-//					new ModelMap("_operate", "getUserSpaces").addAttribute("keyword", keyword).addAttribute("pageNumber", pageNumber)
-//							.addAttribute("pageSize", pageSize));
-//			if (!res.isSuccess())
-//				throw new Exception(res.getContent());
-//			return JSON.parseObject(res.getContent(), new TypeReference<Page<UserSpaceDetail>>() {
-//			});
-//		}
-//		return null;
-//	}
+
+	/**
+	 * 通过关键词搜索企业信息
+	 *
+	 * @param keyword
+	 * @return
+	 * @throws Exception
+	 */
+	public static Page<UserSpaceView> getUserSpacesByKeyword(String keyword, int pageNumber, int pageSize) throws Exception {
+		String Url = AccountConfig.getSpaceSaveUrl();
+		if (!StringUtils.isEmpty(Url)) {
+			HttpUtil.ResponseWrap res = HttpUtil.doGet(Url,
+					new ModelMap("_operate", "getUserSpaces").addAttribute("keyword", keyword).addAttribute("pageNumber", pageNumber)
+							.addAttribute("pageSize", pageSize));
+			if (!res.isSuccess()) {
+                throw new Exception(res.getContent());
+            }
+			return JSON.parseObject(res.getContent(), new TypeReference<Page<UserSpaceView>>() {
+			});
+		}
+		return null;
+	}
 //
 //	/**
 //	 * 通过手机号搜索用户账号信息

+ 14 - 1
sso-server/src/main/java/com/uas/sso/controller/UserspaceManagerController.java

@@ -147,7 +147,7 @@ public class UserspaceManagerController extends BaseController {
 
     /**
      * 根据企业名称查询企业
-     * @param name 企业名称
+     * @param spaceName 企业名称
      * @return 企业信息
      */
     @RequestMapping(value = "/info/name", method = RequestMethod.GET)
@@ -171,6 +171,19 @@ public class UserspaceManagerController extends BaseController {
         return success(userspaceService.findByBusinessCode(businessCode));
     }
 
+    /**
+     * 根据企业名称查询企业
+     * @param spaceUU 企业营业执照号
+     * @return 企业信息
+     */
+    @RequestMapping(value = "/info/spaceUU", method = RequestMethod.GET)
+    public ModelMap findBySpaceUU(Long spaceUU) {
+        if (StringUtils.isEmpty(spaceUU)) {
+            return success();
+        }
+        return success(userspaceService.findOne(spaceUU));
+    }
+
     /**
      * 统计申请已审批和未审批数量
      * @param spaceUU 企业uu号