Jianghan 1 ano atrás
pai
commit
1a226db229
1 arquivos alterados com 10 adições e 10 exclusões
  1. 10 10
      clueSync/sendMail.go

+ 10 - 10
clueSync/sendMail.go

@@ -58,7 +58,7 @@ func WarningPerl() {
 // @Description 部门预警/上限 所有人
 // @Date 2024/5/9
 func WarningDm() {
-	sql1 := `UPDATE dwd_f_crm_personnel_management SET send_mail = (?) where position_id = ?`
+	sql1 := `UPDATE dwd_f_crm_personnel_management SET send_mail = (%s) where position_id = ?`
 	dm := TiDb.SelectBySql(dmInfo)
 	send := true // 所有人
 	for _, m := range *dm {
@@ -101,19 +101,19 @@ func WarningDm() {
 		}
 		if send2 && sendFlag2 == 0 { // 上限
 			ExceedLimitByDm(d1, to, toCc)
-			_, _ = TiDb.ExecBySql(sql1, "send_mail | (1 << 3)", posid) // 倒数第四位修改成0
+			_, _ = TiDb.ExecBySql(fmt.Sprintf(sql1, "send_mail | (1 << 3)"), posid) // 倒数第四位修改成0
 		} else {
 			if sendFlag2 == 1 {
-				_, _ = TiDb.ExecBySql(sql1, "send_mail & ~(1 << 3)", posid) // 倒数第四位修改成1
+				_, _ = TiDb.ExecBySql(fmt.Sprintf(sql1, "send_mail & ~(1 << 3)"), posid) // 倒数第四位修改成1
 			}
 		}
 		if send1 && sendFlag1 == 0 && sendFlag2 == 0 { // 预警
 			WillWarningByDm(d1, to, toCc)
-			_, _ = TiDb.ExecBySql(sql1, "send_mail | (1 << 2)", posid) // 倒数第三位修改成0
+			_, _ = TiDb.ExecBySql(fmt.Sprintf(sql1, "send_mail | (1 << 2)"), posid) // 倒数第三位修改成0
 		} else {
 			send = false // 所有人
 			if sendFlag1 == 1 {
-				_, _ = TiDb.ExecBySql(sql1, "send_mail & ~(1 << 2)", posid) // 倒数第三位修改成1
+				_, _ = TiDb.ExecBySql(fmt.Sprintf(sql1, "send_mail & ~(1 << 2)"), posid) // 倒数第三位修改成1
 			}
 		}
 	}
@@ -152,7 +152,7 @@ func WillWarningByDm(dname, to string, toCc []string) {
 	content := "“%s”的所有参与线索分配的电销人员,私海线索都已达到%d条(不包含成交客户),即将达到私海线索上限%d条(不包含成交客户),请及时通知电销人员将无需跟进的线索退回公海,以避免无法接收新线索。"
 	title = fmt.Sprintf(title, dname)
 	content = fmt.Sprintf(content, dname, cfg.WarningValue, cfg.AllocationCap)
-	sendInfo(to, strings.Join(toCc, ";"), title, content)
+	sendInfo(to, strings.Join(toCc, ","), title, content)
 }
 
 // @Author jianghan
@@ -168,7 +168,7 @@ func WillWarningByAll() {
 		}
 	}
 	content = fmt.Sprintf(content, cfg.WarningValue)
-	sendInfo(strings.Join(to, ";"), "", title, content)
+	sendInfo(strings.Join(to, ","), "", title, content)
 }
 
 // @Author jianghan
@@ -201,7 +201,7 @@ func ExceedLimitByDm(dname, to string, toCc []string) {
 	content := "“%s”的所有参与线索分配的电销人员,私海线索都已达到私海线索上限%d条(不包含成交客户),当前无法接收新线索,请及时通知电销人员将无需跟进的线索退回公海"
 	title = fmt.Sprintf(title, dname)
 	content = fmt.Sprintf(content, dname, cfg.AllocationCap)
-	sendInfo(to, strings.Join(toCc, ";"), title, content)
+	sendInfo(to, strings.Join(toCc, ","), title, content)
 }
 
 // @Author jianghan
@@ -229,7 +229,7 @@ func AutoReleaseNots() {
 		}
 	}
 	toCc = append(toCc, getMailAds("shenbingyi@topnet.net.cn", "沈炳毅"))
-	sendInfo(strings.Join(to, ","), strings.Join(toCc, ";"), title, fmt.Sprintf(content, cfg.AllocationCap))
+	sendInfo(strings.Join(to, ","), strings.Join(toCc, ","), title, fmt.Sprintf(content, cfg.AllocationCap))
 }
 
 // @Author jianghan
@@ -257,7 +257,7 @@ func CantBeAssignedNots() {
 		}
 	}
 	toCc = append(toCc, getMailAds("shenbingyi@topnet.net.cn", "沈炳毅"))
-	sendInfo(strings.Join(to, ","), strings.Join(toCc, ";"), title, fmt.Sprintf(content, cfg.AllocationCap))
+	sendInfo(strings.Join(to, ","), strings.Join(toCc, ","), title, fmt.Sprintf(content, cfg.AllocationCap))
 }
 
 // @Author jianghan