This commit is contained in:
ziming 2025-07-02 10:57:35 +08:00
parent 39a6d78f2b
commit f18d07b003
1 changed files with 5 additions and 5 deletions

View File

@ -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),
}
}