Преглед изворни кода

更换研选行业默认发送手机号

xingzai пре 3 година
родитељ
комит
505342967a
3 измењених фајлова са 7 додато и 97 уклоњено
  1. 3 0
      controllers/activity.go
  2. 1 97
      services/activity.go
  3. 3 0
      utils/config.go

+ 3 - 0
controllers/activity.go

@@ -2122,6 +2122,9 @@ func (this *ActivityCoAntroller) AskAdd() {
 				sendMobile = v.Mobile
 			}
 		}
+		if activityInfo.ChartPermissionId == 31 {
+			sendMobile = utils.ActSendMsgMobile
+		}
 		if sendMobile != "" {
 			openIpItem, _ := models.GetUserRecordByMobile(4, sendMobile)
 			if openIpItem != nil && openIpItem.OpenId != "" {

+ 1 - 97
services/activity.go

@@ -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)

+ 3 - 0
utils/config.go

@@ -63,6 +63,7 @@ var (
 	EmailExpert               string //研选行业专家邮箱
 	EmaiWhiteUserList         string //白名单邮箱
 	IsTask                    bool   //是否执行定时任务
+	ActSendMsgMobile          string //活动带问发送模板消息接收者的手机号
 )
 
 func init() {
@@ -132,6 +133,7 @@ func init() {
 		EmaiWhiteUserList = "tshen@hzinsights.com;cxzhang@hzinsights.com;yyli@hzinsights.com"                                            //白名单邮箱
 		WxMsgTemplateIdAskMsg = "PaoDanHGlt1kFw5q-4_ipJSwO3FyZpxSSNg4rwB7YCk"
 		WxMsgTemplateIdAskMsgMobile = ""
+		ActSendMsgMobile = "15618524605"
 
 	} else {
 		WxAppId = "wxcc32b61f96720d2f"
@@ -159,6 +161,7 @@ func init() {
 		EmaiWhiteUserList = "cxzhang@hzinsights.com"
 		WxMsgTemplateIdAskMsg = "qfNuops-sKrfIkbA7U97A7gSrX03mUpoEpJksRUdloo"
 		WxMsgTemplateIdAskMsgMobile = "15557270714,17634786714,18767183922,17516315016"
+		ActSendMsgMobile = "17634786714"
 	}
 
 	//查研观向小助手