3 天以前 b852254d90e7d1955db31db154193ec8ee84d8b3
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
package cn.iocoder.yudao.module.mes.api.cal;
 
import cn.hutool.core.collection.CollUtil;
import cn.iocoder.yudao.module.mes.api.cal.dto.MesCalTeamRespDTO;
import cn.iocoder.yudao.module.mes.dal.dataobject.cal.team.MesCalTeamDO;
import cn.iocoder.yudao.module.mes.dal.mysql.cal.team.MesCalTeamMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
 
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
 
/**
 * MES 班组 API 实现类
 *
 * @author 超级管理员
 */
@Service
@Validated
public class MesCalTeamApiImpl implements MesCalTeamApi {
 
    @Resource
    private MesCalTeamMapper teamMapper;
 
    @Override
    public List<MesCalTeamRespDTO> getTeamList(Collection<Long> teamIds) {
        if (CollUtil.isEmpty(teamIds)) {
            return Collections.emptyList();
        }
        List<MesCalTeamDO> teams = teamMapper.selectByIds(teamIds);
        List<MesCalTeamRespDTO> list = new ArrayList<>(teams.size());
        for (MesCalTeamDO team : teams) {
            MesCalTeamRespDTO dto = new MesCalTeamRespDTO();
            dto.setId(team.getId());
            dto.setCode(team.getCode());
            dto.setName(team.getName());
            list.add(dto);
        }
        return list;
    }
 
}