2
This commit is contained in:
@@ -28,6 +28,7 @@ func (r *ProductService) GetProductPlatform(productPlatformId int64) (g *dto.Pro
|
||||
var quantity int
|
||||
|
||||
ReportPreRequest := prescription.GetProdStockRequest{
|
||||
PharmacyCode: productPlatform.PharmacyCode,
|
||||
DrugCode: productPlatform.ProductPharmacyCode,
|
||||
}
|
||||
|
||||
@@ -188,6 +189,7 @@ func (r *ProductService) AddProduct(userId string, req requests.AddProduct) (boo
|
||||
|
||||
// 获取商品库存
|
||||
ReportPreRequest := prescription.GetProdStockRequest{
|
||||
PharmacyCode: product.PharmacyCode,
|
||||
DrugCode: product.ProductPharmacyCode,
|
||||
}
|
||||
|
||||
|
||||
@@ -409,7 +409,9 @@ func (r ReportPreRequest) ReportPre() (bool, error) {
|
||||
|
||||
// GetProdStock 获取商品库存
|
||||
func (r GetProdStockRequest) GetProdStock() (*GetProdStockDataResponse, error) {
|
||||
if r.PharmacyCode == "" {
|
||||
r.PharmacyCode = config.C.Pre.PrePlatPharmacyCode
|
||||
}
|
||||
jsonData, err := json.Marshal(r)
|
||||
if err != nil {
|
||||
utils.LogJsonErr("获取商品库存-序列化请求参数失败", err)
|
||||
@@ -483,5 +485,8 @@ func (r GetProdStockRequest) GetProdStock() (*GetProdStockDataResponse, error) {
|
||||
}
|
||||
|
||||
utils.LogJsonInfo("获取商品库存-成功", response.Data)
|
||||
if len(response.Data) == 0 {
|
||||
return &GetProdStockDataResponse{Quantity: "0"}, nil
|
||||
}
|
||||
return &response.Data[0], nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user