Sfoglia il codice sorgente

添加接口,申请企业判断错误修改

wangmh 7 anni fa
parent
commit
40f336aabb

+ 72 - 89
sso-common/src/main/java/com/uas/sso/util/AccountUtils.java

@@ -153,8 +153,8 @@ public class AccountUtils {
     }
 
     /**
-     * 根据营业执照号获得企业信息
-     * @param spaceName 营业执照号
+     * 根据企业名获得企业信息
+     * @param spaceName 企业名
      * @return
      */
     public UserSpaceView findBySpaceName(String spaceName) throws Exception {
@@ -240,7 +240,7 @@ public class AccountUtils {
     }
 
     /**
-     * 统计该企业审批记录数量
+     * 统计该企业申请记录数量
      * @param spaceUU 企业uu号
      * @return
      * @throws Exception
@@ -338,7 +338,7 @@ public class AccountUtils {
     }
 
     /**
-     * 根据用户uu号获取用户信息
+     * 根据企业uu号获取企业信息
      * @param spaceUU 企业uu号
      * @return
      * @throws Exception
@@ -827,91 +827,74 @@ public class AccountUtils {
 		}
 	}
 
-//	/**
-//	 * ERP、SAAS新开账套名称校验
-//	 *
-//	 * @param name
-//	 * @return
-//	 * @throws Exception
-//	 */
-//	public static String validName(String name) throws Exception {
-//		String result = null;
-//		String url = AccountConfig.getSpaceSaveUrl();
-//		if (!StringUtils.isEmpty(url)) {
-//			ResponseWrap res = HttpUtil.doGet(url, new ModelMap("_operate", "validName").addAttribute("name", name),
-//					50);
-//			if (!res.isSuccess())
-//				throw new Exception(res.getContent());
-//			else
-//				result = res.getContent();
-//		}
-//		return result;
-//	}
-//
-//	/**
-//	 * ERP、SAAS新开账套名称校验
-//	 *
-//	 * @param businessCode
-//	 * @return
-//	 * @throws Exception
-//	 */
-//	public static String validBusinessCode(String businessCode) throws Exception {
-//		String result = null;
-//		String url = AccountConfig.getSpaceSaveUrl();
-//		if (!StringUtils.isEmpty(url)) {
-//			ResponseWrap res = HttpUtil.doGet(url,
-//					new ModelMap("_operate", "validBusinessCode").addAttribute("businessCode", businessCode), 50);
-//			if (!res.isSuccess())
-//				throw new Exception(res.getContent());
-//			else
-//				result = res.getContent();
-//		}
-//		return result;
-//	}
-//
-//	/**
-//	 * 通过营业执照号查找 企业详细信息
-//	 *
-//	 * @param
-//	 * @return
-//	 * @throws Exception
-//	 */
-//	public static UserSpaceDetail findByBusinessCode(String businessCode) throws Exception {
-//		String result = null;
-//		String url = AccountConfig.getSpaceSaveUrl();
-//		if (!StringUtils.isEmpty(url)) {
-//			ResponseWrap res = HttpUtil.doGet(url,
-//					new ModelMap("_operate", "findByBusinessCode").addAttribute("businessCode", businessCode), 50);
-//			if (!res.isSuccess())
-//				throw new Exception(res.getContent());
-//			else
-//				result = res.getContent();
-//		}
-//		return JSON.parseObject(result,UserSpaceDetail.class);
-//	}
-//
-//	/**
-//	 * ERP、SAAS新开账套
-//	 *
-//	 * @param userSpaceDetail
-//	 * @param users
-//	 * @throws Exception
-//	 */
-//	public static String applyApp(UserSpaceDetail userSpaceDetail, List<UserDetail> users) throws Exception {
-//		String url = AccountConfig.getSpaceSaveUrl();
-//		String result = null;
-//		if (!StringUtils.isEmpty(url)) {
-//			ResponseWrap res = HttpUtil.doPost(url, new ModelMap("_operate", "registerBranchAccount")
-//							.addAttribute("detail", JSON.toJSON(userSpaceDetail))
-//							.addAttribute("userInfos", JSON.toJSON(users)));
-//			if (!res.isSuccess())
-//				throw new Exception(res.getContent());
-//			else
-//				result = res.getContent();
-//		}
-//		return result;
-//	}
-//
+	/**
+	 * ERP、SAAS新开账套名称校验
+	 *
+	 * @param name
+	 * @return
+	 * @throws Exception
+	 */
+	public static String validName(String name) throws Exception {
+		String result = null;
+		String url = AccountConfig.getSpaceSaveUrl();
+		if (!StringUtils.isEmpty(url)) {
+			HttpUtil.ResponseWrap res = HttpUtil.doGet(url, new ModelMap("_operate", "validName").addAttribute("name", name),
+					50);
+			if (!res.isSuccess()) {
+                throw new Exception(res.getContent());
+            } else {
+                result = res.getContent();
+            }
+		}
+		return result;
+	}
+
+	/**
+	 * ERP、SAAS新开账套名称校验
+	 *
+	 * @param businessCode
+	 * @return
+	 * @throws Exception
+	 */
+	public static String validBusinessCode(String businessCode) throws Exception {
+		String result = null;
+		String url = AccountConfig.getSpaceSaveUrl();
+		if (!StringUtils.isEmpty(url)) {
+			HttpUtil.ResponseWrap res = HttpUtil.doGet(url,
+					new ModelMap("_operate", "validBusinessCode").addAttribute("businessCode", businessCode), 50);
+			if (!res.isSuccess()) {
+                throw new Exception(res.getContent());
+            } else {
+                result = res.getContent();
+            }
+		}
+		return result;
+	}
+
+
+	/**
+	 * ERP、SAAS新开账套
+	 *
+	 * @param userSpaceDetail
+	 * @param users
+	 * @throws Exception
+	 */
+	public static String applyApp(UserSpaceView userSpaceDetail, List<UserView> users) throws Exception {
+		String url = AccountConfig.getSpaceSaveUrl();
+		String result = null;
+		if (!StringUtils.isEmpty(url)) {
+			HttpUtil.ResponseWrap res = HttpUtil.doPost(url, new ModelMap("_operate", "registerBranchAccount")
+							.addAttribute("detail", JSON.toJSON(userSpaceDetail))
+							.addAttribute("userInfos", JSON.toJSON(users)));
+			if (!res.isSuccess()) {
+                throw new Exception(res.getContent());
+            } else {
+                result = res.getContent();
+            }
+		}
+		return result;
+	}
+
 //	/**
 //	 * 商城个人账号增加企业注册
 //	 *

+ 1 - 1
sso-server/src/main/java/com/uas/sso/service/impl/ApplyUserSpaceServiceImpl.java

@@ -68,7 +68,7 @@ public class ApplyUserSpaceServiceImpl implements ApplyUserSpaceService {
         }
 
         // 判断是否已申请
-        List<ApplyUserSpace> applyUserSpaces = applyUserSpaceDao.findByUserUUAndSpaceUUAndStatus(user.getUserUU(), userspace.getSpaceUU(), Status.UNAUDIT.getCode());
+        List<ApplyUserSpace> applyUserSpaces = applyUserSpaceDao.findByUserUUAndSpaceUUAndStatus(user.getUserUU(), userspace.getSpaceUU(), Status.TO_BE_CERTIFIED.getCode());
         if (!CollectionUtils.isEmpty(applyUserSpaces)) {
             throw new VisibleError("你已申请该企业,请耐心等待管理员审核");
         }