|
|
@@ -82,7 +82,7 @@ public class AccountUtils {
|
|
|
* @param spaceUU 企业uu号
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
- public static void unbindUserSpace(Long userUU, Long spaceUU) throws Exception {
|
|
|
+ public static void removeUser(Long userUU, Long spaceUU) throws Exception {
|
|
|
String saveUrl = AccountConfig.getUserSaveUrl();
|
|
|
if (!StringUtils.isEmpty(saveUrl)) {
|
|
|
ModelMap formData = new ModelMap();
|
|
|
@@ -107,7 +107,7 @@ public class AccountUtils {
|
|
|
* @param spaceUU 企业uu号
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
- public static void bindUserSpace(Long userUU, Long spaceUU) throws Exception {
|
|
|
+ public static void addUser(Long userUU, Long spaceUU) throws Exception {
|
|
|
String saveUrl = AccountConfig.getUserSaveUrl();
|
|
|
if (!StringUtils.isEmpty(saveUrl)) {
|
|
|
ModelMap formData = new ModelMap();
|
|
|
@@ -131,7 +131,7 @@ public class AccountUtils {
|
|
|
* @param businessCode 营业执照号
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<UserSpaceView> findByBusinessCode(String businessCode) throws Exception {
|
|
|
+ public UserSpaceView findByBusinessCode(String businessCode) throws Exception {
|
|
|
String saveUrl = AccountConfig.getSpaceSaveUrl();
|
|
|
if (!StringUtils.isEmpty(saveUrl)) {
|
|
|
ModelMap formData = new ModelMap();
|
|
|
@@ -145,7 +145,7 @@ public class AccountUtils {
|
|
|
if (!result.isSuccess()) {
|
|
|
throw new Exception(result.getErrMsg());
|
|
|
} else if (result.getContent() != null){
|
|
|
- return JSON.parseArray(result.getContent().toString(), UserSpaceView.class);
|
|
|
+ return JSON.parseObject(result.getContent().toString(), UserSpaceView.class);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -153,11 +153,11 @@ public class AccountUtils {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 根据营业执照号获得企业信息
|
|
|
- * @param spaceName 营业执照号
|
|
|
+ * 根据企业名获得企业信息
|
|
|
+ * @param spaceName 企业名
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<UserSpaceView> findBySpaceName(String spaceName) throws Exception {
|
|
|
+ public UserSpaceView findBySpaceName(String spaceName) throws Exception {
|
|
|
String saveUrl = AccountConfig.getSpaceSaveUrl();
|
|
|
if (!StringUtils.isEmpty(saveUrl)) {
|
|
|
ModelMap formData = new ModelMap();
|
|
|
@@ -171,7 +171,7 @@ public class AccountUtils {
|
|
|
if (!result.isSuccess()) {
|
|
|
throw new Exception(result.getErrMsg());
|
|
|
} else if (result.getContent() != null){
|
|
|
- return JSON.parseArray(result.getContent().toString(), UserSpaceView.class);
|
|
|
+ return JSON.parseObject(result.getContent().toString(), UserSpaceView.class);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -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;
|
|
|
+ }
|
|
|
+
|
|
|
// /**
|
|
|
// * 商城个人账号增加企业注册
|
|
|
// *
|