Przeglądaj źródła

人脉全量优化行业

xuzhiheng 9 miesięcy temu
rodzic
commit
7fb6747947
1 zmienionych plików z 15 dodań i 4 usunięć
  1. 15 4
      data_project_wy_all/task.go

+ 15 - 4
data_project_wy_all/task.go

@@ -3,6 +3,7 @@ package main
 import (
 	"context"
 	"fmt"
+	"regexp"
 	"strings"
 	"sync"
 	"time"
@@ -47,6 +48,8 @@ type Transaction struct {
 	// From string `bson:"from"`
 }
 
+var regLetter = regexp.MustCompile("[a-z]*")
+
 func IncTransactionDataFromBidAndPro() {
 	// IncTransactionDataFromBid() //bidding
 	IncTransactionDataFromPro() //project
@@ -365,9 +368,17 @@ func DealTransactionForPro(data map[string]interface{}) map[string]interface{} {
 	ids := gconv.Strings(data["ids"])
 	// info := FindInfomationData(ids...) //情报信息查询
 	topscopeclass := []string{}
-	s_topscopeclass := gconv.String(data["s_topscopeclass"])
-	if s_topscopeclass != "" {
-		topscopeclass = strings.Split(s_topscopeclass, ",")
+	// s_topscopeclass := gconv.String(data["s_topscopeclass"])
+	// if s_topscopeclass != "" {
+	// 	topscopeclass = strings.Split(s_topscopeclass, ",")
+	// }
+	if data["topscopeclass"] != nil {
+		if topscopeclasss, ok := data["topscopeclass"].([]interface{}); ok {
+			for _, v := range topscopeclasss {
+				tclass := regLetter.ReplaceAllString(gconv.String(v), "") // 去除字母
+				topscopeclass = append(topscopeclass, tclass)
+			}
+		}
 	}
 	//查询法人信息
 	winners := []string{}
@@ -389,7 +400,7 @@ func DealTransactionForPro(data map[string]interface{}) map[string]interface{} {
 		// Information_Id:    info.Id,
 		BuyerClass:    buyerclass,
 		Buyer:         buyer,
-		Topscopeclass: data["s_topscopeclass"],
+		Topscopeclass: topscopeclass,
 		Winner:        winners,
 		Agency:        agency,
 		Buyer_Id:      buyer_id,