|
@@ -241,6 +241,7 @@ func (this *ReportArticleController) ReportArticleList() {
|
|
|
br.ErrMsg = "获取失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+ //return
|
|
|
condition += ` GROUP BY art.article_id ORDER BY art.publish_date DESC `
|
|
|
//fmt.Println(condition)
|
|
|
list, err := cygx.GetReportArticleList(condition, pars, startSize, pageSize, isClass)
|
|
@@ -370,6 +371,12 @@ func (this *ReportArticleController) ReportArticleList() {
|
|
|
list[k].CommentNum = mapCommment[v.ArticleId]
|
|
|
list[k].ListIndustrial = mapIndustrialList[v.ArticleId]
|
|
|
list[k].ListSubject = mapSubjectList[v.ArticleId]
|
|
|
+
|
|
|
+ if v.ReportId > 0 {
|
|
|
+ list[k].HttpUrl = utils.CYGX_WEB_URL + "/material/ricc/yb/report/" + strconv.Itoa(v.ReportId)
|
|
|
+ } else {
|
|
|
+ list[k].HttpUrl = utils.CYGX_WEB_URL + "/material/info/" + strconv.Itoa(v.ArticleId)
|
|
|
+ }
|
|
|
}
|
|
|
page := paging.GetPaging(currentIndex, pageSize, total)
|
|
|
resp := new(cygx.GetReportArticleListRep)
|
|
@@ -1978,10 +1985,6 @@ func (this *IndustrialSubjectController) ReportMappingAdd() {
|
|
|
br.IsAddLog = true
|
|
|
}
|
|
|
|
|
|
-//func init() {
|
|
|
-// initOrder()
|
|
|
-//}
|
|
|
-
|
|
|
func initart() {
|
|
|
//行业
|
|
|
var condition string
|
|
@@ -3210,3 +3213,459 @@ func initHistoryRemarList() {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+func initcygx_user_feedback() {
|
|
|
+ remarkList, err := cygx.GetCygxUserFeedbackListIni2t()
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ var companyids []int
|
|
|
+ var sellerIds []int
|
|
|
+ var adminIds []int
|
|
|
+ //var companyidsMap
|
|
|
+
|
|
|
+ for _, v := range remarkList {
|
|
|
+ item := new(company.CompanyHistoryRemarkResp)
|
|
|
+ item.CompanyId = v.CompanyId
|
|
|
+ if !utils.InArrayByInt(companyids, v.CompanyId) {
|
|
|
+ companyids = append(companyids, v.CompanyId)
|
|
|
+ }
|
|
|
+
|
|
|
+ if !utils.InArrayByInt(sellerIds, v.SellerId) {
|
|
|
+ sellerIds = append(sellerIds, v.SellerId)
|
|
|
+ }
|
|
|
+
|
|
|
+ if !utils.InArrayByInt(adminIds, v.AdminId) {
|
|
|
+ adminIds = append(adminIds, v.AdminId)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ sysUserList, err := system.GetAdminList()
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ adminMap := make(map[int]*system.Admin, 0)
|
|
|
+ for _, v := range sysUserList {
|
|
|
+ adminMap[v.AdminId] = v
|
|
|
+ }
|
|
|
+
|
|
|
+ listCompany, err := company.GetCompanyProductsByCompanyIdsAndProductIdinit(companyids)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ mapCompamyName := make(map[int]*company.CompanyProduct)
|
|
|
+
|
|
|
+ for _, v := range listCompany {
|
|
|
+ mapCompamyName[v.CompanyId] = v
|
|
|
+ }
|
|
|
+
|
|
|
+ //创建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 = "针对kp的交流反馈"
|
|
|
+ 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 = " kp姓名"
|
|
|
+ cellC := rowTitle.AddCell()
|
|
|
+ cellC.Value = " 公司名称"
|
|
|
+
|
|
|
+ cellMoney := rowTitle.AddCell()
|
|
|
+ cellMoney.Value = "原销售"
|
|
|
+
|
|
|
+ cellConct := rowTitle.AddCell()
|
|
|
+ cellConct.Value = "交流反馈内容"
|
|
|
+
|
|
|
+ cellTime := rowTitle.AddCell()
|
|
|
+ cellTime.Value = "录入时间"
|
|
|
+
|
|
|
+ var SellerNameArr []string
|
|
|
+ for _, item := range sysUserList {
|
|
|
+ if !utils.InArrayByStr(SellerNameArr, item.RealName) {
|
|
|
+ SellerNameArr = append(SellerNameArr, item.RealName)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ fmt.Println(SellerNameArr)
|
|
|
+ for _, v := range SellerNameArr {
|
|
|
+ fmt.Println(v)
|
|
|
+ }
|
|
|
+ //return
|
|
|
+ for _, v := range adminIds {
|
|
|
+ for _, item := range remarkList {
|
|
|
+
|
|
|
+ if item.AdminId != v {
|
|
|
+ //fmt.Println(v)
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ fmt.Println(v)
|
|
|
+ row := sheet.AddRow()
|
|
|
+ cellAData := row.AddCell()
|
|
|
+ cellAData.Value = adminMap[item.AdminId].RealName
|
|
|
+
|
|
|
+ cellBData := row.AddCell()
|
|
|
+ cellBData.Value = item.RealName
|
|
|
+
|
|
|
+ cellCData := row.AddCell()
|
|
|
+ cellCData.Value = item.CompanyName
|
|
|
+
|
|
|
+ cellCnameData := row.AddCell()
|
|
|
+ cellCnameData.Value = mapCompamyName[item.CompanyId].SellerName
|
|
|
+
|
|
|
+ cellContentData := row.AddCell()
|
|
|
+ cellContentData.Value = item.Content
|
|
|
+
|
|
|
+ cellTimeData := row.AddCell()
|
|
|
+ cellTimeData.Value = item.CreateTime.Format(utils.FormatDateTime)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ err = xlsxFile.Save(downLoadnFilePath)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// func init() {
|
|
|
+// initcompany_history_remark()
|
|
|
+// }
|
|
|
+func initcompany_history_remark() {
|
|
|
+ remarkList, err := company.GetCompanyHistoryRemarkListInitExportinit()
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ var companyids []int
|
|
|
+ var adminIds []int
|
|
|
+ //var companyidsMap
|
|
|
+
|
|
|
+ for _, v := range remarkList {
|
|
|
+ item := new(company.CompanyHistoryRemarkResp)
|
|
|
+ item.CompanyId = v.CompanyId
|
|
|
+ if !utils.InArrayByInt(companyids, v.CompanyId) {
|
|
|
+ companyids = append(companyids, v.CompanyId)
|
|
|
+ }
|
|
|
+ if !utils.InArrayByInt(adminIds, v.SysAdminId) {
|
|
|
+ adminIds = append(adminIds, v.SysAdminId)
|
|
|
+ }
|
|
|
+ switch v.TableName {
|
|
|
+ case "company_service_record":
|
|
|
+ item.RemarkType = "沟通记录"
|
|
|
+ case "company_product_remark":
|
|
|
+ item.RemarkType = "历史备注"
|
|
|
+ case "company_no_renewed_note":
|
|
|
+ item.RemarkType = "未续约备注"
|
|
|
+ case "company_renewal_reason":
|
|
|
+ item.RemarkType = "未续约说明"
|
|
|
+ case "cygx_user_feedback":
|
|
|
+ item.RemarkType = "交流反馈(" + v.RealName + ")"
|
|
|
+ default:
|
|
|
+ item.RemarkType = "备注"
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ listCompany, err := company.GetCompanyProductsByCompanyIdsAndProductIdinit(companyids)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ sysUserList, err := system.GetAdminList()
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ adminMap := make(map[int]*system.Admin, 0)
|
|
|
+ for _, v := range sysUserList {
|
|
|
+ adminMap[v.AdminId] = v
|
|
|
+ }
|
|
|
+
|
|
|
+ mapCompamyName := make(map[int]*company.CompanyProduct)
|
|
|
+
|
|
|
+ for _, v := range listCompany {
|
|
|
+ mapCompamyName[v.CompanyId] = v
|
|
|
+ }
|
|
|
+
|
|
|
+ //创建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 = "针对kp的交流反馈"
|
|
|
+ sheet, err := xlsxFile.AddSheet(sheetName)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ //标头
|
|
|
+ rowTitle := sheet.AddRow()
|
|
|
+ cellA := rowTitle.AddCell()
|
|
|
+ cellA.Value = "服务销售姓名"
|
|
|
+
|
|
|
+ cellC := rowTitle.AddCell()
|
|
|
+ cellC.Value = " 公司名称"
|
|
|
+
|
|
|
+ cellMoney := rowTitle.AddCell()
|
|
|
+ cellMoney.Value = "原销售"
|
|
|
+
|
|
|
+ cellConct := rowTitle.AddCell()
|
|
|
+ cellConct.Value = "交流反馈内容"
|
|
|
+
|
|
|
+ cellType := rowTitle.AddCell()
|
|
|
+ cellType.Value = "记录类型"
|
|
|
+
|
|
|
+ cellTime := rowTitle.AddCell()
|
|
|
+ cellTime.Value = "录入时间"
|
|
|
+
|
|
|
+ var SellerNameArr []string
|
|
|
+ for _, item := range remarkList {
|
|
|
+ if !utils.InArrayByStr(SellerNameArr, mapCompamyName[item.CompanyId].ShareSeller) {
|
|
|
+ SellerNameArr = append(SellerNameArr, mapCompamyName[item.CompanyId].ShareSeller)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ fmt.Println(SellerNameArr)
|
|
|
+ for _, v := range SellerNameArr {
|
|
|
+ fmt.Println(v)
|
|
|
+ }
|
|
|
+ //return
|
|
|
+ for _, v := range adminIds {
|
|
|
+ for _, item := range remarkList {
|
|
|
+
|
|
|
+ if item.SysAdminId != v {
|
|
|
+ //fmt.Println(v)
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ fmt.Println(v)
|
|
|
+ row := sheet.AddRow()
|
|
|
+ cellAData := row.AddCell()
|
|
|
+ cellAData.Value = item.SysAdminName
|
|
|
+
|
|
|
+ cellCData := row.AddCell()
|
|
|
+ cellCData.Value = mapCompamyName[item.CompanyId].CompanyName
|
|
|
+
|
|
|
+ cellCnameData := row.AddCell()
|
|
|
+ cellCnameData.Value = mapCompamyName[item.CompanyId].SellerName
|
|
|
+
|
|
|
+ cellContentData := row.AddCell()
|
|
|
+ cellContentData.Value = item.Content
|
|
|
+
|
|
|
+ celltypeData := row.AddCell()
|
|
|
+ switch item.TableName {
|
|
|
+ case "company_service_record":
|
|
|
+ celltypeData.Value = "沟通记录"
|
|
|
+ case "company_product_remark":
|
|
|
+ celltypeData.Value = "历史备注"
|
|
|
+ default:
|
|
|
+ celltypeData.Value = "历史备注"
|
|
|
+ }
|
|
|
+
|
|
|
+ cellTimeData := row.AddCell()
|
|
|
+ cellTimeData.Value = item.CreateTime.Format(utils.FormatDateTime)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ err = xlsxFile.Save(downLoadnFilePath)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+func initRsListinit() {
|
|
|
+ list, errList := roadshow.GetRsCalendarMeetingUserByRaiinit()
|
|
|
+ if errList != nil {
|
|
|
+ fmt.Println(errList)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ var companyids []int
|
|
|
+
|
|
|
+ //var companyidsMap
|
|
|
+ var rsCalendarIds []int
|
|
|
+ for _, v := range list {
|
|
|
+ if !utils.InArrayByInt(companyids, v.CompanyId) {
|
|
|
+ companyids = append(companyids, v.CompanyId)
|
|
|
+ }
|
|
|
+ rsCalendarIds = append(rsCalendarIds, v.RsCalendarId)
|
|
|
+ }
|
|
|
+
|
|
|
+ listCompany, err := company.GetCompanyProductsByCompanyIdsAndProductIdinit(companyids)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ mapCompamyName := make(map[int]*company.CompanyProduct)
|
|
|
+
|
|
|
+ for _, v := range listCompany {
|
|
|
+ mapCompamyName[v.CompanyId] = v
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ mapRsCalendarLabel := make(map[int][]string) //1v1 路演标签
|
|
|
+ mapRsCalendarLabel = cygxService.GetRsCalendarLabelByRsCalendarIds(rsCalendarIds)
|
|
|
+
|
|
|
+ //创建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 = "原销售"
|
|
|
+
|
|
|
+ cellD := rowTitle.AddCell()
|
|
|
+ cellD.Value = "姓名"
|
|
|
+ cellE := rowTitle.AddCell()
|
|
|
+ cellE.Value = "手机号"
|
|
|
+
|
|
|
+ cellF := rowTitle.AddCell()
|
|
|
+ cellF.Value = "路演时间"
|
|
|
+ cellG := rowTitle.AddCell()
|
|
|
+ cellG.Value = "研究员"
|
|
|
+ cellH := rowTitle.AddCell()
|
|
|
+ cellH.Value = "路演形式"
|
|
|
+ cellI := rowTitle.AddCell()
|
|
|
+ cellI.Value = "路演主题"
|
|
|
+ cellJ := rowTitle.AddCell()
|
|
|
+ cellJ.Value = "主题标签"
|
|
|
+
|
|
|
+ for _, v := range companyids {
|
|
|
+ for _, item := range list {
|
|
|
+
|
|
|
+ if item.CompanyId != v {
|
|
|
+ //fmt.Println(v)
|
|
|
+ continue
|
|
|
+ }
|
|
|
+ row := sheet.AddRow()
|
|
|
+ cellAData := row.AddCell()
|
|
|
+ cellAData.Value = item.CompanyName
|
|
|
+
|
|
|
+ cellBData := row.AddCell()
|
|
|
+
|
|
|
+ cellCData := row.AddCell()
|
|
|
+
|
|
|
+ if mapCompamyName[item.CompanyId] != nil {
|
|
|
+ cellBData.Value = mapCompamyName[item.CompanyId].ShareSeller
|
|
|
+ cellCData.Value = mapCompamyName[item.CompanyId].SellerName
|
|
|
+ }
|
|
|
+ cellDData := row.AddCell()
|
|
|
+ cellDData.Value = item.RealName
|
|
|
+ cellEData := row.AddCell()
|
|
|
+ cellEData.Value = item.Mobile
|
|
|
+ cellFData := row.AddCell()
|
|
|
+ cellFData.Value = item.StartDate + " " + item.StartTime
|
|
|
+ cellGData := row.AddCell()
|
|
|
+ cellGData.Value = item.ResearcherName
|
|
|
+ cellHData := row.AddCell()
|
|
|
+ cellHData.Value = item.RoadshowType
|
|
|
+ cellIData := row.AddCell()
|
|
|
+ cellIData.Value = item.RoadShowTheme
|
|
|
+ cellJData := row.AddCell()
|
|
|
+ cellJData.Value = strings.Join(mapRsCalendarLabel[item.RsCalendarId], ",")
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ err = xlsxFile.Save(downLoadnFilePath)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+}
|