From 4b6cf5a0855e41d4f359f4ba91bb131d613dcd6d Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Tue, 4 Jun 2024 19:58:56 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=E4=BB=93=E5=BA=93=E7=AE=A1=E7=90=86:=20?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20*=E9=94=80=E5=94=AE=E5=8D=95**-**=E5=87=86?= =?UTF-8?q?=E5=A4=87=E7=89=A9=E6=96=99*=20=E9=A1=B5=E9=9D=A2=20prepareMate?= =?UTF-8?q?rial.html=20=E6=96=B0=E5=A2=9E=20*=E9=94=80=E5=94=AE=E5=8D=95**?= =?UTF-8?q?-**=E5=87=86=E5=A4=87=E7=89=A9=E6=96=99*=20=20=E6=8C=89?= =?UTF-8?q?=E9=92=AE=20=E6=96=B0=E5=A2=9E=20*=E9=94=80=E5=94=AE=E5=8D=95**?= =?UTF-8?q?-**=E5=87=86=E5=A4=87=E7=89=A9=E6=96=99*=20=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BF=9D=E5=AD=98=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=20*=E9=94=80=E5=94=AE=E5=8D=95**-**?= =?UTF-8?q?=E5=87=86=E5=A4=87=E7=89=A9=E6=96=99*=20=20=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3=20=E6=96=B0=E5=A2=9E=20*?= =?UTF-8?q?=E9=94=80=E5=94=AE=E5=8D=95**-**=E5=87=86=E5=A4=87=E7=89=A9?= =?UTF-8?q?=E6=96=99=20=20=E6=9F=A5=E8=AF=A2=E7=89=A9=E6=96=99=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E4=BF=A1=E6=81=AF*=E6=8E=A5=E5=8F=A3=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=20=E5=87=BA=E5=BA=93=E5=8D=95=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=9B=86=E5=90=88=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WarehouseOutOrderController.java | 51 ++-- .../warehouse/domain/WarehouseOutOrder.java | 15 ++ .../mapper/WarehouseOutOrderDetailMapper.java | 7 + .../IWarehouseOutOrderDetailService.java | 7 + .../service/IWarehouseOutOrderService.java | 5 + .../WarehouseOutOrderDetailServiceImpl.java | 17 ++ .../impl/WarehouseOutOrderServiceImpl.java | 27 +++ .../WarehouseOutOrderDetailMapper.xml | 8 +- .../warehouseOutOrder/prepareMaterial.html | 226 ++++++++++++++++++ .../warehouseOutOrder/warehouseOutOrder.html | 12 +- 10 files changed, 348 insertions(+), 27 deletions(-) create mode 100644 ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterial.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 4b9db4b1..35de1cf3 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 @@ -1,15 +1,14 @@ package com.ruoyi.warehouse.controller; import java.util.List; + +import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail; +import com.ruoyi.warehouse.service.IWarehouseOutOrderDetailService; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.warehouse.domain.WarehouseOutOrder; @@ -34,6 +33,9 @@ public class WarehouseOutOrderController extends BaseController @Autowired private IWarehouseOutOrderService warehouseOutOrderService; + @Autowired + private IWarehouseOutOrderDetailService outOrderDetailService; + @RequiresPermissions("warehouse:warehouseOutOrder:view") @GetMapping() public String warehouseOutOrder() @@ -113,38 +115,39 @@ public class WarehouseOutOrderController extends BaseController } /** - * 删除仓库出库单 + * 销售单-准备物料 */ - @RequiresPermissions("warehouse:warehouseOutOrder:remove") - @Log(title = "仓库出库单", businessType = BusinessType.DELETE) - @PostMapping( "/remove") - @ResponseBody - public AjaxResult remove(String ids) + @GetMapping("/prepareMaterial/{outOrderId}") + public String prepareMaterial(@PathVariable("outOrderId") Long outOrderId, ModelMap mmap) { - return toAjax(warehouseOutOrderService.deleteWarehouseOutOrderByIds(ids)); + WarehouseOutOrder warehouseOutOrder = warehouseOutOrderService.selectWarehouseOutOrderById(outOrderId); + mmap.put("warehouseOutOrder", warehouseOutOrder); + return prefix + "/prepareMaterial"; } /** - * 作废仓库出库单 + * 修改保存销售单-准备物料 */ - @RequiresPermissions("warehouse:warehouseOutOrder:cancel") - @Log(title = "仓库出库单", businessType = BusinessType.CANCEL) - @GetMapping( "/cancel/{id}") + @RequiresPermissions("warehouse:warehouseOutOrder:prepareMaterial") + @Log(title = "仓库出库单", businessType = BusinessType.UPDATE) + @PostMapping("/prepareMaterial") @ResponseBody - public AjaxResult cancel(@PathVariable("id") Long id){ - return toAjax(warehouseOutOrderService.cancelWarehouseOutOrderById(id)); + public AjaxResult prepareMaterialSave(@RequestBody WarehouseOutOrder warehouseOutOrder) + { + return toAjax(warehouseOutOrderService.updatePrepareMaterial(warehouseOutOrder)); } + /** - * 恢复仓库出库单 + * 销售单-准备物料 物料相关信息 */ - @RequiresPermissions("warehouse:warehouseOutOrder:restore") - @Log(title = "仓库出库单", businessType = BusinessType.RESTORE) - @GetMapping( "/restore/{id}") + @PostMapping("/getMaterialListByOutOrderCode") @ResponseBody - public AjaxResult restore(@PathVariable("id")Long id) + public TableDataInfo getMaterialListByOutOrderCode(WarehouseOutOrder warehouseOutOrder) { - return toAjax(warehouseOutOrderService.restoreWarehouseOutOrderById(id)); + startPage(); + List list = outOrderDetailService.selectOutOrderDetailListByCode(warehouseOutOrder); + return getDataTable(list); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseOutOrder.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseOutOrder.java index f0b5aa73..ca862021 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseOutOrder.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/domain/WarehouseOutOrder.java @@ -1,6 +1,8 @@ package com.ruoyi.warehouse.domain; import java.util.Date; +import java.util.List; + import com.fasterxml.jackson.annotation.JsonFormat; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -125,6 +127,9 @@ public class WarehouseOutOrder extends BaseEntity /** 送货日期 */ private Date deliveryDate; + /** 仓库出库单详情*/ + private List warehouseOutOrderDetailList; + public void setOutOrderId(Long outOrderId) { this.outOrderId = outOrderId; @@ -414,6 +419,15 @@ public class WarehouseOutOrder extends BaseEntity return deliveryDate; } + + public List getWarehouseOutOrderDetailList() { + return warehouseOutOrderDetailList; + } + + public void setWarehouseOutOrderDetailList(List warehouseOutOrderDetailList) { + this.warehouseOutOrderDetailList = warehouseOutOrderDetailList; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -454,6 +468,7 @@ public class WarehouseOutOrder extends BaseEntity .append("updateBy", getUpdateBy()) .append("updateTime", getUpdateTime()) .append("remark", getRemark()) + .append("warehouseOutOrderDetailList",getWarehouseOutOrderDetailList()) .toString(); } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderDetailMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderDetailMapper.java index 28e3dbfe..22396f9c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderDetailMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/mapper/WarehouseOutOrderDetailMapper.java @@ -1,6 +1,8 @@ package com.ruoyi.warehouse.mapper; import java.util.List; + +import com.ruoyi.warehouse.domain.WarehouseOutOrder; import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail; /** @@ -74,4 +76,9 @@ public interface WarehouseOutOrderDetailMapper * @return 结果 */ public int restoreWarehouseOutOrderDetailById(Long outOrderDetailId); + + /** + * 销售单-准备物料 物料相关信息 + */ + List selectOutOrderDetailListByCode(String outOrderCode); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderDetailService.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderDetailService.java index 745f38f5..d22b4a00 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderDetailService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderDetailService.java @@ -1,6 +1,8 @@ package com.ruoyi.warehouse.service; import java.util.List; + +import com.ruoyi.warehouse.domain.WarehouseOutOrder; import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail; /** @@ -72,4 +74,9 @@ public interface IWarehouseOutOrderDetailService * @return */ int restoreWarehouseOutOrderDetailById(Long outOrderDetailId); + + /** + * 销售单-准备物料 物料相关信息 + */ + List selectOutOrderDetailListByCode(WarehouseOutOrder warehouseOutOrder); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderService.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderService.java index 6a8d342d..99c54b75 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/IWarehouseOutOrderService.java @@ -72,4 +72,9 @@ public interface IWarehouseOutOrderService * @return */ int restoreWarehouseOutOrderById(Long outOrderId); + + /** + * 修改保存销售单-准备物料 + */ + int updatePrepareMaterial(WarehouseOutOrder warehouseOutOrder); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderDetailServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderDetailServiceImpl.java index 45ad3c38..051fcf33 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderDetailServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/warehouse/service/impl/WarehouseOutOrderDetailServiceImpl.java @@ -3,6 +3,9 @@ package com.ruoyi.warehouse.service.impl; import java.util.List; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.warehouse.domain.WarehouseOutOrder; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.warehouse.mapper.WarehouseOutOrderDetailMapper; @@ -17,6 +20,7 @@ import com.ruoyi.common.core.text.Convert; * @date 2024-06-04 */ @Service +@Slf4j public class WarehouseOutOrderDetailServiceImpl implements IWarehouseOutOrderDetailService { @Autowired @@ -123,4 +127,17 @@ public class WarehouseOutOrderDetailServiceImpl implements IWarehouseOutOrderDet { return warehouseOutOrderDetailMapper.restoreWarehouseOutOrderDetailById(outOrderDetailId); } + + /** + * 销售单-准备物料 物料相关信息 + */ + @Override + public List selectOutOrderDetailListByCode(WarehouseOutOrder warehouseOutOrder) { + + String outOrderCode = warehouseOutOrder.getOutOrderCode(); + if (StringUtils.isEmpty(outOrderCode)){ + log.warn("销售单-准备物料,出库单号为空:{}",outOrderCode); + } + return warehouseOutOrderDetailMapper.selectOutOrderDetailListByCode(outOrderCode); + } } 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 6676f307..99caf11a 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 @@ -3,6 +3,10 @@ package com.ruoyi.warehouse.service.impl; import java.util.List; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.ShiroUtils; +import com.ruoyi.common.utils.StringUtils; +import com.ruoyi.warehouse.domain.WarehouseOutOrderDetail; +import com.ruoyi.warehouse.mapper.WarehouseOutOrderDetailMapper; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.warehouse.mapper.WarehouseOutOrderMapper; @@ -17,11 +21,15 @@ import com.ruoyi.common.core.text.Convert; * @date 2024-06-04 */ @Service +@Slf4j public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService { @Autowired private WarehouseOutOrderMapper warehouseOutOrderMapper; + @Autowired + private WarehouseOutOrderDetailMapper outOrderDetailMapper; + /** * 查询仓库出库单 * @@ -123,4 +131,23 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService { return warehouseOutOrderMapper.restoreWarehouseOutOrderById(outOrderId); } + + /** + * 修改保存销售单-准备物料 + * */ + @Override + public int updatePrepareMaterial(WarehouseOutOrder warehouseOutOrder) { + + List warehouseOutOrderDetailList = warehouseOutOrder.getWarehouseOutOrderDetailList(); + if (StringUtils.isEmpty(warehouseOutOrderDetailList)){ + log.warn("保存销售单-准备物料,物料列表信息为空:{}",warehouseOutOrder); + } + int updateRows = 0; + for (WarehouseOutOrderDetail warehouseOutOrderDetail : warehouseOutOrderDetailList) { + + //更新数据库记录 + updateRows += outOrderDetailMapper.updateWarehouseOutOrderDetail(warehouseOutOrderDetail); + } + return updateRows; + } } diff --git a/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderDetailMapper.xml b/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderDetailMapper.xml index b9310467..2b4b0fcf 100644 --- a/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderDetailMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/warehouse/WarehouseOutOrderDetailMapper.xml @@ -71,7 +71,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where out_order_detail_id = #{outOrderDetailId} - + + + + insert into warehouse_out_order_detail diff --git a/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterial.html b/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterial.html new file mode 100644 index 00000000..b863d282 --- /dev/null +++ b/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/prepareMaterial.html @@ -0,0 +1,226 @@ + + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
+
+
+
+
+
+
+ + + + + + + \ No newline at end of file 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 79a6c2e1..f1ffab32 100644 --- a/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/warehouseOutOrder.html +++ b/ruoyi-admin/src/main/resources/templates/warehouse/warehouseOutOrder/warehouseOutOrder.html @@ -68,7 +68,7 @@ \ No newline at end of file