diff --git a/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseStorageController.java b/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseStorageController.java index 7f566d33..9277800b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseStorageController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseStorageController.java @@ -1,17 +1,18 @@ package com.ruoyi.purchase.controller; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; import com.ruoyi.warehouse.domain.WarehouseStorageOrder; +import com.ruoyi.warehouse.domain.WarehouseStorageOrderDetail; +import com.ruoyi.warehouse.service.IWarehouseStorageOrderDetailService; +import com.ruoyi.warehouse.service.IWarehouseStorageOrderService; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.purchase.domain.PurchaseStorage; @@ -36,6 +37,12 @@ public class PurchaseStorageController extends BaseController @Autowired private IPurchaseStorageService purchaseStorageService; + @Autowired + private IWarehouseStorageOrderService warehouseStorageOrderService; + + @Autowired + private IWarehouseStorageOrderDetailService storageOrderDetailService; + @RequiresPermissions("purchase:purchaseStorage:view") @GetMapping() public String purchaseStorage() @@ -70,6 +77,43 @@ public class PurchaseStorageController extends BaseController return util.exportExcel(list, "采购入库通知单数据"); } + + /** + * 采购入库单详情 + */ + @GetMapping("/detail/{warehouseStorageId}") + public String detail(@PathVariable("warehouseStorageId") Long warehouseStorageId, ModelMap mmap) + { + WarehouseStorageOrder warehouseStorageOrder = warehouseStorageOrderService.selectWarehouseStorageOrderById(warehouseStorageId); + mmap.put("warehouseStorageOrder", warehouseStorageOrder); + return prefix + "/detail"; + } + + /** + * 修改保存采购入库单详情 + */ + @RequiresPermissions("purchase:purchaseStorage:detail") + @Log(title = "仓库入库单", businessType = BusinessType.UPDATE) + @PostMapping("/detail") + @ResponseBody + public AjaxResult detailSave(@RequestBody WarehouseStorageOrder warehouseStorageOrder) + { + return toAjax(warehouseStorageOrderService.updateWarehouseStorageOrder(warehouseStorageOrder)); + } + + + /** + * 采购入库单详情 供应商物料详情列表 + */ + @ResponseBody + @RequestMapping("/storagePurchaseDetailList") + public Map> storagePurchaseDetail(String warehouseStorageCode){ + List allDetails = storageOrderDetailService.selectStorageOrderDetailListByCode(warehouseStorageCode); + Map> groupedDetails = allDetails.stream().collect(Collectors.groupingBy(WarehouseStorageOrderDetail::getSupplierCode)); + return groupedDetails; + } + + /** * 新增采购入库通知单 */ diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/detail.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/detail.html new file mode 100644 index 00000000..85306ef0 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/detail.html @@ -0,0 +1,290 @@ + + + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+ + +
+
+
+
+ +
+
+ +
+
+
+
+
+ + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/purchaseStorage.html b/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/purchaseStorage.html index a15931e0..eb435a5d 100644 --- a/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/purchaseStorage.html +++ b/ruoyi-admin/src/main/resources/templates/purchase/purchaseStorage/purchaseStorage.html @@ -71,9 +71,7 @@ \ No newline at end of file