|
@@ -406,7 +406,7 @@ func AddUserRecord(openId, unionId, nickName, realName, province, city, country,
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//预约外呼名单,会前1小时自动发送邮件给专家组
|
|
|
+//每天新增,删除的白名单(弃用)
|
|
|
func SendEmailUserWhiteList(cont context.Context) (err error) {
|
|
|
var msg string
|
|
|
var fieldStr string
|
|
@@ -589,13 +589,11 @@ func SendEmailUserWhiteList(cont context.Context) (err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//预约外呼名单,会前1小时自动发送邮件给专家组
|
|
|
+//每天新增,删除的白名单
|
|
|
func SendEmailUserWhiteListChange(cont context.Context) (err error) {
|
|
|
var msg string
|
|
|
var fieldStr string
|
|
|
var condition string
|
|
|
- //var mobileStr string
|
|
|
- //var touser string
|
|
|
defer func() {
|
|
|
if err != nil {
|
|
|
fmt.Println("err:", err, time.Now())
|
|
@@ -636,7 +634,6 @@ func SendEmailUserWhiteListChange(cont context.Context) (err error) {
|
|
|
msg = "获取失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
var rep models.UserWhiteListRep
|
|
|
for _, v := range list2 {
|
|
|
list1 = append(list1, v)
|
|
@@ -645,7 +642,7 @@ func SendEmailUserWhiteListChange(cont context.Context) (err error) {
|
|
|
//创建excel
|
|
|
dir, errFile := os.Executable()
|
|
|
exPath := filepath.Dir(dir)
|
|
|
- downLoadnFilePath := exPath + "/" + time.Now().Format(utils.FormatDateTimeUnSpace) + ".xlsx"
|
|
|
+ downLoadnFilePath := exPath + "/" + time.Now().Format(utils.FormatDate) + "新增白名单" + ".xlsx"
|
|
|
xlsxFile := xlsx.NewFile()
|
|
|
if errFile != nil {
|
|
|
msg = "生成文件失败Err:" + errFile.Error()
|
|
@@ -743,14 +740,13 @@ func SendEmailUserWhiteListChange(cont context.Context) (err error) {
|
|
|
}
|
|
|
//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) //延迟两秒,避免过多活动的时候邮件发送没有内容
|
|
|
- defer func() {
|
|
|
- os.Remove(downLoadnFilePath)
|
|
|
- }()
|
|
|
+ //defer func() {
|
|
|
+ os.Remove(downLoadnFilePath)
|
|
|
+ //}()
|
|
|
//创建冻结excel
|
|
|
dir, errFile = os.Executable()
|
|
|
exPath = filepath.Dir(dir)
|
|
|
- downLoadnFilePaths := exPath + "/" + time.Now().Format(utils.FormatDateTimeUnSpace) + ".xlsx"
|
|
|
+ downLoadnFilePaths := exPath + "/" + time.Now().Format(utils.FormatDate) + "删除白名单" + ".xlsx"
|
|
|
xlsxFile = xlsx.NewFile()
|
|
|
if errFile != nil {
|
|
|
msg = "生成文件失败Err:" + errFile.Error()
|
|
@@ -862,9 +858,9 @@ func SendEmailUserWhiteListChange(cont context.Context) (err error) {
|
|
|
|
|
|
//go utils.SendEmailHaveFile(title, content, fileName, "cxzhang@hzinsights.com")
|
|
|
time.Sleep(time.Duration(2) * time.Second) //延迟两秒,避免过多活动的时候邮件发送没有内容
|
|
|
- defer func() {
|
|
|
- os.Remove(downLoadnFilePaths)
|
|
|
- }()
|
|
|
+ //defer func() {
|
|
|
+ os.Remove(downLoadnFilePaths)
|
|
|
+ //}()
|
|
|
if len(list1) > 0 {
|
|
|
for _, v := range list1 {
|
|
|
item := new(models.WxUserWhite)
|