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