From 8a7af3c27dca7eb50898995d5f64547beccc9e24 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期四, 02 七月 2026 10:25:25 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_business' into dev_business

---
 yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/api/item/MdmItemApi.java |  143 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 143 insertions(+), 0 deletions(-)

diff --git a/yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/api/item/MdmItemApi.java b/yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/api/item/MdmItemApi.java
new file mode 100644
index 0000000..597cf14
--- /dev/null
+++ b/yudao-module-mdm/src/main/java/cn/iocoder/yudao/module/mdm/api/item/MdmItemApi.java
@@ -0,0 +1,143 @@
+package cn.iocoder.yudao.module.mdm.api.item;
+
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.mdm.api.item.dto.MdmItemCreateReqDTO;
+import cn.iocoder.yudao.module.mdm.api.item.dto.MdmItemRespDTO;
+import cn.iocoder.yudao.module.mdm.api.item.dto.MdmItemUpdateReqDTO;
+
+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 MdmItemApi {
+
+    String PREFIX = "/rpc-api/mdm/item";
+
+    /**
+     * 鍒涘缓鐗╂枡
+     *
+     * @param createReqDTO 鍒涘缓淇℃伅
+     * @return 鐗╂枡缂栧彿
+     */
+    CommonResult<Long> createItem(MdmItemCreateReqDTO createReqDTO);
+
+    /**
+     * 鏇存柊鐗╂枡
+     *
+     * @param updateReqDTO 鏇存柊淇℃伅
+     * @return 鏄惁鎴愬姛
+     */
+    CommonResult<Boolean> updateItem(MdmItemUpdateReqDTO updateReqDTO);
+
+    /**
+     * 鑾峰彇鐗╂枡
+     *
+     * @param id 鐗╂枡缂栧彿
+     * @return 鐗╂枡
+     */
+    CommonResult<MdmItemRespDTO> getItem(Long id);
+
+    /**
+     * 鑾峰彇鐗╂枡鍒楄〃
+     *
+     * @param ids 鐗╂枡缂栧彿鍒楄〃
+     * @return 鐗╂枡鍒楄〃
+     */
+    CommonResult<List<MdmItemRespDTO>> getItemList(Collection<Long> ids);
+
+    /**
+     * 鑾峰彇鐗╂枡 Map
+     *
+     * @param ids 鐗╂枡缂栧彿鍒楄〃
+     * @return 鐗╂枡 Map
+     */
+    default Map<Long, MdmItemRespDTO> getItemMap(Collection<Long> ids) {
+        List<MdmItemRespDTO> list = getItemList(ids).getCheckedData();
+        return convertMap(list, MdmItemRespDTO::getId);
+    }
+
+    /**
+     * 鑾峰彇鐗╂枡鍒嗛〉
+     *
+     * @param itemType 鐗╂枡绫诲瀷
+     * @param status   鐘舵��
+     * @param pageNo   椤电爜
+     * @param pageSize 姣忛〉鏁伴噺
+     * @return 鐗╂枡鍒嗛〉
+     */
+    CommonResult<PageResult<MdmItemRespDTO>> getItemPage(Integer itemType, Integer status, Integer pageNo, Integer pageSize);
+
+    /**
+     * 鏍规嵁鐘舵�佽幏鍙栫墿鏂欏垪琛�
+     *
+     * @param status 鐘舵��
+     * @return 鐗╂枡鍒楄〃
+     */
+    CommonResult<List<MdmItemRespDTO>> getItemListByStatus(Integer status);
+
+    /**
+     * 鏍¢獙鐗╂枡瀛樺湪
+     *
+     * @param id 鐗╂枡缂栧彿
+     * @return 鐗╂枡
+     */
+    CommonResult<MdmItemRespDTO> validateItemExists(Long id);
+
+    /**
+     * 鏍¢獙鐗╂枡瀛樺湪涓斿惎鐢�
+     *
+     * @param id 鐗╂枡缂栧彿
+     * @return 鐗╂枡
+     */
+    CommonResult<MdmItemRespDTO> validateItemExistsAndEnable(Long id);
+
+    /**
+     * 鏍规嵁缂栫爜鑾峰彇鐗╂枡
+     *
+     * @param code 鐗╂枡缂栫爜
+     * @return 鐗╂枡
+     */
+    CommonResult<MdmItemRespDTO> getItemByCode(String code);
+
+    /**
+     * 鏍规嵁鏉$爜鑾峰彇鐗╂枡
+     *
+     * @param barCode 鐗╂枡鏉$爜
+     * @return 鐗╂枡
+     */
+    CommonResult<MdmItemRespDTO> getItemByBarCode(String barCode);
+
+    /**
+     * 鏍规嵁鍒嗙被缂栧彿缁熻鐗╂枡鏁伴噺
+     *
+     * @param categoryId 鍒嗙被缂栧彿
+     * @return 鐗╂枡鏁伴噺
+     */
+    CommonResult<Long> getItemCountByCategoryId(Long categoryId);
+
+    /**
+     * 鏍规嵁鍗曚綅缂栧彿缁熻鐗╂枡鏁伴噺
+     *
+     * @param unitMeasureId 鍗曚綅缂栧彿
+     * @return 鐗╂枡鏁伴噺
+     */
+    CommonResult<Long> getItemCountByUnitMeasureId(Long unitMeasureId);
+
+    /**
+     * 鏇存柊鐗╂枡鐘舵��
+     *
+     * @param id     鐗╂枡缂栧彿
+     * @param status 鐘舵��
+     * @return 鏄惁鎴愬姛
+     */
+    CommonResult<Boolean> updateItemStatus(Long id, Integer status);
+
+}
\ No newline at end of file

--
Gitblit v1.9.3