123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- package services
- import (
- "fmt"
- "github.com/astaxie/beego/toolbox"
- "hongze/hongze_task/services/data_manage"
- "hongze/hongze_task/services/company_contract"
- "hongze/hongze_task/utils"
- )
- func Task() {
- fmt.Println("task start")
-
- if utils.RunMode == "release"{
- releaseTask()
- }
-
- handleCompanyContract := toolbox.NewTask("handleCompanyContract", "0 1 0 * * *", company_contract.HandleCompanyContract)
- toolbox.AddTask("每日定时合同处理", handleCompanyContract)
-
- companyTryOut := toolbox.NewTask("companyTryOut", "0 5 0 * * *", CompanyTryOut)
- toolbox.AddTask("正式->试用", companyTryOut)
-
- companyFreeze := toolbox.NewTask("companyFreeze", "0 10 0 * * *", CompanyFreeze)
- toolbox.AddTask("试用->冻结", companyFreeze)
-
- companyLoss := toolbox.NewTask("companyLoss", "0 20 0 * * *", CompanyLoss)
- toolbox.AddTask("冻结->流失", companyLoss)
-
- companyReportPermissionClose := toolbox.NewTask("companyReportPermissionClose", "0 30 0 * * *", CompanyReportPermissionClose)
- toolbox.AddTask("用户产品权限试用-->关闭", companyReportPermissionClose)
-
-
-
-
- stackCompanyStatistic := toolbox.NewTask("stackCompanyStatistic", "0 35 0 * * *", StackCompanyStatistic)
- toolbox.AddTask("存量客户数据统计", stackCompanyStatistic)
- toolbox.StartTask()
-
-
-
-
-
- go GetLzProductDetail()
- fmt.Println("task end")
- }
- func releaseTask(){
-
- 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)
-
- 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)
-
- companyRemind := toolbox.NewTask("companyRemind", "0 30 08 * * *", CompanyRemind)
- toolbox.AddTask("companyRemind", companyRemind)
-
- freeViewerDetail := toolbox.NewTask("freeViewerDetail", "0 0 9 * * 1 ", FreeViewerDetail)
- toolbox.AddTask("潜在客户", freeViewerDetail)
-
- refreshData := toolbox.NewTask("refreshData", "0 0 18 * * *", RefreshData)
- toolbox.AddTask("refreshData", refreshData)
- checkDataInterface := toolbox.NewTask("checkDataInterface", "0 */4 * * * * ", data_manage.CheckDataInterface)
- toolbox.AddTask("checkDataInterface", checkDataInterface)
- }
- func TaskTest(){
- fmt.Println("The task is start")
-
- companyReportPermissionClose := toolbox.NewTask("companyReportPermissionClose", "0/30 * * * * *", CompanyReportPermissionClose)
- toolbox.AddTask("用户产品权限试用-->关闭", companyReportPermissionClose)
- toolbox.StartTask()
- fmt.Println("The task is end")
- }
- func Task123() {
- fmt.Println("start")
-
- HongzeUsers()
- fmt.Println("end")
- return
- }
- func SendEmail() (err error) {
-
- go ReportViewTimes()
-
- go ReportViewDetail()
-
- go HongzeUsers()
- return
- }
- func OneMinute() (err error) {
-
-
-
- FrequencyByWeek()
-
- FrequencyByMonth()
- return
- }
- func RefreshData() (err error){
-
- go data_manage.RefreshDataFromWind()
-
- go data_manage.RefreshDataFromThs()
-
- go data_manage.RefreshDataFromPb()
- return
- }
|