1
This commit is contained in:
@@ -24,9 +24,32 @@ func (r *ProductService) GetProductPlatform(productPlatformId int64) (g *dto.Pro
|
||||
return nil, errors.New(err.Error())
|
||||
}
|
||||
|
||||
// 获取商品库存
|
||||
var quantity int
|
||||
|
||||
ReportPreRequest := prescription.GetProdStockRequest{
|
||||
DrugCode: productPlatform.ProductPharmacyCode,
|
||||
}
|
||||
|
||||
result, err := ReportPreRequest.GetProdStock()
|
||||
if err != nil {
|
||||
quantity = 0
|
||||
}
|
||||
|
||||
if result != nil {
|
||||
if result.Quantity != "" {
|
||||
quantity, err = strconv.Atoi(result.Quantity)
|
||||
if err != nil {
|
||||
quantity = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 处理返回值
|
||||
g = dto.GetProductPlatformDto(productPlatform)
|
||||
|
||||
// 加载商品库存
|
||||
g.LoadProductAmount(quantity)
|
||||
return g, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user