Эх сурвалжийг харах

Merge branch 'dev/v2.9.35_zxl' of jianyu/ent_new into feature/v2.9.35

zhangxinlei1996 1 жил өмнө
parent
commit
dc887a4a11

+ 3 - 2
entniche_new/src/config.json

@@ -57,6 +57,7 @@
     "华能信息技术有限公司",
     "浙江华数广电网络股份有限公司"
   ],
-  "portraitStartTime": 2018
-
+  "portraitStartTime": 2018,
+  "nsq":"192.168.3.240:4260",
+  "nsq_topic": "jy_event"
 }

+ 1 - 1
entniche_new/src/config.yaml

@@ -1,5 +1,5 @@
 etcd:
   hosts:
-  - 127.0.0.1:2379
+  - 192.168.3.206:2379
 userCenterKey: "usercenter.rpc" #用户中台rpc
 powerCheckCenterKey: "powercheck.rpc" #权益校验中台

+ 2 - 0
entniche_new/src/config/config.go

@@ -67,6 +67,8 @@ type config struct {
 	Entcustomer        []string
 	SearchPCount       int
 	PortraitStartTime  int `json:"portraitStartTime"`
+	Nsq                string
+	Nsq_topic          string
 }
 
 type timeTaskConfig struct {

+ 55 - 49
entniche_new/src/go.mod

@@ -3,14 +3,14 @@ module entniche_new/src
 go 1.18
 
 require (
-	app.yhyue.com/moapp/jybase v0.0.0-20230511020847-9b0fbc33ff1c
-	app.yhyue.com/moapp/jylog v0.0.0-20230511065424-895d5b2cedfd
-	app.yhyue.com/moapp/jypkg v0.0.0-20230420060744-ff53e7ca6f47
-	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.13
+	app.yhyue.com/moapp/jybase v0.0.0-20230718012114-37013054344b
+	app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545
+	app.yhyue.com/moapp/jypkg v1.0.2-0.20231024062045-5c364be1561d
+	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.14
 	github.com/gogf/gf/v2 v2.0.6
 	github.com/olivere/elastic/v7 v7.0.22
 	github.com/thinxer/go-word2vec v0.0.0-20150917053916-5c19ec7379ed
-	go.mongodb.org/mongo-driver v1.11.1
+	go.mongodb.org/mongo-driver v1.11.6
 	gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
 )
 
@@ -19,66 +19,68 @@ require (
 	app.yhyue.com/moapp/jyMarketing v0.0.2-0.20230304035551-21bb1eedf547 // indirect
 	app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae // indirect
 	bp.jydev.jianyu360.cn/BaseService/entManageApplication v0.0.0-20230214091519-89a98c01ab0e // indirect
-	bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230222052351-9d6fad062447 // indirect
+	bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230225125145-431a4f70093a // indirect
 	bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.7 // indirect
 	github.com/BurntSushi/toml v0.4.1 // indirect
 	github.com/beorn7/perks v1.0.1 // indirect
 	github.com/cenkalti/backoff/v4 v4.2.1 // indirect
 	github.com/cespare/xxhash/v2 v2.2.0 // indirect
 	github.com/clbanning/mxj/v2 v2.5.5 // indirect
-	github.com/coreos/go-semver v0.3.0 // indirect
-	github.com/coreos/go-systemd/v22 v22.3.2 // indirect
+	github.com/coreos/go-semver v0.3.1 // indirect
+	github.com/coreos/go-systemd/v22 v22.5.0 // indirect
 	github.com/davecgh/go-spew v1.1.1 // indirect
-	github.com/dchest/captcha v0.0.0-20200903113550-03f5f0333e1f // indirect
 	github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
-	github.com/fatih/color v1.13.0 // indirect
-	github.com/felixge/fgprof v0.9.3 // indirect
+	github.com/emicklei/go-restful/v3 v3.9.0 // indirect
+	github.com/fatih/color v1.15.0 // indirect
 	github.com/fsnotify/fsnotify v1.6.0 // indirect
 	github.com/garyburd/redigo v1.6.2 // indirect
 	github.com/go-logr/logr v1.2.4 // indirect
 	github.com/go-logr/stdr v1.2.2 // indirect
+	github.com/go-openapi/jsonpointer v0.19.6 // indirect
+	github.com/go-openapi/jsonreference v0.20.1 // indirect
+	github.com/go-openapi/swag v0.22.3 // indirect
 	github.com/go-redis/redis/v8 v8.11.5 // indirect
-	github.com/go-sql-driver/mysql v1.7.0 // indirect
+	github.com/go-sql-driver/mysql v1.7.1 // indirect
 	github.com/gogo/protobuf v1.3.2 // indirect
 	github.com/golang/mock v1.6.0 // indirect
-	github.com/golang/protobuf v1.5.2 // indirect
+	github.com/golang/protobuf v1.5.3 // indirect
 	github.com/golang/snappy v0.0.4 // indirect
 	github.com/gomodule/redigo v2.0.0+incompatible // indirect
+	github.com/google/gnostic v0.5.7-v3refs // indirect
 	github.com/google/go-cmp v0.5.9 // indirect
 	github.com/google/gofuzz v1.2.0 // indirect
-	github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect
-	github.com/googleapis/gnostic v0.5.5 // indirect
 	github.com/gorilla/websocket v1.5.0 // indirect
 	github.com/grokify/html-strip-tags-go v0.0.1 // indirect
-	github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect
+	github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 // indirect
 	github.com/hashicorp/hcl v1.0.0 // indirect
 	github.com/howeyc/fsnotify v0.9.0 // indirect
 	github.com/jinzhu/inflection v1.0.0 // indirect
 	github.com/jinzhu/now v1.1.1 // indirect
 	github.com/josharian/intern v1.0.0 // indirect
 	github.com/json-iterator/go v1.1.12 // indirect
-	github.com/klauspost/compress v1.15.11 // indirect
+	github.com/klauspost/compress v1.15.15 // indirect
 	github.com/longbridgeapp/sqlparser v0.3.1 // indirect
 	github.com/magiconair/properties v1.8.7 // indirect
 	github.com/mailru/easyjson v0.7.7 // indirect
-	github.com/mattn/go-colorable v0.1.12 // indirect
-	github.com/mattn/go-isatty v0.0.14 // indirect
+	github.com/mattn/go-colorable v0.1.13 // indirect
+	github.com/mattn/go-isatty v0.0.17 // indirect
 	github.com/mattn/go-runewidth v0.0.13 // indirect
-	github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
+	github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
 	github.com/mitchellh/mapstructure v1.5.0 // indirect
 	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
 	github.com/modern-go/reflect2 v1.0.2 // indirect
 	github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe // indirect
+	github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
 	github.com/nsqio/go-nsq v1.1.0 // indirect
 	github.com/olekukonko/tablewriter v0.0.5 // indirect
 	github.com/olivere/elastic v6.2.37+incompatible // indirect
 	github.com/openzipkin/zipkin-go v0.4.1 // indirect
-	github.com/pelletier/go-toml/v2 v2.0.6 // indirect
+	github.com/pelletier/go-toml/v2 v2.0.8 // indirect
 	github.com/pkg/errors v0.9.1 // indirect
-	github.com/prometheus/client_golang v1.13.0 // indirect
-	github.com/prometheus/client_model v0.2.0 // indirect
-	github.com/prometheus/common v0.37.0 // indirect
-	github.com/prometheus/procfs v0.8.0 // indirect
+	github.com/prometheus/client_golang v1.15.1 // indirect
+	github.com/prometheus/client_model v0.3.0 // indirect
+	github.com/prometheus/common v0.42.0 // indirect
+	github.com/prometheus/procfs v0.9.0 // indirect
 	github.com/rivo/uniseg v0.2.0 // indirect
 	github.com/sirupsen/logrus v1.9.0 // indirect
 	github.com/spaolacci/murmur3 v1.1.0 // indirect
@@ -92,37 +94,38 @@ require (
 	github.com/xdg-go/scram v1.1.1 // indirect
 	github.com/xdg-go/stringprep v1.0.3 // indirect
 	github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
-	github.com/zeromicro/go-zero v1.4.4 // indirect
+	github.com/zeromicro/go-zero v1.5.3 // indirect
 	github.com/ziutek/blas v0.0.0-20190227122918-da4ca23e90bb // indirect
-	go.etcd.io/etcd/api/v3 v3.5.6 // indirect
-	go.etcd.io/etcd/client/pkg/v3 v3.5.6 // indirect
-	go.etcd.io/etcd/client/v3 v3.5.6 // indirect
+	go.etcd.io/etcd/api/v3 v3.5.9 // indirect
+	go.etcd.io/etcd/client/pkg/v3 v3.5.9 // indirect
+	go.etcd.io/etcd/client/v3 v3.5.9 // indirect
 	go.opentelemetry.io/otel v1.15.1 // indirect
 	go.opentelemetry.io/otel/exporters/jaeger v1.15.1 // indirect
 	go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.15.1 // indirect
 	go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.15.1 // indirect
 	go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.15.1 // indirect
 	go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.15.1 // indirect
+	go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0 // indirect
 	go.opentelemetry.io/otel/exporters/zipkin v1.15.1 // indirect
 	go.opentelemetry.io/otel/sdk v1.15.1 // indirect
 	go.opentelemetry.io/otel/trace v1.15.1 // indirect
 	go.opentelemetry.io/proto/otlp v0.19.0 // indirect
-	go.uber.org/atomic v1.9.0 // indirect
-	go.uber.org/automaxprocs v1.5.1 // indirect
-	go.uber.org/multierr v1.8.0 // indirect
-	go.uber.org/zap v1.21.0 // indirect
-	golang.org/x/crypto v0.0.0-20221010152910-d6f0a8c073c2 // indirect
-	golang.org/x/net v0.8.0 // indirect
-	golang.org/x/oauth2 v0.4.0 // indirect
+	go.uber.org/atomic v1.10.0 // indirect
+	go.uber.org/automaxprocs v1.5.2 // indirect
+	go.uber.org/multierr v1.9.0 // indirect
+	go.uber.org/zap v1.24.0 // indirect
+	golang.org/x/crypto v0.6.0 // indirect
+	golang.org/x/net v0.10.0 // indirect
+	golang.org/x/oauth2 v0.7.0 // indirect
 	golang.org/x/sync v0.1.0 // indirect
-	golang.org/x/sys v0.7.0 // indirect
-	golang.org/x/term v0.6.0 // indirect
-	golang.org/x/text v0.8.0 // indirect
+	golang.org/x/sys v0.8.0 // indirect
+	golang.org/x/term v0.8.0 // indirect
+	golang.org/x/text v0.9.0 // indirect
 	golang.org/x/time v0.3.0 // indirect
 	google.golang.org/appengine v1.6.7 // indirect
-	google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
-	google.golang.org/grpc v1.54.0 // indirect
-	google.golang.org/protobuf v1.30.0 // indirect
+	google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
+	google.golang.org/grpc v1.56.1 // indirect
+	google.golang.org/protobuf v1.31.0 // indirect
 	gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
 	gopkg.in/inf.v0 v0.9.1 // indirect
 	gopkg.in/ini.v1 v1.67.0 // indirect
@@ -131,11 +134,14 @@ require (
 	gopkg.in/yaml.v3 v3.0.1 // indirect
 	gorm.io/driver/mysql v1.0.5 // indirect
 	gorm.io/gorm v1.21.3 // indirect
-	k8s.io/api v0.22.9 // indirect
-	k8s.io/apimachinery v0.22.9 // indirect
-	k8s.io/client-go v0.22.9 // indirect
-	k8s.io/klog/v2 v2.80.1 // indirect
-	k8s.io/utils v0.0.0-20221108210102-8e77b1f39fe2 // indirect
-	sigs.k8s.io/structured-merge-diff/v4 v4.2.1 // indirect
-	sigs.k8s.io/yaml v1.2.0 // indirect
+	jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20231017031425-45003ca9f35a // indirect
+	k8s.io/api v0.26.3 // indirect
+	k8s.io/apimachinery v0.27.0-alpha.3 // indirect
+	k8s.io/client-go v0.26.3 // indirect
+	k8s.io/klog/v2 v2.90.1 // indirect
+	k8s.io/kube-openapi v0.0.0-20230307230338-69ee2d25a840 // indirect
+	k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
+	sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
+	sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
+	sigs.k8s.io/yaml v1.3.0 // indirect
 )

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 87 - 476
entniche_new/src/go.sum


+ 33 - 3
entniche_new/src/service/subscribe/subscribe.go

@@ -18,6 +18,7 @@ import (
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
 	"app.yhyue.com/moapp/jybase/mongodb"
 	. "app.yhyue.com/moapp/jybase/mongodb"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 	. "app.yhyue.com/moapp/jypkg/ent/entity"
 	"app.yhyue.com/moapp/jypkg/ent/util"
 	"go.mongodb.org/mongo-driver/bson"
@@ -987,8 +988,9 @@ func (ac *Action) Get_key() {
 //Update_key 修改关键词
 func (ac *Action) Update_key() {
 	entId := qutil.IntAll(ac.GetSession("entId"))
-	// entUserId := qutil.IntAll(ac.GetSession("entUserId"))
-	// entInfo := VarCurrentUser.EntInfo(entId, entUserId)
+	entUserId := qutil.IntAll(ac.GetSession("entUserId"))
+	userId := qutil.ObjToString(ac.GetSession("mgoUserId"))
+	entInfo := VarCurrentUser.EntInfo(entId, entUserId)
 	vSwitch := ac.GetString("vSwitch")
 	i_type := 0
 	if vSwitch == "m" || vSwitch == "v" {
@@ -1094,7 +1096,24 @@ func (ac *Action) Update_key() {
 				}
 			}
 		}
-
+		keyLen := 0
+		ruleData := GetEntnicheRule(identity, entInfo.Dept.Id, entId, entUserId, entInfo.Ent.Dept_subscribe, entInfo.Role_admin_department, entInfo.Role_admin_system, i_type)
+		//判断是新增还是修改
+		if (*ruleData)["a_items"] != nil {
+			aitems, _ := (*ruleData)["a_items"].([]interface{})
+			a_items := qutil.ObjArrToMapArr(aitems)
+			keyLen = GetKeyWordLen(a_items)
+		}
+		newKeyLen := GetKeyWordLen(qutil.ObjArrToMapArr(keywords["a_items"].([]interface{})))
+		if newKeyLen > keyLen {
+			jy.Publish(util.Mgo_Log, config.Config.Nsq, config.Config.Nsq_topic, "task", userId, jy.Jyweb_node2, map[string]interface{}{
+				"code":       1015, //首次订阅
+				"types":      "subscribeKeyWords",
+				"num":        50,
+				"baseUserId": ac.GetSession("base_user_id"),
+				"positionId": ac.GetSession("position_id"),
+			})
+		}
 		ac.updateEntnicheRule("a_items", keywords["a_items"], identity, i_type)
 		bl := true
 		if bl {
@@ -1707,3 +1726,14 @@ func bubbleSort(a []int) []int {
 func MergeArr(arr1, arr2 []string) []string {
 	return deleteRepeat(append(arr1, arr2...))
 }
+
+func GetKeyWordLen(a_items []map[string]interface{}) (count int) {
+	if len(a_items) == 0 {
+		return
+	}
+	for _, v := range a_items {
+		a_key, _ := v["a_key"].([]interface{})
+		count += len(a_key)
+	}
+	return
+}

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно