|
@@ -1104,9 +1104,9 @@ func FormatExportData(entmg mg.MongodbSim, data *[]map[string]interface{}, webdo
|
|
return time1 > time2
|
|
return time1 > time2
|
|
})
|
|
})
|
|
qyxyMap := make(map[string]bool)
|
|
qyxyMap := make(map[string]bool)
|
|
- qyxyEsMap := make(map[string]*map[string]interface{})
|
|
|
|
|
|
+ qyxyEsMap := make(map[string]map[string]interface{})
|
|
projectsetMap := make(map[string]bool)
|
|
projectsetMap := make(map[string]bool)
|
|
- projectsetEsMap := make(map[string]*map[string]interface{})
|
|
|
|
|
|
+ projectsetEsMap := make(map[string]map[string]interface{})
|
|
if dataType == "2" {
|
|
if dataType == "2" {
|
|
wait := &sync.WaitGroup{}
|
|
wait := &sync.WaitGroup{}
|
|
for _, m := range *data {
|
|
for _, m := range *data {
|
|
@@ -1153,7 +1153,7 @@ func FormatExportData(entmg mg.MongodbSim, data *[]map[string]interface{}, webdo
|
|
if qyxyEsData != nil && len(*qyxyEsData) > 0 {
|
|
if qyxyEsData != nil && len(*qyxyEsData) > 0 {
|
|
for _, m := range *qyxyEsData {
|
|
for _, m := range *qyxyEsData {
|
|
lock.Lock()
|
|
lock.Lock()
|
|
- qyxyEsMap[qutil.InterfaceToStr(m["id"])] = &m
|
|
|
|
|
|
+ qyxyEsMap[qutil.InterfaceToStr(m["id"])] = m
|
|
lock.Unlock()
|
|
lock.Unlock()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1195,7 +1195,7 @@ func FormatExportData(entmg mg.MongodbSim, data *[]map[string]interface{}, webdo
|
|
for _, m2 := range list {
|
|
for _, m2 := range list {
|
|
if projectsetMap[qutil.InterfaceToStr(m2["infoid"])] {
|
|
if projectsetMap[qutil.InterfaceToStr(m2["infoid"])] {
|
|
lock.Lock()
|
|
lock.Lock()
|
|
- projectsetEsMap[qutil.InterfaceToStr(m2["infoid"])] = &m
|
|
|
|
|
|
+ projectsetEsMap[qutil.InterfaceToStr(m2["infoid"])] = m
|
|
lock.Unlock()
|
|
lock.Unlock()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1242,11 +1242,11 @@ func FormatExportData(entmg mg.MongodbSim, data *[]map[string]interface{}, webdo
|
|
if ecm != nil {
|
|
if ecm != nil {
|
|
winnerMaps = append(winnerMaps, ecm)
|
|
winnerMaps = append(winnerMaps, ecm)
|
|
//} else if entDetail := elastic.Get("qyxy", "qyxy", fmt.Sprintf(`{"query":{"bool":{"must":[{"term":{"id":"%s"}}]}},"size":1,"_source":["company_name","company_email","company_phone","legal_person"]}`, entId)); entDetail != nil && len(*entDetail) > 0 {
|
|
//} else if entDetail := elastic.Get("qyxy", "qyxy", fmt.Sprintf(`{"query":{"bool":{"must":[{"term":{"id":"%s"}}]}},"size":1,"_source":["company_name","company_email","company_phone","legal_person"]}`, entId)); entDetail != nil && len(*entDetail) > 0 {
|
|
- } else if entDetail := qyxyEsMap[entId]; entDetail != nil && len(*entDetail) > 0 {
|
|
|
|
|
|
+ } else if entDetail := qyxyEsMap[entId]; entDetail != nil && len(entDetail) > 0 {
|
|
thisEntMap := map[string]interface{}{}
|
|
thisEntMap := map[string]interface{}{}
|
|
legal_person := ""
|
|
legal_person := ""
|
|
- if (*entDetail)["legal_person"] != nil {
|
|
|
|
- legal_person = (*entDetail)["legal_person"].(string)
|
|
|
|
|
|
+ if (entDetail)["legal_person"] != nil {
|
|
|
|
+ legal_person = (entDetail)["legal_person"].(string)
|
|
if isEncry {
|
|
if isEncry {
|
|
var xx = "*"
|
|
var xx = "*"
|
|
switch len([]rune(legal_person)) {
|
|
switch len([]rune(legal_person)) {
|
|
@@ -1259,8 +1259,8 @@ func FormatExportData(entmg mg.MongodbSim, data *[]map[string]interface{}, webdo
|
|
}
|
|
}
|
|
}
|
|
}
|
|
company_phone := ""
|
|
company_phone := ""
|
|
- if (*entDetail)["company_phone"] != nil {
|
|
|
|
- company_phone = (*entDetail)["company_phone"].(string)
|
|
|
|
|
|
+ if entDetail["company_phone"] != nil {
|
|
|
|
+ company_phone = entDetail["company_phone"].(string)
|
|
if isEncry {
|
|
if isEncry {
|
|
if len([]rune(company_phone)) > 7 {
|
|
if len([]rune(company_phone)) > 7 {
|
|
company_phone = company_phone[:7] + "****"
|
|
company_phone = company_phone[:7] + "****"
|
|
@@ -1270,8 +1270,8 @@ func FormatExportData(entmg mg.MongodbSim, data *[]map[string]interface{}, webdo
|
|
}
|
|
}
|
|
}
|
|
}
|
|
company_email := ""
|
|
company_email := ""
|
|
- if (*entDetail)["company_email"] != nil && (*entDetail)["company_email"] != "无" {
|
|
|
|
- company_email = (*entDetail)["company_email"].(string)
|
|
|
|
|
|
+ if entDetail["company_email"] != nil && entDetail["company_email"] != "无" {
|
|
|
|
+ company_email = entDetail["company_email"].(string)
|
|
if isEncry {
|
|
if isEncry {
|
|
if len(strings.Split(company_email, "@")) > 1 {
|
|
if len(strings.Split(company_email, "@")) > 1 {
|
|
company_email = "******" + "@" + strings.Split(company_email, "@")[1]
|
|
company_email = "******" + "@" + strings.Split(company_email, "@")[1]
|
|
@@ -1279,8 +1279,8 @@ func FormatExportData(entmg mg.MongodbSim, data *[]map[string]interface{}, webdo
|
|
}
|
|
}
|
|
}
|
|
}
|
|
company_name := ""
|
|
company_name := ""
|
|
- if (*entDetail)["company_name"] != nil {
|
|
|
|
- company_name = (*entDetail)["company_name"].(string)
|
|
|
|
|
|
+ if entDetail["company_name"] != nil {
|
|
|
|
+ company_name = entDetail["company_name"].(string)
|
|
}
|
|
}
|
|
thisEntMap["legal_person"] = legal_person
|
|
thisEntMap["legal_person"] = legal_person
|
|
thisEntMap["company_phone"] = company_phone
|
|
thisEntMap["company_phone"] = company_phone
|
|
@@ -1300,10 +1300,10 @@ func FormatExportData(entmg mg.MongodbSim, data *[]map[string]interface{}, webdo
|
|
}
|
|
}
|
|
//====================字段补漏=========================
|
|
//====================字段补漏=========================
|
|
//if v["toptype"] == "结果" && dataType == "2" && !(v["agency"] != nil && v["budget"] != nil && v["buyerperson"] != nil && v["buyertel"] != nil) {
|
|
//if v["toptype"] == "结果" && dataType == "2" && !(v["agency"] != nil && v["budget"] != nil && v["buyerperson"] != nil && v["buyertel"] != nil) {
|
|
- if r := projectsetEsMap[qutil.InterfaceToStr(v["_id"])]; r != nil && len(*r) > 0 {
|
|
|
|
|
|
+ if r := projectsetEsMap[qutil.InterfaceToStr(v["_id"])]; r != nil && len(r) > 0 {
|
|
//r := elastic.Get("projectset", "projectset", fmt.Sprintf(`{"query":{"term":{"list.infoid":"%s"}},"_source": ["list"]}`, v["_id"]))
|
|
//r := elastic.Get("projectset", "projectset", fmt.Sprintf(`{"query":{"term":{"list.infoid":"%s"}},"_source": ["list"]}`, v["_id"]))
|
|
//if r != nil && len(*r) > 0 {
|
|
//if r != nil && len(*r) > 0 {
|
|
- MsgList := (*r)["list"]
|
|
|
|
|
|
+ MsgList := r["list"]
|
|
if MsgList != nil {
|
|
if MsgList != nil {
|
|
list := qutil.ObjArrToMapArr(MsgList.([]interface{}))
|
|
list := qutil.ObjArrToMapArr(MsgList.([]interface{}))
|
|
for _, vv := range list {
|
|
for _, vv := range list {
|