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'