|
@@ -5245,9 +5245,10 @@ func initart121_1() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// func init() {
|
|
|
-// initAct33()
|
|
|
-// }
|
|
|
+//func init() {
|
|
|
+// initContract()
|
|
|
+//}
|
|
|
+
|
|
|
func initAct33() {
|
|
|
//行业
|
|
|
var condition string
|
|
@@ -5485,3 +5486,192 @@ func initart33() {
|
|
|
}
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+func initUserKw() {
|
|
|
+ listKw, e := cygx.GetCygxSearchKeyWordListInit()
|
|
|
+ if e != nil {
|
|
|
+ fmt.Println(e)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ mapCompanyIds := make(map[int]bool)
|
|
|
+ var companyids []int
|
|
|
+ for _, v := range listKw {
|
|
|
+ if mapCompanyIds[v.CompanyId] {
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ companyids = append(companyids, v.CompanyId)
|
|
|
+ mapCompanyIds[v.CompanyId] = true
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ companyProductItems, err := company.GetCompanyProductByCompanyIdSAndProductId(companyids, 2)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ mapCompamyStatus := make(map[int]string)
|
|
|
+ for _, v := range companyProductItems {
|
|
|
+ mapCompamyStatus[v.CompanyId] = v.Status
|
|
|
+ }
|
|
|
+
|
|
|
+ //创建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)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //标头
|
|
|
+ rowTitle := sheet.AddRow()
|
|
|
+ cellA := rowTitle.AddCell()
|
|
|
+ cellA.Value = "搜索词"
|
|
|
+ cellB8 := rowTitle.AddCell()
|
|
|
+ cellB8.Value = "手机号"
|
|
|
+
|
|
|
+ cellB9 := rowTitle.AddCell()
|
|
|
+ cellB9.Value = "姓名"
|
|
|
+
|
|
|
+ cellB10 := rowTitle.AddCell()
|
|
|
+ cellB10.Value = "公司"
|
|
|
+
|
|
|
+ cellB11 := rowTitle.AddCell()
|
|
|
+ cellB11.Value = "状态"
|
|
|
+
|
|
|
+ cellB12 := rowTitle.AddCell()
|
|
|
+ cellB12.Value = "搜索时间"
|
|
|
+
|
|
|
+ for _, vE := range listKw {
|
|
|
+ row := sheet.AddRow()
|
|
|
+ cellAData := row.AddCell()
|
|
|
+ cellAData.Value = vE.KeyWord
|
|
|
+
|
|
|
+ cellBData8 := row.AddCell()
|
|
|
+ cellBData8.Value = vE.Mobile
|
|
|
+
|
|
|
+ cellBData9 := row.AddCell()
|
|
|
+ cellBData9.Value = vE.RealName
|
|
|
+
|
|
|
+ cellBData10 := row.AddCell()
|
|
|
+ cellBData10.Value = vE.CompanyName
|
|
|
+
|
|
|
+ cellBData11 := row.AddCell()
|
|
|
+ cellBData11.Value = mapCompamyStatus[vE.CompanyId]
|
|
|
+
|
|
|
+ cellBData12 := row.AddCell()
|
|
|
+ cellBData12.Value = vE.CreateTime
|
|
|
+ }
|
|
|
+
|
|
|
+ err = xlsxFile.Save(downLoadnFilePath)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ fmt.Println("end")
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+func initContract() {
|
|
|
+ listContractList, e := company.CompanyContractList()
|
|
|
+ if e != nil {
|
|
|
+ fmt.Println(e)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ var companyContractIds []int
|
|
|
+ for _, v := range listContractList {
|
|
|
+ companyContractIds = append(companyContractIds, v.CompanyContractId)
|
|
|
+ }
|
|
|
+
|
|
|
+ //合并合同所对应的权限
|
|
|
+ mappermissionName, err := cygxService.GetCompanyContractPermissionNameMapById(companyContractIds)
|
|
|
+ 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
|
|
|
+
|
|
|
+ var sheetName string
|
|
|
+ sheetName = "35W公司统计"
|
|
|
+ sheet, err := xlsxFile.AddSheet(sheetName)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //标头
|
|
|
+ rowTitle := sheet.AddRow()
|
|
|
+ cellA := rowTitle.AddCell()
|
|
|
+ cellA.Value = "客户名称"
|
|
|
+ cellB8 := rowTitle.AddCell()
|
|
|
+ cellB8.Value = "销售"
|
|
|
+
|
|
|
+ cellB9 := rowTitle.AddCell()
|
|
|
+ cellB9.Value = "服务销售"
|
|
|
+
|
|
|
+ cellB10 := rowTitle.AddCell()
|
|
|
+ cellB10.Value = "合同金额"
|
|
|
+
|
|
|
+ cellB11 := rowTitle.AddCell()
|
|
|
+ cellB11.Value = "签约套餐"
|
|
|
+
|
|
|
+ for _, vE := range listContractList {
|
|
|
+ row := sheet.AddRow()
|
|
|
+ cellAData := row.AddCell()
|
|
|
+ cellAData.Value = vE.CompanyName
|
|
|
+
|
|
|
+ cellBData8 := row.AddCell()
|
|
|
+ cellBData8.Value = vE.SellerNameLast
|
|
|
+
|
|
|
+ cellBData9 := row.AddCell()
|
|
|
+ cellBData9.Value = vE.ShareSellerLast
|
|
|
+
|
|
|
+ cellBData10 := row.AddCell()
|
|
|
+ cellBData10.Value = fmt.Sprint(vE.Money)
|
|
|
+
|
|
|
+ cellBData11 := row.AddCell()
|
|
|
+ cellBData11.Value = mappermissionName[vE.CompanyContractId]
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ err = xlsxFile.Save(downLoadnFilePath)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ fmt.Println("end")
|
|
|
+
|
|
|
+}
|