fix(backend): 入库审核库存沿用明细真实快照名 + 库存列表过滤软删商品,修复历史导入占位顶替;入库/出库列表支持 keyword 搜索
Deploy Server / release-deploy-server (push) Successful in 53s

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YZ4DskSRKsSiheQonFtQvx
This commit is contained in:
wangjia
2026-06-20 16:02:02 +08:00
parent 7f3261a4a9
commit fb1e637ce4
9 changed files with 225 additions and 15 deletions
+18 -8
View File
@@ -64,16 +64,26 @@ func (s *StockService) ApproveStockIn(shopID, orderID, reviewerID uint64) error
unitPricePtr = &itemCopy.UnitPrice
}
productCode := ""
productName := ""
series := ""
spec := ""
// 优先使用明细自带快照列(历史导入单的真实商品信息在此),
// Product 关联仅作兜底(普通 UI 录入单的明细快照为空)。
productCode := itemCopy.ProductCode
productName := itemCopy.ProductName
series := itemCopy.Series
spec := itemCopy.Spec
unit := ""
if itemCopy.Product != nil {
productCode = itemCopy.Product.Code
productName = itemCopy.Product.Name
series = itemCopy.Product.Series
spec = itemCopy.Product.Spec
if productCode == "" {
productCode = itemCopy.Product.Code
}
if productName == "" {
productName = itemCopy.Product.Name
}
if series == "" {
series = itemCopy.Product.Series
}
if spec == "" {
spec = itemCopy.Product.Spec
}
unit = itemCopy.Product.Unit
}