Browse Source

清洗更新优化

zhengkun 9 months ago
parent
commit
fbb58644e7
3 changed files with 35 additions and 4 deletions
  1. 6 3
      src/check.go
  2. 1 1
      src/check_pub.go
  3. 28 0
      src/check_unit.go

+ 6 - 3
src/check.go

@@ -38,16 +38,19 @@ func startCheckData(sid, eid string) {
 			//更新-
 			update_info := make(map[string]interface{}, 0)
 			//审查-发布时间
-			getCheckDataPublishtime(tmp, update_info)
+			getCheckDataPub(tmp, update_info)
+			//审查-单位信息
+			getCheckDataUnit(tmp, update_info)
+			//是否删除
 			is_unset := false
-			if update_ai { //审查-大模型与抽取
+			if update_ai {
 				is_unset = ChooseCheckDataAI(tmp, &update_info)
 				if update_info["com_package"] == nil { //构建单包信息···
 					com_package := CreatSingleFieldInfo(tmp, update_info)
 					update_info["com_package"] = com_package
 				}
 			}
-			//最终计算是否清洗
+			//最终更新
 			if len(update_info) > 0 {
 				UpdateTask.updatePool <- []map[string]interface{}{
 					update_id,

+ 1 - 1
src/check_publishtime.go → src/check_pub.go

@@ -4,7 +4,7 @@ import (
 	qu "qfw/util"
 )
 
-func getCheckDataPublishtime(tmp map[string]interface{}, update map[string]interface{}) {
+func getCheckDataPub(tmp map[string]interface{}, update map[string]interface{}) {
 	publishtime := qu.IntAll(tmp["publishtime"])
 	bidopentime := qu.IntAll(tmp["bidopentime"])
 	bidendtime := qu.IntAll(tmp["bidendtime"])

+ 28 - 0
src/check_unit.go

@@ -0,0 +1,28 @@
+package main
+
+import (
+	qu "qfw/util"
+	"strings"
+)
+
+// 单位值···
+func getCheckDataUnit(tmp map[string]interface{}, update map[string]interface{}) {
+	buyer, s_winner, agency := qu.ObjToString(tmp["buyer"]), qu.ObjToString(tmp["s_winner"]), qu.ObjToString(tmp["agency"])
+	if buyer == s_winner && buyer != "" {
+		if strings.Contains(buyer, "公司") {
+			tmp["buyer"] = ""
+			update["buyer"] = ""
+		} else {
+			tmp["winner"] = ""
+			tmp["s_winner"] = ""
+			update["winner"] = ""
+			update["s_winner"] = ""
+		}
+	}
+	if agency != "" {
+		if agency == buyer || agency == s_winner {
+			tmp["agency"] = ""
+			update["agency"] = ""
+		}
+	}
+}