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.MdmItemSkuRespDTO;
|
|
import java.util.Collection;
|
import java.util.List;
|
import java.util.Map;
|
|
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap;
|
|
/**
|
* MDM 物料 SKU API 接口
|
*
|
* @author 芋道源码
|
*/
|
public interface MdmItemSkuApi {
|
|
String PREFIX = "/rpc-api/mdm/item-sku";
|
|
/**
|
* 获取 SKU
|
*
|
* @param id SKU 编号
|
* @return SKU
|
*/
|
CommonResult<MdmItemSkuRespDTO> getItemSku(Long id);
|
|
/**
|
* 获取 SKU 列表
|
*
|
* @param ids SKU 编号列表
|
* @return SKU 列表
|
*/
|
CommonResult<List<MdmItemSkuRespDTO>> getItemSkuList(Collection<Long> ids);
|
|
/**
|
* 获取 SKU Map
|
*
|
* @param ids SKU 编号列表
|
* @return SKU Map
|
*/
|
default Map<Long, MdmItemSkuRespDTO> getItemSkuMap(Collection<Long> ids) {
|
List<MdmItemSkuRespDTO> list = getItemSkuList(ids).getCheckedData();
|
return convertMap(list, MdmItemSkuRespDTO::getId);
|
}
|
|
/**
|
* 获取物料的 SKU 列表
|
*
|
* @param itemId 物料编号
|
* @return SKU 列表
|
*/
|
CommonResult<List<MdmItemSkuRespDTO>> getItemSkuListByItemId(Long itemId);
|
|
/**
|
* 校验 SKU 存在
|
*
|
* @param id SKU 编号
|
* @return SKU
|
*/
|
CommonResult<MdmItemSkuRespDTO> validateItemSkuExists(Long id);
|
|
/**
|
* 校验 SKU 存在且启用
|
*
|
* @param id SKU 编号
|
* @return SKU
|
*/
|
CommonResult<MdmItemSkuRespDTO> validateItemSkuExistsAndEnable(Long id);
|
|
/**
|
* 根据编码获取 SKU
|
*
|
* @param code SKU 编码
|
* @return SKU
|
*/
|
CommonResult<MdmItemSkuRespDTO> getItemSkuByCode(String code);
|
|
/**
|
* 根据条码获取 SKU
|
*
|
* @param barCode SKU 条码
|
* @return SKU
|
*/
|
CommonResult<MdmItemSkuRespDTO> getItemSkuByBarCode(String barCode);
|
|
}
|