|
|
@@ -345,6 +345,13 @@ public class RoleServiceImpl extends SuperService {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+ Comparator comparator1 = new Comparator<ModularModel>() {
|
|
|
+ @Override
|
|
|
+ public int compare(ModularModel o1, ModularModel o2) {
|
|
|
+ return Integer.compare(o1.getIndex(), o2.getIndex());
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
Map<String, List<AuthModel>> maps = authModels.stream().collect(Collectors.groupingBy(AuthModel::getModularName));
|
|
|
List<ModularModel> modularModels = new ArrayList<>();
|
|
|
maps.forEach((key, val) -> {
|
|
|
@@ -356,8 +363,12 @@ public class RoleServiceImpl extends SuperService {
|
|
|
val.sort(comparator);
|
|
|
}
|
|
|
modularModel.setAuthModels(val);
|
|
|
+ if (ObjectUtils.isNotEmpty(val)) {
|
|
|
+ modularModel.setIndex(val.get(0).getIndex());
|
|
|
+ }
|
|
|
modularModels.add(modularModel);
|
|
|
});
|
|
|
+ modularModels.sort(comparator1);
|
|
|
return modularModels;
|
|
|
}
|
|
|
|
|
|
@@ -567,8 +578,7 @@ public class RoleServiceImpl extends SuperService {
|
|
|
if (ObjectUtils.isEmpty(userAccount)) {
|
|
|
return false;
|
|
|
}
|
|
|
- OrganizationUser organizationUser = organizationUserDao.findTopByOrganizationAndUser(
|
|
|
- organization, userAccount);
|
|
|
+ OrganizationUser organizationUser = organizationUserDao.findTopByOrganizationAndUser(organization, userAccount);
|
|
|
if (ObjectUtils.isEmpty(organizationUser)) {
|
|
|
return false;
|
|
|
}
|
|
|
@@ -587,8 +597,7 @@ public class RoleServiceImpl extends SuperService {
|
|
|
if (ObjectUtils.isEmpty(organization)) {
|
|
|
return false;
|
|
|
}
|
|
|
- OrganizationUser organizationUser = organizationUserDao.findTopByOrganizationAndUser(
|
|
|
- organization, userAccount);
|
|
|
+ OrganizationUser organizationUser = organizationUserDao.findTopByOrganizationAndUser(organization, userAccount);
|
|
|
if (ObjectUtils.isNotEmpty(organizationUser)) {
|
|
|
return true;
|
|
|
}
|