fix: 调整销售分析与排行榜功能
This commit is contained in:
parent
c9ca9d97e7
commit
4e974efc1c
|
|
@ -516,15 +516,15 @@ func (d *DingTalkBotBiz) handleReport(ctx context.Context, rec *entitys.Recogniz
|
||||||
}
|
}
|
||||||
reports = append(reports, repo...)
|
reports = append(reports, repo...)
|
||||||
case "report_sales_analysis":
|
case "report_sales_analysis":
|
||||||
|
product := strings.Split(group.ProductName, ",")
|
||||||
repo, _err := rep.GetProfitRankingSum(t)
|
repo, _err := rep.GetStatisOfficialProductSum(t, product)
|
||||||
if _err != nil {
|
if _err != nil {
|
||||||
return _err
|
return _err
|
||||||
}
|
}
|
||||||
reports = append(reports, repo)
|
reports = append(reports, repo)
|
||||||
|
|
||||||
case "report_ranking_of_distributors":
|
case "report_ranking_of_distributors":
|
||||||
product := strings.Split(group.ProductName, ",")
|
repo, _err := rep.GetProfitRankingSum(t)
|
||||||
repo, _err := rep.GetStatisOfficialProductSum(t, product)
|
|
||||||
if _err != nil {
|
if _err != nil {
|
||||||
return _err
|
return _err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -243,7 +243,7 @@ func (b *BbxtTools) GetProfitRankingSum(now time.Time) (report *ReportRes, err e
|
||||||
}, err
|
}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetStatisOfficialProductSum 利润同比分销商排行榜
|
// GetStatisOfficialProductSum 销量同比分析
|
||||||
func (b *BbxtTools) GetStatisOfficialProductSum(now time.Time, productName []string) (report *ReportRes, err error) {
|
func (b *BbxtTools) GetStatisOfficialProductSum(now time.Time, productName []string) (report *ReportRes, err error) {
|
||||||
|
|
||||||
ct := []string{
|
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"
|
filePath := b.cacheDir + "/xstb_ana" + fmt.Sprintf("%d", time.Now().Unix()) + ".xlsx"
|
||||||
err = b.SimpleFillExcelWithTitle(b.excelTempDir+"/"+"xstb_ana.xlsx", filePath, total, title)
|
err = b.SimpleFillExcelWithTitle(b.excelTempDir+"/"+"xstb_ana.xlsx", filePath, total, title)
|
||||||
return &ReportRes{
|
return &ReportRes{
|
||||||
ReportName: "利润同比分销商排行榜",
|
ReportName: "销售同比分析",
|
||||||
Title: title,
|
Title: title,
|
||||||
Path: filePath,
|
Path: filePath,
|
||||||
Data: total,
|
Data: total,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue