处理没有自由用户列表空问题
This commit is contained in:
parent
0de1d9f28d
commit
88638d6fa8
@ -5,9 +5,9 @@ import ink.wgink.exceptions.SearchException;
|
|||||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||||
import ink.wgink.interfaces.user.IUserBaseService;
|
import ink.wgink.interfaces.user.IUserBaseService;
|
||||||
import ink.wgink.pojo.ListPage;
|
import ink.wgink.pojo.ListPage;
|
||||||
import ink.wgink.pojo.pos.DepartmentPO;
|
|
||||||
import ink.wgink.pojo.dtos.department.DepartmentUserDTO;
|
import ink.wgink.pojo.dtos.department.DepartmentUserDTO;
|
||||||
import ink.wgink.pojo.dtos.user.UserDTO;
|
import ink.wgink.pojo.dtos.user.UserDTO;
|
||||||
|
import ink.wgink.pojo.pos.DepartmentPO;
|
||||||
import ink.wgink.pojo.result.SuccessResultList;
|
import ink.wgink.pojo.result.SuccessResultList;
|
||||||
import ink.wgink.service.department.dao.IDepartmentUserDao;
|
import ink.wgink.service.department.dao.IDepartmentUserDao;
|
||||||
import ink.wgink.service.department.pojo.vos.DepartmentUserSortVO;
|
import ink.wgink.service.department.pojo.vos.DepartmentUserSortVO;
|
||||||
@ -19,7 +19,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -203,15 +202,12 @@ public class DepartmentUserServiceImpl extends DefaultBaseService implements IDe
|
|||||||
*/
|
*/
|
||||||
private SuccessResultList<List<DepartmentUserDTO>> listPageUserByExcludeDepartment(ListPage page) {
|
private SuccessResultList<List<DepartmentUserDTO>> listPageUserByExcludeDepartment(ListPage page) {
|
||||||
List<DepartmentUserDTO> hasDepartmentUsers = list(getHashMap(0));
|
List<DepartmentUserDTO> hasDepartmentUsers = list(getHashMap(0));
|
||||||
if (hasDepartmentUsers.isEmpty()) {
|
|
||||||
return new SuccessResultList<>(new ArrayList<>(), 1, 0L);
|
|
||||||
}
|
|
||||||
List<String> userIds = new ArrayList<>();
|
List<String> userIds = new ArrayList<>();
|
||||||
for (DepartmentUserDTO hasDepartmentUserId : hasDepartmentUsers) {
|
for (DepartmentUserDTO hasDepartmentUserId : hasDepartmentUsers) {
|
||||||
userIds.add(hasDepartmentUserId.getUserId());
|
userIds.add(hasDepartmentUserId.getUserId());
|
||||||
}
|
}
|
||||||
SuccessResultList<List<UserDTO>> successResultList = userBaseService.listPageByExcludeIds(userIds, page);
|
SuccessResultList<List<UserDTO>> successResultList = userBaseService.listPageByExcludeIds(userIds, page);
|
||||||
return listPageDepartmentUser(successResultList, hasDepartmentUsers, page);
|
return listPageExcludeDepartmentUser(successResultList);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -231,18 +227,36 @@ public class DepartmentUserServiceImpl extends DefaultBaseService implements IDe
|
|||||||
userIds.add(hasDepartmentUserId.getUserId());
|
userIds.add(hasDepartmentUserId.getUserId());
|
||||||
}
|
}
|
||||||
SuccessResultList<List<UserDTO>> successResultList = userBaseService.listPageByIds(userIds, page);
|
SuccessResultList<List<UserDTO>> successResultList = userBaseService.listPageByIds(userIds, page);
|
||||||
return listPageDepartmentUser(successResultList, hasDepartmentUsers, page);
|
return listPageDepartmentUser(successResultList, hasDepartmentUsers);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 机构用户分页列表
|
* 机构用户分页列表
|
||||||
*
|
*
|
||||||
* @param userIds
|
* @param successResultList
|
||||||
* @param hasDepartmentUsers
|
|
||||||
* @param page
|
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private SuccessResultList<List<DepartmentUserDTO>> listPageDepartmentUser(SuccessResultList<List<UserDTO>> successResultList, List<DepartmentUserDTO> hasDepartmentUsers, ListPage page) {
|
private SuccessResultList<List<DepartmentUserDTO>> listPageExcludeDepartmentUser(SuccessResultList<List<UserDTO>> successResultList) {
|
||||||
|
// 查询用户排序
|
||||||
|
List<UserDTO> userDTOs = successResultList.getRows();
|
||||||
|
List<DepartmentUserDTO> departmentUserDTOs = new ArrayList<>();
|
||||||
|
for (UserDTO userDTO : userDTOs) {
|
||||||
|
DepartmentUserDTO departmentUserDTO = new DepartmentUserDTO(userDTO);
|
||||||
|
departmentUserDTO.setDepartmentId("");
|
||||||
|
departmentUserDTO.setUserSort("ZZZ-000");
|
||||||
|
departmentUserDTOs.add(departmentUserDTO);
|
||||||
|
}
|
||||||
|
return new SuccessResultList<>(departmentUserDTOs, successResultList.getPage(), successResultList.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 机构用户分页列表
|
||||||
|
*
|
||||||
|
* @param successResultList
|
||||||
|
* @param hasDepartmentUsers
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private SuccessResultList<List<DepartmentUserDTO>> listPageDepartmentUser(SuccessResultList<List<UserDTO>> successResultList, List<DepartmentUserDTO> hasDepartmentUsers) {
|
||||||
// 查询用户排序
|
// 查询用户排序
|
||||||
List<UserDTO> userDTOs = successResultList.getRows();
|
List<UserDTO> userDTOs = successResultList.getRows();
|
||||||
List<DepartmentUserDTO> departmentUserDTOs = new ArrayList<>();
|
List<DepartmentUserDTO> departmentUserDTOs = new ArrayList<>();
|
||||||
|
Loading…
Reference in New Issue
Block a user