Parcourir la source

优化 预告、采购意向分类

wcc il y a 2 ans
Parent
commit
82940105be
3 fichiers modifiés avec 35 ajouts et 0 suppressions
  1. 7 0
      src/task/task.go
  2. 14 0
      src/util/charge_rule.go
  3. 14 0
      src/util/util_test.go

+ 7 - 0
src/task/task.go

@@ -753,6 +753,13 @@ func NewTaskRunAll(tt *TTask, budp bool, mapInfo map[string]interface{}) int {
 								SMap.Map["subtype"] = subtype
 							}
 						}
+						//一级分类是预告,但是标题含有招标计划,同时含有 预公告|预公示,变为 采购意向
+						if SMap.Map["toptype"] == "预告" {
+							if u.DealYuce(tmp["title"].(string)) {
+								SMap.Map["toptype"] = "采购意向"
+								SMap.Map["subtype"] = "采购意向"
+							}
+						}
 					}
 					// 针对用户行业分类,单独处理数据
 					if mapInfo["stype"] == "yonghuhangye" || strings.TrimSpace(tt.S_name) == "用户行业分类" {

+ 14 - 0
src/util/charge_rule.go

@@ -3,6 +3,7 @@ package util
 import (
 	"go.mongodb.org/mongo-driver/bson/primitive"
 	"regexp"
+	"strings"
 )
 
 // 审批数据判断字段,包含三个以上属于拟建
@@ -165,3 +166,16 @@ func RemoveDuplicateString(arr []string) []string {
 	// Return the new slice.
 	return result
 }
+
+//DealYuce 处理一级是预告,符合条件到采购意向
+func DealYuce(data string) bool {
+	//标题含有招标计划,并且含有 预公告或者预公示,分类划分到采购意向
+	re1 := strings.Contains(data, "招标计划")
+	re2 := strings.Contains(data, "预公告")
+	re3 := strings.Contains(data, "预公示")
+	if re1 && (re2 || re3) {
+		return true
+	}
+
+	return false
+}

+ 14 - 0
src/util/util_test.go

@@ -237,3 +237,17 @@ func TestGetUserKeys(t *testing.T) {
 	userKeys := GetUserKeys(obj)
 	fmt.Println(userKeys)
 }
+
+func TestDealYuce(t *testing.T) {
+	title := "内乡县6.7万亩高标准农田示范区项目招标计划预公示"
+	fmt.Println(title, "=>", DealYuce(title))
+
+	title = "南阳市卧龙区行政审批服务中心装饰装修工程招标计划预公示招标公告"
+	fmt.Println(title, "=>", DealYuce(title))
+
+	title = "赣州蓉江新区各项目机电用镀锌钢管招标计划"
+	fmt.Println(title, "=>", DealYuce(title))
+
+	title = "公安县车胤中学公安县车胤中学台式计算机政府采购计划合同公告"
+	fmt.Println(title, "=>", DealYuce(title))
+}