|
@@ -738,33 +738,17 @@ func SendEmailUserWhiteListChange(cont context.Context) (err error) {
|
|
|
title := time.Now().Format("2006-01-02") + "新增白名单用户"
|
|
|
content := time.Now().Format("2006-01-02") + "新增白名单用户"
|
|
|
fileName := downLoadnFilePath
|
|
|
- //if activityInfo.ChartPermissionName == "科技" {
|
|
|
- // touser = utils.EmailTechnology
|
|
|
- //} else if activityInfo.ChartPermissionName == "医药" {
|
|
|
- // touser = utils.EmailMedicine
|
|
|
- //} else if activityInfo.ChartPermissionName == "消费" {
|
|
|
- // touser = utils.EmailConsumption
|
|
|
- //} else if activityInfo.ChartPermissionName == "智造" {
|
|
|
- // touser = utils.EmailZhizao
|
|
|
- //} else if activityInfo.ChartPermissionName == "策略" {
|
|
|
- // touser = utils.EmailStrategy
|
|
|
- //}
|
|
|
go utils.SendEmailHaveFile(title, content, fileName, "cxzhang@hzinsights.com;tshen@hzinsights.com")
|
|
|
//go utils.SendEmailHaveFile(title, content, fileName, "cxzhang@hzinsights.com")
|
|
|
//go utils.SendEmailHaveFile(title, content, fileName, "tshen@hzinsights.com")
|
|
|
time.Sleep(time.Duration(2) * time.Second) //延迟两秒,避免过多活动的时候邮件发送没有内容
|
|
|
- //errFile = models.UPdateActivityIdToSendFile(v.ActivityId)
|
|
|
- //if errFile != nil {
|
|
|
- // msg = "获取失败,Err:" + errFile.Error()
|
|
|
- // return
|
|
|
- //}
|
|
|
defer func() {
|
|
|
os.Remove(downLoadnFilePath)
|
|
|
}()
|
|
|
//创建冻结excel
|
|
|
dir, errFile = os.Executable()
|
|
|
exPath = filepath.Dir(dir)
|
|
|
- downLoadnFilePath = exPath + "/" + time.Now().Format(utils.FormatDateTimeUnSpace) + ".xlsx"
|
|
|
+ downLoadnFilePaths := exPath + "/" + time.Now().Format(utils.FormatDateTimeUnSpace) + ".xlsx"
|
|
|
xlsxFile = xlsx.NewFile()
|
|
|
if errFile != nil {
|
|
|
msg = "生成文件失败Err:" + errFile.Error()
|
|
@@ -862,19 +846,19 @@ func SendEmailUserWhiteListChange(cont context.Context) (err error) {
|
|
|
cellM.Value = item.PermissionName
|
|
|
}
|
|
|
}
|
|
|
- errFile = xlsxFile.Save(downLoadnFilePath)
|
|
|
+ errFile = xlsxFile.Save(downLoadnFilePaths)
|
|
|
if errFile != nil {
|
|
|
msg = "保存文件失败Err:" + errFile.Error()
|
|
|
return
|
|
|
}
|
|
|
title = time.Now().Format("2006-01-02") + "删除白名单用户"
|
|
|
content = time.Now().Format("2006-01-02") + "删除白名单用户"
|
|
|
- fileName = downLoadnFilePath
|
|
|
+ fileName = downLoadnFilePaths
|
|
|
go utils.SendEmailHaveFile(title, content, fileName, "cxzhang@hzinsights.com;tshen@hzinsights.com")
|
|
|
//go utils.SendEmailHaveFile(title, content, fileName, "cxzhang@hzinsights.com")
|
|
|
time.Sleep(time.Duration(2) * time.Second) //延迟两秒,避免过多活动的时候邮件发送没有内容
|
|
|
defer func() {
|
|
|
- os.Remove(downLoadnFilePath)
|
|
|
+ os.Remove(downLoadnFilePaths)
|
|
|
}()
|
|
|
if len(list1) > 0 {
|
|
|
for _, v := range list1 {
|