2026-07-01 6b5f7c66fc40d7f6099d561e31a34fbd50dd20d3
yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/api/item/MdmItemSkuApi.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,88 @@
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);
}