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 @@