From 9e1228cfb183b53527f09d7b7df21e18bf7649f9 Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Thu, 14 Nov 2024 14:00:26 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E4=BF=AE=E6=94=B9=E5=94=AE=E5=90=8E?= =?UTF-8?q?=E9=AA=8C=E6=94=B6=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2=EF=BC=9A?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=8E=E7=AB=AF=E6=96=99=E5=8F=B7=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=80=BC=E7=9A=84=E9=97=AE=E9=A2=98=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E9=94=80=E5=94=AE=E5=87=BA=E8=B4=A7=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=EF=BC=9A=E5=8A=A0=E4=B8=8A=E5=B7=B2=E9=AA=8C?= =?UTF-8?q?=E6=94=B6=E6=95=B0=E5=AD=97=E6=AE=B5=EF=BC=9B=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=87=BA=E8=B4=A7=E6=95=B0=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=EF=BC=8C=E5=A6=82=E6=9E=9C=E5=B7=B2=E9=AA=8C=E6=94=B6=E6=95=B0?= =?UTF-8?q?=E7=AD=89=E4=BA=8E=E7=89=A9=E6=96=99=E6=95=B0=E6=88=96=E8=80=85?= =?UTF-8?q?=EF=BC=8C=E5=B7=B2=E7=94=B3=E8=AF=B7=E5=87=BA=E8=B4=A7=E6=95=B0?= =?UTF-8?q?=E7=AD=89=E4=BA=8E=E7=89=A9=E6=96=99=E6=95=B0=EF=BC=8C=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E6=94=B9=E7=89=A9=E6=96=99=E7=94=B3=E8=AF=B7=E5=87=BA?= =?UTF-8?q?=E8=B4=A7=E6=95=B0=E4=B8=BA=E2=80=9D=E5=B7=B2=E5=87=BA=E8=B4=A7?= =?UTF-8?q?=E2=80=9C=20=E4=BF=AE=E6=94=B9=E9=94=80=E5=94=AE=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2=EF=BC=9A=E9=94=80?= =?UTF-8?q?=E5=94=AE=E5=8F=91=E8=B5=B7=E5=87=BA=E8=B4=A7=E5=89=8D=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E8=AF=A5=E8=AE=A2=E5=8D=95=E6=98=AF=E5=90=A6=E5=B7=B2?= =?UTF-8?q?=E7=BB=93=E6=A1=88=20=E4=BF=AE=E6=94=B9=E5=94=AE=E5=90=8E?= =?UTF-8?q?=E9=AA=8C=E6=94=B6=E5=90=8E=E7=AB=AF=E6=8E=A5=E5=8F=A3=EF=BC=9A?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B2=A1=E6=9C=89=E8=AE=BE=E5=A4=87id?= =?UTF-8?q?=E5=92=8C=E6=9C=89=E8=AE=BE=E5=A4=87id=E7=9A=84=E6=96=B9?= =?UTF-8?q?=E6=B3=95=EF=BC=8C=E9=87=8D=E5=86=99=E9=AA=8C=E6=94=B6=E7=9A=84?= =?UTF-8?q?=E5=90=8C=E6=97=B6=E5=A4=84=E7=90=86=E9=94=80=E5=94=AE=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=AD=90=E8=A1=A8=E7=9A=84=E5=B7=B2=E9=AA=8C=E6=94=B6?= =?UTF-8?q?=E6=95=B0=EF=BC=8C=E6=8C=89=E7=85=A7=E4=BA=A4=E4=BB=98=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E7=9A=84=E5=85=88=E5=90=8E=EF=BC=8C=E6=9D=A5=E5=86=B3?= =?UTF-8?q?=E5=AE=9A=E5=88=86=E9=85=8D=E5=B7=B2=E9=AA=8C=E6=94=B6=E6=95=B0?= =?UTF-8?q?=E7=9A=84=E5=85=88=E5=90=8E=EF=BC=8C=E7=84=B6=E5=90=8E=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E5=88=86=E8=A7=A3=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=8F=B7=EF=BC=8C=E5=8F=8D=E6=9F=A5=E9=94=80=E5=94=AE=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=EF=BC=8C=E5=B9=B6=E6=A3=80=E6=9F=A5=E6=AF=8F=E4=B8=AA?= =?UTF-8?q?=20SysSalesOrderChild=20=E4=B8=AD=E7=9A=84=20item.getMaterialNu?= =?UTF-8?q?m()=20=E5=92=8C=20item.getHasCheckNum()=20=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E7=9B=B8=E7=AD=89=E3=80=82=E5=A6=82=E6=9E=9C=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E5=8F=B7=E5=AF=B9=E5=BA=94?= =?UTF-8?q?=E7=9A=84=E6=89=80=E6=9C=89=20SysSalesOrderChild=20=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E8=BF=99=E4=B8=A4=E4=B8=AA=E5=80=BC=E9=83=BD=E7=9B=B8?= =?UTF-8?q?=E7=AD=89=EF=BC=8C=E5=88=99=E5=B0=86=E8=AF=A5=E9=94=80=E5=94=AE?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=9A=84=E5=87=BA=E5=BA=93=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E4=B8=BA=E2=80=9C=E5=85=A8=E9=83=A8=E9=AA=8C?= =?UTF-8?q?=E6=94=B6=E2=80=9D=EF=BC=8C=E5=90=A6=E5=88=99=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=B8=BA=E2=80=9C=E9=83=A8=E5=88=86=E9=AA=8C=E6=94=B6=E2=80=9D?= =?UTF-8?q?=E3=80=82=20=E4=BF=AE=E6=94=B9=E9=94=80=E5=94=AE=E5=87=BA?= =?UTF-8?q?=E8=B4=A7=E9=80=9A=E7=9F=A5=E7=9A=84=20=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E9=94=80=E5=94=AE=E5=8F=91=E8=B5=B7=E5=87=BA=E8=B4=A7=E7=94=9F?= =?UTF-8?q?=E6=88=90=E9=94=80=E5=94=AE=E5=87=BA=E8=B4=A7=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E5=8D=95=E5=88=97=E8=A1=A8=E5=90=8E=E7=AB=AF=E6=96=B9=E6=B3=95?= =?UTF-8?q?=EF=BC=8C=E5=8A=A0=E4=B8=8AsysSalesOrderChildList=E5=8F=82?= =?UTF-8?q?=E6=95=B0=EF=BC=8C=E5=90=8E=E7=BB=AD=E6=96=B9=E6=B3=95=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E9=83=BD=E6=9D=A5=E8=87=AA=E5=B7=B2?= =?UTF-8?q?=E7=BB=8F=E8=A2=AB=E5=A4=84=E7=90=86=E8=BF=87=E7=9A=84=20sysSal?= =?UTF-8?q?esOrderChildList=E4=B8=AD=E7=9A=84=E6=95=B0=E6=8D=AE=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=87=BA=E5=BA=93=E5=8D=95=E7=9A=84=20?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E9=94=80=E5=94=AE=E5=8F=91=E8=B5=B7=E5=87=BA?= =?UTF-8?q?=E8=B4=A7=E7=94=9F=E6=88=90=E4=BB=93=E5=BA=93=E5=87=BA=E5=BA=93?= =?UTF-8?q?=E5=8D=95=E6=96=B9=E6=B3=95=20=E5=8A=A0=E4=B8=8AsysSalesOrderCh?= =?UTF-8?q?ildList=E5=8F=82=E6=95=B0=EF=BC=8C=E5=90=8E=E7=BB=AD=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E4=B8=AD=E7=9A=84=E6=95=B0=E6=8D=AE=E9=83=BD=E6=9D=A5?= =?UTF-8?q?=E8=87=AA=E5=B7=B2=E7=BB=8F=E8=A2=AB=E5=A4=84=E7=90=86=E8=BF=87?= =?UTF-8?q?=E7=9A=84=20sysSalesOrderChildList=E4=B8=AD=E7=9A=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=20=E4=BF=AE=E6=94=B9=20selectSalesOrderChildByCodeAnd?= =?UTF-8?q?No=E6=96=B9=E6=B3=95=EF=BC=8C=E6=9F=A5=E8=AF=A2=E7=9A=84?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=8A=A0=E4=B8=8A=E7=BC=BA=E5=B0=91=E7=9A=84?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E6=95=B0=E6=8D=AE=20=E4=BF=AE=E6=94=B9=20?= =?UTF-8?q?=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E5=AD=90=E8=A1=A8=20?= =?UTF-8?q?=E7=9A=84=E9=94=80=E5=94=AE=E5=87=BA=E8=B4=A7=E7=89=A9=E6=96=99?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=B1=95=E7=A4=BA=E6=96=B9=E6=B3=95=EF=BC=9A?= =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E5=AF=B9=E5=B7=B2=E9=AA=8C=E6=94=B6=E6=95=B0?= =?UTF-8?q?=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/AftersalesOutOrderServiceImpl.java | 70 +++++++++++++++---- .../ISysSalesShippingInformService.java | 3 +- .../impl/SysSalesOrderChildServiceImpl.java | 4 ++ .../impl/SysSalesOrderServiceImpl.java | 15 ++-- .../SysSalesShippingInformServiceImpl.java | 3 +- .../service/IWarehouseOutOrderService.java | 3 +- .../impl/WarehouseOutOrderServiceImpl.java | 7 +- .../system/SysSalesOrderChildMapper.xml | 3 +- .../aftersalesConfirmCheck.html | 2 +- .../system/salesOrder/salesDeliverGoods.html | 12 ++++ .../system/salesOrder/salesOrder.html | 12 ++-- 11 files changed, 102 insertions(+), 32 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOutOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOutOrderServiceImpl.java index 05495858..c9c5d72f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOutOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/aftersales/service/impl/AftersalesOutOrderServiceImpl.java @@ -779,6 +779,7 @@ public class AftersalesOutOrderServiceImpl implements IAftersalesOutOrderService if (Objects.equals(tempShippingInformDetail.getThisShippingNum(), sysSalesShippingInformDetail.getHasCheckNum())){ allWithoutCheckFlag = 1; } + // 当前时间 Date now = new Date(); @@ -804,21 +805,45 @@ public class AftersalesOutOrderServiceImpl implements IAftersalesOutOrderService orderChildren.add(tempSalesOrderChild); } } - //按照计划交付时间与当前时间的差值排序 - orderChildren.sort(Comparator.comparing(o->Math.abs(o.getDeliveryTime().getTime() - now.getTime()))); - //更新 HasCheckNum 数据 + // 按照计划交付时间与当前时间的差值排序 + orderChildren.sort(Comparator.comparing(o -> Math.abs(o.getDeliveryTime().getTime() - now.getTime()))); + + // 更新 HasCheckNum 数据 + boolean shouldContinue = true; for (SysSalesOrderChild orderChild : orderChildren) { + if (!shouldContinue) { + break; + } + orderChild.setUpdateTime(new Date()); orderChild.setUpdateBy(loginName); - orderChild.setHasCheckNum(sysSalesShippingInformDetail.getHasCheckNum()); + + // 检查数据库中是否有已有的 hasCheckNum,如果有则进行合计 + Integer existingHasCheckNum = orderChild.getHasCheckNum(); + Integer currentHasCheckNum = sysSalesShippingInformDetail.getHasCheckNum(); + + if (existingHasCheckNum != null) { + orderChild.setHasCheckNum(existingHasCheckNum + currentHasCheckNum); + } else { + orderChild.setHasCheckNum(currentHasCheckNum); + } + int updateSalesOrderChildResult = salesOrderChildMapper.updateSysSalesOrderChildByCodeAndQuoteId(orderChild); if (updateSalesOrderChildResult <= 0) { - throw new BusinessException("更新销售订单子表数据失败"); + throw new RuntimeException("更新销售订单子表数据失败"); + } + + // 检查是否需要继续更新下一个 + if (orderChild.getHasCheckNum().equals(orderChild.getMaterialNum())) { + shouldContinue = true; + } else { + shouldContinue = false; } } + int updateShippingInformDetailResult = shippingInformDetailMapper.updateSysSalesShippingInformDetail(sysSalesShippingInformDetail); if (updateShippingInformDetailResult <= 0) { throw new BusinessException("更新销售出货通知单详情数据失败"); @@ -918,17 +943,38 @@ public class AftersalesOutOrderServiceImpl implements IAftersalesOutOrderService orderChildren.add(tempSalesOrderChild); } } - //按照计划交付时间与当前时间的差值排序 - orderChildren.sort(Comparator.comparing(o->Math.abs(o.getDeliveryTime().getTime() - now.getTime()))); - //更新 HasCheckNum 数据 + // 按照计划交付时间与当前时间的差值排序 + orderChildren.sort(Comparator.comparing(o -> Math.abs(o.getDeliveryTime().getTime() - now.getTime()))); + + // 更新 HasCheckNum 数据 + boolean shouldContinue = true; for (SysSalesOrderChild orderChild : orderChildren) { - orderChild.setUpdateTime(new Date()); - orderChild.setUpdateBy(loginName); - orderChild.setHasCheckNum(sysSalesShippingInformDetail.getHasCheckNum()); + if (!shouldContinue) { + break; + } + + + // 检查数据库中是否有已有的 hasCheckNum,如果有则进行合计 + Integer existingHasCheckNum = orderChild.getHasCheckNum(); + Integer currentHasCheckNum = tempShippingInformDetail.getHasCheckNum(); + + if (existingHasCheckNum != null) { + orderChild.setHasCheckNum(existingHasCheckNum + currentHasCheckNum); + } else { + orderChild.setHasCheckNum(currentHasCheckNum); + } + int updateSalesOrderChildResult = salesOrderChildMapper.updateSysSalesOrderChildByCodeAndQuoteId(orderChild); if (updateSalesOrderChildResult <= 0) { - throw new BusinessException("更新销售订单子表数据失败"); + throw new RuntimeException("更新销售订单子表数据失败"); + } + + // 检查是否需要继续更新下一个 + if (orderChild.getHasCheckNum().equals(orderChild.getMaterialNum())) { + shouldContinue = true; + } else { + shouldContinue = false; } } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformService.java index 0afb89dc..b4b3215d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesShippingInformService.java @@ -3,6 +3,7 @@ package com.ruoyi.system.service; import java.util.List; import com.ruoyi.system.domain.SysSalesOrder; +import com.ruoyi.system.domain.SysSalesOrderChild; import com.ruoyi.system.domain.SysSalesShippingInform; import com.ruoyi.system.domain.SysSalesShippingInformDetail; import com.ruoyi.system.domain.Vo.ConfirmReceivingDetailVo; @@ -82,7 +83,7 @@ public interface ISysSalesShippingInformService /** * 通过销售发起出货生成销售出货通知单列表 * */ - int generateShippingInformBySalesOrder(SysSalesOrder sysSalesOrder, String outOrderCode,List salesOrderIdList); + int generateShippingInformBySalesOrder(List sysSalesOrderChildList, SysSalesOrder sysSalesOrder, String outOrderCode, List salesOrderIdList); /** diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderChildServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderChildServiceImpl.java index f92a9f74..7dd28a5f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderChildServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderChildServiceImpl.java @@ -119,6 +119,10 @@ public class SysSalesOrderChildServiceImpl implements ISysSalesOrderChildService (existingItem.getOutBoundQuantity() != null ? existingItem.getOutBoundQuantity() : 0) + (newItem.getOutBoundQuantity() != null ? newItem.getOutBoundQuantity() : 0) ); + existingItem.setHasCheckNum( + (existingItem.getHasCheckNum() != null ? existingItem.getHasCheckNum() : 0) + + (newItem.getHasCheckNum() != null ? newItem.getHasCheckNum() : 0) + ); return existingItem; } )); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java index 02724ab2..ab8b32a7 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderServiceImpl.java @@ -533,8 +533,11 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService List sysSalesOrderChildList = sysSalesOrder.getSysSalesOrderChildList(); + //过滤掉申请出货数为null的数据,也就是本次不发起出货 + sysSalesOrderChildList = sysSalesOrderChildList.stream().filter(sysSalesOrderChild -> (sysSalesOrderChild.getApplyShippingNum() != null)).collect(Collectors.toList()); //过滤掉申请出货数为0的数据,也就是本次不发起出货 - sysSalesOrderChildList = sysSalesOrderChildList.stream().filter(sysSalesOrderChild -> sysSalesOrderChild.getApplyShippingNum() != 0 ).collect(Collectors.toList()); + sysSalesOrderChildList = sysSalesOrderChildList.stream().filter(sysSalesOrderChild -> (sysSalesOrderChild.getApplyShippingNum() != 0)).collect(Collectors.toList()); + List salesOrderIdList = sysSalesOrder.getSalesOrderIdList(); @@ -572,9 +575,13 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService if (hasApplyShippingNum == null) { hasApplyShippingNum = 0; // 确保 hasApplyShippingNum 不为 null } - + if (hasApplyShippingNum+oldChild.getApplyShippingNum() > oldChild.getMaterialNum()){ + throw new BusinessException("申请出货数与已申请出货数之和不能大于订单数量"); + } // 计算新的已申请出货数 hasApplyShippingNum += applyShippingNum; + + oldChild.setHasApplyShippingNum(hasApplyShippingNum); oldChild.setUpdateTime(new Date()); oldChild.setUpdateBy(loginName); @@ -596,10 +603,10 @@ public class SysSalesOrderServiceImpl implements ISysSalesOrderService //两个表生成同一个出库单号 String outOrderCode = redisCache.generateBillNo("CK"); //通过销售发起出货生成仓库出库单 - int insertWarehouseOutOrderResult = warehouseOutOrderService.generateWarehouseOutOrderBySalesOrder(sysSalesOrder,outOrderCode,salesOrderIdList); + int insertWarehouseOutOrderResult = warehouseOutOrderService.generateWarehouseOutOrderBySalesOrder(sysSalesOrderChildList,sysSalesOrder,outOrderCode,salesOrderIdList); //通过销售发起出货生成销售出货通知单列表 - int insertShippingInformResult = sysSalesShippingInformService.generateShippingInformBySalesOrder(sysSalesOrder,outOrderCode,salesOrderIdList); + int insertShippingInformResult = sysSalesShippingInformService.generateShippingInformBySalesOrder(sysSalesOrderChildList,sysSalesOrder,outOrderCode,salesOrderIdList); return sysSalesOrderMapper.updateSysSalesOrderBySalesOrderCode(sysSalesOrder); } diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java index 5e05004f..ec3cde83 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesShippingInformServiceImpl.java @@ -203,7 +203,7 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor * 通过销售发起出货生成销售出货通知单列表 * */ @Override - public int generateShippingInformBySalesOrder(SysSalesOrder sysSalesOrder,String outOrderCode,List salesOrderIdList) { + public int generateShippingInformBySalesOrder(List sysSalesOrderChildList,SysSalesOrder sysSalesOrder,String outOrderCode,List salesOrderIdList) { String loginName = ShiroUtils.getLoginName(); @@ -271,7 +271,6 @@ public class SysSalesShippingInformServiceImpl implements ISysSalesShippingInfor //更新销售出货通知详情数据 - List sysSalesOrderChildList = sysSalesOrder.getSysSalesOrderChildList(); for (SysSalesOrderChild sysSalesOrderChild : sysSalesOrderChildList) { SysSalesShippingInformDetail sysSalesShippingInformDetail = new SysSalesShippingInformDetail(); sysSalesShippingInformDetail.setOutOrderCode(outOrderCode); 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 d2282fa3..85318512 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 @@ -6,6 +6,7 @@ import com.ruoyi.aftersales.domain.vo.SelectShippingDeviceVO; import com.ruoyi.erp.domain.vo.ErpDevelopModifyorderPickingVo; import com.ruoyi.system.domain.SysMakeorderPickVo; import com.ruoyi.system.domain.SysSalesOrder; +import com.ruoyi.system.domain.SysSalesOrderChild; import com.ruoyi.system.domain.Vo.BaseEmpRequisiteOrderVO; import com.ruoyi.warehouse.domain.WarehouseOutOrder; import org.springframework.transaction.annotation.Transactional; @@ -109,7 +110,7 @@ public interface IWarehouseOutOrderService /** * 通过销售发起出货生成仓库出库单 * */ - int generateWarehouseOutOrderBySalesOrder(SysSalesOrder sysSalesOrder, String outOrderCode, List salesOrderIdList); + int generateWarehouseOutOrderBySalesOrder(List sysSalesOrderChildList, SysSalesOrder sysSalesOrder, String outOrderCode, List salesOrderIdList); /** * 开发修改单领料审核通过后生产出库单 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 2e98a528..47f62c85 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 @@ -978,7 +978,7 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService * 通过销售发起出货生成仓库出库单 * */ @Override - public int generateWarehouseOutOrderBySalesOrder(SysSalesOrder sysSalesOrder,String outOrderCode,List salesOrderIdList) { + public int generateWarehouseOutOrderBySalesOrder(List sysSalesOrderChildList,SysSalesOrder sysSalesOrder,String outOrderCode,List salesOrderIdList) { // String salesOrderCode = sysSalesOrder.getSalesOrderCode(); // if (StringUtils.isEmpty(salesOrderCode)){ @@ -1034,7 +1034,7 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService warehouseOutOrder.setCreateTime(new Date()); warehouseOutOrder.setCreateBy(ShiroUtils.getLoginName()); //新增出库单明细 - CreateOutOrderDetailBySalesOrderChildList(sysSalesOrder,outOrderCode); + CreateOutOrderDetailBySalesOrderChildList(sysSalesOrder, sysSalesOrderChildList,outOrderCode); return warehouseOutOrderMapper.insertWarehouseOutOrder(warehouseOutOrder); } @@ -1055,8 +1055,7 @@ public class WarehouseOutOrderServiceImpl implements IWarehouseOutOrderService //新增出库单明细 - private void CreateOutOrderDetailBySalesOrderChildList(SysSalesOrder sysSalesOrder,String outOrderCode) { - List sysSalesOrderChildList = sysSalesOrder.getSysSalesOrderChildList(); + private void CreateOutOrderDetailBySalesOrderChildList( SysSalesOrder sysSalesOrder,List sysSalesOrderChildList,String outOrderCode) { for (SysSalesOrderChild sysSalesOrderChild : sysSalesOrderChildList) { WarehouseOutOrderDetail warehouseOutOrderDetail = new WarehouseOutOrderDetail(); warehouseOutOrderDetail.setOutOrderCode(outOrderCode); diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml index 92dc2cb7..6a504220 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml @@ -104,7 +104,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"