|
@@ -797,7 +797,10 @@ func ExtRuleCore(doc map[string]interface{}, e *ExtractTask, vc *RuleCore, j *ju
|
|
|
j.Result[k] = [](*ju.ExtField){}
|
|
|
}
|
|
|
for _, tmp := range v {
|
|
|
- field := &ju.ExtField{Weight: qu.IntAll(tmp["weight"]), Field: k, Code: qu.ObjToString(tmp["code"]), Type: qu.ObjToString(tmp["type"]), MatchType: qu.ObjToString(tmp["matchtype"]), RuleText: qu.ObjToString(tmp["ruletext"]), SourceValue: tmp["sourcevalue"], Value: tmp["value"]}
|
|
|
+ field := &ju.ExtField{Weight: qu.IntAll(tmp["weight"]),ExtFrom:qu.ObjToString(tmp["extfrom"]), Field: k, Code: qu.ObjToString(tmp["code"]), Type: qu.ObjToString(tmp["type"]), MatchType: qu.ObjToString(tmp["matchtype"]), RuleText: qu.ObjToString(tmp["ruletext"]), SourceValue: tmp["sourcevalue"], Value: tmp["value"]}
|
|
|
+ if k == "bidamount" && field.ExtFrom=="第一候选人"{
|
|
|
+ field.Score = 1
|
|
|
+ }
|
|
|
if isSite {
|
|
|
field.Score = 1
|
|
|
}
|
|
@@ -1038,12 +1041,15 @@ func getKvByLuaFields(vc *RuleCore, j *ju.Job, et *ExtractTask) (map[string][]ma
|
|
|
if len(j.Winnerorder) > 1 {
|
|
|
if vc.Field == "bidamount" {
|
|
|
for _, v := range j.Winnerorder {
|
|
|
+ if v["price"] == nil{
|
|
|
+ continue
|
|
|
+ }
|
|
|
kvmap[vc.Field] = append(kvmap[vc.Field], map[string]interface{}{
|
|
|
"code": "winnerorder",
|
|
|
"field": vc.Field,
|
|
|
"ruletext": "中标候选人",
|
|
|
- "extfrom": vc.ExtFrom,
|
|
|
- "sourcevalue": "中标候选人",
|
|
|
+ "extfrom": v["sortstr"],
|
|
|
+ "sourcevalue": v["price"],
|
|
|
"value": v["price"],
|
|
|
"type": "winnerorder",
|
|
|
"matchtype": "winnerorder",
|
|
@@ -1055,8 +1061,8 @@ func getKvByLuaFields(vc *RuleCore, j *ju.Job, et *ExtractTask) (map[string][]ma
|
|
|
"code": "CL_中标候选人",
|
|
|
"field": vc.Field,
|
|
|
"ruletext": "中标候选人",
|
|
|
- "extfrom": vc.ExtFrom,
|
|
|
- "sourcevalue": "中标候选人",
|
|
|
+ "extfrom": j.Winnerorder[0]["sortstr"],
|
|
|
+ "sourcevalue": price,
|
|
|
"value": price,
|
|
|
"type": "winnerorder",
|
|
|
"matchtype": "winnerorder",
|
|
@@ -2035,8 +2041,10 @@ func resetWinnerorder(j *ju.Job) {
|
|
|
// }
|
|
|
//}
|
|
|
if maxlen > 0 {
|
|
|
- winners = append(winners,&ju.ExtField{Code:"winnerorder",Field:"winner",ExtFrom:"j.Winnerorder",Value:j.Winnerorder[0]["entname"]} )
|
|
|
- bidamounts = append(bidamounts,&ju.ExtField{Code:"winnerorder",Field:"bidamount",ExtFrom:"j.Winnerorder",Value:j.Winnerorder[0]["price"]} )
|
|
|
+ winners = append(winners,&ju.ExtField{Code:"winnerorder",Field:"winner",ExtFrom:"j.Winnerorder",Value:j.Winnerorder[0]["entname"],Score:0.5} )
|
|
|
+ if j.Winnerorder[0]["price"]!= nil{
|
|
|
+ bidamounts = append(bidamounts,&ju.ExtField{Code:"winnerorder",Field:"bidamount",ExtFrom:"j.Winnerorder",Value:j.Winnerorder[0]["price"],Score:0.5} )
|
|
|
+ }
|
|
|
}
|
|
|
if j.Result["winner"] == nil{
|
|
|
j.Result["winner"] = winners
|
|
@@ -2044,7 +2052,7 @@ func resetWinnerorder(j *ju.Job) {
|
|
|
j.Result["winner"] = append(j.Result["winner"],winners... )
|
|
|
}
|
|
|
if j.Result["bidamount"]==nil{
|
|
|
- j.Result["bidamount"] = winners
|
|
|
+ j.Result["bidamount"] = bidamounts
|
|
|
}else {
|
|
|
j.Result["bidamount"] = append(j.Result["bidamount"],bidamounts... )
|
|
|
}
|