|
@@ -13,6 +13,7 @@ import (
|
|
|
"log-server/model/log"
|
|
"log-server/model/log"
|
|
|
"log-server/model/log/request"
|
|
"log-server/model/log/request"
|
|
|
"log-server/model/log/response"
|
|
"log-server/model/log/response"
|
|
|
|
|
+ "log-server/model/typeManage"
|
|
|
loging2 "log-server/service/log/loging"
|
|
loging2 "log-server/service/log/loging"
|
|
|
"log-server/utils"
|
|
"log-server/utils"
|
|
|
"strconv"
|
|
"strconv"
|
|
@@ -22,6 +23,7 @@ import (
|
|
|
|
|
|
|
|
type ServiceStatisticsLog struct {
|
|
type ServiceStatisticsLog struct {
|
|
|
loging2.LogicalLog
|
|
loging2.LogicalLog
|
|
|
|
|
+ Person typeManage.ResponsiblePerson
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
var StatisticsCompletedKey = "%s:StatisticsCompleted"
|
|
var StatisticsCompletedKey = "%s:StatisticsCompleted"
|
|
@@ -1052,15 +1054,24 @@ func (s *ServiceStatisticsLog) RegularCheckPc() {
|
|
|
noReportingPc = append(noReportingPc, pc)
|
|
noReportingPc = append(noReportingPc, pc)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+ mpsPerson, _ := s.Person.GetUserInfo()
|
|
|
|
|
+ var mobile []string
|
|
|
var content string
|
|
var content string
|
|
|
-
|
|
|
|
|
|
|
+ nameMps := map[string]int{}
|
|
|
if len(noReportingPc) != 0 {
|
|
if len(noReportingPc) != 0 {
|
|
|
- content += fmt.Sprintf("两小时内未检测到中控数据<font color=\"warning\">%d台</font>:", len(noReportingPc))
|
|
|
|
|
|
|
+ content += fmt.Sprintf("一小时内未检测到中控数据<font color=\"warning\">%d台</font>:", len(noReportingPc))
|
|
|
for _, pc := range noReportingPc {
|
|
for _, pc := range noReportingPc {
|
|
|
content += "\n"
|
|
content += "\n"
|
|
|
name := computersF[pc]
|
|
name := computersF[pc]
|
|
|
content += name + " : " + pc
|
|
content += name + " : " + pc
|
|
|
|
|
+ nameMps[name] = 1
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if len(nameMps) != 0 {
|
|
|
|
|
+ for name, _ := range nameMps {
|
|
|
|
|
+ if _, ok := mpsPerson[name]; ok {
|
|
|
|
|
+ mobile = append(mobile, mpsPerson[name])
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if content != "" {
|
|
if content != "" {
|
|
@@ -1071,9 +1082,22 @@ func (s *ServiceStatisticsLog) RegularCheckPc() {
|
|
|
url := global.GVA_CONFIG.SendUrl.ComputerSendUrl
|
|
url := global.GVA_CONFIG.SendUrl.ComputerSendUrl
|
|
|
//url := "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=7d095d5b-8240-45fd-a68c-baff3628d83b"
|
|
//url := "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=7d095d5b-8240-45fd-a68c-baff3628d83b"
|
|
|
_, err = s.SendMsgData(url, sendMsg)
|
|
_, err = s.SendMsgData(url, sendMsg)
|
|
|
|
|
+ if len(mobile) != 0 {
|
|
|
|
|
+ var sendTextData SendTextMsg
|
|
|
|
|
+ sendTextData.MsgType = "text"
|
|
|
|
|
+ sendTextData.Text.MentionedMobileList = mobile
|
|
|
|
|
+ _, _ = s.SendMsgData(url, sendTextData)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+type SendTextMsg struct {
|
|
|
|
|
+ MsgType string `json:"msgtype"`
|
|
|
|
|
+ Text struct {
|
|
|
|
|
+ MentionedMobileList []string `json:"mentioned_mobile_list"`
|
|
|
|
|
+ } `json:"text"`
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
type SendMsg struct {
|
|
type SendMsg struct {
|
|
|
MsgType string `json:"msgtype"`
|
|
MsgType string `json:"msgtype"`
|
|
|
Markdown struct {
|
|
Markdown struct {
|