|
@@ -30,7 +30,7 @@ var (
|
|
|
// @Description 个人预警/上限
|
|
|
// @Date 2024/4/11
|
|
|
func WarningPerl() {
|
|
|
- sql := `SELECT count(*) FROM dwd_f_crm_clue_info where position_id = ? and assign_type >= 1 and trailstatus <> '08'`
|
|
|
+ sql := `SELECT count(*) FROM dwd_f_crm_clue_info where position_id = ? and trailstatus <> '08'`
|
|
|
sql1 := `UPDATE dwd_f_crm_personnel_management SET send_mail = (?) where position_id = ?`
|
|
|
pp := Mysql.SelectBySql(`SELECT name, position_id, send_mail & 1 AS flag_1, (send_mail >> 1) & 1 AS flag_2 FROM dwd_f_crm_personnel_management WHERE assign_type >= 1`)
|
|
|
if pp != nil && len(*pp) > 0 {
|
|
@@ -39,15 +39,15 @@ func WarningPerl() {
|
|
|
sendFlag2 := common.IntAll(m["flag_2"]) //上限邮件发送
|
|
|
posid := common.Int64All(m["position_id"])
|
|
|
count := Mysql.CountBySql(sql, posid)
|
|
|
- if count >= int64(cfg.WarningValue) && sendFlag1 == 0 {
|
|
|
+ if count >= cfg.WarningValue && sendFlag1 == 0 {
|
|
|
WillWarningByPp(posid) // 发预警邮件
|
|
|
_, _ = Mysql.ExecBySql(sql1, "send_mail | (1 << 0)", posid)
|
|
|
- } else if count >= int64(cfg.AllocationCap) && sendFlag2 == 0 {
|
|
|
+ } else if count >= cfg.AllocationCap && sendFlag2 == 0 {
|
|
|
ExceedLimitByPp(posid) // 发上限邮件
|
|
|
_, _ = Mysql.ExecBySql(sql1, "send_mail | (1 << 1)", posid)
|
|
|
- } else if sendFlag1 == 1 && count < int64(cfg.WarningValue) { // 已发邮件
|
|
|
+ } else if sendFlag1 == 1 && count < cfg.WarningValue { // 已发邮件
|
|
|
_, _ = Mysql.ExecBySql(sql1, "send_mail & ~(1 << 0)", posid)
|
|
|
- } else if sendFlag2 == 1 && count < int64(cfg.AllocationCap) { // 已发邮件
|
|
|
+ } else if sendFlag2 == 1 && count < cfg.AllocationCap { // 已发邮件
|
|
|
_, _ = Mysql.ExecBySql(sql1, "send_mail & ~(1 << 1)", posid)
|
|
|
}
|
|
|
}
|