|
|
@@ -315,6 +315,8 @@ var LastPayAddNumKey = "%s:msgSendInfo:%d:lastPayAddNum"
|
|
|
var PayErrAddNumKey = "%s:msgSendInfo:%d:PayErrAddNum" // 支付异常累加数量
|
|
|
var TaskCompletedStatusKey = "%s:taskCompletedStatus" // 任务完成状态-1,1
|
|
|
var LastFreeMsgSendTimeKey = "%s:lastFreeMsgSendTime" // 上次付费发送消息时间
|
|
|
+var LastDirectorMsgSendTimeKey = "%s:lastDirectorMsgSendTime:%d" // 上次负责人活跃发送消息时间
|
|
|
+var LastFreeDirectorMsgSendTimeKey = "%s:lastFreeDirectorMsgSendTime:%d" // 上次负责人付费发送消息时间
|
|
|
|
|
|
type CompletedInfo struct {
|
|
|
AlsoTarget int //剩余数量
|
|
|
@@ -936,11 +938,15 @@ func (s *SyncData) TaskMsgSendRetainedDataUpdate(ctx context.Context, completesI
|
|
|
if len(mps) == 0 {
|
|
|
global.GVA_LOG.Warn(retained)
|
|
|
}
|
|
|
+ b, _ := json.Marshal(mps)
|
|
|
+ global.GVA_LOG.Warn(string(b))
|
|
|
+ mpsPerson, _ := s.Person.GetUserInfoData()
|
|
|
retained += fmt.Sprintf("<font color=\"warning\">%s</font>", time.Now().Format("2006-01-02 15:04:05"))
|
|
|
var errMsg = "**以下游戏目标效率为零:**"
|
|
|
var errMsgZ = ""
|
|
|
- var sendMsg = map[string]string{}
|
|
|
- var errSendMsg = map[string]string{}
|
|
|
+ var sendMsg = make(map[string]string, len(mpsPerson))
|
|
|
+ var errSendMsg = make(map[string]string, len(mpsPerson))
|
|
|
+ var PErrSendMsg = make(map[string]string, len(mpsPerson))
|
|
|
var m int // 时间内
|
|
|
m = (int(ctime) - lastMsgSendTime) / 60
|
|
|
for taskId, data := range mps {
|
|
|
@@ -1043,6 +1049,9 @@ func (s *SyncData) TaskMsgSendRetainedDataUpdate(ctx context.Context, completesI
|
|
|
errMsgZ += eMsg
|
|
|
errSendMsg[name] += eMsg
|
|
|
}
|
|
|
+ if (rm >= 60 || nm >= 60) && eMsg != "" {
|
|
|
+ PErrSendMsg[name] += eMsg
|
|
|
+ }
|
|
|
sendMsg[name] += ","
|
|
|
if m >= 60 {
|
|
|
sendMsg[name] += strconv.Itoa(m / 60)
|
|
|
@@ -1056,9 +1065,10 @@ func (s *SyncData) TaskMsgSendRetainedDataUpdate(ctx context.Context, completesI
|
|
|
}
|
|
|
hour := time.Now().Hour()
|
|
|
msg := ""
|
|
|
- mpsPerson, _ := s.Person.GetUserInfoData()
|
|
|
+
|
|
|
//b1 ,_ := json.Marshal(mpsPerson)
|
|
|
//global.GVA_LOG.Warn(string(b1))
|
|
|
+ msgType := "# 活跃异常 "
|
|
|
var mobile []string
|
|
|
if hour >= 16 {
|
|
|
if len(sendMsg) == 0 {
|
|
|
@@ -1080,31 +1090,8 @@ func (s *SyncData) TaskMsgSendRetainedDataUpdate(ctx context.Context, completesI
|
|
|
//msg += errMsg + errMsgZ
|
|
|
msg += fmt.Sprintf("<font color=\"warning\">%s</font>", errMsg+errMsgZ)
|
|
|
}
|
|
|
- for pName, pMsg := range sendMsg {
|
|
|
- if hour >= mpsPerson[pName].StartTime {
|
|
|
- personMsg := pMsg
|
|
|
- if _, ok := errSendMsg[pName]; ok {
|
|
|
- personMsg += fmt.Sprintf("<font color=\"warning\">%s</font>", errSendMsg[pName])
|
|
|
- }
|
|
|
- url := mpsPerson[pName].Url
|
|
|
- var sendPersonData SendMsg
|
|
|
- sendPersonData.MsgType = "markdown"
|
|
|
- sendPersonData.Markdown.Content = personMsg
|
|
|
- s.SendMsgData(url, sendPersonData)
|
|
|
- if mpsPerson[pName].Custodians != "" {
|
|
|
- if _, ok := mpsPerson[mpsPerson[pName].Custodians]; ok {
|
|
|
- custodiansMsg := fmt.Sprintf("<font color=\"warning\">%s的任务</font>", pName)
|
|
|
- custodiansMsg += "\n"
|
|
|
- custodiansMsg += personMsg
|
|
|
- var custodiansData SendMsg
|
|
|
- custodiansData.MsgType = "markdown"
|
|
|
- custodiansData.Markdown.Content = custodiansMsg
|
|
|
- urlCustodians := mpsPerson[mpsPerson[pName].Custodians].Url
|
|
|
- s.SendMsgData(urlCustodians, custodiansData)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
+ go s.TaskMsgSendDirector(ctx, msgType, PErrSendMsg, mpsPerson, hour, date, 60, false)
|
|
|
} else {
|
|
|
if errMsgZ != "" {
|
|
|
//msg += errMsg + errMsgZ
|
|
|
@@ -1119,34 +1106,9 @@ func (s *SyncData) TaskMsgSendRetainedDataUpdate(ctx context.Context, completesI
|
|
|
msg += fmt.Sprintf("<font color=\"warning\">%s</font>", m)
|
|
|
}
|
|
|
}
|
|
|
- for pName, pMsg := range sendMsg {
|
|
|
- if hour >= mpsPerson[pName].StartTime {
|
|
|
- var personMsg = "# 活跃播报 "
|
|
|
- personMsg += fmt.Sprintf("<font color=\"warning\">%s</font>", time.Now().Format("2006-01-02 15:04:05"))
|
|
|
- personMsg = pMsg
|
|
|
- if _, ok := errSendMsg[pName]; ok {
|
|
|
- personMsg += fmt.Sprintf("<font color=\"warning\">%s</font>", errSendMsg[pName])
|
|
|
- }
|
|
|
- url := mpsPerson[pName].Url
|
|
|
- var sendPersonData SendMsg
|
|
|
- sendPersonData.MsgType = "markdown"
|
|
|
- sendPersonData.Markdown.Content = personMsg
|
|
|
- global.GVA_LOG.Warn(personMsg)
|
|
|
- s.SendMsgData(url, sendPersonData)
|
|
|
- if mpsPerson[pName].Custodians != "" {
|
|
|
- custodiansMsg := fmt.Sprintf("<font color=\"warning\">%s的任务</font>", pName)
|
|
|
- custodiansMsg += "\n"
|
|
|
- custodiansMsg += personMsg
|
|
|
- var custodiansData SendMsg
|
|
|
- custodiansData.MsgType = "markdown"
|
|
|
- custodiansData.Markdown.Content = custodiansMsg
|
|
|
- urlCustodians := mpsPerson[mpsPerson[pName].Custodians].Url
|
|
|
- s.SendMsgData(urlCustodians, custodiansData)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ go s.TaskMsgSendDirector(ctx, msgType, PErrSendMsg, mpsPerson, hour, date, 60, false)
|
|
|
}
|
|
|
- //global.GVA_LOG.Warn(msg)
|
|
|
+ global.GVA_LOG.Warn(msg)
|
|
|
_ = s.cache.SetCacheStr(ctx, lastMsgSendTimeKey, time.Now().Unix())
|
|
|
if msg == "" {
|
|
|
return
|
|
|
@@ -1167,6 +1129,46 @@ func (s *SyncData) TaskMsgSendRetainedDataUpdate(ctx context.Context, completesI
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+func (s *SyncData) TaskMsgSendDirector(ctx context.Context, msgType string, sendMsg map[string]string, mpsPerson map[string]typeManage.ResponsiblePerson, hour int, date string, lt int, isFree bool) {
|
|
|
+ for pName, pMsg := range sendMsg {
|
|
|
+ lastTimeKey := ""
|
|
|
+ if isFree {
|
|
|
+ lastTimeKey = fmt.Sprintf(LastFreeDirectorMsgSendTimeKey, date, mpsPerson[pName].Id)
|
|
|
+ } else {
|
|
|
+ lastTimeKey = fmt.Sprintf(LastDirectorMsgSendTimeKey, date, mpsPerson[pName].Id)
|
|
|
+ }
|
|
|
+ lastTime, _ := s.cache.GetCacheNum(ctx, lastTimeKey)
|
|
|
+ if lastTime == 0 {
|
|
|
+ lastTime = int(time.Now().Unix()) - 60*61
|
|
|
+ }
|
|
|
+ lttime := int(time.Now().Unix()) - lastTime
|
|
|
+ if hour >= mpsPerson[pName].StartTime && lttime/60 >= lt {
|
|
|
+ var personMsg = msgType //"# 活跃异常 "
|
|
|
+ if isFree {
|
|
|
+ personMsg += "\n"
|
|
|
+ }
|
|
|
+ personMsg += fmt.Sprintf("<font color=\"warning\">%s</font>", pMsg)
|
|
|
+ url := mpsPerson[pName].Url
|
|
|
+ var sendPersonData SendMsg
|
|
|
+ sendPersonData.MsgType = "markdown"
|
|
|
+ sendPersonData.Markdown.Content = personMsg
|
|
|
+ global.GVA_LOG.Warn(personMsg)
|
|
|
+ s.SendMsgData(url, sendPersonData)
|
|
|
+ if mpsPerson[pName].Custodians != "" {
|
|
|
+ custodiansMsg := fmt.Sprintf("<font color=\"warning\">%s的任务</font>", pName)
|
|
|
+ custodiansMsg += "\n"
|
|
|
+ custodiansMsg += personMsg
|
|
|
+ var custodiansData SendMsg
|
|
|
+ custodiansData.MsgType = "markdown"
|
|
|
+ custodiansData.Markdown.Content = custodiansMsg
|
|
|
+ urlCustodians := mpsPerson[mpsPerson[pName].Custodians].Url
|
|
|
+ s.SendMsgData(urlCustodians, custodiansData)
|
|
|
+ }
|
|
|
+ _ = s.cache.SetCacheStr(ctx, lastTimeKey, time.Now().Unix())
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
func (s *SyncData) TaskMsgSendFreeDataUpdate(ctx context.Context, completesInfo []task.GameTargetComplete, ctime int64, date, lastFreeMsgSendTimeKey string, isOne bool) {
|
|
|
var RateMp = make(map[int]CompletedInfo)
|
|
|
lastFreeMsgSendTime, _ := s.cache.GetCacheNum(ctx, lastFreeMsgSendTimeKey)
|
|
|
@@ -1217,6 +1219,7 @@ func (s *SyncData) TaskMsgSendFreeDataUpdate(ctx context.Context, completesInfo
|
|
|
var m int //时间内
|
|
|
m = (int(ctime) - lastFreeMsgSendTime) / 60
|
|
|
mpsPerson, _ := s.Person.GetUserInfoData()
|
|
|
+ var PErrSendMsg = make(map[string]string, len(mpsPerson))
|
|
|
var mobile []string
|
|
|
for taskId, data := range RateMp {
|
|
|
if data.AlsoTarget <= 0 {
|
|
|
@@ -1248,6 +1251,8 @@ func (s *SyncData) TaskMsgSendFreeDataUpdate(ctx context.Context, completesInfo
|
|
|
_ = s.cache.SetCacheStr(ctx, lastPayCompletedUpdateTimeKey, ctime) //上次付费更新时间
|
|
|
data.TimeRate = 60 * 60 * 2
|
|
|
}
|
|
|
+ // 单条异常记录
|
|
|
+ oneErrM := ""
|
|
|
// 5分钟数据没动报异常数据
|
|
|
if data.TimeRate/60 >= 2 {
|
|
|
if data.Rate == 0 {
|
|
|
@@ -1255,30 +1260,36 @@ func (s *SyncData) TaskMsgSendFreeDataUpdate(ctx context.Context, completesInfo
|
|
|
payErrAddNumKey := fmt.Sprintf(PayErrAddNumKey, date, data.TaskId)
|
|
|
numErr, _ := s.cache.GetCacheNum(context.Background(), payErrAddNumKey)
|
|
|
lastAddFeeNumErr, _ := s.cache.GetCacheNum(context.Background(), lastPayAddNumKey)
|
|
|
- errMsgZ += "\n"
|
|
|
- errMsgZ += taskStatistics.GameName
|
|
|
- errMsgZ += "("
|
|
|
+
|
|
|
+ oneErrM += taskStatistics.GameName
|
|
|
+ oneErrM += "("
|
|
|
if data.TimeRate/60 >= 60 {
|
|
|
- errMsgZ += strconv.Itoa(data.TimeRate / 60 / 60)
|
|
|
- errMsgZ += "小时内(+" + strconv.Itoa(numErr) + "))"
|
|
|
+ oneErrM += strconv.Itoa(data.TimeRate / 60 / 60)
|
|
|
+ oneErrM += "小时内(+" + strconv.Itoa(numErr) + "))"
|
|
|
} else {
|
|
|
- errMsgZ += strconv.Itoa(data.TimeRate / 60)
|
|
|
- errMsgZ += "分钟内(+" + strconv.Itoa(numErr) + "))"
|
|
|
+ oneErrM += strconv.Itoa(data.TimeRate / 60)
|
|
|
+ oneErrM += "分钟内(+" + strconv.Itoa(numErr) + "))"
|
|
|
}
|
|
|
- errMsgZ += ","
|
|
|
- errMsgZ += "最后加付费时间 "
|
|
|
+ oneErrM += ","
|
|
|
+ oneErrM += "最后加付费时间 "
|
|
|
t := time.Unix(int64(data.AddPayUpdateTime), 0)
|
|
|
- errMsgZ += t.Format("15:04:05")
|
|
|
- errMsgZ += "(+" + strconv.Itoa(lastAddFeeNumErr) + ")"
|
|
|
+ oneErrM += t.Format("15:04:05")
|
|
|
+ oneErrM += "(+" + strconv.Itoa(lastAddFeeNumErr) + ")"
|
|
|
+ errMsgZ += "\n"
|
|
|
+ errMsgZ += oneErrM
|
|
|
if _, ok := mpsPerson[name]; ok {
|
|
|
mobile = append(mobile, mpsPerson[name].MobilePhoneNumber)
|
|
|
}
|
|
|
+ if data.TimeRate/60 >= 30 {
|
|
|
+ PErrSendMsg[name] += oneErrM
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
sendMsg[name] += ","
|
|
|
if m >= 60 {
|
|
|
sendMsg[name] += strconv.Itoa(m / 60)
|
|
|
- sendMsg[name] += "分钟内完成"
|
|
|
+ sendMsg[name] += "小时内完成"
|
|
|
} else {
|
|
|
sendMsg[name] += strconv.Itoa(m)
|
|
|
sendMsg[name] += "分钟内完成"
|
|
|
@@ -1290,34 +1301,14 @@ func (s *SyncData) TaskMsgSendFreeDataUpdate(ctx context.Context, completesInfo
|
|
|
return
|
|
|
}
|
|
|
hour := time.Now().Hour()
|
|
|
- for name, msg := range sendMsg {
|
|
|
- retained += "\n"
|
|
|
- retained += name
|
|
|
- retained += msg
|
|
|
- if hour >= mpsPerson[name].StartTime {
|
|
|
- var personMsg = "# 付费播报 "
|
|
|
- personMsg += fmt.Sprintf("<font color=\"warning\">%s</font>", time.Now().Format("2006-01-02 15:04:05"))
|
|
|
- personMsg = msg
|
|
|
- url := mpsPerson[name].Url
|
|
|
- var sendPersonData SendMsg
|
|
|
- sendPersonData.MsgType = "markdown"
|
|
|
- sendPersonData.Markdown.Content = personMsg
|
|
|
- s.SendMsgData(url, sendPersonData)
|
|
|
- if mpsPerson[name].Custodians != "" {
|
|
|
- if _, ok := mpsPerson[mpsPerson[name].Custodians]; ok {
|
|
|
- custodiansMsg := fmt.Sprintf("<font color=\"warning\">%s的任务</font>", name)
|
|
|
- custodiansMsg += "\n"
|
|
|
- custodiansMsg += personMsg
|
|
|
- var custodiansData SendMsg
|
|
|
- custodiansData.MsgType = "markdown"
|
|
|
- custodiansData.Markdown.Content = custodiansMsg
|
|
|
- urlCustodians := mpsPerson[mpsPerson[name].Custodians].Url
|
|
|
- s.SendMsgData(urlCustodians, custodiansData)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ msgType := "# 付费异常 "
|
|
|
+ go s.TaskMsgSendDirector(ctx, msgType, PErrSendMsg, mpsPerson, hour, date, 30, true)
|
|
|
msg := retained
|
|
|
+ for name, msg1 := range sendMsg {
|
|
|
+ msg += "\n"
|
|
|
+ msg += name
|
|
|
+ msg += msg1
|
|
|
+ }
|
|
|
if errMsgZ != "" {
|
|
|
msg += "\n"
|
|
|
//msg += errMsg + errMsgZ
|
|
|
@@ -1342,7 +1333,7 @@ func (s *SyncData) TaskMsgSendFreeDataUpdate(ctx context.Context, completesInfo
|
|
|
// 加付费通知
|
|
|
func (s *SyncData) FreeSendMsg(num, target int, taskName, director string) {
|
|
|
hour := time.Now().Hour()
|
|
|
- if hour < 8 {
|
|
|
+ if hour < 8 || num < 20 {
|
|
|
return
|
|
|
}
|
|
|
person, err := s.Person.GetUserInfoByName(director)
|