From 3a8a81be5f3cf33b9577d667009cbfe3ebfc7743 Mon Sep 17 00:00:00 2001 From: xins Date: Wed, 24 Jan 2024 17:46:26 +0800 Subject: [PATCH] =?UTF-8?q?1.4.3=20WMS=EF=BC=9A=E6=81=A2=E5=A4=8D=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WmsBaseWarehouseController.java | 71 +++++++++++++++++-- 1 file changed, 67 insertions(+), 4 deletions(-) diff --git a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsBaseWarehouseController.java b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsBaseWarehouseController.java index b457bff..34e91df 100644 --- a/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsBaseWarehouseController.java +++ b/hw-modules/hw-wms/src/main/java/com/hw/wms/controller/WmsBaseWarehouseController.java @@ -5,7 +5,9 @@ import java.io.IOException; import javax.servlet.http.HttpServletResponse; import com.hw.wms.domain.WmsBaseCategory; +import com.hw.wms.domain.WmsWarehouseMaterial; import com.hw.wms.service.IWmsBaseCategoryService; +import com.hw.wms.service.IWmsWarehouseMaterialService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -41,6 +43,9 @@ public class WmsBaseWarehouseController extends BaseController @Autowired private IWmsBaseCategoryService wmsBaseCategoryService; + @Autowired + private IWmsWarehouseMaterialService wmsWarehouseMaterialService; + /** * 查询仓库列表 */ @@ -57,7 +62,7 @@ public class WmsBaseWarehouseController extends BaseController * 导出仓库列表 */ @RequiresPermissions("wms:wmswarehouse:export") - @Log(title = "仓库", businessType = BusinessType.EXPORT) + @Log(title = "仓库管理", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, WmsBaseWarehouse wmsBaseWarehouse) { @@ -80,7 +85,7 @@ public class WmsBaseWarehouseController extends BaseController * 新增仓库 */ @RequiresPermissions("wms:wmswarehouse:add") - @Log(title = "仓库", businessType = BusinessType.INSERT) + @Log(title = "仓库管理", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody WmsBaseWarehouse wmsBaseWarehouse) { @@ -91,7 +96,7 @@ public class WmsBaseWarehouseController extends BaseController * 修改仓库 */ @RequiresPermissions("wms:wmswarehouse:edit") - @Log(title = "仓库", businessType = BusinessType.UPDATE) + @Log(title = "仓库管理", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody WmsBaseWarehouse wmsBaseWarehouse) { @@ -102,7 +107,7 @@ public class WmsBaseWarehouseController extends BaseController * 删除仓库 */ @RequiresPermissions("wms:wmswarehouse:remove") - @Log(title = "仓库", businessType = BusinessType.DELETE) + @Log(title = "仓库管理", businessType = BusinessType.DELETE) @DeleteMapping("/{warehouseIds}") public AjaxResult remove(@PathVariable Long[] warehouseIds) { @@ -121,4 +126,62 @@ public class WmsBaseWarehouseController extends BaseController return success(list); } + /** + * 查询已分配物料 + */ + @RequiresPermissions("wms:wmswarehouse:materialallocate") + @GetMapping("/selectWmsWarehouseMaterialList") + public TableDataInfo selectWmsWarehouseMaterialList(WmsWarehouseMaterial wmsWarehouseMaterial) + { + startPage(); + List warehouseMaterials = wmsWarehouseMaterialService.selectWmsWarehouseMaterialJoinList(wmsWarehouseMaterial); + return getDataTable(warehouseMaterials); + } + + /** + * 分配仓库可入物料 + */ + @RequiresPermissions("wms:wmswarehouse:materialallocate") + @Log(title = "仓库管理", businessType = BusinessType.ALLOCATE) + @PutMapping("/allocateMaterials") + public AjaxResult allocateMaterials(Long warehouseId, Long[] materialIds) + { + wmsWarehouseMaterialService.batchInsertWarehouseMaterial(warehouseId, materialIds); + return success(); + } + + + /** + * 删除仓库配置的物料信息 + */ + @RequiresPermissions("wms:wmswarehouse:materialallocate") + @Log(title = "仓库管理", businessType = BusinessType.UNALLOCATE) + @PostMapping("/unallocateMaterials") + public AjaxResult unallocateMaterials(Long[] warehouseMaterialIds) + { + return toAjax(wmsWarehouseMaterialService.deleteWmsWarehouseMaterialByWarehouseMaterialIds(warehouseMaterialIds)); + } + + +// /** +// * 根据仓库分配可入库物料信息 +// */ +// @RequiresPermissions("wms:wmswarehouse:materialallocate") +// @GetMapping("/allocateMaterial/{warehouseId}") +// public AjaxResult allocateMaterial(@PathVariable("warehouseId") Long warehouseId) +// { +// AjaxResult ajax = AjaxResult.success(); +// WmsBaseWarehouse warehouse = wmsBaseWarehouseService.selectWmsBaseWarehouseByWarehouseId(warehouseId); +// +// WmsWarehouseMaterial queryWarehouseMaterial = new WmsWarehouseMaterial(); +// queryWarehouseMaterial.setWarehouseId(warehouseId); +// queryWarehouseMaterial.setStorageType(WmsConstants.WMS_WAREHOUSE_MATERIAL_STORAGE_TYPE_MATERIAL); +// +// List warehouseMaterials = wmsWarehouseMaterialService.selectWmsWarehouseMaterialList(queryWarehouseMaterial); +// ajax.put("warehouse", warehouse); +// ajax.put("warehouseMaterials", warehouseMaterials); +// return ajax; +// } + + }