task.go 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. package services
  2. import (
  3. "fmt"
  4. "github.com/astaxie/beego/toolbox"
  5. )
  6. func Task() {
  7. fmt.Println("task start")
  8. //发送邮件
  9. sendEmail := toolbox.NewTask("sendEmail", "0 0 12 * * 0 ", SendEmail)
  10. toolbox.AddTask("sendEmail", sendEmail)
  11. oneMinute := toolbox.NewTask("oneMinute", "0 */1 7-23 * * * ", OneMinute)
  12. toolbox.AddTask("oneMinute", oneMinute)
  13. //隆众指标获取
  14. getLzProductList := toolbox.NewTask("getLzProductList", "0 0 11-19/1 * * * ", GetLzProductList)
  15. toolbox.AddTask("getLzProductList", getLzProductList)
  16. //隆众指标数据获取
  17. getLzProductDetail := toolbox.NewTask("getLzProductDetail", "0 5 11-19/1 * * * ", GetLzProductDetail)
  18. toolbox.AddTask("getLzProductDetail", getLzProductDetail)
  19. //隆众价格指标获取
  20. getLzProductPriceProduct := toolbox.NewTask("getLzProductPriceProduct", "0 5 11-19/1 * * * ", GetLzProductPriceProduct)
  21. toolbox.AddTask("getLzProductPriceProduct", getLzProductPriceProduct)
  22. //隆众价格指标数据获取
  23. getLzProductPriceData := toolbox.NewTask("getLzProductPriceData", "0 10 11-19/1 * * * ", GetLzProductPriceData)
  24. toolbox.AddTask("getLzProductPriceData", getLzProductPriceData)
  25. toolbox.StartTask()
  26. //GetHistoryLzProductDetail()
  27. //GetLzPrice()
  28. //GetLzProductDetail()
  29. //LzExportExcel()
  30. //GetLzProductList()GetLzProductDetail
  31. fmt.Println("task end")
  32. }
  33. //func Task() {
  34. // fmt.Println("start")
  35. // GetHistoryLzProductDetail()
  36. // fmt.Println("end")
  37. //}
  38. func SendEmail() (err error) {
  39. //报告历史访问次数
  40. go ReportViewTimes()
  41. //报告访问详情
  42. go ReportViewDetail()
  43. //潜在客户回访记录
  44. go FreeViewerDetail()
  45. //用户权限统计
  46. go HongzeUsers()
  47. return
  48. }
  49. func OneMinute() (err error) {
  50. //日度
  51. //FrequencyByDay()
  52. //周度
  53. FrequencyByWeek()
  54. //月度
  55. //FrequencyByMonth()
  56. return
  57. }