Browse Source

[feat]

销售管理 销售订单
新增查询销售订单子表中存在bom的子表列表controller方法;
新增查询销售订单子表过滤原料和辅料service方法;
dev
王晓迪 2 weeks ago
parent
commit
e83ad4bc28
  1. 13
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysSalesOrderChildController.java
  2. 6
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderChildService.java
  3. 13
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysSalesOrderChildServiceImpl.java
  4. 2
      ruoyi-admin/src/main/resources/mapper/system/SysSalesOrderChildMapper.xml

13
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<SysSalesOrderChild> list = SysSalesOrderChildService.selectSysSalesOrderChildListAll(SysSalesOrderChild);
return getDataTable(list);
}
/**
* 查询销售订单子表存在bom的列表
*/
@PostMapping("/listBom")
@ResponseBody
public TableDataInfo listBom(SysSalesOrderChild SysSalesOrderChild)
{
startPage();
List<SysSalesOrderChild> list = SysSalesOrderChildService.selectSysSalesOrderChildListWithBom(SysSalesOrderChild);
return getDataTable(list);
}
/**
* 导出客户报价子列表
*/

6
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysSalesOrderChildService.java

@ -41,4 +41,10 @@ public interface ISysSalesOrderChildService {
* 销售出货物料列表展示
*/
List<SysSalesOrderChild> selectSalesDeliverGoodsDetailList(List<Long> salesOrderIdList);
/*
* 筛选除原料/辅料外的0阶bom
* */
List<SysSalesOrderChild> selectSysSalesOrderChildListWithBom(SysSalesOrderChild sysCustomerQuoteChild);
}

13
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<SysSalesOrderChild> selectSysSalesOrderChildListWithBom(SysSalesOrderChild sysCustomerQuoteChild) {
List<SysSalesOrderChild> list = sysCustomerQuoteChildMapper.selectSysSalesOrderChildList(sysCustomerQuoteChild);
// 过滤出5/6/7/8/9开头的物料(存在bom)
List<SysSalesOrderChild> 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;
}
}

2
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'
</sql>

Loading…
Cancel
Save