From 316638ed97afd0a806d8c127daee0f0812d0431b Mon Sep 17 00:00:00 2001 From: wangcl Date: Wed, 29 Dec 2021 10:54:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8D=9F=E8=80=97=E6=93=8D?= =?UTF-8?q?=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusiMaterialOperateController.java | 15 ++++++++------ .../impl/BusiMaterialOperateServiceImpl.java | 4 ++-- .../templates/busi/materialperate/addIn.html | 20 +++++++++---------- .../templates/busi/materialperate/addOut.html | 18 ++++++++++------- .../busi/materialperate/materialperate.html | 18 +++++++++++------ 5 files changed, 44 insertions(+), 31 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/busi/controller/BusiMaterialOperateController.java b/ruoyi-admin/src/main/java/com/ruoyi/busi/controller/BusiMaterialOperateController.java index 54a84dee0..1985745ae 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/busi/controller/BusiMaterialOperateController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/busi/controller/BusiMaterialOperateController.java @@ -68,20 +68,23 @@ public class BusiMaterialOperateController extends BaseController } /** - * 新增物料操作流水 + * 新增来料和损耗 */ @GetMapping("/addIn") - public String addIn() - { + public String addIn(@RequestParam(name = "operType", required = false) String operType, @RequestParam(name = "inTab", required = false) String inTab, ModelMap mmap) { + mmap.put("operType",operType); + mmap.put("inTab",inTab); + return prefix + "/addIn"; } /** - * 新增物料操作流水 + * 新增分料 */ @GetMapping("/addOut") - public String addOut() - { + public String addOut(@RequestParam(name = "operType", required = false) String operType, @RequestParam(name = "inTab", required = false) String inTab, ModelMap mmap) { + mmap.put("operType",operType); + mmap.put("inTab",inTab); return prefix + "/addOut"; } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/busi/service/impl/BusiMaterialOperateServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/busi/service/impl/BusiMaterialOperateServiceImpl.java index 6167e59cb..238d074f1 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/busi/service/impl/BusiMaterialOperateServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/busi/service/impl/BusiMaterialOperateServiceImpl.java @@ -70,7 +70,7 @@ public class BusiMaterialOperateServiceImpl implements IBusiMaterialOperateServi } else {// 2为入库 double stockAmount = busiMaterialStock.getAmountIn() - busiMaterialStock.getAmountOut(); if(busiMaterialOperate.getAmount() > stockAmount){ - throw new ServiceException("出库超过库存"); + throw new ServiceException("出库或损耗超过库存,库存值:" + stockAmount); } busiMaterialStock.setAmountOut(busiMaterialOperate.getAmount() + busiMaterialStock.getAmountOut()); } @@ -87,7 +87,7 @@ public class BusiMaterialOperateServiceImpl implements IBusiMaterialOperateServi if ("1".equals(busiMaterialOperate.getOprateType())) { busiMaterialStock.setAmountIn(busiMaterialOperate.getAmount()); } else { - throw new ServiceException("尚未建立库存,请先入库再出库"); + throw new ServiceException("尚未建立库存,请先操作物料入库"); } busiMaterialStockMapper.insertBusiMaterialStock(busiMaterialStock); } diff --git a/ruoyi-admin/src/main/resources/templates/busi/materialperate/addIn.html b/ruoyi-admin/src/main/resources/templates/busi/materialperate/addIn.html index 312c00224..45cd53586 100644 --- a/ruoyi-admin/src/main/resources/templates/busi/materialperate/addIn.html +++ b/ruoyi-admin/src/main/resources/templates/busi/materialperate/addIn.html @@ -6,33 +6,33 @@
- +
- +
- -
+ +
-
+
- +
- -
+ +
- +
@@ -50,7 +50,7 @@
-
+
diff --git a/ruoyi-admin/src/main/resources/templates/busi/materialperate/addOut.html b/ruoyi-admin/src/main/resources/templates/busi/materialperate/addOut.html index f4c7a7141..44eb38eb5 100644 --- a/ruoyi-admin/src/main/resources/templates/busi/materialperate/addOut.html +++ b/ruoyi-admin/src/main/resources/templates/busi/materialperate/addOut.html @@ -6,23 +6,23 @@