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