package services import ( "fmt" "github.com/astaxie/beego/toolbox" ) func Task() { fmt.Println("task start") //发送邮件 sendEmail := toolbox.NewTask("sendEmail", "0 0 12 * * 0 ", SendEmail) toolbox.AddTask("sendEmail", sendEmail) oneMinute := toolbox.NewTask("oneMinute", "0 */1 7-23 * * * ", OneMinute) toolbox.AddTask("oneMinute", oneMinute) //隆众指标获取 getLzProductList := toolbox.NewTask("getLzProductList", "0 0 11-19/1 * * * ", GetLzProductList) toolbox.AddTask("getLzProductList", getLzProductList) //隆众指标数据获取 getLzProductDetail := toolbox.NewTask("getLzProductDetail", "0 5 11-19/1 * * * ", GetLzProductDetail) toolbox.AddTask("getLzProductDetail", getLzProductDetail) //隆众价格指标获取 getLzProductPriceProduct := toolbox.NewTask("getLzProductPriceProduct", "0 5 11-19/1 * * * ", GetLzProductPriceProduct) toolbox.AddTask("getLzProductPriceProduct", getLzProductPriceProduct) //隆众价格指标数据获取 getLzProductPriceData := toolbox.NewTask("getLzProductPriceData", "0 10 11-19/1 * * * ", GetLzProductPriceData) toolbox.AddTask("getLzProductPriceData", getLzProductPriceData) //正式->试用 companyTryOut := toolbox.NewTask("companyTryOut", "0 5 0 * * *", CompanyTryOut) toolbox.AddTask("companyTryOut", companyTryOut) //试用->冻结 companyFreeze := toolbox.NewTask("companyFreeze", "0 10 0 * * *", CompanyFreeze) toolbox.AddTask("companyFreeze", companyFreeze) //冻结->流失 companyLoss := toolbox.NewTask("companyLoss", "0 20 0 * * *", CompanyLoss) toolbox.AddTask("companyLoss", companyLoss) //删除日志记录 deleteReportSaveLog := toolbox.NewTask("deleteReportSaveLog", "0 20 0 * * *", DeleteReportSaveLog) toolbox.AddTask("deleteReportSaveLog", deleteReportSaveLog) toolbox.StartTask() //GetHistoryLzProductDetail() //GetLzPrice() //GetLzProductDetail() //LzExportExcel() //GetLzProductList()GetLzProductDetail fmt.Println("task end") } func Task123() { fmt.Println("start") //0 42 4 1 * *     毎月1日的 4:42 分 执行 DeleteReportSaveLog() fmt.Println("end") } func SendEmail() (err error) { //报告历史访问次数 go ReportViewTimes() //报告访问详情 go ReportViewDetail() //潜在客户回访记录 go FreeViewerDetail() //用户权限统计 go HongzeUsers() return } func OneMinute() (err error) { //日度 //FrequencyByDay() //周度 FrequencyByWeek() //月度 //FrequencyByMonth() return }