friday
parent
420beaa6bd
commit
8ec2db4f58
|
@ -31,7 +31,7 @@ _/ ____\______ ____ _____ _____ ____ __ _ _______ ____ ____
|
||||||
log.Println("目前是定时任务模式")
|
log.Println("目前是定时任务模式")
|
||||||
log.Printf("等待任务的第%v次执行...\n", operateTime)
|
log.Printf("等待任务的第%v次执行...\n", operateTime)
|
||||||
// 定义任务,每周五的五点执行
|
// 定义任务,每周五的五点执行
|
||||||
gocron.Every(1).Saturday().At("16:00").Do(retryJob)
|
gocron.Every(1).Friday().At("16:00").Do(retryJob)
|
||||||
// 开始定时任务
|
// 开始定时任务
|
||||||
<-gocron.Start()
|
<-gocron.Start()
|
||||||
} else {
|
} else {
|
||||||
|
@ -68,9 +68,11 @@ func job() error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result := aichat.NewAiReq(excel.ExcelAddress).StartChat(option.MODEL_API).PrepareWechatBody()
|
|
||||||
remainder := fmt.Sprintf("文件同步完成,地址是%v,稍后将发送ai分析结果%v", excel.ExcelAddress, ">_<~")
|
remainder := fmt.Sprintf("文件同步完成,地址是%v,稍后将发送ai分析结果%v", "http://43.143.245.135:233/"+excel.ExcelName, ">_<~")
|
||||||
notifer.SendWechat(remainder)
|
notifer.SendWechat(remainder)
|
||||||
|
|
||||||
|
result := aichat.NewAiReq(excel.ExcelAddress).StartChat(option.MODEL_API).PrepareWechatBody()
|
||||||
notifer.SendWechat(result)
|
notifer.SendWechat(result)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,19 +82,22 @@ func (e *Excel) SetReplyContent() *Excel {
|
||||||
repliesContentSlice := tools.ReverseSlice(s)
|
repliesContentSlice := tools.ReverseSlice(s)
|
||||||
repliesContentSlice = tools.RemoveNewlineElements(repliesContentSlice)
|
repliesContentSlice = tools.RemoveNewlineElements(repliesContentSlice)
|
||||||
repliesContentSlice = tools.AddNewlineToEachElement(repliesContentSlice)
|
repliesContentSlice = tools.AddNewlineToEachElement(repliesContentSlice)
|
||||||
//跳过没有回复内容的工单。
|
|
||||||
if len(repliesContentSlice) == 0 {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
//工单id转换为cloudid
|
//工单id转换为cloudid
|
||||||
cloudId := filter.Id2CloudId(v)
|
cloudId := filter.Id2CloudId(v)
|
||||||
if cloudId == "" {
|
if cloudId == "" {
|
||||||
contentMap[v] = repliesContentSlice
|
contentMap[v] = repliesContentSlice
|
||||||
log.Printf("goroutine%v:回复内容处理完成,工单id(非cloudid是%v)", j, v)
|
log.Printf("goroutine%v:回复内容处理完成,工单id(非cloudid是%v\n)", j, v)
|
||||||
|
log.Printf("goroutine%v:UdeskId为:%v,内容为:%v\n", j, v, contentMap[v])
|
||||||
} else {
|
} else {
|
||||||
contentMap[cloudId] = repliesContentSlice
|
contentMap[cloudId] = repliesContentSlice
|
||||||
log.Printf("goroutine%v:回复内容处理完成,工单id(非cloudid是%v)", j, v)
|
log.Printf("goroutine%v:回复内容处理完成,工单id(cloudid是%v\n)", j, cloudId)
|
||||||
|
log.Printf("goroutine%v:cloudId为:%v,内容为:%v\n", j, cloudId, contentMap[cloudId])
|
||||||
|
}
|
||||||
|
|
||||||
|
//跳过没有回复内容的工单。
|
||||||
|
if len(repliesContentSlice) == 0 {
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("goroutine%v结束\n", j)
|
log.Printf("goroutine%v结束\n", j)
|
||||||
|
|
Loading…
Reference in New Issue