|
@@ -96,7 +96,11 @@ func biddingTask(data []byte, mapInfo map[string]interface{}, tasktype string) {
|
|
|
mgo.DestoryMongoConn(session)
|
|
|
}
|
|
|
log.Println(mapInfo, "create bidding index...over", "all:", count, "bidding size:", n1, ",es size:", n2)
|
|
|
-
|
|
|
+ if tasktype == "bidding_history" {
|
|
|
+ qutil.Debug(tasktype)
|
|
|
+ // 历史判重id段结束之后 生全量数据索引
|
|
|
+ biddingDataTask(data, mapInfo)
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
func doIndex(infos []map[string]interface{}, eMap map[string]map[string]interface{}, index, itype, db, c, bkey, tasktype string) (int, int) {
|
|
@@ -112,7 +116,7 @@ func doIndex(infos []map[string]interface{}, eMap map[string]map[string]interfac
|
|
|
log.Println("开始迭代..")
|
|
|
for n, tmp := range infos {
|
|
|
n1++
|
|
|
- if sensitive := qutil.ObjToString(tmp["sensitive"]); sensitive == "测试" { //bidding中有敏感词,不生索引
|
|
|
+ if sensitive := qutil.ObjToString(tmp["sensitive"]); sensitive == "测试" || sensitive == "异常" { //bidding中有敏感词,不生索引
|
|
|
tmp = make(map[string]interface{})
|
|
|
continue
|
|
|
}
|
|
@@ -405,6 +409,7 @@ func doIndex(infos []map[string]interface{}, eMap map[string]map[string]interfac
|
|
|
if tmp[field] != nil && qutil.Int64All(tmp[field]) > 0 {
|
|
|
newTmp[field] = qutil.Int64All(tmp[field])
|
|
|
}
|
|
|
+
|
|
|
} else if field == "review_experts" {
|
|
|
// 评审专家
|
|
|
if arr, ok := tmp["review_experts"].([]interface{}); ok && len(arr) > 0 {
|
|
@@ -438,6 +443,10 @@ func doIndex(infos []map[string]interface{}, eMap map[string]map[string]interfac
|
|
|
}
|
|
|
YuceEndtime(newTmp) // 预测结果时间
|
|
|
newTmp["createtime"] = time.Now().Unix() // es库数据创建时间,只有增量数据有
|
|
|
+ if qutil.ObjToString(newTmp["spidercode"]) == "a_jyxxfbpt_gg" {
|
|
|
+ // 剑鱼信息发布数据 通过udp通知信息发布程序
|
|
|
+ go UdpMethod(mongodb.BsonIdToSId(newTmp["_id"]))
|
|
|
+ }
|
|
|
arrEs = append(arrEs, newTmp)
|
|
|
}
|
|
|
if len(update) > 0 {
|
|
@@ -459,7 +468,7 @@ func doIndex(infos []map[string]interface{}, eMap map[string]map[string]interfac
|
|
|
}
|
|
|
elastic.BulkSave(index, itype, &tmps, true)
|
|
|
if other_index != "" && other_itype != "" {
|
|
|
- bidding_other_es.BulkSave(other_index, other_itype, &tmps, true)
|
|
|
+ elastic.BulkSave(other_index, other_itype, &tmps, true)
|
|
|
}
|
|
|
if len(multiIndex) == 2 {
|
|
|
elastic.BulkSave(multiIndex[0], multiIndex[1], &tmps, true)
|
|
@@ -699,3 +708,22 @@ func FormatDateStr(ds string) int64 {
|
|
|
return location.Unix()
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+type Request struct {
|
|
|
+ InfoId string
|
|
|
+}
|
|
|
+type Response struct {
|
|
|
+ Rep []map[string]interface{}
|
|
|
+}
|
|
|
+
|
|
|
+// @Description rpc调用信息发布程序接口
|
|
|
+// @Author J 2022/4/13 9:13 AM
|
|
|
+func UdpMethod(id string) {
|
|
|
+ mapinfo := map[string]interface{}{
|
|
|
+ "infoid": id,
|
|
|
+ "stype": "jyfb_data_over",
|
|
|
+ }
|
|
|
+ datas, _ := json.Marshal(mapinfo)
|
|
|
+ qutil.Debug(JyUdpAddr, string(datas))
|
|
|
+ _ = udpclient.WriteUdp(datas, mu.OP_TYPE_DATA, JyUdpAddr)
|
|
|
+}
|