|
@@ -103,33 +103,33 @@ func WarningDm() {
|
|
|
}
|
|
|
if send2 && sendFlag2 == 0 { // 上限
|
|
|
ExceedLimitByDm(d1, to, toCc)
|
|
|
- _, _ = TiDb.ExecBySql(fmt.Sprintf(sql1, "send_mail | (1 << 3)"), posid) // 倒数第四位修改成0
|
|
|
+ _, _ = TiDb.ExecBySql(fmt.Sprintf(sql1, "send_mail | (1 << 3)"), posid) // 倒数第四位修改成1
|
|
|
sendFlag2 = 1
|
|
|
} else {
|
|
|
if !send2 && sendFlag2 == 1 {
|
|
|
- _, _ = TiDb.ExecBySql(fmt.Sprintf(sql1, "send_mail & ~(1 << 3)"), posid) // 倒数第四位修改成1
|
|
|
+ _, _ = TiDb.ExecBySql(fmt.Sprintf(sql1, "send_mail & ~(1 << 3)"), posid) // 倒数第四位修改成0
|
|
|
}
|
|
|
}
|
|
|
if send1 && sendFlag1 == 0 && sendFlag2 == 0 { // 预警
|
|
|
WillWarningByDm(d1, to, toCc)
|
|
|
- _, _ = TiDb.ExecBySql(fmt.Sprintf(sql1, "send_mail | (1 << 2)"), posid) // 倒数第三位修改成0
|
|
|
+ _, _ = TiDb.ExecBySql(fmt.Sprintf(sql1, "send_mail | (1 << 2)"), posid) // 倒数第三位修改成1
|
|
|
} else {
|
|
|
if !send1 && sendFlag1 == 1 {
|
|
|
- _, _ = TiDb.ExecBySql(fmt.Sprintf(sql1, "send_mail & ~(1 << 2)"), posid) // 倒数第三位修改成1
|
|
|
+ _, _ = TiDb.ExecBySql(fmt.Sprintf(sql1, "send_mail & ~(1 << 2)"), posid) // 倒数第三位修改成0
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if send {
|
|
|
- sql := `UPDATE jianyu_subjectdb_test.dwd_f_crm_personnel_management SET send_mail = (%s) where position_id IN (SELECT a.position_id FROM dwd_d_crm_department_level_succbi a INNER JOIN dwd_f_crm_personnel_management b ON a.position_id = b.position_id WHERE b.role_id = 5 AND b.resign = 0)`
|
|
|
+ sql := `UPDATE dwd_f_crm_personnel_management SET send_mail = (%s) where position_id IN (SELECT a.position_id FROM dwd_d_crm_department_level_succbi a INNER JOIN dwd_f_crm_personnel_management b ON a.position_id = b.position_id WHERE b.role_id = 5 AND b.resign = 0)`
|
|
|
info3 := TiDb.SelectBySql(xgFlag)
|
|
|
if info3 != nil && len(*info3) > 0 {
|
|
|
sendFlag := common.IntAll((*info3)[0]["flag_1"])
|
|
|
if sendFlag == 0 {
|
|
|
WillWarningByAll()
|
|
|
- TiDb.ExecBySql(fmt.Sprintf(sql, "send_mail & ~(1 << 4)"))
|
|
|
+ TiDb.ExecBySql(fmt.Sprintf(sql, "send_mail | (1 << 4)"))
|
|
|
} else {
|
|
|
|
|
|
- TiDb.ExecBySql(fmt.Sprintf(sql, "send_mail | (1 << 4)")) // 修改销管 发送邮件标志 0
|
|
|
+ TiDb.ExecBySql(fmt.Sprintf(sql, "send_mail & ~(1 << 4)")) // 修改销管 发送邮件标志 0
|
|
|
}
|
|
|
}
|
|
|
}
|