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 getItemCategoryPage(MdmItemCategoryPageReqVO pageReqVO); /** * 获得物料分类列表 * * @param ids 编号数组 * @return 物料分类列表 */ List getItemCategoryList(Collection ids); /** * 获得物料分类 Map * * @param ids 编号数组 * @return 物料分类 Map */ default Map getItemCategoryMap(Collection ids) { return convertMap(getItemCategoryList(ids), MdmItemCategoryDO::getId); } /** * 获得指定分类的子分类列表(包含自己) * * @param id 分类编号 * @return 子分类列表 */ List getItemCategoryChildrenList(Long id); /** * 获得启用的分类列表 * * @return 分类列表 */ List getSimpleItemList(); }