puzhibing
6 天以前 fccb84b175884930aacfa3531c5bdb4333f8c851
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package com.ruoyi.system.service.impl;
 
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.utils.StringUtils;
import com.ruoyi.system.mapper.TBreedingAndPreservationMapper;
import com.ruoyi.system.mapper.TProjectTeamMapper;
import com.ruoyi.system.mapper.TProjectTeamStaffMapper;
import com.ruoyi.system.model.TBreedingAndPreservation;
import com.ruoyi.system.model.TProjectTeam;
import com.ruoyi.system.model.TProjectTeamStaff;
import com.ruoyi.system.query.TBreedingAndPreservationQuery;
import com.ruoyi.system.service.TBreedingAndPreservationService;
import com.ruoyi.system.vo.TBreedingAndPreservationVO;
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;
 
import java.util.List;
import java.util.stream.Collectors;
 
/**
 * <p>
 * 菌种选育保藏记录 服务实现类
 * </p>
 *
 * @author 无关风月
 * @since 2025-04-12
 */
@Service
public class TBreedingAndPreservationServiceImpl extends ServiceImpl<TBreedingAndPreservationMapper, TBreedingAndPreservation> implements TBreedingAndPreservationService {
    @Autowired
    private TProjectTeamMapper projectTeamMapper;
 
    @Override
    public PageInfo<TBreedingAndPreservationVO> pageList(TBreedingAndPreservationQuery query) {
        PageInfo<TBreedingAndPreservationVO> pageInfo = new PageInfo<>(query.getPageNum(), query.getPageSize());
        List<TBreedingAndPreservationVO> list = this.baseMapper.pageList(query,pageInfo);
        for (TBreedingAndPreservationVO tBreedingAndPreservationVO : list) {
            if (StringUtils.isNotEmpty(tBreedingAndPreservationVO.getProjectId())) {
                TProjectTeam tProjectTeam = projectTeamMapper.selectById(tBreedingAndPreservationVO.getProjectId());
                if (tProjectTeam != null) {
                    tBreedingAndPreservationVO.setProjectName(tProjectTeam.getTeamName());
                }
            }
        }
        pageInfo.setRecords(list);
        return pageInfo;
    }
}