|
@@ -9,6 +9,7 @@ import (
|
|
|
"hongze/hz_crm_api/models"
|
|
|
"hongze/hz_crm_api/models/company"
|
|
|
"hongze/hz_crm_api/models/cygx"
|
|
|
+ "hongze/hz_crm_api/models/roadshow"
|
|
|
"hongze/hz_crm_api/models/system"
|
|
|
"hongze/hz_crm_api/services"
|
|
|
cygxService "hongze/hz_crm_api/services/cygx"
|
|
@@ -1978,7 +1979,7 @@ func (this *IndustrialSubjectController) ReportMappingAdd() {
|
|
|
}
|
|
|
|
|
|
//func init() {
|
|
|
-// initOrderArticle()
|
|
|
+// initRsList()
|
|
|
//}
|
|
|
|
|
|
func initart() {
|
|
@@ -2856,3 +2857,79 @@ func initOrderArticle() {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+func initRsList() {
|
|
|
+
|
|
|
+ list, errList := roadshow.GetCalendarDetailListinit()
|
|
|
+ if errList != nil {
|
|
|
+ fmt.Println(errList)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ //创建excel
|
|
|
+ dir, err := os.Executable()
|
|
|
+ exPath := filepath.Dir(dir)
|
|
|
+ downLoadnFilePath := exPath + "/" + time.Now().Format(utils.FormatDateTimeUnSpace) + ".xlsx"
|
|
|
+ xlsxFile := xlsx.NewFile()
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ style := xlsx.NewStyle()
|
|
|
+ alignment := xlsx.Alignment{
|
|
|
+ Horizontal: "center",
|
|
|
+ Vertical: "center",
|
|
|
+ WrapText: true,
|
|
|
+ }
|
|
|
+ style.Alignment = alignment
|
|
|
+ style.ApplyAlignment = true
|
|
|
+
|
|
|
+ redStyle := xlsx.NewStyle()
|
|
|
+ redStyle.Alignment = alignment
|
|
|
+ redStyle.ApplyAlignment = true
|
|
|
+ redStyle.Font.Color = "ff0000"
|
|
|
+ //定义底色需要标黄的 单元格颜色
|
|
|
+ redFill := xlsx.Fill{"solid", "ffff00", "ffff00"}
|
|
|
+ redStyle.Fill = redFill
|
|
|
+ //redStyle.Border = *border
|
|
|
+
|
|
|
+ var sheetName string
|
|
|
+ sheetName = "活动"
|
|
|
+ sheet, err := xlsxFile.AddSheet(sheetName)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //标头
|
|
|
+ rowTitle := sheet.AddRow()
|
|
|
+ cellA := rowTitle.AddCell()
|
|
|
+ cellA.Value = "研究员"
|
|
|
+ cellB := rowTitle.AddCell()
|
|
|
+ cellB.Value = "路演时间"
|
|
|
+ cellC := rowTitle.AddCell()
|
|
|
+ cellC.Value = "公司名"
|
|
|
+
|
|
|
+ cellMoney := rowTitle.AddCell()
|
|
|
+ cellMoney.Value = "销售"
|
|
|
+
|
|
|
+ for _, item := range list {
|
|
|
+ row := sheet.AddRow()
|
|
|
+ cellAData := row.AddCell()
|
|
|
+ cellAData.Value = item.ResearcherName
|
|
|
+
|
|
|
+ cellBData := row.AddCell()
|
|
|
+ cellBData.Value = item.StartDate + " " + item.StartTime
|
|
|
+ cellCData := row.AddCell()
|
|
|
+ cellCData.Value = item.Title
|
|
|
+
|
|
|
+ cellCnameData := row.AddCell()
|
|
|
+ cellCnameData.Value = item.SysUserRealName
|
|
|
+ }
|
|
|
+
|
|
|
+ err = xlsxFile.Save(downLoadnFilePath)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+}
|