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