diff --git a/internal/biz/warning_budget.go b/internal/biz/warning_budget.go index fad3bba..52537b8 100644 --- a/internal/biz/warning_budget.go +++ b/internal/biz/warning_budget.go @@ -182,9 +182,9 @@ func (this *VoucherBiz) Calculate(ctx context.Context, product *bo.ProductBo, wx return nil } -func (this *VoucherBiz) WarningSend(ctx context.Context, product *bo.ProductBo, w *do.WxResp) error { +func (this *VoucherBiz) WarningSend(ctx context.Context, product *bo.ProductBo, wxResp *do.WxResp) error { - if err := this.DingMixRepo.SendMarkdownMessage(ctx, "券预算不足", formatAsCard(product, w)); err != nil { + if err := this.DingMixRepo.SendMarkdownMessage(ctx, "券预算不足", formatAsCard(product, wxResp)); err != nil { return err } @@ -199,7 +199,7 @@ func (this *VoucherBiz) WarningSend(ctx context.Context, product *bo.ProductBo, } if len(mobileList) > 0 { - return this.SmsMixRepo.Send(ctx, mobileList, buildTemplateParams(product, w)) + return this.SmsMixRepo.Send(ctx, mobileList, buildTemplateParams(product, wxResp)) } return nil @@ -210,12 +210,12 @@ func buildTemplateParams(product *bo.ProductBo, req *do.WxResp) map[string]strin "stock_name": product.BatchName, "stock_no": product.ProductNo, "amount": strconv.Itoa(int(req.Amount)), - "all_budget": strconv.Itoa(int(req.AllBudget)), "all_stock": strconv.Itoa(int(req.AllStock)), + "all_budget": strconv.Itoa(int(req.AllBudget)), "used_stock": strconv.Itoa(int(req.UsedStock)), "used_budget": strconv.Itoa(int(req.UsedBudget)), - "available_budget": strconv.Itoa(int(req.AvailableBudget)), "available_stock": strconv.Itoa(int(req.AvailableStock)), + "available_budget": strconv.Itoa(int(req.AvailableBudget)), "budget_usage_rate": fmt.Sprintf("%.1f", req.StockUsageRate), } }