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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package cn.iocoder.yudao.module.mdm.service.category;
 
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.mdm.controller.admin.category.vo.MdmItemCategoryPageReqVO;
import cn.iocoder.yudao.module.mdm.controller.admin.category.vo.MdmItemCategorySaveReqVO;
import cn.iocoder.yudao.module.mdm.dal.dataobject.category.MdmItemCategoryDO;
import jakarta.validation.Valid;
 
import java.util.Collection;
import java.util.List;
import java.util.Map;
 
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
 
/**
 * MDM 物料分类 Service 接口
 *
 * @author 芋道源码
 */
public interface MdmItemCategoryService {
 
    /**
     * 创建物料分类
     *
     * @param createReqVO 创建信息
     * @return 编号
     */
    Long createItemCategory(@Valid MdmItemCategorySaveReqVO createReqVO);
 
    /**
     * 更新物料分类
     *
     * @param updateReqVO 更新信息
     */
    void updateItemCategory(@Valid MdmItemCategorySaveReqVO updateReqVO);
 
    /**
     * 更新物料分类状态
     *
     * @param id     编号
     * @param status 状态
     */
    void updateItemCategoryStatus(Long id, Integer status);
 
    /**
     * 删除物料分类
     *
     * @param id 编号
     */
    void deleteItemCategory(Long id);
 
    /**
     * 获得物料分类
     *
     * @param id 编号
     * @return 物料分类
     */
    MdmItemCategoryDO getItemCategory(Long id);
 
    /**
     * 校验物料分类存在
     *
     * @param id 编号
     * @return 物料分类
     */
    MdmItemCategoryDO validateItemCategoryExists(Long id);
 
    /**
     * 获得物料分类分页
     *
     * @param pageReqVO 分页查询
     * @return 物料分类分页
     */
    PageResult<MdmItemCategoryDO> getItemCategoryPage(MdmItemCategoryPageReqVO pageReqVO);
 
    /**
     * 获得物料分类列表
     *
     * @param ids 编号数组
     * @return 物料分类列表
     */
    List<MdmItemCategoryDO> getItemCategoryList(Collection<Long> ids);
 
    /**
     * 获得物料分类 Map
     *
     * @param ids 编号数组
     * @return 物料分类 Map
     */
    default Map<Long, MdmItemCategoryDO> getItemCategoryMap(Collection<Long> ids) {
        return convertMap(getItemCategoryList(ids), MdmItemCategoryDO::getId);
    }
 
    /**
     * 获得指定分类的子分类列表(包含自己)
     *
     * @param id 分类编号
     * @return 子分类列表
     */
    List<MdmItemCategoryDO> getItemCategoryChildrenList(Long id);
 
    /**
     * 获得启用的分类列表
     *
     * @return 分类列表
     */
    List<MdmItemCategoryDO> getSimpleItemList();
 
}