Commit 68598635 by Joneq

调试数据不正确

parent f1b4f667
Showing with 9 additions and 6 deletions
...@@ -127,6 +127,7 @@ func GetMaterialstatistic() { ...@@ -127,6 +127,7 @@ func GetMaterialstatistic() {
sqlDb := scm_data_dao.GetDashboardDb() sqlDb := scm_data_dao.GetDashboardDb()
i:=1
for _, res := range gjson.Get(jsonStr, "data").Array() { for _, res := range gjson.Get(jsonStr, "data").Array() {
erpKey := make(map[string]interface{}) erpKey := make(map[string]interface{})
...@@ -136,8 +137,9 @@ func GetMaterialstatistic() { ...@@ -136,8 +137,9 @@ func GetMaterialstatistic() {
}) })
//添加数据 //添加数据
_, err := sqlDb.Exec("insert into lie_btv_daily_top_order (datetime,sn,order_num)" + _, err := sqlDb.Exec("insert into lie_btv_daily_top_order (sort,datetime,sn,order_num)" +
"value(?,?,?)",currentDate,erpKey["materialName"],erpKey["materialQty"]) "value(?,?,?,?)",i,currentDate,erpKey["materialName"],erpKey["materialQty"])
i++
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)
} }
...@@ -167,6 +169,7 @@ func TopSearch()int64 { ...@@ -167,6 +169,7 @@ func TopSearch()int64 {
sqlDb := scm_data_dao.GetDashboardDb() sqlDb := scm_data_dao.GetDashboardDb()
i:=1
for _, res := range gjson.Get(jsonStr, "data").Array() { for _, res := range gjson.Get(jsonStr, "data").Array() {
erpKey := make(map[string]interface{}) erpKey := make(map[string]interface{})
...@@ -181,13 +184,13 @@ func TopSearch()int64 { ...@@ -181,13 +184,13 @@ func TopSearch()int64 {
if insertDataNum > 0{ if insertDataNum > 0{
//添加数据 //添加数据
_, err := sqlDb.Exec("insert into lie_btv_daily_top_search (datetime,sn,search_num)" + _, err := sqlDb.Exec("insert into lie_btv_daily_top_search (sort,datetime,sn,search_num)" +
"value(?,?,?)",currentDate,erpKey["goods_name"],erpKey["count"]) "value(?,?,?,?)",i,currentDate,erpKey["goods_name"],erpKey["count"])
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)
} }
} }
i++
insertDataNum-- insertDataNum--
} }
...@@ -221,7 +224,7 @@ func RequestTableInfo(requestType string)string { ...@@ -221,7 +224,7 @@ func RequestTableInfo(requestType string)string {
func GetCurrentSku()string { 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://so12.ichunt.com/search/Es/searchSku?create_time/range="+strconv.FormatInt(timeStart.Unix(),10)+","+strconv.FormatInt(currentUnix,10)+"&goods_status/condition=1"
fmt.Println(requestStr) fmt.Println(requestStr)
requestResult := RequestUrl(requestStr) requestResult := RequestUrl(requestStr)
fmt.Println("sku总量json"+requestResult) fmt.Println("sku总量json"+requestResult)
......
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