|
|
@ -13,10 +13,7 @@ import com.easy.admin.auth.common.constant.SysRoleConst; |
|
|
|
import com.easy.admin.auth.common.status.SysDeptStatus; |
|
|
|
import com.easy.admin.auth.common.status.SysUserStatus; |
|
|
|
import com.easy.admin.auth.dao.SysUserMapper; |
|
|
|
import com.easy.admin.auth.model.SysUser; |
|
|
|
import com.easy.admin.auth.model.SysUserRole; |
|
|
|
import com.easy.admin.auth.model.UserInfoRequest; |
|
|
|
import com.easy.admin.auth.model.UserInfoResponse; |
|
|
|
import com.easy.admin.auth.model.*; |
|
|
|
import com.easy.admin.auth.service.SysUserRoleService; |
|
|
|
import com.easy.admin.auth.service.SysUserService; |
|
|
|
import com.easy.admin.common.core.common.pagination.Page; |
|
|
@ -32,11 +29,14 @@ import com.easy.admin.util.PasswordUtil; |
|
|
|
import com.easy.admin.util.ShiroUtil; |
|
|
|
import com.easy.admin.common.core.util.ToolUtil; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Stream; |
|
|
|
|
|
|
|
/** |
|
|
|
* 用户管理 |
|
|
@ -392,35 +392,46 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public IPage<UserInfoResponse> getUsersByCondition(String condition, UserInfoRequest request, Integer pageNo, Integer pageSize) { |
|
|
|
public IPage<UserInfoResponseOV> getUsersByCondition(String condition, UserInfoRequest request, Integer pageNo, Integer pageSize) { |
|
|
|
Page page=new Page<>(pageNo,pageSize); |
|
|
|
IPage<UserInfoResponse> result=new Page<>(); |
|
|
|
IPage<UserInfoResponse> UserInfoPage=new Page<>(); |
|
|
|
if(condition.equals("all")){ |
|
|
|
//信息化保障团队,显示所有人员信息
|
|
|
|
result=userMapper.getAllUserPage(page, request); |
|
|
|
UserInfoPage=userMapper.getAllUserPage(page, request); |
|
|
|
} else if (condition.equals("task")) { |
|
|
|
//任务牵头处室人员信息
|
|
|
|
condition="任务牵头处室"; |
|
|
|
result = userMapper.getUserPageByCondition(page,request,condition); |
|
|
|
UserInfoPage = userMapper.getUserPageByCondition(page,request,condition); |
|
|
|
}else if (condition.equals("team")){ |
|
|
|
//信息化保障团队人员
|
|
|
|
condition="信息化保障团队"; |
|
|
|
String condition1="总咨询单位"; |
|
|
|
result=userMapper.getUserPageByConditions(page,request,condition,condition1); |
|
|
|
UserInfoPage=userMapper.getUserPageByConditions(page,request,condition,condition1); |
|
|
|
} else if (condition.equals("guazhi")) { |
|
|
|
//挂职人员
|
|
|
|
condition="信息化保障团队"; |
|
|
|
result = userMapper.getUserPageByCondition(page,request,condition); |
|
|
|
UserInfoPage = userMapper.getUserPageByCondition(page,request,condition); |
|
|
|
}else if (condition.equals("consult")) { |
|
|
|
//咨询人员
|
|
|
|
condition="总咨询单位"; |
|
|
|
result = userMapper.getUserPageByCondition(page,request,condition); |
|
|
|
UserInfoPage = userMapper.getUserPageByCondition(page,request,condition); |
|
|
|
}else if (condition.equals("contact")) { |
|
|
|
//项目联系人
|
|
|
|
condition="项目联系人"; |
|
|
|
result = userMapper.getUserPageByCondition(page,request,condition); |
|
|
|
UserInfoPage = userMapper.getUserPageByCondition(page,request,condition); |
|
|
|
} |
|
|
|
|
|
|
|
IPage<UserInfoResponseOV> result=new Page<>(); |
|
|
|
List<UserInfoResponse> collect = UserInfoPage.getRecords().stream().collect(Collectors.toList()); |
|
|
|
List<UserInfoResponseOV> newRecords=new ArrayList<>(); |
|
|
|
for(UserInfoResponse c:collect){ |
|
|
|
List<String> r = c.getRole().stream().map(x -> x.getRoleName()).collect(Collectors.toList()); |
|
|
|
UserInfoResponseOV res=new UserInfoResponseOV(); |
|
|
|
BeanUtils.copyProperties(c,res); |
|
|
|
res.setRoleName(String.join(",",r)); |
|
|
|
newRecords.add(res); |
|
|
|
} |
|
|
|
result.setRecords(newRecords).setTotal(UserInfoPage.getTotal()).setCurrent(UserInfoPage.getCurrent()).setSize(UserInfoPage.getSize()); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|