|
@@ -1,7 +1,6 @@
|
|
package service
|
|
package service
|
|
|
|
|
|
import (
|
|
import (
|
|
- "bytes"
|
|
|
|
"context"
|
|
"context"
|
|
"database/sql"
|
|
"database/sql"
|
|
"encoding/json"
|
|
"encoding/json"
|
|
@@ -114,7 +113,7 @@ func ClueImportTtSync(this *biservice.ClueImportReq) (string, int) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-//根据id重新生成es
|
|
|
|
|
|
+// 根据id重新生成es
|
|
func CreateEsById(newId string) bool {
|
|
func CreateEsById(newId string) bool {
|
|
data := BiService.FindOne("customer_data_ttzl", map[string]interface{}{"id_new": newId}, "", "")
|
|
data := BiService.FindOne("customer_data_ttzl", map[string]interface{}{"id_new": newId}, "", "")
|
|
if data == nil || len(*data) == 0 {
|
|
if data == nil || len(*data) == 0 {
|
|
@@ -125,7 +124,7 @@ func CreateEsById(newId string) bool {
|
|
return ok
|
|
return ok
|
|
}
|
|
}
|
|
|
|
|
|
-//重新生成es
|
|
|
|
|
|
+// 重新生成es
|
|
func CreateEs(v map[string]interface{}) (string, bool) {
|
|
func CreateEs(v map[string]interface{}) (string, bool) {
|
|
details := ""
|
|
details := ""
|
|
biddingData, ok := Bidding.FindOne("bidding", map[string]interface{}{"_id": mongodb.StringTOBsonId(common.ObjToString(v["id"]))})
|
|
biddingData, ok := Bidding.FindOne("bidding", map[string]interface{}{"_id": mongodb.StringTOBsonId(common.ObjToString(v["id"]))})
|
|
@@ -1135,24 +1134,3 @@ func doGet(url string) ([]byte, error) {
|
|
log.Println(url, "调用结果 ", string(bs))
|
|
log.Println(url, "调用结果 ", string(bs))
|
|
return bs, nil
|
|
return bs, nil
|
|
}
|
|
}
|
|
-
|
|
|
|
-func doPost(url string, body []byte) ([]byte, error) {
|
|
|
|
- req, err := http.NewRequest("POST", url, bytes.NewReader(body))
|
|
|
|
- if err != nil {
|
|
|
|
- return nil, err
|
|
|
|
- }
|
|
|
|
- req.Header.Add("Content-Type", "application/json;charset=utf-8")
|
|
|
|
- resp, err := http.DefaultClient.Do(req)
|
|
|
|
- if err != nil {
|
|
|
|
- return nil, err
|
|
|
|
- }
|
|
|
|
- bs, err := ioutil.ReadAll(resp.Body)
|
|
|
|
- if err != nil {
|
|
|
|
- return nil, err
|
|
|
|
- }
|
|
|
|
- defer func() {
|
|
|
|
- _ = resp.Body.Close()
|
|
|
|
- }()
|
|
|
|
- log.Println(url, "调用结果 ", string(bs))
|
|
|
|
- return bs, nil
|
|
|
|
-}
|
|
|