|
@@ -22,13 +22,15 @@ func ChooseCheckDataAI(tmp map[string]interface{}, update_info *map[string]inter
|
|
|
ChooseTheBestPackageField(ai_zhipu, s_toptype, s_subtype, tmp, update_info, &ext_ai_record)
|
|
|
//最终金额修正与选取
|
|
|
ChooseTheBestAmountField(tmp, update_info)
|
|
|
- //最终单位修正与选取
|
|
|
- ChooseTheBestUnitField(ai_zhipu, s_toptype, s_subtype, tmp, update_info, &ext_ai_record)
|
|
|
+
|
|
|
+ //其他字段选取
|
|
|
+ ChooseTheBestOtherField(ai_zhipu, tmp, update_info, &ext_ai_record)
|
|
|
+
|
|
|
//字段记录
|
|
|
(*update_info)["ext_ai_record"] = ext_ai_record
|
|
|
|
|
|
//跨分类是否删除结果类字段
|
|
|
- if s_subtype == "单一" || s_subtype == "中标" || s_subtype == "成交" || s_subtype == "合同" {
|
|
|
+ if s_toptype == "结果" || s_toptype == "其它" || s_subtype == "单一" {
|
|
|
|
|
|
} else {
|
|
|
for k, _ := range Unset_Check {
|
|
@@ -37,7 +39,6 @@ func ChooseCheckDataAI(tmp map[string]interface{}, update_info *map[string]inter
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
return false
|
|
|
}
|
|
|
|
|
@@ -71,15 +72,21 @@ func ChooseTheBestClassField(ai_zhipu map[string]interface{}, tmp map[string]int
|
|
|
|
|
|
// 选取字段
|
|
|
func ChooseTheBestCoreField(ai_zhipu map[string]interface{}, s_toptype string, s_subtype string, tmp map[string]interface{}, update_info *map[string]interface{}, ext_ai_record *map[string]interface{}) {
|
|
|
- //基础字段···
|
|
|
if s_buyer := qu.ObjToString(ai_zhipu["s_buyer"]); s_buyer != "" {
|
|
|
(*update_info)["buyer"] = s_buyer
|
|
|
(*ext_ai_record)["buyer"] = tmp["buyer"]
|
|
|
- if agency := qu.ObjToString(tmp["agency"]); agency != "" && agency == s_buyer {
|
|
|
- delete((*update_info), "buyer")
|
|
|
- delete((*ext_ai_record), "buyer")
|
|
|
+ }
|
|
|
+ if s_toptype == "拟建" {
|
|
|
+ if s_owner := qu.ObjToString(ai_zhipu["s_owner"]); s_owner != "" {
|
|
|
+ (*update_info)["owner"] = s_owner
|
|
|
+ (*ext_ai_record)["owner"] = tmp["owner"]
|
|
|
}
|
|
|
}
|
|
|
+ //基础字段···
|
|
|
+ if s_agency := qu.ObjToString(ai_zhipu["s_agency"]); s_agency != "" {
|
|
|
+ (*update_info)["agency"] = s_agency
|
|
|
+ (*ext_ai_record)["agency"] = tmp["agency"]
|
|
|
+ }
|
|
|
if s_projectname := qu.ObjToString(ai_zhipu["s_projectname"]); s_projectname != "" {
|
|
|
(*update_info)["projectname"] = s_projectname
|
|
|
(*ext_ai_record)["projectname"] = tmp["projectname"]
|
|
@@ -92,25 +99,16 @@ func ChooseTheBestCoreField(ai_zhipu map[string]interface{}, s_toptype string, s
|
|
|
(*update_info)["budget"] = s_budget
|
|
|
(*ext_ai_record)["budget"] = tmp["budget"]
|
|
|
}
|
|
|
- //地域字段···
|
|
|
- o_area, o_district := qu.ObjToString(tmp["area"]), qu.ObjToString(tmp["district"])
|
|
|
+ //规则地域字段···
|
|
|
+ o_area, o_city, o_district := qu.ObjToString(tmp["area"]), qu.ObjToString(tmp["city"]), qu.ObjToString(tmp["district"])
|
|
|
s_area, s_city := qu.ObjToString(ai_zhipu["s_area"]), qu.ObjToString(ai_zhipu["s_city"])
|
|
|
if s_area != "" && s_area != "全国" {
|
|
|
+ //部分站点可以排除···更新逻辑
|
|
|
(*update_info)["area"] = s_area
|
|
|
if s_city != "" {
|
|
|
(*update_info)["city"] = s_city
|
|
|
if o_district != "" {
|
|
|
- //判断抽取的区县是否合理···
|
|
|
- isT := false
|
|
|
- if ds := S_DistrictDict[o_district]; ds != nil {
|
|
|
- for _, v := range ds {
|
|
|
- if v.C_Name == s_city && v.P_Name == s_area {
|
|
|
- isT = true
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if !isT {
|
|
|
+ if s_city != o_city || s_area != o_area {
|
|
|
(*update_info)["district"] = ""
|
|
|
}
|
|
|
}
|
|
@@ -124,8 +122,17 @@ func ChooseTheBestCoreField(ai_zhipu map[string]interface{}, s_toptype string, s
|
|
|
(*ext_ai_record)["city"] = tmp["city"]
|
|
|
(*ext_ai_record)["district"] = tmp["district"]
|
|
|
}
|
|
|
+
|
|
|
+ //对于地域的补充校验
|
|
|
+ site := qu.ObjToString(tmp["site"])
|
|
|
+ if (site == "军队采购网新网址" || site == "军队采购网") && o_area != "全国" && o_area != "" {
|
|
|
+ delete((*update_info), "area")
|
|
|
+ delete((*update_info), "city")
|
|
|
+ delete((*update_info), "district")
|
|
|
+ }
|
|
|
+
|
|
|
//先用外围字段替换
|
|
|
- if s_subtype == "中标" || s_subtype == "成交" || s_subtype == "合同" || s_subtype == "单一" {
|
|
|
+ if s_toptype == "结果" || s_toptype == "其它" || s_subtype == "单一" {
|
|
|
if s_bidamount := qu.Float64All(ai_zhipu["s_bidamount"]); s_bidamount > 0.0 && s_bidamount < 1000000000.0 {
|
|
|
(*update_info)["bidamount"] = s_bidamount
|
|
|
(*ext_ai_record)["bidamount"] = tmp["bidamount"]
|
|
@@ -170,8 +177,6 @@ func ChooseTheBestCoreField(ai_zhipu map[string]interface{}, s_toptype string, s
|
|
|
// }
|
|
|
// }
|
|
|
//}
|
|
|
- } else {
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -190,7 +195,7 @@ func ChooseTheBestPackageField(ai_zhipu map[string]interface{}, s_toptype string
|
|
|
(*update_info)["budget"] = p_budget
|
|
|
(*ext_ai_record)["budget"] = tmp["budget"]
|
|
|
}
|
|
|
- if s_subtype == "单一" || s_subtype == "中标" || s_subtype == "成交" || s_subtype == "合同" {
|
|
|
+ if s_toptype == "结果" || s_toptype == "其它" || s_subtype == "单一" {
|
|
|
if p_winner := qu.ObjToString((*s_pkg)["s_winner"]); p_winner != "" {
|
|
|
(*update_info)["s_winner"] = p_winner
|
|
|
(*update_info)["winner"] = p_winner
|
|
@@ -215,7 +220,7 @@ func ChooseTheBestPackageField(ai_zhipu map[string]interface{}, s_toptype string
|
|
|
(*update_info)["budget"] = p_budget
|
|
|
(*ext_ai_record)["budget"] = tmp["budget"]
|
|
|
}
|
|
|
- if s_subtype == "单一" || s_subtype == "中标" || s_subtype == "成交" || s_subtype == "合同" {
|
|
|
+ if s_toptype == "结果" || s_toptype == "其它" || s_subtype == "单一" {
|
|
|
if p_winner := qu.ObjToString((*s_pkg)["s_winner"]); p_winner != "" && (*update_info)["s_winner"] == nil {
|
|
|
(*update_info)["s_winner"] = p_winner
|
|
|
(*update_info)["winner"] = p_winner
|
|
@@ -259,39 +264,95 @@ func ChooseTheBestAmountField(tmp map[string]interface{}, update_info *map[strin
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// 核对单位值
|
|
|
-func ChooseTheBestUnitField(ai_zhipu map[string]interface{}, s_toptype string, s_subtype string, tmp map[string]interface{}, update_info *map[string]interface{}, ext_ai_record *map[string]interface{}) {
|
|
|
- buyer := qu.ObjToString((*update_info)["buyer"])
|
|
|
- s_winner := qu.ObjToString((*update_info)["s_winner"])
|
|
|
- agency := qu.ObjToString((*update_info)["agency"])
|
|
|
- if buyer == "" {
|
|
|
- buyer = qu.ObjToString(tmp["buyer"])
|
|
|
+// 选择其它字段
|
|
|
+func ChooseTheBestOtherField(ai_zhipu map[string]interface{}, tmp map[string]interface{}, update_info *map[string]interface{}, ext_ai_record *map[string]interface{}) {
|
|
|
+ if s_purchasinglist := qu.ObjToMap(ai_zhipu["s_purchasinglist"]); s_purchasinglist != nil {
|
|
|
+ if purchasinglist := IsMarkInterfaceMap((*s_purchasinglist)["purchasinglist"]); len(purchasinglist) > 0 {
|
|
|
+ (*update_info)["purchasinglist"] = purchasinglist
|
|
|
+ }
|
|
|
+ if purchasinglist_label := qu.ObjToMap((*s_purchasinglist)["purchasinglist_label"]); purchasinglist_label != nil {
|
|
|
+ (*update_info)["purchasinglist_label"] = purchasinglist_label
|
|
|
+ }
|
|
|
+ if jycodes := qu.ObjToString((*s_purchasinglist)["jycodes"]); jycodes != "" {
|
|
|
+ (*update_info)["jycodes"] = jycodes
|
|
|
+ }
|
|
|
+ if purchasing := qu.ObjToString((*s_purchasinglist)["purchasing"]); purchasing != "" {
|
|
|
+ (*update_info)["purchasing"] = purchasing
|
|
|
+ }
|
|
|
}
|
|
|
- if s_winner == "" {
|
|
|
- s_winner = qu.ObjToString(tmp["s_winner"])
|
|
|
+ //新增字段
|
|
|
+ if biddingcode := qu.ObjToString(ai_zhipu["s_biddingcode"]); biddingcode != "" {
|
|
|
+ (*update_info)["biddingcode"] = biddingcode
|
|
|
}
|
|
|
- if agency == "" {
|
|
|
- agency = qu.ObjToString(tmp["agency"])
|
|
|
+ if packagecode := qu.ObjToString(ai_zhipu["s_packagecode"]); packagecode != "" {
|
|
|
+ (*update_info)["packagecode"] = packagecode
|
|
|
}
|
|
|
|
|
|
- if buyer == s_winner && buyer != "" {
|
|
|
- if strings.Contains(buyer, "公司") {
|
|
|
- (*update_info)["buyer"] = ""
|
|
|
- (*ext_ai_record)["buyer"] = tmp["buyer"]
|
|
|
- } else {
|
|
|
- if s_subtype == "单一" || s_subtype == "中标" || s_subtype == "成交" || s_subtype == "合同" {
|
|
|
- (*update_info)["s_winner"] = ""
|
|
|
- (*update_info)["winner"] = ""
|
|
|
- (*ext_ai_record)["s_winner"] = tmp["s_winner"]
|
|
|
- (*ext_ai_record)["winner"] = tmp["winner"]
|
|
|
- }
|
|
|
- }
|
|
|
+ //替换字段
|
|
|
+ if contractcode := qu.ObjToString(ai_zhipu["s_contractcode"]); contractcode != "" {
|
|
|
+ (*update_info)["contractcode"] = contractcode
|
|
|
+ (*ext_ai_record)["contractcode"] = tmp["contractcode"]
|
|
|
}
|
|
|
- if agency != "" {
|
|
|
- if agency == buyer || agency == s_winner {
|
|
|
- (*update_info)["agency"] = ""
|
|
|
- (*ext_ai_record)["agency"] = tmp["buyer"]
|
|
|
- }
|
|
|
+ if bidopenaddress := qu.ObjToString(ai_zhipu["s_bidopenaddress"]); bidopenaddress != "" {
|
|
|
+ (*update_info)["bidopenaddress"] = bidopenaddress
|
|
|
+ (*ext_ai_record)["bidopenaddress"] = tmp["bidopenaddress"]
|
|
|
+ }
|
|
|
+ //折扣
|
|
|
+ if biddiscount := qu.Float64All(ai_zhipu["s_biddiscount"]); biddiscount > 0.0 {
|
|
|
+ (*update_info)["biddiscount"] = biddiscount
|
|
|
+ (*ext_ai_record)["biddiscount"] = tmp["biddiscount"]
|
|
|
+ }
|
|
|
+ //时间戳
|
|
|
+ if bidopentime := qu.Int64All(ai_zhipu["s_bidopentime"]); bidopentime > 0 {
|
|
|
+ (*update_info)["bidopentime"] = bidopentime
|
|
|
+ (*ext_ai_record)["bidopentime"] = tmp["bidopentime"]
|
|
|
+ }
|
|
|
+ if bidendtime := qu.Int64All(ai_zhipu["s_bidendtime"]); bidendtime > 0 {
|
|
|
+ (*update_info)["bidendtime"] = bidendtime
|
|
|
+ (*ext_ai_record)["bidendtime"] = tmp["bidendtime"]
|
|
|
+ }
|
|
|
+ if docstarttime := qu.Int64All(ai_zhipu["s_docstarttime"]); docstarttime > 0 {
|
|
|
+ (*update_info)["docstarttime"] = docstarttime
|
|
|
+ (*ext_ai_record)["docstarttime"] = tmp["docstarttime"]
|
|
|
+ }
|
|
|
+ if docendtime := qu.Int64All(ai_zhipu["s_docendtime"]); docendtime > 0 {
|
|
|
+ (*update_info)["docendtime"] = docendtime
|
|
|
+ (*ext_ai_record)["docendtime"] = tmp["docendtime"]
|
|
|
+ }
|
|
|
+ //
|
|
|
+ if signstarttime := qu.Int64All(ai_zhipu["s_signstarttime"]); signstarttime > 0 {
|
|
|
+ (*update_info)["signstarttime"] = signstarttime
|
|
|
+ (*ext_ai_record)["signstarttime"] = tmp["signstarttime"]
|
|
|
+ }
|
|
|
+ if signendtime := qu.Int64All(ai_zhipu["s_signendtime"]); signendtime > 0 {
|
|
|
+ (*update_info)["signendtime"] = signendtime
|
|
|
+ (*ext_ai_record)["signendtime"] = tmp["signendtime"]
|
|
|
+ }
|
|
|
+
|
|
|
+ //联系方式
|
|
|
+ if buyerperson := qu.ObjToString(ai_zhipu["s_buyerperson"]); buyerperson != "" {
|
|
|
+ (*update_info)["buyerperson"] = buyerperson
|
|
|
+ (*ext_ai_record)["buyerperson"] = tmp["buyerperson"]
|
|
|
+ }
|
|
|
+ if buyertel := qu.ObjToString(ai_zhipu["s_buyertel"]); buyertel != "" {
|
|
|
+ (*update_info)["buyertel"] = buyertel
|
|
|
+ (*ext_ai_record)["buyertel"] = tmp["buyertel"]
|
|
|
+ }
|
|
|
+ if agencyperson := qu.ObjToString(ai_zhipu["s_agencyperson"]); agencyperson != "" {
|
|
|
+ (*update_info)["agencyperson"] = agencyperson
|
|
|
+ (*ext_ai_record)["agencyperson"] = tmp["agencyperson"]
|
|
|
+ }
|
|
|
+ if agencytel := qu.ObjToString(ai_zhipu["s_agencytel"]); agencytel != "" {
|
|
|
+ (*update_info)["agencytel"] = agencytel
|
|
|
+ (*ext_ai_record)["agencytel"] = tmp["agencytel"]
|
|
|
+ }
|
|
|
+ if winnerperson := qu.ObjToString(ai_zhipu["s_winnerperson"]); winnerperson != "" {
|
|
|
+ (*update_info)["winnerperson"] = winnerperson
|
|
|
+ (*ext_ai_record)["winnerperson"] = tmp["winnerperson"]
|
|
|
+ }
|
|
|
+ if winnertel := qu.ObjToString(ai_zhipu["s_winnertel"]); winnertel != "" {
|
|
|
+ (*update_info)["winnertel"] = winnertel
|
|
|
+ (*ext_ai_record)["winnertel"] = tmp["winnertel"]
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -347,7 +408,7 @@ func staffInfo(pkg map[string]interface{}) bool {
|
|
|
|
|
|
// 核对ai分包
|
|
|
func staffAiPackageInfo(com_package []map[string]interface{}, s_toptype string, s_subtype string) []map[string]interface{} {
|
|
|
- if s_subtype == "单一" || s_subtype == "中标" || s_subtype == "成交" || s_subtype == "合同" {
|
|
|
+ if s_toptype == "结果" || s_toptype == "其它" || s_subtype == "单一" {
|
|
|
return com_package
|
|
|
}
|
|
|
new_com_package := []map[string]interface{}{}
|
|
@@ -379,7 +440,7 @@ func CheckClassByOtherFileds(toptype_ai, subtype_ai string, data map[string]inte
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- //2、招标、结果错误校正
|
|
|
+ //2、招标、结果错误校正 (对于开标记录···有异常)
|
|
|
if toptype_ai != "结果" && toptype_rule == "结果" {
|
|
|
//return toptype_rule,subtype_rule//默认规则为准
|
|
|
if len(winnerorder) > 0 || s_winner != "" || data["bidamount"] != nil {
|