| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.system.mapper.SysUserMapper; |
| | | import com.ruoyi.system.mapper.TPedigreeChartMapper; |
| | | import com.ruoyi.system.model.TPedigreeChart; |
| | | import com.ruoyi.system.model.TProjectTeamStaff; |
| | |
| | | import com.ruoyi.system.vo.TPedigreeChartDetailVO; |
| | | import com.ruoyi.system.vo.TPedigreeChartVO; |
| | | import com.ruoyi.system.vo.TProjectTeamVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | |
| | | @Service |
| | | public class TPedigreeChartServiceImpl extends ServiceImpl<TPedigreeChartMapper, TPedigreeChart> implements TPedigreeChartService { |
| | | |
| | | @Autowired |
| | | private SysUserMapper sysUserMapper; |
| | | @Override |
| | | public PageInfo<TPedigreeChartVO> pageList(TPedigreeChartQuery query) { |
| | | PageInfo<TPedigreeChartVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | |
| | | public PageInfo<TPedigreeChartDetailVO> pageListDetail(TPedigreeChartDetailQuery query) { |
| | | PageInfo<TPedigreeChartDetailVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize()); |
| | | List<TPedigreeChartDetailVO> list = this.baseMapper.pageListDetail(query,pageInfo); |
| | | List<SysUser> sysUsers = sysUserMapper.selectAllList(); |
| | | for (TPedigreeChartDetailVO tPedigreeChartDetailVO : list) { |
| | | SysUser sysUser = sysUsers.stream().filter(e -> e.getUserId().equals(Long.valueOf(tPedigreeChartDetailVO.getVaccinateId()))) |
| | | .findFirst().orElse(null); |
| | | if (sysUser!=null){ |
| | | tPedigreeChartDetailVO.setExperimenter(sysUser.getNickName()); |
| | | } |
| | | SysUser sysUser1 = sysUsers.stream().filter(e -> e.getUserId().equals(Long.valueOf(tPedigreeChartDetailVO.getVaccinateId()))) |
| | | .findFirst().orElse(null); |
| | | if (sysUser1!=null){ |
| | | tPedigreeChartDetailVO.setVaccinateName(sysUser.getNickName()); |
| | | } |
| | | } |
| | | pageInfo.setRecords(list); |
| | | return pageInfo; |
| | | } |