dev
Administrator 2024-05-26 09:15:34 +08:00
parent 420beaa6bd
commit 8ec2db4f58
2 changed files with 14 additions and 9 deletions

View File

@ -31,7 +31,7 @@ _/ ____\______ ____ _____ _____ ____ __ _ _______ ____ ____
log.Println("目前是定时任务模式")
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()
} else {
@ -68,9 +68,11 @@ func job() error {
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)
result := aichat.NewAiReq(excel.ExcelAddress).StartChat(option.MODEL_API).PrepareWechatBody()
notifer.SendWechat(result)
return nil
}

View File

@ -82,19 +82,22 @@ func (e *Excel) SetReplyContent() *Excel {
repliesContentSlice := tools.ReverseSlice(s)
repliesContentSlice = tools.RemoveNewlineElements(repliesContentSlice)
repliesContentSlice = tools.AddNewlineToEachElement(repliesContentSlice)
//跳过没有回复内容的工单。
if len(repliesContentSlice) == 0 {
return
}
//工单id转换为cloudid
cloudId := filter.Id2CloudId(v)
if cloudId == "" {
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 {
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)