fix: 调整销售分析与排行榜功能

This commit is contained in:
renzhiyuan 2025-12-31 17:36:18 +08:00
parent c9ca9d97e7
commit 4e974efc1c
2 changed files with 6 additions and 6 deletions

View File

@ -516,15 +516,15 @@ func (d *DingTalkBotBiz) handleReport(ctx context.Context, rec *entitys.Recogniz
}
reports = append(reports, repo...)
case "report_sales_analysis":
repo, _err := rep.GetProfitRankingSum(t)
product := strings.Split(group.ProductName, ",")
repo, _err := rep.GetStatisOfficialProductSum(t, product)
if _err != nil {
return _err
}
reports = append(reports, repo)
case "report_ranking_of_distributors":
product := strings.Split(group.ProductName, ",")
repo, _err := rep.GetStatisOfficialProductSum(t, product)
repo, _err := rep.GetProfitRankingSum(t)
if _err != nil {
return _err
}

View File

@ -243,7 +243,7 @@ func (b *BbxtTools) GetProfitRankingSum(now time.Time) (report *ReportRes, err e
}, err
}
// GetStatisOfficialProductSum 利润同比分销商排行榜
// GetStatisOfficialProductSum 销量同比分析
func (b *BbxtTools) GetStatisOfficialProductSum(now time.Time, productName []string) (report *ReportRes, err error) {
ct := []string{
@ -302,7 +302,7 @@ func (b *BbxtTools) GetStatisOfficialProductSum(now time.Time, productName []str
filePath := b.cacheDir + "/xstb_ana" + fmt.Sprintf("%d", time.Now().Unix()) + ".xlsx"
err = b.SimpleFillExcelWithTitle(b.excelTempDir+"/"+"xstb_ana.xlsx", filePath, total, title)
return &ReportRes{
ReportName: "利润同比分销商排行榜",
ReportName: "销售同比分析",
Title: title,
Path: filePath,
Data: total,