|
@@ -48,78 +48,6 @@ func ClueImportTtSync(this *biservice.ClueImportReq) (string, int) {
|
|
|
wg := new(sync.WaitGroup)
|
|
|
ch := make(chan bool, 20)
|
|
|
for _, v := range *data {
|
|
|
-<<<<<<< HEAD
|
|
|
- v["isCompetitors"] = "否"
|
|
|
- details := ""
|
|
|
- id := common.ObjToString(v["id"])
|
|
|
- href := common.ObjToString(v["href"])
|
|
|
-
|
|
|
- for _, vv := range strings.Split(competitors, ",") {
|
|
|
- if strings.Contains(href, vv) {
|
|
|
- v["isCompetitors"] = "是"
|
|
|
- }
|
|
|
- }
|
|
|
- customer_data := BiService.FindOne("customer_data_ttzl", map[string]interface{}{"id": id}, "", "")
|
|
|
- if customer_data != nil {
|
|
|
- log.Println("数据重复", id)
|
|
|
- continue
|
|
|
- }
|
|
|
- delete(v, "import_pc")
|
|
|
- dataId := BiService.Insert("customer_data_ttzl", v)
|
|
|
- if dataId > 0 {
|
|
|
- //
|
|
|
- biddingData, ok := Bidding.FindOne("bidding", map[string]interface{}{"_id": mongodb.StringTOBsonId(id)})
|
|
|
- if ok && biddingData != nil && len(*biddingData) > 0 {
|
|
|
- details = common.ObjToString((*biddingData)["detail"])
|
|
|
- }
|
|
|
- //
|
|
|
- BiService.Insert("customer_data_ttzl_gl", map[string]interface{}{"msg_id": dataId, "info_id": id, "details": details, "isHistory": "否"})
|
|
|
- delete(v, "isCompetitors")
|
|
|
- delete(v, "msg_id")
|
|
|
- v["_id"] = v["id"]
|
|
|
- delete(v, "id")
|
|
|
- v["details"] = cleanHTML(details)
|
|
|
- if common.ObjToString(v["publishtime"]) != "" {
|
|
|
- v["publishtime2"] = common.ObjToString(v["publishtime"])
|
|
|
- publishtime, _ := time.ParseInLocation(date.Date_Full_Layout, common.ObjToString(v["publishtime"]), time.Local)
|
|
|
- v["publishtime"] = publishtime.UnixMilli()
|
|
|
- } else {
|
|
|
- delete(v, "publishtime")
|
|
|
- }
|
|
|
- // if common.ObjToString(v["docstarttime"]) != "" {
|
|
|
- // docstarttime, _ := time.ParseInLocation(date.Date_Full_Layout, common.ObjToString(v["docstarttime"]), time.Local)
|
|
|
- // v["docstarttime"] = docstarttime.Unix()
|
|
|
- // } else {
|
|
|
- // delete(v, "docstarttime")
|
|
|
- // }
|
|
|
- // if common.ObjToString(v["docendtime"]) != "" {
|
|
|
- // docendtime, _ := time.ParseInLocation(date.Date_Full_Layout, common.ObjToString(v["docendtime"]), time.Local)
|
|
|
- // v["docendtime"] = docendtime.Unix()
|
|
|
- // } else {
|
|
|
- // delete(v, "docendtime")
|
|
|
- // }
|
|
|
- // if common.ObjToString(v["bidstarttime"]) != "" {
|
|
|
- // bidstarttime, _ := time.ParseInLocation(date.Date_Full_Layout, common.ObjToString(v["bidstarttime"]), time.Local)
|
|
|
- // v["bidstarttime"] = bidstarttime.Unix()
|
|
|
- // } else {
|
|
|
- // delete(v, "bidstarttime")
|
|
|
- // }
|
|
|
- // if common.ObjToString(v["bidendtime"]) != "" {
|
|
|
- // bidendtime, _ := time.ParseInLocation(date.Date_Full_Layout, common.ObjToString(v["bidendtime"]), time.Local)
|
|
|
- // v["bidendtime"] = bidendtime.Unix()
|
|
|
- // } else {
|
|
|
- // delete(v, "bidendtime")
|
|
|
- // }
|
|
|
- // if common.ObjToString(v["bidopentime"]) != "" {
|
|
|
- // bidopentime, _ := time.ParseInLocation(date.Date_Full_Layout, common.ObjToString(v["bidopentime"]), time.Local)
|
|
|
- // v["bidopentime"] = bidopentime.Unix()
|
|
|
- // } else {
|
|
|
- // delete(v, "bidopentime")
|
|
|
- // }
|
|
|
- for k, vv := range v {
|
|
|
- if vv == nil {
|
|
|
- delete(v, k)
|
|
|
-=======
|
|
|
wg.Add(1)
|
|
|
ch <- true
|
|
|
go func(v map[string]interface{}) {
|
|
@@ -134,7 +62,6 @@ func ClueImportTtSync(this *biservice.ClueImportReq) (string, int) {
|
|
|
for _, vv := range strings.Split(competitors, ",") {
|
|
|
if strings.Contains(href, vv) {
|
|
|
v["isCompetitors"] = "是"
|
|
|
->>>>>>> master
|
|
|
}
|
|
|
}
|
|
|
delete(v, "import_pc")
|