task.go 1.7 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. GetLzProductPriceData()
  36. fmt.Println("end")
  37. }
  38. */
  39. func SendEmail() (err error) {
  40. //报告历史访问次数
  41. go ReportViewTimes()
  42. //报告访问详情
  43. go ReportViewDetail()
  44. //潜在客户回访记录
  45. go FreeViewerDetail()
  46. //用户权限统计
  47. go HongzeUsers()
  48. return
  49. }
  50. func OneMinute() (err error) {
  51. //日度
  52. //FrequencyByDay()
  53. //周度
  54. FrequencyByWeek()
  55. //月度
  56. //FrequencyByMonth()
  57. return
  58. }