ziwen 2 лет назад
Родитель
Сommit
a9a8df58f7
3 измененных файлов с 11 добавлено и 9 удалено
  1. 3 1
      services/com_trade.go
  2. 4 4
      services/commodity_trade_zhengzhou.go
  3. 4 4
      services/task.go

+ 3 - 1
services/com_trade.go

@@ -576,7 +576,8 @@ func syncComTradeData(comTradeId int, indexCode, indexNameCn, flowCode, partnerC
 				}
 			}
 			tmpName += finalpartnerName
-
+			//fmt.Println(tmpData.IndexTradeCode)
+			//fmt.Println(tmpName)
 
 			valueName := tmpName + "贸易金额"
 			weightName := tmpName + "贸易重量"
@@ -593,6 +594,7 @@ func syncComTradeData(comTradeId int, indexCode, indexNameCn, flowCode, partnerC
 					Name:       valueName,
 					CreateTime: time.Now(),
 				}
+
 				tmpErr := models.AddComTradeCodeMapping(tmpComTradeCodeMapping)
 				if tmpErr != nil {
 					fmt.Println(indexCode, "添加贸易金额失败,err:", err)

+ 4 - 4
services/commodity_trade_zhengzhou.go

@@ -102,7 +102,7 @@ func SyncRankingFromZhengzhou() {
 		}
 		table := doc.Find("table")
 		var classifyName, classifyType, tradeDate string
-		var dealSuffix, dealAddCutSuffix, buySuffix, buyAddCutSuffix, sellSuffix, sellAddCutSuffix string
+		var dealSuffix, buySuffix, sellSuffix string
 		var dealVal, dealAddCutVal, buyVal, buyAddCutVal, sellVal, sellAddCutVal string
 		var rank string
 		table.Find("tr").Each(func(i int, tr *goquery.Selection) {
@@ -163,7 +163,7 @@ func SyncRankingFromZhengzhou() {
 					}
 					if tk == 3 {
 						if strings.Contains(tdText, "增减量") {
-							dealAddCutSuffix = tdText
+							//dealAddCutSuffix = tdText
 						} else {
 							dealAddCutVal = tdText
 						}
@@ -177,7 +177,7 @@ func SyncRankingFromZhengzhou() {
 					}
 					if tk == 6 {
 						if strings.Contains(tdText, "增减量") {
-							buyAddCutSuffix = tdText
+							//buyAddCutSuffix = tdText
 						} else {
 							buyAddCutVal = tdText
 						}
@@ -191,7 +191,7 @@ func SyncRankingFromZhengzhou() {
 					}
 					if tk == 9 {
 						if strings.Contains(tdText, "增减量") {
-							sellAddCutSuffix = tdText
+							//sellAddCutSuffix = tdText
 						} else {
 							sellAddCutVal = tdText
 						}

+ 4 - 4
services/task.go

@@ -7,7 +7,7 @@ import (
 )
 
 func Task() {
-	//sync()
+	sync()
 	//sync2()
 	//sync3()
 	//syncAllComTradeMapping()
@@ -28,9 +28,9 @@ func Task() {
 	task.StartTask()
 	//FileCoalJsm()
 	//FileCoalFirm()
-	FileCoalCoastal()
-	FileCoalInland()
-	SyncRankingFromDalianSearch(0)
+	//FileCoalCoastal()
+	//FileCoalInland()
+	//SyncRankingFromDalianSearch(0)
 	fmt.Println("end crawler")
 }