Commit 5d1c040e by Joneq

调试数据不正确

parent ec8689c6
Showing with 12 additions and 4 deletions
......@@ -43,8 +43,14 @@ func main() {
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 := "2021-05-26"
currentDate = "2021-05-26"
//请求数据
currentUnix = time.Now().Unix()-36000
......@@ -72,14 +78,14 @@ func GetTotalStatistic() {
jsonStr := RequestTableInfo("totalStatistic")
//{"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() == "[]" {
fmt.Println(jsonStr)
return
}
sqlDb := scm_data_dao.GetDashboardDb()
currentSearch :=TopSearch()
currentSearch := TopSearch()
for _, res := range gjson.Get(jsonStr, "data").Array() {
......@@ -111,8 +117,9 @@ func GetMaterialstatistic() {
jsonStr := RequestTableInfo("topStatistic")
//{"data": [], "returnCode": "0000", "returnMsg": "\u6210\u529f"}
fmt.Println("topStatistic json:"+jsonStr)
if gjson.Get(jsonStr,"returnCode").String() != "0000" || gjson.Get(jsonStr, "data").String() == "[]" {
fmt.Println(jsonStr)
return
}
......@@ -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"
requestResult := RequestUrl(requestStr)
fmt.Println("sku总量json"+requestResult)
return gjson.Get(requestResult,"data.total").String()
}
......
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