|
@@ -100,6 +100,12 @@ func ReportViewDetail() (err error) {
|
|
|
day.TypeValue = "day"
|
|
|
typeList = append(typeList, day)
|
|
|
|
|
|
+ advisory := new(models.ReportType)
|
|
|
+ advisory.TypeName = "每日商品聚焦"
|
|
|
+ advisory.TypeValue = "advisory"
|
|
|
+ typeList = append(typeList, advisory)
|
|
|
+
|
|
|
+
|
|
|
week := new(models.ReportType)
|
|
|
week.TypeName = "周报"
|
|
|
week.TypeValue = "week"
|
|
@@ -166,6 +172,40 @@ func ReportViewDetail() (err error) {
|
|
|
cellE := row.AddCell()
|
|
|
cellE.Value = v.TypeName
|
|
|
}
|
|
|
+ } else if v.TypeValue == "advisory" {
|
|
|
+ sheet, err := file.AddSheet(v.TypeName + "研报阅读统计")
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ //标头
|
|
|
+ rowTitle := sheet.AddRow()
|
|
|
+ cellA := rowTitle.AddCell()
|
|
|
+ cellA.Value = "用户名称"
|
|
|
+ cellB := rowTitle.AddCell()
|
|
|
+ cellB.Value = "公司名称"
|
|
|
+ cellC := rowTitle.AddCell()
|
|
|
+ cellC.Value = "访问时间"
|
|
|
+ cellD := rowTitle.AddCell()
|
|
|
+ cellD.Value = "访问标题"
|
|
|
+ cellE := rowTitle.AddCell()
|
|
|
+ cellE.Value = "报告类型"
|
|
|
+ items, err := models.GetAdvisoryViewersDetail(startTime, endTime)
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ for _, item := range items {
|
|
|
+ row := sheet.AddRow()
|
|
|
+ cellA := row.AddCell()
|
|
|
+ cellA.Value = item.RealName
|
|
|
+ cellB := row.AddCell()
|
|
|
+ cellB.Value = item.CompanyName
|
|
|
+ cellC := row.AddCell()
|
|
|
+ cellC.Value = item.CreatedTime
|
|
|
+ cellD := row.AddCell()
|
|
|
+ cellD.Value = item.ResearchReportName
|
|
|
+ cellE := row.AddCell()
|
|
|
+ cellE.Value = v.TypeName
|
|
|
+ }
|
|
|
} else {
|
|
|
sheet, err := file.AddSheet(v.TypeName + "研报阅读统计")
|
|
|
if err != nil {
|
|
@@ -210,6 +250,7 @@ func ReportViewDetail() (err error) {
|
|
|
title := "研报阅读统计报表"
|
|
|
savePath := "report_view_detail"+ time.Now().Format(utils.FormatDateTimeUnSpace) + ".xlsx"
|
|
|
err = file.Save("./" + savePath)
|
|
|
+ fmt.Println(err)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
@@ -220,7 +261,7 @@ func ReportViewDetail() (err error) {
|
|
|
if sendResult {
|
|
|
os.Remove(savePath)
|
|
|
}
|
|
|
- fmt.Println("send result:", sendResult)
|
|
|
- fmt.Println("end send email")
|
|
|
+ //fmt.Println("send result:", sendResult)
|
|
|
+ //fmt.Println("end send email")
|
|
|
return nil
|
|
|
}
|