|
@@ -435,96 +435,6 @@ func SendEmailFileForAskMsgResearch(cont context.Context) (err error) {
|
|
|
msg = "发送附件模版消息失败 Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- //for _, v := range listActivity {
|
|
|
- // activityInfo, _ := models.GetAddActivityInfoById(v.ActivityId)
|
|
|
- // if activityInfo == nil {
|
|
|
- // msg = "活动不存在,Err:activityId:" + strconv.Itoa(v.ActivityId)
|
|
|
- // return
|
|
|
- // }
|
|
|
- // list, errFile := models.GetActivityMsgExport(v.ActivityId)
|
|
|
- // if errFile != nil {
|
|
|
- // msg = "获取失败,Err:" + errFile.Error()
|
|
|
- // return
|
|
|
- // }
|
|
|
- // //创建excel
|
|
|
- // dir, errFile := os.Executable()
|
|
|
- // exPath := filepath.Dir(dir)
|
|
|
- // downLoadnFilePath := exPath + "/" + time.Now().Format(utils.FormatDateTimeUnSpace) + utils.GetRandDigit(5) + ".xlsx"
|
|
|
- // xlsxFile := xlsx.NewFile()
|
|
|
- // if errFile != nil {
|
|
|
- // msg = "生成文件失败Err:" + errFile.Error()
|
|
|
- // return
|
|
|
- // }
|
|
|
- // style := xlsx.NewStyle()
|
|
|
- // alignment := xlsx.Alignment{
|
|
|
- // Horizontal: "center",
|
|
|
- // Vertical: "center",
|
|
|
- // WrapText: true,
|
|
|
- // }
|
|
|
- // style.Alignment = alignment
|
|
|
- // style.ApplyAlignment = true
|
|
|
- // sheet, errFile := xlsxFile.AddSheet("外呼名单")
|
|
|
- // if errFile != nil {
|
|
|
- // msg = "新增Sheet失败,Err:" + errFile.Error()
|
|
|
- // return
|
|
|
- // }
|
|
|
- // //设置宽度
|
|
|
- // _ = sheet.SetColWidth(1, 1, 30)
|
|
|
- // _ = sheet.SetColWidth(2, 2, 60)
|
|
|
- // //标头
|
|
|
- // rowTitle := sheet.AddRow()
|
|
|
- // cellA := rowTitle.AddCell()
|
|
|
- // cellA.Value = "姓名"
|
|
|
- // cellB := rowTitle.AddCell()
|
|
|
- // cellB.Value = "公司名称"
|
|
|
- // cellC := rowTitle.AddCell()
|
|
|
- // cellC.Value = "问题"
|
|
|
- // cellD := rowTitle.AddCell()
|
|
|
- // cellD.Value = "提交时间"
|
|
|
- //
|
|
|
- // for _, item := range list {
|
|
|
- // row := sheet.AddRow()
|
|
|
- // cellA := row.AddCell()
|
|
|
- // cellA.Value = item.RealName
|
|
|
- // cellB := row.AddCell()
|
|
|
- // cellB.Value = item.CompanyName
|
|
|
- // cellC := row.AddCell()
|
|
|
- // cellC.Value = item.Content
|
|
|
- // cellD := row.AddCell()
|
|
|
- // cellD.Value = item.CreateTime
|
|
|
- // }
|
|
|
- // errFile = xlsxFile.Save(downLoadnFilePath)
|
|
|
- // if errFile != nil {
|
|
|
- // msg = "保存文件失败Err:" + errFile.Error()
|
|
|
- // return
|
|
|
- // }
|
|
|
- // title := activityInfo.ActivityName + "-活动带问"
|
|
|
- // content := "活动带问详情"
|
|
|
- // fileName := downLoadnFilePath
|
|
|
- // if utils.RunMode == "release" {
|
|
|
- // touser = "cxzhang@hzinsights.com;ywang@hzinsights.com;tshen@hzinsights.com"
|
|
|
- // } else {
|
|
|
- // touser = "cxzhang@hzinsights.com;jhwang@hzinsights.com;tshen@hzinsights.com"
|
|
|
- // }
|
|
|
- // sendResult := utils.SendEmailByHongze(title, content, touser, fileName, title+".xlsx")
|
|
|
- // if sendResult {
|
|
|
- // errFile = models.UPdateActivityMsgToSendFile(v.ActivityId)
|
|
|
- // if errFile != nil {
|
|
|
- // msg = "获取失败,Err:" + errFile.Error()
|
|
|
- // return
|
|
|
- // }
|
|
|
- // os.Remove(downLoadnFilePath)
|
|
|
- // } else {
|
|
|
- // go utils.SendEmail("发送附件模版消息失败"+"【"+utils.APPNAME+"】"+time.Now().Format(utils.RunMode), msg+";Err:"+activityInfo.ActivityName, utils.EmailSendToUsers)
|
|
|
- // utils.FileLog.Info("发送附件模版消息失败,Err:%s", activityInfo.ActivityName)
|
|
|
- // }
|
|
|
- //}
|
|
|
-
|
|
|
- listEmail, err := models.GetAskEmail()
|
|
|
- if err != nil {
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
for _, v := range listActivity {
|
|
|
activityInfo, _ := models.GetAddActivityInfoById(v.ActivityId)
|
|
|
if activityInfo == nil {
|
|
@@ -542,13 +452,7 @@ func SendEmailFileForAskMsgResearch(cont context.Context) (err error) {
|
|
|
if err != nil && err.Error() != utils.ErrNoRow() {
|
|
|
return err
|
|
|
}
|
|
|
- var sendMobile string
|
|
|
- for _, vEmail := range listEmail {
|
|
|
- if strings.Index(activityInfo.Host, vEmail.Name) > 0 {
|
|
|
- sendMobile = vEmail.Mobile
|
|
|
- }
|
|
|
- }
|
|
|
- openIpItem, _ := models.GetUserRecordByMobile(4, sendMobile)
|
|
|
+ openIpItem, _ := models.GetUserRecordByMobile(4, utils.ActSendMsgMobile)
|
|
|
if openIpItem != nil && openIpItem.OpenId != "" {
|
|
|
//获取销售信息
|
|
|
sellerItem, err := models.GetSellerByCompanyIdCheckFicc(v2.CompanyId, 2)
|