| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.documents4j.api.IFileConsumer; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.system.applet.query.LeaveListUserQuery; |
| | | import com.ruoyi.system.applet.vo.LeaveUserListVO; |
| | | import com.ruoyi.system.mapper.SysUserMapper; |
| | | import com.ruoyi.system.mapper.TDeptMapper; |
| | | import com.ruoyi.system.mapper.TLeaveMapper; |
| | | import com.ruoyi.system.mapper.TProjectDeptMapper; |
| | |
| | | private TProjectDeptMapper projectDeptMapper; |
| | | @Autowired |
| | | private TDeptMapper deptMapper; |
| | | @Autowired |
| | | private SysUserMapper sysUserMapper; |
| | | @Override |
| | | public PageInfo<LeaveListVO> pageList(LeaveListQuery query) { |
| | | if (StringUtils.hasLength(query.getDeptName())){ |
| | |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | |
| | | @Override |
| | | public PageInfo<LeaveUserListVO> leaveList(LeaveListUserQuery query) { |
| | | List<SysUser> sysUsers = sysUserMapper.selectAllList(); |
| | | if (StringUtils.hasLength(query.getLeavePersonName())){ |
| | | List<Long> collect = sysUsers.stream().filter(e -> e.getNickName().contains(query.getLeavePersonName())) |
| | | .map(SysUser::getUserId).collect(Collectors.toList()); |
| | | if (collect.isEmpty()){ |
| | | collect.add(0L); |
| | | } |
| | | query.setUserIds(collect); |
| | | |
| | | } |
| | | PageInfo<LeaveUserListVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<LeaveUserListVO> list = this.baseMapper.leaveList(query,pageInfo); |
| | | for (LeaveUserListVO leaveUserListVO : list) { |
| | | SysUser sysUser = sysUsers.stream().filter(e -> (e.getUserId() + "").equals(leaveUserListVO.getLeavePerson())) |
| | | .findFirst().orElse(null); |
| | | if (sysUser!=null){ |
| | | leaveUserListVO.setLeavePersonName(sysUser.getNickName()); |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |
| | | } |