预警24
This commit is contained in:
parent
39a6d78f2b
commit
f18d07b003
|
|
@ -182,9 +182,9 @@ func (this *VoucherBiz) Calculate(ctx context.Context, product *bo.ProductBo, wx
|
||||||
return nil
|
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
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -199,7 +199,7 @@ func (this *VoucherBiz) WarningSend(ctx context.Context, product *bo.ProductBo,
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(mobileList) > 0 {
|
if len(mobileList) > 0 {
|
||||||
return this.SmsMixRepo.Send(ctx, mobileList, buildTemplateParams(product, w))
|
return this.SmsMixRepo.Send(ctx, mobileList, buildTemplateParams(product, wxResp))
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
@ -210,12 +210,12 @@ func buildTemplateParams(product *bo.ProductBo, req *do.WxResp) map[string]strin
|
||||||
"stock_name": product.BatchName,
|
"stock_name": product.BatchName,
|
||||||
"stock_no": product.ProductNo,
|
"stock_no": product.ProductNo,
|
||||||
"amount": strconv.Itoa(int(req.Amount)),
|
"amount": strconv.Itoa(int(req.Amount)),
|
||||||
"all_budget": strconv.Itoa(int(req.AllBudget)),
|
|
||||||
"all_stock": strconv.Itoa(int(req.AllStock)),
|
"all_stock": strconv.Itoa(int(req.AllStock)),
|
||||||
|
"all_budget": strconv.Itoa(int(req.AllBudget)),
|
||||||
"used_stock": strconv.Itoa(int(req.UsedStock)),
|
"used_stock": strconv.Itoa(int(req.UsedStock)),
|
||||||
"used_budget": strconv.Itoa(int(req.UsedBudget)),
|
"used_budget": strconv.Itoa(int(req.UsedBudget)),
|
||||||
"available_budget": strconv.Itoa(int(req.AvailableBudget)),
|
|
||||||
"available_stock": strconv.Itoa(int(req.AvailableStock)),
|
"available_stock": strconv.Itoa(int(req.AvailableStock)),
|
||||||
|
"available_budget": strconv.Itoa(int(req.AvailableBudget)),
|
||||||
"budget_usage_rate": fmt.Sprintf("%.1f", req.StockUsageRate),
|
"budget_usage_rate": fmt.Sprintf("%.1f", req.StockUsageRate),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue