package cn.iocoder.yudao.module.mdm.api.item;
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
import cn.iocoder.yudao.module.mdm.api.item.dto.MdmItemModelRespDTO;
|
|
import java.util.Collection;
|
import java.util.List;
|
import java.util.Map;
|
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
|
|
/**
|
* MDM 物料型号 API 接口
|
*
|
* @author 超级管理员
|
*/
|
public interface MdmItemModelApi {
|
|
String PREFIX = "/rpc-api/mdm/item-model";
|
|
/**
|
* 获取物料型号
|
*
|
* @param id 型号编号
|
* @return 物料型号
|
*/
|
CommonResult<MdmItemModelRespDTO> getItemModel(Long id);
|
|
/**
|
* 获取物料型号列表
|
*
|
* @param ids 型号编号列表
|
* @return 物料型号列表
|
*/
|
CommonResult<List<MdmItemModelRespDTO>> getItemModelList(Collection<Long> ids);
|
|
/**
|
* 获取物料型号 Map
|
*
|
* @param ids 型号编号列表
|
* @return 物料型号 Map
|
*/
|
default Map<Long, MdmItemModelRespDTO> getItemModelMap(Collection<Long> ids) {
|
List<MdmItemModelRespDTO> list = getItemModelList(ids).getCheckedData();
|
return convertMap(list, MdmItemModelRespDTO::getId);
|
}
|
|
/**
|
* 获取指定物料的型号列表
|
*
|
* @param itemId 物料编号
|
* @return 物料型号列表
|
*/
|
CommonResult<List<MdmItemModelRespDTO>> getItemModelListByItemId(Long itemId);
|
|
/**
|
* 校验物料型号存在
|
*
|
* @param id 型号编号
|
* @return 物料型号
|
*/
|
CommonResult<MdmItemModelRespDTO> validateItemModelExists(Long id);
|
|
/**
|
* 校验物料型号存在、启用,且归属于指定物料
|
*
|
* @param id 型号编号
|
* @param itemId 物料编号
|
* @return 物料型号
|
*/
|
CommonResult<MdmItemModelRespDTO> validateItemModelExistsAndEnable(Long id, Long itemId);
|
|
}
|