From af94c2246fd1aa7ea506a180f001525d416105c8 Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期五, 24 四月 2026 09:34:01 +0800
Subject: [PATCH] fix(product): 修复产品模型文件迁移逻辑
---
src/main/java/com/ruoyi/production/service/impl/ProductBomServiceImpl.java | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/ruoyi/production/service/impl/ProductBomServiceImpl.java b/src/main/java/com/ruoyi/production/service/impl/ProductBomServiceImpl.java
index 256119c..ea427f8 100644
--- a/src/main/java/com/ruoyi/production/service/impl/ProductBomServiceImpl.java
+++ b/src/main/java/com/ruoyi/production/service/impl/ProductBomServiceImpl.java
@@ -73,7 +73,9 @@
*/
public Long countChild(Long productModelId) {
ProductBom productBom = productBomMapper.selectOne(new LambdaQueryWrapper<ProductBom>()
- .eq(ProductBom::getProductModelId, productModelId));
+ .eq(ProductBom::getProductModelId, productModelId)
+ .orderByDesc(ProductBom::getId)
+ .last("limit 1"));
if(productBom != null){
return productStructureService.countBybomId(productBom.getId());
}
--
Gitblit v1.9.3