浏览代码

3.3版本

xingzai 3 年之前
父节点
当前提交
33e7d98a14
共有 3 个文件被更改,包括 6 次插入21 次删除
  1. 1 0
      models/user.go
  2. 1 1
      services/task.go
  3. 4 20
      services/user.go

+ 1 - 0
models/user.go

@@ -304,6 +304,7 @@ func GetFormalUserWhiteList(fieldStr, condition string) (items []*UserWhiteList,
 		INNER JOIN company_product AS cp ON cp.company_id = u.company_id
 		WHERE 1= 1
 		AND cp.product_id = 2
+		AND b.product_id = 2
 		AND u.company_id >1 ` + condition + `
 		GROUP BY u.user_id`
 	_, err = orm.NewOrm().Raw(sql).QueryRows(&items)

+ 1 - 1
services/task.go

@@ -56,7 +56,7 @@ func Task() {
 	//task.AddTask("sendEmailUserWhiteList", sendEmailUserWhiteList)
 
 	//白名单发送2
-	sendEmailUserWhiteListChange := task.NewTask("sendEmailUserWhiteList2", "0 00 17 * * *", SendEmailUserWhiteListChange) //预约外呼名单,会前1小时自动发送邮件给专家组
+	sendEmailUserWhiteListChange := task.NewTask("sendEmailUserWhiteListChange", "0 00 17 * * *", SendEmailUserWhiteListChange) //新增 和冻结的客户白名单
 	task.AddTask("sendEmailUserWhiteListChange", sendEmailUserWhiteListChange)
 
 	//editOutboundMobile := task.NewTask("editOutboundMobile", "0 */1 8-22 * * *", EditOutboundMobile) //同步外呼号码与手机号

+ 4 - 20
services/user.go

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