From e83ad4bc28e76447d48859e1c8ea70e363a4bdea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=99=93=E8=BF=AA?= <2596750866@qq.com> Date: Fri, 15 Nov 2024 14:14:47 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E9=94=80=E5=94=AE=E7=AE=A1=E7=90=86?= =?UTF-8?q?=20=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E9=94=80=E5=94=AE=E8=AE=A2=E5=8D=95=E5=AD=90?= =?UTF-8?q?=E8=A1=A8=E4=B8=AD=E5=AD=98=E5=9C=A8bom=E7=9A=84=E5=AD=90?= =?UTF-8?q?=E8=A1=A8=E5=88=97=E8=A1=A8controller=E6=96=B9=E6=B3=95?= =?UTF-8?q?=EF=BC=9B=20=E6=96=B0=E5=A2=9E=E6=9F=A5=E8=AF=A2=E9=94=80?= =?UTF-8?q?=E5=94=AE=E8=AE=A2=E5=8D=95=E5=AD=90=E8=A1=A8=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E5=8E=9F=E6=96=99=E5=92=8C=E8=BE=85=E6=96=99service=E6=96=B9?= =?UTF-8?q?=E6=B3=95=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SysSalesOrderChildController.java | 13 +++++++++++++ .../system/service/ISysSalesOrderChildService.java | 6 ++++++ .../service/impl/SysSalesOrderChildServiceImpl.java | 13 +++++++++++++ .../mapper/system/SysSalesOrderChildMapper.xml | 2 +- 4 files changed, 33 insertions(+), 1 deletion(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderChildController.java b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderChildController.java index 7d6d976c..ca340f7d 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderChildController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderChildController.java @@ -15,6 +15,7 @@ import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.*; import java.util.List; +import java.util.stream.Collectors; /** * 客户销售订单报价子Controller @@ -57,6 +58,18 @@ public class SysSalesOrderChildController extends BaseController List list = SysSalesOrderChildService.selectSysSalesOrderChildListAll(SysSalesOrderChild); return getDataTable(list); } + /** + * 查询销售订单子表(存在bom)的列表 + */ + @PostMapping("/listBom") + @ResponseBody + public TableDataInfo listBom(SysSalesOrderChild SysSalesOrderChild) + { + startPage(); + List list = SysSalesOrderChildService.selectSysSalesOrderChildListWithBom(SysSalesOrderChild); + return getDataTable(list); + } + /** * 导出客户报价子列表 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderChildService.java b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderChildService.java index 03138843..3db3b33f 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderChildService.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderChildService.java @@ -41,4 +41,10 @@ public interface ISysSalesOrderChildService { * 销售出货物料列表展示 */ List selectSalesDeliverGoodsDetailList(List salesOrderIdList); + + /* + * 筛选除原料/辅料外的0阶bom + * */ + List selectSysSalesOrderChildListWithBom(SysSalesOrderChild sysCustomerQuoteChild); + } 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 7dd28a5f..b4650807 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 @@ -132,6 +132,19 @@ public class SysSalesOrderChildServiceImpl implements ISysSalesOrderChildService return mergedList; } + + @Override + public List selectSysSalesOrderChildListWithBom(SysSalesOrderChild sysCustomerQuoteChild) { + + List list = sysCustomerQuoteChildMapper.selectSysSalesOrderChildList(sysCustomerQuoteChild); + // 过滤出5/6/7/8/9开头的物料(存在bom) + List filteredList = list.stream() + .filter(item -> item.getMaterialCode() != null && (item.getMaterialCode().startsWith("5") + || item.getMaterialCode().startsWith("6")|| item.getMaterialCode().startsWith("7") + || item.getMaterialCode().startsWith("8")|| item.getMaterialCode().startsWith("9"))) + .collect(Collectors.toList()); + return filteredList; + } } diff --git a/ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml b/ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml index 6a504220..f1fb8b57 100644 --- a/ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml @@ -59,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ,b.id as bom_id,b.use_status, b.audit_status from sys_sales_order_child a left join erp_bom b - on a.materialCode = b.material_no + on a.materialCode = b.material_no and b.parent_id = '0'