|
@@ -6669,7 +6669,7 @@ func initCommpanyList() {
|
|
|
}
|
|
|
|
|
|
//func init() {
|
|
|
-// initart121_326()
|
|
|
+// initart121_328()
|
|
|
//}
|
|
|
|
|
|
// 公司研选剩余点数
|
|
@@ -7052,3 +7052,84 @@ func initart121_326() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+// 研选专栏阅读内容
|
|
|
+func initart121_328() {
|
|
|
+
|
|
|
+ listComapny, err := company.GetCompanyProductsByCompanyId23423()
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ 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 = "PV"
|
|
|
+ sheet, err := xlsxFile.AddSheet(sheetName)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //标头
|
|
|
+ rowTitle := sheet.AddRow()
|
|
|
+
|
|
|
+ cellC := rowTitle.AddCell()
|
|
|
+ cellC.Value = "公司名称"
|
|
|
+
|
|
|
+ cellDCreatedTime := rowTitle.AddCell()
|
|
|
+ cellDCreatedTime.Value = "Uv"
|
|
|
+
|
|
|
+ for k, v := range listComapny {
|
|
|
+ fmt.Println("kkkk", k)
|
|
|
+
|
|
|
+ listPv, err := cygx.GetCygxYanxuanSpecialRecordListsss(v.CompanyId)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ row := sheet.AddRow()
|
|
|
+
|
|
|
+ cellADatatitle := row.AddCell()
|
|
|
+ cellADatatitle.Value = v.CompanyName
|
|
|
+
|
|
|
+ cellADataPd := row.AddCell()
|
|
|
+ cellADataPd.Value = strconv.Itoa(len(listPv))
|
|
|
+
|
|
|
+ cellADataPdId := row.AddCell()
|
|
|
+ cellADataPdId.Value = strconv.Itoa(v.CompanyId)
|
|
|
+
|
|
|
+ }
|
|
|
+ err = xlsxFile.Save(downLoadnFilePath)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return
|
|
|
+}
|