Commit 6ce4681a by 孙龙

up

parent a3362d36
......@@ -3,12 +3,11 @@ package cron_crm_schedulememo
import (
"encoding/json"
"errors"
"fmt"
cfg "github.com/ichunt2019/cfg/lib"
xlog "github.com/ichunt2019/lxLog/log"
"github.com/tidwall/gjson"
"golang-asynctask/app/dao/crm/cron_crm_schedulememo"
cfg "github.com/ichunt2019/cfg/lib"
comfunc "golang-asynctask/util/lib"
xlog "github.com/ichunt2019/lxLog/log"
"net/http"
"net/url"
"time"
......@@ -25,14 +24,15 @@ func RemindMemo(){
//}()
currentTime := time.Now().Format("2006-01-02")
fmt.Println(currentTime)
start_time_str := currentTime + " 00:00:00"
end_time_str := currentTime + " 23:59:59"
start_time,_ :=time.Parse("2006-01-02 15:04:05",start_time_str);
end_time,_ :=time.Parse("2006-01-02 15:04:05",end_time_str);
loc, _ := time.LoadLocation("Local")
start_time,_ :=time.ParseInLocation("2006-01-02 15:04:05",start_time_str,loc);
end_time,_ :=time.ParseInLocation("2006-01-02 15:04:05",end_time_str,loc);
sql := "select id,sale_id from lie_schedule_memo where status = 1 and end_time >=? and end_time <=?"
......
......@@ -51,17 +51,20 @@ func Corder(){
//若过期的任务,该客户释放回小组池
func TimeoutRelease(){
sql := "SELECT id,end_time,status,handler_id FROM `lie_schedule` where status = 1 and end_time <= unix_timestamp(now()) "
sql := "SELECT id,end_time,status,handler_id,schedule_type FROM `lie_schedule` where status = 1 and end_time <= unix_timestamp(now()) "
res,err := cron_crm_todotask.Dao.GetDb("crm").QueryString(sql);
if err != nil{
xlog.Instance("cron_crm_todotask").Error("若过期的任务,err:%s",err);
}
//fmt.Println(res)
for _,v := range res{
isok := releaseUser(v["id"],v["handler_id"])
if !isok{
continue
//自主领取的任务才需要释放回小组池
if v["schedule_type"] == "1"{
isok := releaseUser(v["id"],v["handler_id"])
if !isok{
continue
}
}
id , err := strconv.ParseInt(v["id"], 10, 64)
if err != nil{
continue;
......@@ -115,12 +118,14 @@ func RemindTimeout(){
start_time_str := currentTime + " 00:00:00"
end_time_str := currentTime + " 23:59:59"
start_time,_ :=time.Parse("2006-01-02 15:04:05",start_time_str);
end_time,_ :=time.Parse("2006-01-02 15:04:05",end_time_str);
loc, _ := time.LoadLocation("Local")
start_time,_ :=time.ParseInLocation("2006-01-02 15:04:05",start_time_str,loc);
end_time,_ :=time.ParseInLocation("2006-01-02 15:04:05",end_time_str,loc);
sql := "select id,handler_id,handler_name from lie_schedule where status = 1 and end_time >=? and end_time <=?"
reult,err := cron_crm_todotask.Dao.GetDb("crm").SQL(sql,start_time.Unix()+1*24*3600,end_time.Unix()+3*24*3600).QueryString()
reult,err := cron_crm_todotask.Dao.GetDb("crm").SQL(sql,start_time.Unix()+3*24*3600,end_time.Unix()+3*24*3600).QueryString()
if err != nil{
xlog.Instance("cron_crm_todotask").Error("err:%s",err);
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment