Browse Source

处理APPID不可为空的BUG

zhangqiankun 3 years ago
parent
commit
f192bd3b14

+ 18 - 0
saas-account/src/main/java/com/persagy/person/controller/SaasAccountController.java

@@ -121,6 +121,24 @@ public class SaasAccountController {
     }
     
     /**
+     * 根据角色ID,查询出此角色下所有的账号信息
+     */
+    @ApiOperation(value = "查询角色账号信息")
+    @RequestMapping(value = "queryRoleAccountList")
+    public ResponseResult queryRoleAccountList(@RequestBody @Validated SaasAccountQueryVO queryVO) {
+    	if (StringUtil.isBlank(queryVO.getRoleId())) {
+    		return ResponseResultUtil.errorResult(ResponseCode.A0400.getCode(), "角色ID,不可为空");
+		}
+    	SaasAccount saasAccount = new SaasAccount();
+    	BeanUtils.copyProperties(queryVO, saasAccount);
+    	List<SaasAccount> accounts = this.saasAccountService.queryRoleAccountList(saasAccount, queryVO.getRoleId());
+    	if (CollectionUtil.isEmpty(accounts)) {
+    		return ResponseResultUtil.successResult(Lists.newArrayList(), 0L);
+		}
+    	return ResponseResultUtil.successResult(accounts, (long) accounts.size());
+    }
+    
+    /**
      * 根据账号名称获取账号信息
      */
     @ApiOperation(value = "根据账号名称获取账号信息")

+ 15 - 0
saas-account/src/main/java/com/persagy/person/controller/SaasLoginController.java

@@ -29,11 +29,13 @@ import com.persagy.log.core.util.RequestUtil;
 import com.persagy.person.config.ApplicationProperties;
 import com.persagy.person.manage.SaasRoleMenuHandler;
 import com.persagy.person.pojo.dto.SaasAccount;
+import com.persagy.person.pojo.dto.SaasGroup;
 import com.persagy.person.pojo.dto.SaasMenu;
 import com.persagy.person.pojo.vo.account.SaasAccountLoginVO;
 import com.persagy.person.pojo.vo.account.SaasAccountQueryVO;
 import com.persagy.person.pojo.vo.menu.SaasMenuQueryVO;
 import com.persagy.person.service.ISaasAccountService;
+import com.persagy.person.service.ISaasGroupService;
 import com.persagy.security.constant.CipherConstans;
 import com.persagy.security.util.BouncycastleCipher;
 import com.persagy.security.util.SecureAES;
@@ -60,6 +62,9 @@ public class SaasLoginController {
 	private ApplicationProperties properties;
 	
     @Autowired
+    private ISaasGroupService saasGroupService;
+	
+    @Autowired
     private BouncycastleCipher bouncycastleCipher;
     
 	@Autowired
@@ -105,6 +110,11 @@ public class SaasLoginController {
     	if (SaasCommonConstant.STR_STATUS_1.equals(account.getAccountBelong()) && StringUtil.isBlank(account.getGroupCode())) {
 			return ResponseResultUtil.errorResult(ResponseCode.C0341.getCode(), "业务系统账号,集团编码不可为空");
 		}
+    	// 获取集团名称
+    	if (StringUtil.isNotBlank(account.getGroupCode())) {
+    		SaasGroup saasGroup = this.saasGroupService.getOne(account.getGroupCode());
+    		account.setGroupName(saasGroup == null ? null : saasGroup.getGroupName());
+		}
     	// 更新账号登录时间,及IP
     	String address = RequestUtil.getIpAddress(request);
     	LambdaUpdateWrapper<SaasAccount> updateWrapper = new SaasAccount.Builder().createUpdateWrapper()
@@ -143,6 +153,11 @@ public class SaasLoginController {
     	if (account == null) {
     		return ResponseResultUtil.errorResult(ResponseCode.A0402.getCode(), "账号信息不存在");
 		}
+    	// 获取集团名称
+    	if (StringUtil.isNotBlank(account.getGroupCode())) {
+    		SaasGroup saasGroup = this.saasGroupService.getOne(account.getGroupCode());
+    		account.setGroupName(saasGroup == null ? null : saasGroup.getGroupName());
+		}
     	String token = this.setRedisToken(account, queryVO.getAppId(), true, true);
     	response.setHeader(CipherConstans.TOKEN_HEADER_TOKEN, token);
     	return ResponseResultUtil.successResult(account);

+ 1 - 1
saas-account/src/main/java/com/persagy/person/controller/SaasRoleController.java

@@ -195,7 +195,7 @@ public class SaasRoleController {
 		if (!SaasCommonConstant.STR_STATUS_0.equals(createVO.getRoleType())) {
 			// 非系统角色,一定存在集团编码
 			if (StringUtil.isBlank(createVO.getGroupCode())) {
-				return ResponseResultUtil.errorResult(ResponseCode.C0341.getCode(), "集团编码必须存在");
+				return ResponseResultUtil.errorResult(ResponseCode.A0400.getCode(), "集团编码必须存在");
 			}
 			// 验证集团信息是否存在
 			SaasGroup saasGroup = this.saasGroupService.getOne(createVO.getGroupCode());

+ 8 - 0
saas-account/src/main/java/com/persagy/person/mapper/SaasAccountMapper.java

@@ -29,4 +29,12 @@ public interface SaasAccountMapper extends BaseMapper<SaasAccount> {
 	 */
 	List<SaasAccount> queryAccountGroupList(@Param("account") SaasAccount saasAccount, @Param("startRow") int startRow, @Param("size") int size);
 
+    /**
+     * 根据角色ID获取,账号信息
+     * @param saasAccount
+     * @param roleId
+     * @return
+     */
+	List<SaasAccount> queryRoleAccountList(@Param("account") SaasAccount saasAccount, @Param("roleId") String roleId);
+
 }

+ 3 - 0
saas-account/src/main/java/com/persagy/person/pojo/vo/account/SaasAccountQueryVO.java

@@ -29,6 +29,9 @@ public class SaasAccountQueryVO {
 	
 	@ApiModelProperty(value = "账号ID", example = "RY56122123152")
 	private String accountId; 	// 当前账号ID
+
+	@ApiModelProperty(value = "角色ID", example = "RY56122123152")
+	private String roleId; 	// 角色ID
 	
 	@ApiModelProperty(value = "账号类型, 0-超级管理员(所有集团),1-单集团管理员(单集团),2-普通账号", example = "0")
 	private String accountType;		//账号类型, 0-超级管理员(所有集团),1-单集团管理员(单集团),2-普通账号

+ 11 - 0
saas-account/src/main/java/com/persagy/person/service/ISaasAccountService.java

@@ -1,5 +1,7 @@
 package com.persagy.person.service;
 
+import java.util.List;
+
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.persagy.common.service.ISuperService;
@@ -25,6 +27,14 @@ public interface ISaasAccountService extends ISuperService<SaasAccount> {
 	 */
 	SaasAccount getOne(String id, String groupCode, String username);
 	
+    /**
+     * 根据角色ID获取,账号信息
+     * @param saasAccount
+     * @param roleId
+     * @return
+     */
+	List<SaasAccount> queryRoleAccountList(SaasAccount saasAccount, String roleId);
+	
 	/**
 	 * 获取账号列表,此方法会关联出集团名称信息
 	 * 
@@ -63,5 +73,6 @@ public interface ISaasAccountService extends ISuperService<SaasAccount> {
      * @return
      */
     LambdaQueryWrapper<SaasAccount> getQueryWrapperByUsername(SaasAccount saasAccount);
+
 }
 

+ 6 - 0
saas-account/src/main/java/com/persagy/person/service/impl/SaasAccountServiceImpl.java

@@ -41,6 +41,11 @@ public class SaasAccountServiceImpl extends SuperServiceImpl<SaasAccountMapper,
 	}
 	
 	@Override
+	public List<SaasAccount> queryRoleAccountList(SaasAccount saasAccount, String roleId) {
+		return this.baseMapper.queryRoleAccountList(saasAccount, roleId);
+	}
+	
+	@Override
 	public Page<SaasAccount> queryAccountPageList(SaasAccount saasAccount, int page, int size) {
 		Page<SaasAccount> pageRecord = new Page<SaasAccount>();
 		int startRow = (page - 1) * size;
@@ -130,4 +135,5 @@ public class SaasAccountServiceImpl extends SuperServiceImpl<SaasAccountMapper,
                 SaasAccount::getUpdateTime, SaasAccount::getUpdateUser, SaasAccount::getRemark, SaasAccount::getValid);
         return queryWrapper;
     }
+
 }

+ 21 - 0
saas-account/src/main/resources/mapper/SaasAccountMapper.xml

@@ -57,4 +57,25 @@
 		<if test="startRow != null and size != null">LIMIT #{startRow}, #{size} </if>
 	</select>
 	
+	<select id="queryRoleAccountList" resultMap="BaseResultMap">
+		SELECT N.* FROM (SELECT DISTINCT ACCOUNT_ID FROM saas_account_role 
+		<where>
+			<if test="account.groupCode != null and account.groupCode.trim().length() != 0">AND GROUP_CODE = #{account.groupCode}</if>
+			<if test="roleId != null and roleId.trim().length() != 0">AND ROLE_ID = #{roleId}</if>
+		</where>) M JOIN (SELECT <include refid="Base_Sql_Columns"></include> FROM saas_account
+		<where>
+			<if test="account.id != null and account.id.trim().length() != 0">AND ID = #{account.id}</if>
+			<if test="account.groupCode != null and account.groupCode.trim().length() != 0">AND GROUP_CODE = #{account.groupCode}</if>
+			<if test="account.appId != null and account.appId.trim().length() != 0">AND TERMINAL LIKE CONCAT('%', #{account.appId}, '%')</if>
+			<if test="account.phoneNum != null and account.phoneNum.trim().length() != 0">AND PHONE_NUM = #{account.phoneNum}</if>
+			<if test="account.mail != null and account.mail.trim().length() != 0">AND MAIL = #{account.mail}</if>
+			<if test="account.username != null and account.username.trim().length() != 0">AND USERNAME LIKE CONCAT('%', #{account.username}, '%')</if>
+			<if test="account.accountType != null and account.accountType.trim().length() != 0">AND ACCOUNT_TYPE = #{account.accountType}</if>
+			<if test="account.accountBelong != null and account.accountBelong.trim().length() != 0">AND ACCOUNT_BELONG = #{account.accountBelong}</if>
+			<if test="account.accountSource != null and account.accountSource.trim().length() != 0">AND ACCOUNT_SOURCE = #{account.accountSource}</if>
+			<if test="account.updateUser != null and account.updateUser.trim().length() != 0">AND UPDATE_USER = #{account.updateUser}</if>
+			<if test="account.valid != null">AND VALID = #{account.valid}</if>
+		</where>) N ON M.ACCOUNT_ID = N.ID ORDER BY N.UPDATE_TIME DESC, N.ID DESC 
+	</select>
+	
 </mapper>

+ 2 - 2
saas-common/src/main/java/com/persagy/common/model/BaseUserModel.java

@@ -29,8 +29,8 @@ public class BaseUserModel {
 	@ApiModelProperty(value = "账号归属", required = true, example = "0")
 	private String accountBelong; 	// 当前账号归属
 	
-	@NotBlank(message = "应用ID,不可为空")
-	@ApiModelProperty(value = "应用ID, PC-电脑端,APP-手机应用端", example = "PC", required = true)
+	//@NotBlank(message = "应用ID,不可为空")
+	@ApiModelProperty(value = "应用ID, PC-电脑端,APP-手机应用端", example = "PC")
     private String appId;
 	
 }

+ 107 - 61
saas-doc/doc/saas_platform.md

@@ -57,10 +57,11 @@ API接口直接调用时,需先请求获取OpenId(目前为账号ID)的接口
 请求:
 
 	{
-		"appId":"PC",			//登录端,PC-电脑,APP-手机应用端,作为sql条件
+		"appId":"PC",			//登录端,PC-电脑,APP-手机应用端,必填,作为sql条件
 	    "username":"zhangsan",   //账号登录名,必填
 	    "password":"123456",    //账号密码,必填
-	    "remember":false		// 是否记住登录,true-记住,默认false
+	    "remember":false,		// 是否记住登录,true-记住,默认false,选填
+	    "auths":false			// 是否获取此账号对应的菜单权限树,true-获取,默认false,选填
 	}
 
 返回:
@@ -109,9 +110,9 @@ body:
 body:
 
 	{
-		"appId":"PC",						//登录端,PC-电脑,APP-手机应用,作为sql条件
-		"username":"zhangsan",      			//账号用户名,
-	    "accountId":"AC1372371635352403969"     //账号ID,
+		"appId":"PC",						//登录端,PC-电脑,APP-手机应用端,必填,作为sql条件
+		"username":"zhangsan",      			//账号用户名,
+	    "accountId":"AC1372371635352403969"     //账号ID,
 	}
 
 返回:
@@ -179,7 +180,7 @@ body:
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"1371370289309515777",     //当前账号ID,必填,作为sql条件
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填
 	    "groupCode":"TEST",    //集团编码,选填
@@ -220,7 +221,7 @@ body:
 请求:
 
 	{
-	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"AC1372371635352403969",     //当前账号ID,必填,作为sql条件
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填
 	    "groupCode":"TEST"    //集团编码,选填
@@ -273,7 +274,7 @@ body:
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"1371370289309515777",     //当前账号ID,必填
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填
 	    "groupCode":"TEST",    //集团编码,必填
@@ -300,7 +301,7 @@ body:
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"1371370289309515777",     //当前账号ID,必填
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填
 	    "groupCode":"TEST",    //集团编码,必填
@@ -329,7 +330,7 @@ body:
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"zhangsan",     //当前账号ID,必填
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填
 	    "groupCode":"TEST"   //集团编码,选填
@@ -433,7 +434,7 @@ body:
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"zhangsan",     //当前账号ID,必填
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填
 	    "groupCode":"TEST"   //集团编码,选填
@@ -526,7 +527,7 @@ body:
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,必填
 	    "accountId":"AC123456789",     //当前账号ID,当 isTotal 为true时,作为sql条件,否则,不做为sql条件,必填
 	    "groupCode":"TEST",   //集团编码,必填
@@ -570,7 +571,7 @@ body:
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,必填
 	    "accountId":"AC123456789",     //当前账号ID,必填,做为sql条件
 	    "groupCode":"TEST",   //集团编码,必填
@@ -614,7 +615,7 @@ body:
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,填,不做为sql条件
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,填,不做为sql条件
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,必填,不做为sql条件
 	    "accountId":"AC1372001812832444418",     //当前账号ID,必填,作为sql条件
 	    "groupCode":"TEST",   //集团编码,必填
@@ -642,7 +643,7 @@ body:
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,填,不做为sql条件
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,填,不做为sql条件
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,必填,不做为sql条件
 	    "accountId":"AC1372001812832444418",     //当前账号ID,必填,不做为sql条件
 	    "id":"AR1372001812832444418",    //区域ID,必填
@@ -670,7 +671,7 @@ body:
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,填,不做为sql条件
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,填,不做为sql条件
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,必填,不做为sql条件
 	    "accountId":"AC1372001812832444418",     //当前账号ID,必填,做为sql条件
 	    "groupCode":"TEST",   //集团编码,必填
@@ -695,7 +696,7 @@ body:
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "id":"1371367185138696194",      //主键ID,选填
 	    "accountId":"1371370289309515777",     //当前账号ID,必填,作为sql条件
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填
@@ -784,7 +785,7 @@ body:
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "id":"1371367185138696194",      //主键ID,选填
 	    "accountId":"1371370289309515777",     //当前账号ID,必填
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填
@@ -929,7 +930,7 @@ Header:Content-Type=application/json
 
 ```
 {
-    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
     "accountId":"AC1375000220760301569",     //当前账号ID,必填,作为sql条件
     "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填
     "groupCode":"PUTONG",    //集团编码,选填
@@ -1015,7 +1016,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "id":"1371367185138696194",      //主键ID,选填
 	    "accountId":"1371370289309515777",     //当前账号ID,必填,作为sql条件
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填
@@ -1061,7 +1062,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"1371370289309515777",     //当前账号ID,必填
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填
 	    "groupCode":"TEST",    //集团编码,必填
@@ -1089,7 +1090,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "id":"1371367185138696194",      //主键ID,必填
 	    "accountId":"1371370289309515777",     //当前账号ID,必填
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填
@@ -1117,7 +1118,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"AC1372371635352403969",     //当前账号ID,必填
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填
 	    "groupCode":"TEST",    //集团编码,必填
@@ -1184,6 +1185,49 @@ Header:Content-Type=application/json
 	    "respMsg": "success"
 	}
 
+### 查询角色账号信息
+
+	URL:http://develop.persagy.com/saas-platform/saas-account/account/queryRoleAccountList
+	Method:POST
+	Header:Content-Type=application/json
+
+请求:
+
+	{
+	    "groupCode":"WD",    //集团编码,必填
+	    "roleId":"RO1372505156457959327",          //角色ID,必填
+	    "valid":1         //是否可用,0-不可用,1-可用,选填
+	}
+
+返回:
+
+	{
+	    "content": [
+	        {
+	        	"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号
+	            "accountSource": "persagy",
+	            "accountType": "0",
+	            "appId": "PC",
+	            "createTime": 1615795130000,
+	            "validEndTime": 1899791706000,
+	            "groupCode": "TEST",
+	            "headPortrait": "http://127.0.0.1:8080/test.img",
+	            "id": "1371370289309515777",
+	            "mail": "18888888888@163.com",
+	            "password": "123456",
+	            "phoneNum": "18888888888",
+	            "remark": "remark",
+	            "updateTime": 1615795130000,
+	            "username": "zhangsan",
+	            "valid": 1,
+	            "validStartTime": 1615720476000
+	        }
+	    ],
+	    "count": 1,
+	    "respCode": "00000",
+	    "respMsg": "success"
+	}
+
 ### 分页查询账号信息
 
 	URL:http://develop.persagy.com/saas-platform/saas-account/account/queryAccountPageList
@@ -1256,7 +1300,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "groupCode":"TEST",    //集团编码,必填
 	    "username":"zhangsan",     //登录用户名,必填
 	}
@@ -1300,7 +1344,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "groupCode":"TEST",    //集团编码,选填
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填
 	    "username":"zhangsan",     //登录用户名,必填
@@ -1340,7 +1384,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"1371370289309515777",     //账号ID,必填
 	    "groupCode":"TEST",    //集团编码,选填
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填
@@ -1380,7 +1424,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"AC1371370289309515777",     //账号ID,必填,注意这里是关联着的账号ID,而非登录着的账号ID
 	    "groupCode":"TEST",    //集团编码,必填
 	    "appId":"PC"        //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,必填,目前不作为sql条件
@@ -1402,7 +1446,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"1371370289309515777",     //账号ID,必填
 	    "groupCode":"TEST",    //集团编码,必填
 	    "appId":"PC"        //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填,目前不作为sql条件
@@ -1424,7 +1468,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"1371370289309515777",     //账号ID,必填
 	    "groupCode":"TEST",    //集团编码,必填
 	    "appId":"PC"        //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填,目前不作为sql条件
@@ -1446,7 +1490,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"1371370289309515777",     //账号ID,必填,作为sql条件
 	    "groupCode":"TEST",    //集团编码,选填
 	    "appId":"PC",        //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填,目前不作为sql条件
@@ -1470,7 +1514,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"1371370289309515777",     //账号ID,必填,作为sql条件
 	    "groupCode":"TEST",    //集团编码,选填
 	    "appId":"PC"        //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填,目前不作为sql条件
@@ -1494,7 +1538,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 		"groupCode":"TEST",    //集团编码,选填
 		"accountId":"1371370289309515777",     //当前账号ID,必填,不做为sql条件
 	    "id":"RO1371755195843821569",            //角色ID, 选填
@@ -1542,16 +1586,18 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "id":"RO1371755195843821569",            //角色ID, 选填
 	    "accountId":"1371370289309515777",     //当前账号ID,必填,不做为sql条件
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填,不做为sql条件
 	    "roleCode":"1001",  //角色编码,选填
 	    "roleType":"0", 	// 角色类型,0-系统角色,1-业务角色,选填
+	    "roleTypes":["0"],	// 角色类型集合,选填
 	    "roleName":"测试",  //角色名称,支持模糊查询,选填
 	    "groupCode":"TEST",    //集团编码,必填
 	    "counMenu":true,   //是否统计菜单数量,true-统计,默认false
 	    "countFunction":true,   //是否统计功能点数量,true-统计,默认false
+	    "adminOrder":true,	// 是否按照超级管理员第一位,其余账号顺延的规则排序
 	    "page":1,       //分页页码,不可低于1,必填
 	    "size":10       //分页大小,不可低于1,必填
 	}
@@ -1590,7 +1636,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"1371370289309515777",     //当前账号ID,必填,不做为sql条件
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填,不做为sql条件
 		"groupCode":"TEST",         //集团编码,必填
@@ -1631,7 +1677,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"1371370289309515777",     //当前账号ID,必填,不做为sql条件
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填,不做为sql条件
 	    "groupCode":"TEST",    //集团编码,必填
@@ -1668,7 +1714,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "id":"RO1371755195843821569",          //角色ID,必填
 	    "accountId":"1371370289309515777",     //当前账号ID,必填,不做为sql条件
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填,不做为sql条件
@@ -1708,7 +1754,7 @@ Header:Content-Type=application/json
 
 	{
 	    "id":"RO1372505156457959425",        //角色ID,必填
-	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"AC1372371635352403969",     //当前账号ID,必填
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填,不做为sql条件
 	    "groupCode":"TEST"    //集团编码,选填
@@ -1732,9 +1778,9 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,填,不做为sql条件
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,填,不做为sql条件
 	    "accountId":"1371370289309515777",     //当前账号ID,必填,不做为sql条件
-	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,必填,做为sql条件
+	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,必填,做为sql条件
 	    "menuId":"ME1372505574210637825",		//菜单ID,选填
 	    "menuType":"0"		//菜单类型,0-系统菜单,1-标准业务菜单,2-IBMS菜单,必填
 	}
@@ -1836,9 +1882,9 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"1371370289309515777",     //当前账号ID,必填
-	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,必填,作为sql条件
+	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,必填
 	    "isMenu":false,		//是否仅查询出菜单树,true-是,默认false
 	    "groupCode":"TEST"    //集团编码,选填
 	    
@@ -1974,7 +2020,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"1371370289309515777",     //当前账号ID,必填
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填
 	    "parentId":"",    //上级菜单ID,选填
@@ -2005,7 +2051,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "id":"1371374894051352577",      //菜单ID,必填
 	    "accountId":"1371370289309515777",     //当前账号ID,必填
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填
@@ -2039,7 +2085,7 @@ Header:Content-Type=application/json
 
 	{
 	    "id":"ME1372505865173700610",      //菜单ID,必填
-	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"AC1372371635352403969",     //当前账号ID,必填
 	    "appId":"PC",        //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填
 	    "groupCode":"TEST"      //集团编码
@@ -2063,7 +2109,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"1371370289309515777",     //当前账号ID,必填,不做为sql条件
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填,不做为sql条件
 	    "menuId":"1371376123917754369",       //菜单ID,选填
@@ -2089,7 +2135,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,填,做为sql条件
+	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,填,做为sql条件
 	    "accountId":"1371370289309515777",     //当前账号ID,必填,不做为sql条件
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,必填,不做为sql条件
 	    "groupCode":"sybs",       //集团编码,选填
@@ -2129,7 +2175,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"1371370289309515777",     //当前账号ID,必填
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填
 	    "menuId":"1371376123917754369",       //菜单ID,必填
@@ -2157,7 +2203,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "id":"FU1371635736550330370",        //功能ID,必填
 	    "accountId":"1371370289309515777",     //当前账号ID,必填
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填
@@ -2185,7 +2231,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "id":"FU1371635736550330370",            //功能点ID,必填
 	    "accountId":"1371370289309515777",     //当前账号ID,必填
 	    "appId":"PC"         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填,不做为SQL条件
@@ -2267,7 +2313,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,填,不做为sql条件
+	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,填,不做为sql条件
 	    "accountId":"AC1374999923417702402",     //当前账号ID,必填,做为sql条件
 	    "appId":"PC",               //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填,不做为sql条件
 	    "groupCode":"QKZZ",         //集团编码,选填
@@ -2299,7 +2345,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,填,不做为sql条件
+	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,填,不做为sql条件
 	    "accountId":"AC1374999923417702402",     //当前账号ID,必填,做为sql条件
 	    "appId":"PC",               //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填,不做为sql条件
 	    "groupCode":"QKZZ",         //集团编码,必填
@@ -2323,7 +2369,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,填,不做为sql条件
+	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,填,不做为sql条件
 	    "accountId":"AC1372371635352403969",     //当前账号ID,必填,做为sql条件
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填,不做为sql条件
 	    "auths": [
@@ -2351,7 +2397,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,填,不做为sql条件
+	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,填,不做为sql条件
 	    "accountId":"AC1374999923417702402",     //当前账号ID,必填,做为sql条件
 	    "appId":"PC",               //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填,不做为sql条件
 	    "groupCode":"QKZZ",         //集团编码,选填
@@ -2377,7 +2423,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"AC1372371635352403969",     //当前账号ID,选填
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填,不做为sql条件
 	    "groupCode":"TEST",    //集团编码,选填
@@ -2411,7 +2457,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"AC1372371635352403969",     //当前账号ID,必填
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填,不做为sql条件
 	    "groupCode":"TEST",    //集团编码,必填
@@ -2434,7 +2480,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,填,做为sql条件
+	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,填,做为sql条件
 	    "accountId":"AC1375000220760301569",     //当前账号ID,必填,做为sql条件
 	    "appId":"PC",               //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填,不做为sql条件
 	    "groupCode":"03",         //集团编码,accountBelong为业务账号时,必填
@@ -2463,7 +2509,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+	    "accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"AC1372371635352403969",     //当前账号ID,必填
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填,不做为sql条件
 	    "groupCode":"TEST",    //集团编码,选填
@@ -2488,7 +2534,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"1371370289309515777",     //当前账号ID,必填,不做为sql条件
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填,不做为sql条件
 	    "groupCode":"TEST",    //集团编码,必填
@@ -2522,7 +2568,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"1371370289309515777",     //当前账号ID,必填,不做为sql条件
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填,不做为sql条件
 	    "groupCode":"TEST",    //集团编码,必填
@@ -2548,7 +2594,7 @@ Header:Content-Type=application/json
 
 	// 先删后新增,仅删除此角色下的所有菜单功能点的关联关系,并重新新增
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"1371370289309515777",     //当前账号ID,必填,不做为sql条件
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填,不做为sql条件
 	    "groupCode":"TEST",    //集团编码,必填
@@ -2581,7 +2627,7 @@ Header:Content-Type=application/json
 请求:
 
 	{
-		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
+		"accountBelong":"0",		//账号所属, 0-运维系统账号,1-业务账号,
 	    "accountId":"1371370289309515777",     //当前账号ID,必填,不做为sql条件
 	    "appId":"PC",         //应用ID, PC-电脑端,APP-手机应用端,BIM-BIM平台,,必填,不做为sql条件
 	    "groupCode":"TEST",    //集团编码,必填

+ 1 - 1
saas-doc/sql/saas_platform.sql

@@ -11,7 +11,7 @@ DROP TABLE IF EXISTS `saas_account`;
 CREATE TABLE `saas_account` (
   `ID` varchar(64) NOT NULL,
   `GROUP_CODE` varchar(20) DEFAULT NULL COMMENT '集团编码',
-  `APP_ID` varchar(64) DEFAULT NULL COMMENT '应用ID, PC-电脑端,APP-手机端',
+  `TERMINAL` varchar(100) DEFAULT NULL COMMENT '应用ID, PC-电脑端,APP-手机端',
   `USERNAME` varchar(50) DEFAULT NULL COMMENT '登录用户名,集团下唯一,业务保证',
   `PASSWORD` varchar(128) DEFAULT NULL COMMENT '登录密码',
   `PHONE_NUM` varchar(20) DEFAULT NULL COMMENT '手机号',