| | |
| | | return |
| | | } |
| | | |
| | | products := make([]*product_inventory.OutputProduct, 0, len(params.Products)) |
| | | for _, product := range params.Products { |
| | | products = append(products, &product_inventory.OutputProduct{ |
| | | Number: product.Number, |
| | | Amount: product.OutputAmount.String(), |
| | | }) |
| | | } |
| | | client := product_inventory.NewProductInventoryServiceClient(grpc_init.ProductInventoryServiceConn) |
| | | _, err := client.OrderProductOutput(ctx.GetCtx(), &product_inventory.OrderProductOutputRequest{ |
| | | OrderNumber: params.SaleDetailNumber, |
| | | Products: products, |
| | | }) |
| | | |
| | | if err != nil { |
| | | logx.Errorf("product_inventory.OrderProductOutput err:%v, params:%v", err, params) |
| | | ctx.FailWithMsg(ecode.UnknownErr, "发货失败") |
| | | return |
| | | } |
| | | |
| | | ctx.OkWithDetailed(nil) |
| | | } |
| | | |