Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
孙龙
/
golang_asynctask
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6ce4681a
authored
Sep 07, 2021
by
孙龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
up
parent
a3362d36
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
14 deletions
app/service/crm/cron_crm_schedulememo/cron_crm_schedulememo.go
app/service/crm/cron_crm_todotask/service.go
app/service/crm/cron_crm_schedulememo/cron_crm_schedulememo.go
View file @
6ce4681a
...
...
@@ -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 <=?"
...
...
app/service/crm/cron_crm_todotask/service.go
View file @
6ce4681a
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment