2026-07-01 6b5f7c66fc40d7f6099d561e31a34fbd50dd20d3
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
package cn.iocoder.yudao.module.mdm.api.category;
 
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.mdm.api.category.dto.MdmItemCategoryRespDTO;
import cn.iocoder.yudao.module.mdm.dal.dataobject.category.MdmItemCategoryDO;
import cn.iocoder.yudao.module.mdm.service.category.MdmItemCategoryService;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.util.Collection;
import java.util.List;
 
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
 
/**
 * MDM 物料分类 API 实现类
 *
 * @author 芋道源码
 */
@RestController
@RequestMapping(MdmItemCategoryApi.PREFIX)
@Validated
public class MdmItemCategoryApiImpl implements MdmItemCategoryApi {
 
    @Resource
    private MdmItemCategoryService itemCategoryService;
 
    @Override
    public CommonResult<MdmItemCategoryRespDTO> getItemCategory(Long id) {
        MdmItemCategoryDO itemCategory = itemCategoryService.getItemCategory(id);
        return success(BeanUtils.toBean(itemCategory, MdmItemCategoryRespDTO.class));
    }
 
    @Override
    public CommonResult<List<MdmItemCategoryRespDTO>> getItemCategoryList(Collection<Long> ids) {
        List<MdmItemCategoryDO> list = itemCategoryService.getItemCategoryList(ids);
        return success(BeanUtils.toBean(list, MdmItemCategoryRespDTO.class));
    }
 
    @Override
    public CommonResult<MdmItemCategoryRespDTO> validateItemCategoryExists(Long id) {
        MdmItemCategoryDO itemCategory = itemCategoryService.validateItemCategoryExists(id);
        return success(BeanUtils.toBean(itemCategory, MdmItemCategoryRespDTO.class));
    }
 
}