|
@@ -41,7 +41,7 @@ public class AuthorizeServiceImpl implements IAuthorizeService {
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|
|
|
- public Result saveAccountGroup(String accountId, String groupIds) {
|
|
|
+ public Result saveAccountGroup(Integer accountId, Integer groupIds) {
|
|
|
/**
|
|
|
* Step1:先删除原先的账号关联权限组数据;
|
|
|
* Step2:再添加新的账号关联权限组数据;
|
|
@@ -51,18 +51,13 @@ public class AuthorizeServiceImpl implements IAuthorizeService {
|
|
|
accountGroupMapper.removeAccountGroup(groupIds);
|
|
|
return new Result(10000, "保存账号关联权限组成功", true);
|
|
|
}else {
|
|
|
- String[] groupIdArray = accountId.split(",");
|
|
|
+
|
|
|
accountGroupMapper.removeAccountGroup(accountId);
|
|
|
-// for (int a = 0; a < groupIdArray.length; a++) {
|
|
|
-// accountGroupMapper.removeAccountGroup(accountId,groupIdArray[a]);
|
|
|
-// }
|
|
|
- for (int a = 0; a < groupIdArray.length; a++) {
|
|
|
- AccountGroup accountGroupEntity = new AccountGroup();
|
|
|
- accountGroupEntity.setAccountId(Integer.parseInt(groupIdArray[a]));
|
|
|
- accountGroupEntity.setGroupId(Integer.parseInt(groupIds));
|
|
|
- accountGroupMapper.insert(accountGroupEntity);
|
|
|
-// accountGroupMapper.insert(Integer.parseInt(accountId),Integer.parseInt(groupIdArray[a]));
|
|
|
- }
|
|
|
+ AccountGroup accountGroupEntity = new AccountGroup();
|
|
|
+ accountGroupEntity.setAccountId(accountId);
|
|
|
+ accountGroupEntity.setGroupId(groupIds);
|
|
|
+ accountGroupMapper.insert(accountGroupEntity);
|
|
|
+
|
|
|
return new Result(10000, "保存账号关联权限组成功", true);
|
|
|
}
|
|
|
|