|
@@ -8300,3 +8300,321 @@ func initAct5349() {
|
|
|
}
|
|
|
fmt.Println("end")
|
|
|
}
|
|
|
+
|
|
|
+//func init() {
|
|
|
+// //companyIdArr := []int{7408, 12442, 5618, 7577, 15736}
|
|
|
+// //
|
|
|
+// //for _, v := range companyIdArr {
|
|
|
+// // initconmap(v)
|
|
|
+// //}
|
|
|
+// initconmapMobile()
|
|
|
+//}
|
|
|
+
|
|
|
+func initconmap(companyId int) {
|
|
|
+ item, err := company.GetCompanyDetailById(companyId)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //创建excel
|
|
|
+ dir, err := os.Executable()
|
|
|
+ exPath := filepath.Dir(dir)
|
|
|
+ downLoadnFilePath := exPath + "/" + item.CompanyName + ".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
|
|
|
+
|
|
|
+ for pidIndex := 0; pidIndex <= 1; pidIndex++ {
|
|
|
+ var sheetName string
|
|
|
+ if pidIndex == 0 {
|
|
|
+ sheetName = "活动信息"
|
|
|
+ //listDate = list
|
|
|
+ } else {
|
|
|
+ sheetName = "报告信息"
|
|
|
+ //listDate = listClPvPower
|
|
|
+ }
|
|
|
+ sheet, err := xlsxFile.AddSheet(sheetName)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if pidIndex == 0 {
|
|
|
+ //标头
|
|
|
+ rowTitle := sheet.AddRow()
|
|
|
+
|
|
|
+ cellA := rowTitle.AddCell()
|
|
|
+ cellA.Value = "手机号"
|
|
|
+
|
|
|
+ cellA2 := rowTitle.AddCell()
|
|
|
+ cellA2.Value = "姓名"
|
|
|
+
|
|
|
+ cellA4 := rowTitle.AddCell()
|
|
|
+ cellA4.Value = "公司名"
|
|
|
+
|
|
|
+ cellB := rowTitle.AddCell()
|
|
|
+ cellB.Value = "活动名称"
|
|
|
+
|
|
|
+ cellAt := rowTitle.AddCell()
|
|
|
+ cellAt.Value = "活动时间"
|
|
|
+
|
|
|
+ cellUser := rowTitle.AddCell()
|
|
|
+ cellUser.Value = "入会时间"
|
|
|
+
|
|
|
+ cellCompany := rowTitle.AddCell()
|
|
|
+ cellCompany.Value = "退出时间"
|
|
|
+
|
|
|
+ cellTime := rowTitle.AddCell()
|
|
|
+ cellTime.Value = "参会时长"
|
|
|
+
|
|
|
+ signUpDetailList, err := cygx.GetSignupDetailListinit521(companyId)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var mobils []string
|
|
|
+
|
|
|
+ for _, v := range signUpDetailList {
|
|
|
+ mobils = append(mobils, v.Mobile)
|
|
|
+ }
|
|
|
+
|
|
|
+ listUserFicc, err := models.GetWxUserRaiSllerListByUserMobileFiic(mobils)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ mapUser := make(map[string]string)
|
|
|
+ for _, v := range listUserFicc {
|
|
|
+ mapUser[v.Mobile] = v.RealName
|
|
|
+ }
|
|
|
+ for _, vs := range signUpDetailList {
|
|
|
+ if vs.CompanyName == "弘则研究" {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ row := sheet.AddRow()
|
|
|
+
|
|
|
+ cellA1Datatitle := row.AddCell()
|
|
|
+ cellA1Datatitle.Value = vs.Mobile
|
|
|
+
|
|
|
+ cellA2Datatitle := row.AddCell()
|
|
|
+ if vs.RealName == "" {
|
|
|
+ vs.RealName = mapUser[vs.Mobile]
|
|
|
+ }
|
|
|
+ cellA2Datatitle.Value = vs.RealName
|
|
|
+
|
|
|
+ cellA4Datatitle := row.AddCell()
|
|
|
+ cellA4Datatitle.Value = vs.CompanyName
|
|
|
+
|
|
|
+ cellADatatitle := row.AddCell()
|
|
|
+ cellADatatitle.Value = vs.ActivityName
|
|
|
+
|
|
|
+ cellADatatitle2 := row.AddCell()
|
|
|
+ cellADatatitle2.Value = vs.ActivityTime
|
|
|
+
|
|
|
+ cellADataPd := row.AddCell()
|
|
|
+ cellADataPd.Value = vs.FirstMeetingTime
|
|
|
+
|
|
|
+ cellADataPd2 := row.AddCell()
|
|
|
+ cellADataPd2.Value = vs.LastMeetingTime
|
|
|
+
|
|
|
+ cellBData := row.AddCell()
|
|
|
+ cellBData.Value = vs.Duration
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //标头
|
|
|
+ rowTitle := sheet.AddRow()
|
|
|
+
|
|
|
+ cellB := rowTitle.AddCell()
|
|
|
+ cellB.Value = "手机号"
|
|
|
+
|
|
|
+ cellActime := rowTitle.AddCell()
|
|
|
+ cellActime.Value = "姓名"
|
|
|
+
|
|
|
+ cellD := rowTitle.AddCell()
|
|
|
+ cellD.Value = "公司名"
|
|
|
+
|
|
|
+ cellE := rowTitle.AddCell()
|
|
|
+ cellE.Value = "阅读时间"
|
|
|
+
|
|
|
+ cellE5 := rowTitle.AddCell()
|
|
|
+ cellE5.Value = "报告标题"
|
|
|
+
|
|
|
+ cellE6 := rowTitle.AddCell()
|
|
|
+ cellE6.Value = "报告发布时间"
|
|
|
+
|
|
|
+ signUpDetailList, err := cygx.GetArticleHistoryListInitsscompany_id(companyId)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var mobils []string
|
|
|
+
|
|
|
+ for _, v := range signUpDetailList {
|
|
|
+ mobils = append(mobils, v.Mobile)
|
|
|
+ }
|
|
|
+ listUserFicc, err := models.GetWxUserRaiSllerListByUserMobileFiic(mobils)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ mapUser := make(map[string]string)
|
|
|
+ for _, v := range listUserFicc {
|
|
|
+ mapUser[v.Mobile] = v.RealName
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, v2 := range signUpDetailList {
|
|
|
+ row := sheet.AddRow()
|
|
|
+ cellActData1 := row.AddCell()
|
|
|
+ cellActData1.Value = v2.Mobile
|
|
|
+
|
|
|
+ cellActData2 := row.AddCell()
|
|
|
+ if v2.RealName == "" {
|
|
|
+ v2.RealName = mapUser[v2.Mobile]
|
|
|
+ }
|
|
|
+ cellActData2.Value = v2.RealName
|
|
|
+
|
|
|
+ cellActData3 := row.AddCell()
|
|
|
+ cellActData3.Value = v2.CompanyName
|
|
|
+
|
|
|
+ cellActData4 := row.AddCell()
|
|
|
+ cellActData4.Value = v2.CreateTime
|
|
|
+
|
|
|
+ cellActData5 := row.AddCell()
|
|
|
+ cellActData5.Value = v2.Title
|
|
|
+
|
|
|
+ cellActData6 := row.AddCell()
|
|
|
+ cellActData6.Value = v2.PublishDate
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ err = xlsxFile.Save(downLoadnFilePath)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ fmt.Println("end")
|
|
|
+}
|
|
|
+
|
|
|
+func initconmapMobile() {
|
|
|
+
|
|
|
+ //创建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
|
|
|
+
|
|
|
+ var sheetName string
|
|
|
+ sheetName = "活动信息"
|
|
|
+ sheet, err := xlsxFile.AddSheet(sheetName)
|
|
|
+
|
|
|
+ //标头
|
|
|
+ rowTitle := sheet.AddRow()
|
|
|
+
|
|
|
+ cellA := rowTitle.AddCell()
|
|
|
+ cellA.Value = "手机号"
|
|
|
+
|
|
|
+ cellA2 := rowTitle.AddCell()
|
|
|
+ cellA2.Value = "姓名"
|
|
|
+
|
|
|
+ cellA4 := rowTitle.AddCell()
|
|
|
+ cellA4.Value = "公司名"
|
|
|
+
|
|
|
+ cellB := rowTitle.AddCell()
|
|
|
+ cellB.Value = "活动名称"
|
|
|
+
|
|
|
+ cellAt := rowTitle.AddCell()
|
|
|
+ cellAt.Value = "活动时间"
|
|
|
+
|
|
|
+ cellUser := rowTitle.AddCell()
|
|
|
+ cellUser.Value = "入会时间"
|
|
|
+
|
|
|
+ cellCompany := rowTitle.AddCell()
|
|
|
+ cellCompany.Value = "退出时间"
|
|
|
+
|
|
|
+ cellTime := rowTitle.AddCell()
|
|
|
+ cellTime.Value = "参会时长"
|
|
|
+
|
|
|
+ signUpDetailList, err := cygx.GetSignupDetailListinit521m()
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var mobils []string
|
|
|
+
|
|
|
+ for _, v := range signUpDetailList {
|
|
|
+ mobils = append(mobils, v.Mobile)
|
|
|
+ }
|
|
|
+
|
|
|
+ listUserFicc, err := models.GetWxUserRaiSllerListByUserMobileFiic(mobils)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ mapUser := make(map[string]string)
|
|
|
+ for _, v := range listUserFicc {
|
|
|
+ mapUser[v.Mobile] = v.RealName
|
|
|
+ }
|
|
|
+ for _, vs := range signUpDetailList {
|
|
|
+ if vs.CompanyName == "弘则研究" {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ row := sheet.AddRow()
|
|
|
+
|
|
|
+ cellA1Datatitle := row.AddCell()
|
|
|
+ cellA1Datatitle.Value = vs.Mobile
|
|
|
+
|
|
|
+ cellA2Datatitle := row.AddCell()
|
|
|
+ if vs.RealName == "" {
|
|
|
+ vs.RealName = mapUser[vs.Mobile]
|
|
|
+ }
|
|
|
+ cellA2Datatitle.Value = vs.RealName
|
|
|
+
|
|
|
+ cellA4Datatitle := row.AddCell()
|
|
|
+ cellA4Datatitle.Value = vs.CompanyName
|
|
|
+
|
|
|
+ cellADatatitle := row.AddCell()
|
|
|
+ cellADatatitle.Value = vs.ActivityName
|
|
|
+
|
|
|
+ cellADatatitle2 := row.AddCell()
|
|
|
+ cellADatatitle2.Value = vs.ActivityTime
|
|
|
+
|
|
|
+ cellADataPd := row.AddCell()
|
|
|
+ cellADataPd.Value = vs.FirstMeetingTime
|
|
|
+
|
|
|
+ cellADataPd2 := row.AddCell()
|
|
|
+ cellADataPd2.Value = vs.LastMeetingTime
|
|
|
+
|
|
|
+ cellBData := row.AddCell()
|
|
|
+ cellBData.Value = vs.Duration
|
|
|
+ }
|
|
|
+
|
|
|
+ err = xlsxFile.Save(downLoadnFilePath)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ fmt.Println("end")
|
|
|
+}
|