From 814844defc2ce2fc20d330a6fa55eed33e4597cd Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Wed, 5 Jun 2024 15:23:24 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=E4=BB=93=E5=BA=93=E7=AE=A1=E7=90=86:=20?= =?UTF-8?q?=E5=87=BA=E5=BA=93=E5=8D=95=20=E6=96=B0=E5=A2=9E=E7=94=9F?= =?UTF-8?q?=E4=BA=A7=E5=8D=95-=E5=87=BA=E5=BA=93=20=E6=8C=89=E9=92=AE=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=94=9F=E4=BA=A7=E5=8D=95-=E5=87=BA?= =?UTF-8?q?=E5=BA=93=E9=A1=B5=E9=9D=A2makeOutWarehouse.html=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=94=9F=E4=BA=A7=E5=8D=95-=E5=87=BA=E5=BA=93?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E6=9F=A5=E8=AF=A2=E9=A1=B5=E9=9D=A2=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=20=E6=96=B0=E5=A2=9E=E7=94=9F=E4=BA=A7=E5=8D=95-?= =?UTF-8?q?=E5=87=BA=E5=BA=93=E5=90=8E=E7=AB=AF=E4=BF=AE=E6=94=B9=E4=BF=9D?= =?UTF-8?q?=E5=AD=98=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WarehouseOutOrderController.java | 24 +++ .../impl/WarehouseOutOrderServiceImpl.java | 17 ++ .../warehouseOutOrder/makeOutWarehouse.html | 191 ++++++++++++++++++ .../warehouseOutOrder/prepareMaterial.html | 2 +- .../warehouseOutOrder/warehouseOutOrder.html | 12 +- 5 files changed, 244 insertions(+), 2 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/makeOutWarehouse.html diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseOutOrderController.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseOutOrderController.java index c22fb2a1..3fb11f08 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseOutOrderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/controller/WarehouseOutOrderController.java @@ -190,4 +190,28 @@ public class WarehouseOutOrderController extends BaseController return getDataTable(list); } + + /** + * 生产单-出库 + */ + @GetMapping("/makeOutWarehouse/{outOrderId}") + public String makeOutWarehouse(@PathVariable("outOrderId") Long outOrderId, ModelMap mmap) + { + WarehouseOutOrder warehouseOutOrder = warehouseOutOrderService.selectWarehouseOutOrderById(outOrderId); + mmap.put("warehouseOutOrder", warehouseOutOrder); + return prefix + "/makeOutWarehouse"; + } + + /** + * 修改保存出库单-出库 + */ + @RequiresPermissions("warehouse:warehouseOutOrder:makeOutWarehouse") + @Log(title = "仓库出库单", businessType = BusinessType.UPDATE) + @PostMapping("/makeOutWarehouse") + @ResponseBody + public AjaxResult makeOutWarehouseSave(@RequestBody WarehouseOutOrder warehouseOutOrder) + { + return toAjax(warehouseOutOrderService.updatePrepareMaterial(warehouseOutOrder)); + } + } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java index b3a1805f..0046299b 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderServiceImpl.java @@ -1,5 +1,6 @@ package com.ruoyi.warehouse.service.impl; +import java.util.Date; import java.util.List; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; @@ -13,6 +14,7 @@ import com.ruoyi.warehouse.mapper.WarehouseOutOrderMapper; import com.ruoyi.warehouse.domain.WarehouseOutOrder; import com.ruoyi.warehouse.service.IWarehouseOutOrderService; import com.ruoyi.common.core.text.Convert; +import org.springframework.transaction.annotation.Transactional; /** * 仓库出库单Service业务层处理 @@ -135,15 +137,22 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService /** * 修改保存销售单-准备物料 * */ + @Transactional @Override public int updatePrepareMaterial(WarehouseOutOrder warehouseOutOrder) { + String loginName = ShiroUtils.getLoginName(); + warehouseOutOrder.setUpdateBy(loginName); + warehouseOutOrder.setUpdateTime(new Date()); + warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder); List warehouseOutOrderDetailList = warehouseOutOrder.getWarehouseOutOrderDetailList(); if (StringUtils.isEmpty(warehouseOutOrderDetailList)){ log.warn("保存销售单-准备物料,物料列表信息为空:{}",warehouseOutOrder); } int updateRows = 0; for (WarehouseOutOrderDetail warehouseOutOrderDetail : warehouseOutOrderDetailList) { + warehouseOutOrderDetail.setUpdateBy(loginName); + warehouseOutOrderDetail.setUpdateTime(new Date()); warehouseOutOrderDetail.setRemark(warehouseOutOrder.getRemark()); //更新数据库记录 updateRows += outOrderDetailMapper.updateWarehouseOutOrderDetail(warehouseOutOrderDetail); @@ -155,15 +164,23 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService /** * 修改保存销售单-出库 */ + @Transactional @Override public int updateSalesOutWarehouse(WarehouseOutOrder warehouseOutOrder) { + String loginName = ShiroUtils.getLoginName(); + warehouseOutOrder.setUpdateBy(loginName); + warehouseOutOrder.setUpdateTime(new Date()); + warehouseOutOrderMapper.updateWarehouseOutOrder(warehouseOutOrder); + List warehouseOutOrderDetailList = warehouseOutOrder.getWarehouseOutOrderDetailList(); if (StringUtils.isEmpty(warehouseOutOrderDetailList)){ log.warn("保存销售单-出库,物料列表信息为空:{}",warehouseOutOrder); } int updateRows = 0; for (WarehouseOutOrderDetail warehouseOutOrderDetail : warehouseOutOrderDetailList) { + warehouseOutOrderDetail.setUpdateBy(loginName); + warehouseOutOrderDetail.setUpdateTime(new Date()); warehouseOutOrderDetail.setRemark(warehouseOutOrder.getRemark()); warehouseOutOrderDetail.setDeliveryDate(warehouseOutOrder.getDeliveryDate()); //更新数据库记录 diff --git a/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/makeOutWarehouse.html b/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/makeOutWarehouse.html new file mode 100644 index 00000000..7161929f --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/makeOutWarehouse.html @@ -0,0 +1,191 @@ + + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+
+
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterial.html b/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterial.html index 8316ba23..5b0bc67b 100644 --- a/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterial.html +++ b/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterial.html @@ -1,7 +1,7 @@ - + diff --git a/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/warehouseOutOrder.html b/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/warehouseOutOrder.html index b477a1d0..093ff21f 100644 --- a/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/warehouseOutOrder.html +++ b/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/warehouseOutOrder.html @@ -70,7 +70,7 @@ var editFlag = [[${@permission.hasPermi('warehouse:warehouseOutOrder:edit')}]]; var prepareMaterialFlag = [[${@permission.hasPermi('warehouse:warehouseOutOrder:prepareMaterial')}]]; var salesOutWarehouseFlag = [[${@permission.hasPermi('warehouse:warehouseOutOrder:salesOutWarehouse')}]]; - + var makeOutWarehouseFlag = [[${@permission.hasPermi('warehouse:warehouseOutOrder:makeOutWarehouse')}]]; var warehouseOutStatusDatas = [[${@dict.getType('warehouse_out_status')}]]; var warehouseOrderTypeDatas = [[${@dict.getType('warehouse_order_type')}]]; @@ -180,6 +180,10 @@ if (row.warehouseOutStatus == 4 && row.warehouseOrderType == 0 && row.warehouseOutType == 0){ actions.push('出库 '); } + if (row.warehouseOutStatus == 4 && row.warehouseOrderType == 1 && row.warehouseOutType == 1){ + actions.push('出库 '); + } + return actions.join(''); } }] @@ -198,6 +202,12 @@ var url = ctx + 'warehouse/warehouseOutOrder/salesOutWarehouse/' + outOrderId; $.modal.open("出库",url); } + + /*生产单-出库*/ + function makeOutWarehouse(outOrderId){ + var url = ctx + 'warehouse/warehouseOutOrder/makeOutWarehouse/' + outOrderId; + $.modal.open("出库",url); + } \ No newline at end of file