云
2026-10-26 63ba72f5d65a3a4dcd56d9228582042448af61d7
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
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 code 分类编码
     * @return 物料分类
     */
    MdmItemCategoryDO getItemCategoryByCode(String code);
 
    /**
     * 校验物料分类存在
     *
     * @param id 编号
     * @return 物料分类
     */
    MdmItemCategoryDO validateItemCategoryExists(Long id);
 
    /**
     * 获得物料分类分页
     *
     * @param pageReqVO 分页查询
     * @return 物料分类分页
     */
    PageResult<MdmItemCategoryDO> getItemCategoryPage(MdmItemCategoryPageReqVO pageReqVO);
 
    /**
     * 获得物料分类列表
     *
     * @param ids 编号数组
     * @return 物料分类列表
     */
    List<MdmItemCategoryDO> getItemCategoryList(Collection<Long> ids);
 
    /**
     * 获得全部分类列表(含禁用)
     *
     * @return 分类列表
     */
    List<MdmItemCategoryDO> getItemCategoryAllList();
 
    /**
     * 获得物料分类 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();
 
    /**
     * 根据物料/产品标识获取分类
     *
     * @param itemOrProduct 物料/产品标识
     * @return 物料分类
     */
    MdmItemCategoryDO getItemCategoryByItemOrProduct(String itemOrProduct);
 
}