|
|
@@ -1,5 +1,7 @@
|
|
|
package com.usoftchina.saas.account.service.impl;
|
|
|
|
|
|
+import com.github.pagehelper.PageHelper;
|
|
|
+import com.github.pagehelper.PageInfo;
|
|
|
import com.usoftchina.saas.account.cache.AccountCache;
|
|
|
import com.usoftchina.saas.account.dto.AccountRoleDTO;
|
|
|
import com.usoftchina.saas.account.mapper.AccountCompanyMapper;
|
|
|
@@ -11,7 +13,9 @@ import com.usoftchina.saas.account.po.Role;
|
|
|
import com.usoftchina.saas.account.po.RoleResource;
|
|
|
import com.usoftchina.saas.account.service.AccountService;
|
|
|
import com.usoftchina.saas.account.service.RoleService;
|
|
|
+import com.usoftchina.saas.commons.dto.ListReqDTO;
|
|
|
import com.usoftchina.saas.context.BaseContextHolder;
|
|
|
+import com.usoftchina.saas.page.PageRequest;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
@@ -123,8 +127,22 @@ public class AccountServiceImpl implements AccountService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public List<AccountRoleDTO> selectAccountRole(){
|
|
|
- return accountRoleMapper.selectAccountRole();
|
|
|
+ public PageInfo<AccountRoleDTO> selectAccountRole(PageRequest page, ListReqDTO listReqDTO){
|
|
|
+ PageHelper.startPage(page.getNumber(), page.getSize());
|
|
|
+ List<AccountRoleDTO> accountRoleDTOList = getList(listReqDTO);
|
|
|
+ //取分页信息
|
|
|
+ PageInfo<AccountRoleDTO> pageInfo = new PageInfo<AccountRoleDTO>(accountRoleDTOList);
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<AccountRoleDTO> getList(ListReqDTO listReqDTO) {
|
|
|
+ Long companyId = BaseContextHolder.getCompanyId();
|
|
|
+ String condition = listReqDTO.getFinalCondition();
|
|
|
+ if(condition == null){
|
|
|
+ condition = "1=1";
|
|
|
+ }
|
|
|
+ List<AccountRoleDTO> AccountRoleDTOList = accountRoleMapper.selectAccountRole(condition, companyId);
|
|
|
+ return AccountRoleDTOList;
|
|
|
}
|
|
|
|
|
|
@Override
|