|
@@ -38,19 +38,24 @@ public class AdminRoleLogic {
|
|
|
AdminUserCom adminUser = commonLogic.getAdminUser(request);
|
|
|
List<String> companyWechatIds = adminUser.getCompanyWechatIds();
|
|
|
|
|
|
- Integer type = adminRoleService.getById(adminUser.getRoleId()).getType();
|
|
|
+ final AdminRole role = adminRoleService.getById(adminUser.getRoleId());
|
|
|
+ Integer type = role.getType();
|
|
|
+
|
|
|
if("admin".equals(adminUser.getUserName())){
|
|
|
type = RoleTypeEnum.ADMIN.getCode();
|
|
|
- } else if (type == RoleTypeEnum.COMPANY.getCode()) {
|
|
|
+ } else if (org.apache.commons.lang3.StringUtils.isBlank(role.getCompanyWechatId())) {
|
|
|
type = RoleTypeEnum.ADMIN.getCode();
|
|
|
}
|
|
|
|
|
|
- return adminRoleService.lambdaQuery()
|
|
|
- .like(StringUtils.isNotBlank(companyWechatName),AdminRole::getCompanyName,companyWechatName)
|
|
|
+ Page<AdminRole> rolePage = adminRoleService.lambdaQuery()
|
|
|
+ .like(StringUtils.isNotBlank(companyWechatName), AdminRole::getCompanyName, companyWechatName)
|
|
|
.le(AdminRole::getType, type)
|
|
|
.in(CollectionUtils.isNotEmpty(companyWechatIds), AdminRole::getCompanyWechatId, companyWechatIds)
|
|
|
.orderByDesc(AdminRole::getType)
|
|
|
+
|
|
|
.page(new Page<>(pageNo, pageSize));
|
|
|
+
|
|
|
+ return rolePage;
|
|
|
}
|
|
|
|
|
|
/**
|