|
@@ -1,11 +1,9 @@
|
|
|
package com.gree.mall.manager.logic.admin;
|
|
|
|
|
|
-import com.alibaba.excel.util.StringUtils;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.gree.mall.manager.bean.admin.AdminUserCom;
|
|
|
-import com.gree.mall.manager.enums.RoleTypeEnum;
|
|
|
import com.gree.mall.manager.exception.RemoteServiceException;
|
|
|
import com.gree.mall.manager.logic.common.CommonLogic;
|
|
|
import com.gree.mall.manager.plus.entity.AdminRole;
|
|
@@ -15,12 +13,11 @@ import com.gree.mall.manager.plus.service.AdminRoleService;
|
|
|
import com.gree.mall.manager.plus.service.AdminUserModuleRelaService;
|
|
|
import com.gree.mall.manager.plus.service.AdminUserService;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
-import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
|
|
@@ -37,13 +34,15 @@ public class AdminRoleLogic {
|
|
|
/**
|
|
|
* 角色列表
|
|
|
*/
|
|
|
- public IPage<AdminRole> listPage(HttpServletRequest request, Integer pageNo, Integer pageSize) {
|
|
|
+ public IPage<AdminRole> listPage(HttpServletRequest request, String adminCompanyId, Integer type, Integer pageNo, Integer pageSize) {
|
|
|
AdminUserCom adminUser = commonLogic.getAdminUser(request);
|
|
|
List<String> companyWechatIds = adminUser.getAdminCompanyIds();
|
|
|
|
|
|
Integer userType = this.checkUserType(adminUser);
|
|
|
|
|
|
return adminRoleService.lambdaQuery()
|
|
|
+ .eq(StringUtils.isNotBlank(adminCompanyId), AdminRole::getCompanyWechatId, adminCompanyId)
|
|
|
+ .eq(Objects.nonNull(type), AdminRole::getType, type)
|
|
|
.in(CollectionUtils.isNotEmpty(companyWechatIds), AdminRole::getCompanyWechatId, companyWechatIds)
|
|
|
.eq(userType > 0, AdminRole::getType, userType)
|
|
|
.orderByAsc(AdminRole::getType)
|