|
@@ -21,9 +21,12 @@ func ChooseCheckDataAI(tmp map[string]interface{}, update_info *map[string]inter
|
|
ChooseTheBestCoreField(ai_zhipu, s_toptype, s_subtype, tmp, update_info, &ext_ai_record)
|
|
ChooseTheBestCoreField(ai_zhipu, s_toptype, s_subtype, tmp, update_info, &ext_ai_record)
|
|
//选取分包
|
|
//选取分包
|
|
ChooseTheBestPackageField(ai_zhipu, s_toptype, s_subtype, tmp, update_info, &ext_ai_record)
|
|
ChooseTheBestPackageField(ai_zhipu, s_toptype, s_subtype, tmp, update_info, &ext_ai_record)
|
|
-
|
|
|
|
//最终金额修正与选取
|
|
//最终金额修正与选取
|
|
ChooseTheBestAmountField(tmp, update_info)
|
|
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
|
|
(*update_info)["ext_ai_record"] = ext_ai_record
|
|
@@ -38,7 +41,6 @@ func ChooseCheckDataAI(tmp map[string]interface{}, update_info *map[string]inter
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
|
|
|
|
@@ -72,14 +74,14 @@ 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{}) {
|
|
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 != "" {
|
|
if s_buyer := qu.ObjToString(ai_zhipu["s_buyer"]); s_buyer != "" {
|
|
(*update_info)["buyer"] = s_buyer
|
|
(*update_info)["buyer"] = s_buyer
|
|
(*ext_ai_record)["buyer"] = tmp["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_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 != "" {
|
|
if s_projectname := qu.ObjToString(ai_zhipu["s_projectname"]); s_projectname != "" {
|
|
(*update_info)["projectname"] = s_projectname
|
|
(*update_info)["projectname"] = s_projectname
|
|
@@ -93,25 +95,15 @@ func ChooseTheBestCoreField(ai_zhipu map[string]interface{}, s_toptype string, s
|
|
(*update_info)["budget"] = s_budget
|
|
(*update_info)["budget"] = s_budget
|
|
(*ext_ai_record)["budget"] = tmp["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"])
|
|
s_area, s_city := qu.ObjToString(ai_zhipu["s_area"]), qu.ObjToString(ai_zhipu["s_city"])
|
|
if s_area != "" && s_area != "全国" {
|
|
if s_area != "" && s_area != "全国" {
|
|
(*update_info)["area"] = s_area
|
|
(*update_info)["area"] = s_area
|
|
if s_city != "" {
|
|
if s_city != "" {
|
|
(*update_info)["city"] = s_city
|
|
(*update_info)["city"] = s_city
|
|
if o_district != "" {
|
|
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"] = ""
|
|
(*update_info)["district"] = ""
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -260,6 +252,113 @@ 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"])
|
|
|
|
+ }
|
|
|
|
+ if s_winner == "" {
|
|
|
|
+ s_winner = qu.ObjToString(tmp["s_winner"])
|
|
|
|
+ }
|
|
|
|
+ if agency == "" {
|
|
|
|
+ agency = qu.ObjToString(tmp["agency"])
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ 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 agency != "" {
|
|
|
|
+ if agency == buyer || agency == s_winner {
|
|
|
|
+ (*update_info)["agency"] = ""
|
|
|
|
+ (*ext_ai_record)["agency"] = 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 purchasinglist := ai_zhipu["purchasinglist"]; purchasinglist != nil {
|
|
|
|
+ (*update_info)["purchasinglist"] = purchasinglist
|
|
|
|
+ (*ext_ai_record)["purchasinglist"] = tmp["purchasinglist"]
|
|
|
|
+ }
|
|
|
|
+ //新增字段
|
|
|
|
+ if biddingcode := ai_zhipu["s_biddingcode"]; biddingcode != nil {
|
|
|
|
+ (*update_info)["biddingcode"] = biddingcode
|
|
|
|
+ }
|
|
|
|
+ if packagecode := ai_zhipu["s_packagecode"]; packagecode != nil {
|
|
|
|
+ (*update_info)["packagecode"] = packagecode
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //替换字段
|
|
|
|
+ if contractcode := ai_zhipu["s_contractcode"]; contractcode != nil {
|
|
|
|
+ (*update_info)["contractcode"] = contractcode
|
|
|
|
+ (*ext_ai_record)["contractcode"] = tmp["contractcode"]
|
|
|
|
+ }
|
|
|
|
+ if bidopenaddress := ai_zhipu["s_bidopenaddress"]; bidopenaddress != nil {
|
|
|
|
+ (*update_info)["bidopenaddress"] = bidopenaddress
|
|
|
|
+ (*ext_ai_record)["bidopenaddress"] = tmp["bidopenaddress"]
|
|
|
|
+ }
|
|
|
|
+ if biddiscount := ai_zhipu["s_biddiscount"]; biddiscount != nil {
|
|
|
|
+ (*update_info)["biddiscount"] = biddiscount
|
|
|
|
+ (*ext_ai_record)["biddiscount"] = tmp["biddiscount"]
|
|
|
|
+ }
|
|
|
|
+ if bidopentime := ai_zhipu["s_bidopentime"]; bidopentime != nil {
|
|
|
|
+ (*update_info)["bidopentime"] = bidopentime
|
|
|
|
+ (*ext_ai_record)["bidopentime"] = tmp["bidopentime"]
|
|
|
|
+ }
|
|
|
|
+ if bidendtime := ai_zhipu["s_bidendtime"]; bidendtime != nil {
|
|
|
|
+ (*update_info)["bidendtime"] = bidendtime
|
|
|
|
+ (*ext_ai_record)["bidendtime"] = tmp["bidendtime"]
|
|
|
|
+ }
|
|
|
|
+ if docstarttime := ai_zhipu["s_docstarttime"]; docstarttime != nil {
|
|
|
|
+ (*update_info)["docstarttime"] = docstarttime
|
|
|
|
+ (*ext_ai_record)["docstarttime"] = tmp["docstarttime"]
|
|
|
|
+ }
|
|
|
|
+ if docendtime := ai_zhipu["s_docendtime"]; docendtime != nil {
|
|
|
|
+ (*update_info)["docendtime"] = docendtime
|
|
|
|
+ (*ext_ai_record)["docendtime"] = tmp["docendtime"]
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //联系方式
|
|
|
|
+ if buyerperson := ai_zhipu["s_buyerperson"]; buyerperson != nil {
|
|
|
|
+ (*update_info)["buyerperson"] = buyerperson
|
|
|
|
+ (*ext_ai_record)["buyerperson"] = tmp["buyerperson"]
|
|
|
|
+ }
|
|
|
|
+ if buyertel := ai_zhipu["s_buyertel"]; buyertel != nil {
|
|
|
|
+ (*update_info)["buyertel"] = buyertel
|
|
|
|
+ (*ext_ai_record)["buyertel"] = tmp["buyertel"]
|
|
|
|
+ }
|
|
|
|
+ if agencyperson := ai_zhipu["s_agencyperson"]; agencyperson != nil {
|
|
|
|
+ (*update_info)["agencyperson"] = agencyperson
|
|
|
|
+ (*ext_ai_record)["agencyperson"] = tmp["agencyperson"]
|
|
|
|
+ }
|
|
|
|
+ if agencytel := ai_zhipu["s_agencytel"]; agencytel != nil {
|
|
|
|
+ (*update_info)["agencytel"] = agencytel
|
|
|
|
+ (*ext_ai_record)["agencytel"] = tmp["agencytel"]
|
|
|
|
+ }
|
|
|
|
+ if winnerperson := ai_zhipu["s_winnerperson"]; winnerperson != nil {
|
|
|
|
+ (*update_info)["winnerperson"] = winnerperson
|
|
|
|
+ (*ext_ai_record)["winnerperson"] = tmp["winnerperson"]
|
|
|
|
+ }
|
|
|
|
+ if winnertel := ai_zhipu["s_winnertel"]; winnertel != nil {
|
|
|
|
+ (*update_info)["winnertel"] = winnertel
|
|
|
|
+ (*ext_ai_record)["winnertel"] = tmp["winnertel"]
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
// 筛选金额
|
|
// 筛选金额
|
|
func filterAmount(f1 float64, f2 float64) float64 {
|
|
func filterAmount(f1 float64, f2 float64) float64 {
|
|
//选取一个合适的金额 ...
|
|
//选取一个合适的金额 ...
|
|
@@ -326,20 +425,13 @@ func staffAiPackageInfo(com_package []map[string]interface{}, s_toptype string,
|
|
|
|
|
|
// 核对分类
|
|
// 核对分类
|
|
func CheckClassByOtherFileds(toptype_ai, subtype_ai string, data map[string]interface{}) (string, string) {
|
|
func CheckClassByOtherFileds(toptype_ai, subtype_ai string, data map[string]interface{}) (string, string) {
|
|
- /*
|
|
|
|
- 存在winnerorder
|
|
|
|
- 1、ai未识别出结果
|
|
|
|
- 2、规则结果-变更(66bf0b3a66cf0db42ad6ecc3)、结果-废标(66bf08fd66cf0db42ad6d9fc)
|
|
|
|
- 3、ai招标,规则结果-成交(66bef5d166cf0db42ad65cc1)
|
|
|
|
- 4、
|
|
|
|
- */
|
|
|
|
toptype_rule := qu.ObjToString(data["toptype"])
|
|
toptype_rule := qu.ObjToString(data["toptype"])
|
|
subtype_rule := qu.ObjToString(data["subtype"])
|
|
subtype_rule := qu.ObjToString(data["subtype"])
|
|
//1、结果类 中标和成交错误校正
|
|
//1、结果类 中标和成交错误校正
|
|
s_winner := qu.ObjToString(data["s_winner"])
|
|
s_winner := qu.ObjToString(data["s_winner"])
|
|
winnerorder := IsMarkInterfaceMap(data["winnerorder"])
|
|
winnerorder := IsMarkInterfaceMap(data["winnerorder"])
|
|
- if toptype_ai == "结果" && toptype_rule == "结果" { //会不会出现结果-废标、结果-变更中有中标候选人的情况?
|
|
|
|
- if subtype_ai == "成交" && subtype_rule == "成交" && len(winnerorder) > 0 { //规则、大模型都错(66bef30966cf0db42ad64f4c)
|
|
|
|
|
|
+ if toptype_ai == "结果" && toptype_rule == "结果" {
|
|
|
|
+ if subtype_ai == "成交" && subtype_rule == "成交" && len(winnerorder) > 0 { //规则、大模型都错
|
|
return "结果", "中标"
|
|
return "结果", "中标"
|
|
}
|
|
}
|
|
if ((subtype_ai == "中标" || subtype_ai == "其它") && subtype_rule == "成交") || ((subtype_ai == "成交" || subtype_ai == "其它") && subtype_rule == "中标") {
|
|
if ((subtype_ai == "中标" || subtype_ai == "其它") && subtype_rule == "成交") || ((subtype_ai == "成交" || subtype_ai == "其它") && subtype_rule == "中标") {
|
|
@@ -354,10 +446,8 @@ func CheckClassByOtherFileds(toptype_ai, subtype_ai string, data map[string]inte
|
|
//2、招标、结果错误校正
|
|
//2、招标、结果错误校正
|
|
if toptype_ai != "结果" && toptype_rule == "结果" {
|
|
if toptype_ai != "结果" && toptype_rule == "结果" {
|
|
//return toptype_rule,subtype_rule//默认规则为准
|
|
//return toptype_rule,subtype_rule//默认规则为准
|
|
- if len(winnerorder) > 0 {
|
|
|
|
- return toptype_rule, "中标"
|
|
|
|
- } else if s_winner != "" || data["bidamount"] != nil {
|
|
|
|
- return toptype_rule, "成交"
|
|
|
|
|
|
+ if len(winnerorder) > 0 || s_winner != "" || data["bidamount"] != nil {
|
|
|
|
+ return toptype_rule, subtype_rule
|
|
} else {
|
|
} else {
|
|
return toptype_ai, subtype_ai
|
|
return toptype_ai, subtype_ai
|
|
}
|
|
}
|