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
5d1c040e
authored
May 27, 2021
by
Joneq
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调试数据不正确
parent
ec8689c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
cmd/bigtv/sync_bigtv_statistics/main.go
cmd/bigtv/sync_bigtv_statistics/main.go
View file @
5d1c040e
...
@@ -43,8 +43,14 @@ func main() {
...
@@ -43,8 +43,14 @@ func main() {
runtime
.
GOMAXPROCS
(
2
)
runtime
.
GOMAXPROCS
(
2
)
sqlDb
:=
scm_data_dao
.
GetDashboardDb
()
sqlDb
.
Exec
(
"truncate lie_btv_daily_order_transaction"
)
sqlDb
.
Exec
(
"truncate lie_btv_daily_top_order"
)
sqlDb
.
Exec
(
"truncate lie_btv_daily_top_search"
)
currentDate
=
time
.
Now
()
.
Format
(
"2006-01-02"
)
currentDate
=
time
.
Now
()
.
Format
(
"2006-01-02"
)
currentDate
:
=
"2021-05-26"
currentDate
=
"2021-05-26"
//请求数据
//请求数据
currentUnix
=
time
.
Now
()
.
Unix
()
-
36000
currentUnix
=
time
.
Now
()
.
Unix
()
-
36000
...
@@ -72,14 +78,14 @@ func GetTotalStatistic() {
...
@@ -72,14 +78,14 @@ func GetTotalStatistic() {
jsonStr
:=
RequestTableInfo
(
"totalStatistic"
)
jsonStr
:=
RequestTableInfo
(
"totalStatistic"
)
//{"data": [{"materialQty": 0, "materialCount": 0, "materialTotalQty": 966724502}], "returnCode": "0000", "returnMsg": "\u6210\u529f"}
//{"data": [{"materialQty": 0, "materialCount": 0, "materialTotalQty": 966724502}], "returnCode": "0000", "returnMsg": "\u6210\u529f"}
fmt
.
Println
(
"totalStatistic"
+
jsonStr
)
if
gjson
.
Get
(
jsonStr
,
"returnCode"
)
.
String
()
!=
"0000"
||
gjson
.
Get
(
jsonStr
,
"data"
)
.
String
()
==
"[]"
{
if
gjson
.
Get
(
jsonStr
,
"returnCode"
)
.
String
()
!=
"0000"
||
gjson
.
Get
(
jsonStr
,
"data"
)
.
String
()
==
"[]"
{
fmt
.
Println
(
jsonStr
)
return
return
}
}
sqlDb
:=
scm_data_dao
.
GetDashboardDb
()
sqlDb
:=
scm_data_dao
.
GetDashboardDb
()
currentSearch
:=
TopSearch
()
currentSearch
:=
TopSearch
()
for
_
,
res
:=
range
gjson
.
Get
(
jsonStr
,
"data"
)
.
Array
()
{
for
_
,
res
:=
range
gjson
.
Get
(
jsonStr
,
"data"
)
.
Array
()
{
...
@@ -111,8 +117,9 @@ func GetMaterialstatistic() {
...
@@ -111,8 +117,9 @@ func GetMaterialstatistic() {
jsonStr
:=
RequestTableInfo
(
"topStatistic"
)
jsonStr
:=
RequestTableInfo
(
"topStatistic"
)
//{"data": [], "returnCode": "0000", "returnMsg": "\u6210\u529f"}
//{"data": [], "returnCode": "0000", "returnMsg": "\u6210\u529f"}
fmt
.
Println
(
"topStatistic json:"
+
jsonStr
)
if
gjson
.
Get
(
jsonStr
,
"returnCode"
)
.
String
()
!=
"0000"
||
gjson
.
Get
(
jsonStr
,
"data"
)
.
String
()
==
"[]"
{
if
gjson
.
Get
(
jsonStr
,
"returnCode"
)
.
String
()
!=
"0000"
||
gjson
.
Get
(
jsonStr
,
"data"
)
.
String
()
==
"[]"
{
fmt
.
Println
(
jsonStr
)
return
return
}
}
...
@@ -214,6 +221,7 @@ func GetCurrentSku()string {
...
@@ -214,6 +221,7 @@ func GetCurrentSku()string {
requestStr
:=
"http://soso12.ichunt.com/search/Es/searchSku?create_time/range="
+
strconv
.
FormatInt
(
timeStart
.
Unix
(),
10
)
+
","
+
strconv
.
FormatInt
(
currentUnix
,
10
)
+
"&goods_status/condition=1"
requestStr
:=
"http://soso12.ichunt.com/search/Es/searchSku?create_time/range="
+
strconv
.
FormatInt
(
timeStart
.
Unix
(),
10
)
+
","
+
strconv
.
FormatInt
(
currentUnix
,
10
)
+
"&goods_status/condition=1"
requestResult
:=
RequestUrl
(
requestStr
)
requestResult
:=
RequestUrl
(
requestStr
)
fmt
.
Println
(
"sku总量json"
+
requestResult
)
return
gjson
.
Get
(
requestResult
,
"data.total"
)
.
String
()
return
gjson
.
Get
(
requestResult
,
"data.total"
)
.
String
()
}
}
...
...
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