From 8389dde4a8081008d23ddf6df13c94404ad33734 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Fri, 7 Jun 2024 17:41:31 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=E4=BB=93=E5=BA=93=E7=AE=A1=E7=90=86:=20?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E7=9B=98=E7=82=B9=20=E4=BF=AE=E6=94=B9=20?= =?UTF-8?q?=E5=BA=93=E5=AD=98=E7=9B=98=E7=82=B9=E4=BF=AE=E6=94=B9=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20=E4=BF=AE=E6=94=B9=20=E5=BA=93=E5=AD=98=E7=9B=98?= =?UTF-8?q?=E7=82=B9=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=A0=B9=E6=8D=AE=E7=9B=98=E7=82=B9=E5=8D=95=E5=8F=B7?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=BA=93=E5=AD=98=E7=9B=98=E7=82=B9=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WarehouseInventoryCheckController.java | 14 +- .../WarehouseInventoryCheckDetailMapper.java | 5 + .../IWarehouseInventoryCheckService.java | 5 + .../WarehouseInventoryCheckServiceImpl.java | 24 ++ .../WarehouseInventoryCheckDetailMapper.xml | 8 +- .../warehouse/inventoryCheck/edit.html | 233 +++++++++++++++--- 6 files changed, 254 insertions(+), 35 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseInventoryCheckController.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseInventoryCheckController.java index 2e182fa2..965f30d3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseInventoryCheckController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseInventoryCheckController.java @@ -3,6 +3,7 @@ package com.ruoyi.warehouse.controller; import java.util.List; import com.ruoyi.warehouse.domain.VO.WarehouseMaterialVO; +import com.ruoyi.warehouse.domain.WarehouseInventoryCheckDetail; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -105,12 +106,23 @@ public class WarehouseInventoryCheckController extends BaseController @Log(title = "仓库库存盘点", businessType = BusinessType.UPDATE) @PostMapping("/edit") @ResponseBody - public AjaxResult editSave(WarehouseInventoryCheck warehouseInventoryCheck) + public AjaxResult editSave(@RequestBody WarehouseInventoryCheck warehouseInventoryCheck) { return toAjax(warehouseInventoryCheckService.updateWarehouseInventoryCheck(warehouseInventoryCheck)); } + /** + * 根据盘点单号查询盘点详情信息 + */ + @ResponseBody + @PostMapping("/getInventoryCheckDetailList") + public TableDataInfo getInventoryCheckDetailList(WarehouseInventoryCheck warehouseInventoryCheck){ + startPage(); + List list = warehouseInventoryCheckService.selectInventoryCheckDetailListByCode(warehouseInventoryCheck.getInventoryCheckCode()); + return getDataTable(list); + } + /** * 物料信息弹出页面 diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseInventoryCheckDetailMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseInventoryCheckDetailMapper.java index 2bde4d1b..1469d2e0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseInventoryCheckDetailMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseInventoryCheckDetailMapper.java @@ -74,4 +74,9 @@ public interface WarehouseInventoryCheckDetailMapper * @return 结果 */ public int restoreWarehouseInventoryCheckDetailById(Long inventoryCheckDetailId); + + /** + * 根据盘点单号查找盘点详情信息 + * */ + List selectInventoryCheckDetailListByCode(String inventoryCheckCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseInventoryCheckService.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseInventoryCheckService.java index 577b2497..967779cb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseInventoryCheckService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseInventoryCheckService.java @@ -3,6 +3,7 @@ package com.ruoyi.warehouse.service; import java.util.List; import com.ruoyi.warehouse.domain.WarehouseInventoryCheck; import com.ruoyi.warehouse.domain.VO.WarehouseMaterialVO; +import com.ruoyi.warehouse.domain.WarehouseInventoryCheckDetail; /** * 仓库库存盘点Service接口 @@ -50,4 +51,8 @@ public interface IWarehouseInventoryCheckService * */ public List selectAllMaterialInfo(); + /** + * 根据盘点单号查找盘点详情信息 + * */ + List selectInventoryCheckDetailListByCode(String inventoryCheckCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseInventoryCheckServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseInventoryCheckServiceImpl.java index 13214bc9..77f504a0 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseInventoryCheckServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseInventoryCheckServiceImpl.java @@ -118,12 +118,27 @@ public class WarehouseInventoryCheckServiceImpl implements IWarehouseInventoryCh * @param warehouseInventoryCheck 仓库库存盘点 * @return 结果 */ + @Transactional @Override public int updateWarehouseInventoryCheck(WarehouseInventoryCheck warehouseInventoryCheck) { String loginName = ShiroUtils.getLoginName(); warehouseInventoryCheck.setUpdateBy(loginName); warehouseInventoryCheck.setUpdateTime(DateUtils.getNowDate()); + + List inventoryCheckDetails = warehouseInventoryCheck.getInventoryCheckDetails(); + + if (StringUtils.isEmpty(inventoryCheckDetails)){ + log.warn("仓库盘点物料相关信息为空:{}",inventoryCheckDetails); + } + + for (WarehouseInventoryCheckDetail tempInventoryCheckDetail : inventoryCheckDetails) { + + tempInventoryCheckDetail.setUpdateBy(loginName); + tempInventoryCheckDetail.setUpdateTime(new Date()); + inventoryCheckDetailMapper.updateWarehouseInventoryCheckDetail(tempInventoryCheckDetail); + } + return warehouseInventoryCheckMapper.updateWarehouseInventoryCheck(warehouseInventoryCheck); } @@ -146,6 +161,15 @@ public class WarehouseInventoryCheckServiceImpl implements IWarehouseInventoryCh return warehouseMaterialVOs; } + /** + * 根据盘点单号查找盘点详情信息 + * */ + @Override + public List selectInventoryCheckDetailListByCode(String inventoryCheckCode) { + + return inventoryCheckDetailMapper.selectInventoryCheckDetailListByCode(inventoryCheckCode); + } + /** *库存盘点单号生成规则 diff --git a/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseInventoryCheckDetailMapper.xml b/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseInventoryCheckDetailMapper.xml index 3d543a45..7638e5a6 100644 --- a/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseInventoryCheckDetailMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseInventoryCheckDetailMapper.xml @@ -42,7 +42,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where inventory_check_detail_id = #{inventoryCheckDetailId} - + + + + insert into warehouse_inventory_check_detail diff --git a/ruoyi-admin/src/main/resources/templates/warehouse/inventoryCheck/edit.html b/ruoyi-admin/src/main/resources/templates/warehouse/inventoryCheck/edit.html index 26c00b90..71087f38 100644 --- a/ruoyi-admin/src/main/resources/templates/warehouse/inventoryCheck/edit.html +++ b/ruoyi-admin/src/main/resources/templates/warehouse/inventoryCheck/edit.html @@ -9,29 +9,17 @@
- +
- +
-
- -
- -
-
-
- -
- -
-
@@ -45,7 +33,7 @@
- +
@@ -53,18 +41,6 @@
-
- -
- -
-
-
- -
- -
-
@@ -72,26 +48,217 @@
+ + +
+
+
+ 选择物料 + + 选择物料 + +
+
+
+
+
+
+
+
+ + \ No newline at end of file