|
@@ -258,6 +258,67 @@ func ReportViewDetail() (err error) {
|
|
|
cellF.Value = `双周报`
|
|
|
}
|
|
|
continue
|
|
|
+ } else if v.TypeName == `月报` {
|
|
|
+ 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 = "访问页面"
|
|
|
+ cellF := rowTitle.AddCell()
|
|
|
+ cellF.Value = "报告类型"
|
|
|
+
|
|
|
+ items, err := models.GetResearchReportViewersDetail(startTime, endTime, v.TypeValue)
|
|
|
+ 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 = item.ReportVariety
|
|
|
+ cellF := row.AddCell()
|
|
|
+ cellF.Value = v.TypeName
|
|
|
+ }
|
|
|
+
|
|
|
+ //新月报的数据
|
|
|
+ monthItems, err := models.GetRddpMonthReportViewersDetail(startTime, endTime)
|
|
|
+ if err != nil {
|
|
|
+ return err
|
|
|
+ }
|
|
|
+ for _, item := range monthItems {
|
|
|
+ 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.ClassifyNameSecond + `】` + item.ResearchReportName
|
|
|
+ cellE := row.AddCell()
|
|
|
+ cellE.Value = item.ClassifyNameSecond
|
|
|
+ cellF := row.AddCell()
|
|
|
+ cellF.Value = `月报`
|
|
|
+ }
|
|
|
+ continue
|
|
|
}
|
|
|
|
|
|
if v.TypeValue == "rddp" {
|
|
@@ -384,6 +445,7 @@ func ReportViewDetail() (err error) {
|
|
|
if sendResult {
|
|
|
os.Remove(savePath)
|
|
|
}
|
|
|
+
|
|
|
//fmt.Println("send result:", sendResult)
|
|
|
//fmt.Println("end send email")
|
|
|
return nil
|