From a0b4de611e3b1986b2713c6a161cc1613ec31a5b Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 10 十一月 2026 11:42:13 +0800
Subject: [PATCH] feat(mes): 采购入库简化为确认入库并自动生成入库单
---
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/itemreceipt/MesWmItemReceiptController.java | 30 ++++++++++++++++++++++--------
1 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/itemreceipt/MesWmItemReceiptController.java b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/itemreceipt/MesWmItemReceiptController.java
index deb0f72..8cf3289 100644
--- a/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/itemreceipt/MesWmItemReceiptController.java
+++ b/yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/wm/itemreceipt/MesWmItemReceiptController.java
@@ -17,8 +17,8 @@
import cn.iocoder.yudao.module.mes.service.qc.iqc.MesQcIqcService;
import cn.iocoder.yudao.module.mes.service.wm.arrivalnotice.MesWmArrivalNoticeService;
import cn.iocoder.yudao.module.mes.service.wm.itemreceipt.MesWmItemReceiptService;
-import cn.iocoder.yudao.module.erp.api.purchase.ErpSupplierApi;
-import cn.iocoder.yudao.module.erp.api.purchase.dto.ErpSupplierRespDTO;
+import cn.iocoder.yudao.module.srm.api.supplier.SrmSupplierApi;
+import cn.iocoder.yudao.module.srm.api.supplier.dto.SrmSupplierRespDTO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
@@ -47,7 +47,7 @@
@Resource
private MesWmItemReceiptService itemReceiptService;
@Resource
- private ErpSupplierApi supplierApi;
+ private SrmSupplierApi srmSupplierApi;
@Resource
private MesQcIqcService iqcService;
@Resource
@@ -80,7 +80,6 @@
@GetMapping("/get")
@Operation(summary = "鑾峰緱閲囪喘鍏ュ簱鍗�")
@Parameter(name = "id", description = "缂栧彿", required = true, example = "1024")
- @PreAuthorize("@ss.hasPermission('mes:wm-item-receipt:query')")
public CommonResult<MesWmItemReceiptRespVO> getItemReceipt(@RequestParam("id") Long id) {
MesWmItemReceiptDO receipt = itemReceiptService.getItemReceipt(id);
if (receipt == null) {
@@ -91,7 +90,6 @@
@GetMapping("/page")
@Operation(summary = "鑾峰緱閲囪喘鍏ュ簱鍗曞垎椤�")
- @PreAuthorize("@ss.hasPermission('mes:wm-item-receipt:query')")
public CommonResult<PageResult<MesWmItemReceiptRespVO>> getItemReceiptPage(
@Valid MesWmItemReceiptPageReqVO pageReqVO) {
PageResult<MesWmItemReceiptDO> pageResult = itemReceiptService.getItemReceiptPage(pageReqVO);
@@ -129,11 +127,27 @@
}
@PutMapping("/finish")
- @Operation(summary = "鎵ц鍏ュ簱")
+ @Operation(summary = "鎵ц鍏ュ簱锛堟棫娴佺▼锛屽凡鐢辩‘璁ゅ叆搴撳彇浠o級")
@Parameter(name = "id", description = "缂栧彿", required = true)
@PreAuthorize("@ss.hasPermission('mes:wm-item-receipt:finish')")
+ @Deprecated
public CommonResult<Boolean> finishItemReceipt(@RequestParam("id") Long id) {
itemReceiptService.finishItemReceipt(id);
+ return success(true);
+ }
+
+ @PutMapping("/confirm")
+ @Operation(summary = "纭鍏ュ簱锛氭牳瀵规暟閲忓悗涓�姝ュ畬鎴愬叆搴�")
+ @Parameter(name = "id", description = "閲囪喘鍏ュ簱鍗曠紪鍙�", required = true)
+ @Parameter(name = "warehouseId", description = "鍏ュ簱浠撳簱缂栧彿", required = true)
+ @Parameter(name = "locationId", description = "鍏ュ簱搴撳尯缂栧彿", required = true)
+ @Parameter(name = "areaId", description = "鍏ュ簱搴撲綅缂栧彿", required = true)
+ @PreAuthorize("@ss.hasPermission('mes:wm-item-receipt:finish')")
+ public CommonResult<Boolean> confirmItemReceipt(@RequestParam("id") Long id,
+ @RequestParam(value = "warehouseId", required = false) Long warehouseId,
+ @RequestParam(value = "locationId", required = false) Long locationId,
+ @RequestParam(value = "areaId", required = false) Long areaId) {
+ itemReceiptService.confirmItemReceipt(id, warehouseId, locationId, areaId);
return success(true);
}
@@ -172,9 +186,9 @@
return Collections.emptyList();
}
// 1. 鑾峰緱鍏宠仈鏁版嵁锛堥噰璐叆搴撲娇鐢� ERP 渚涘簲鍟嗭級
- Map<Long, ErpSupplierRespDTO> supplierMap = supplierApi.getSupplierList(
+ Map<Long, SrmSupplierRespDTO> supplierMap = srmSupplierApi.getSupplierList(
convertSet(list, MesWmItemReceiptDO::getVendorId)).getCheckedData().stream()
- .collect(java.util.stream.Collectors.toMap(ErpSupplierRespDTO::getId, v -> v, (a, b) -> a));
+ .collect(java.util.stream.Collectors.toMap(SrmSupplierRespDTO::getId, v -> v, (a, b) -> a));
Map<Long, MesQcIqcDO> iqcMap = iqcService.getIqcMap(
convertSet(list, MesWmItemReceiptDO::getIqcId));
Map<Long, MesWmArrivalNoticeDO> noticeMap = arrivalNoticeService.getArrivalNoticeMap(
--
Gitblit v1.9.3