Răsfoiți Sursa

返回新增字段

Jianghan 9 luni în urmă
părinte
comite
b16ff78427

+ 4 - 3
api/internal/logic/prcollectlistlogic.go

@@ -29,10 +29,11 @@ func NewPrCollectListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PrC
 func (l *PrCollectListLogic) PrCollectList(req *types.PrCollectListReq) (resp *types.Reply, err error) {
 	logx.Info(fmt.Sprintf("%+v", req))
 	resp = &types.Reply{}
-	list, count := service.GetCollectList(req)
+	list, count, has := service.GetCollectList(req)
 	resp.Data = map[string]interface{}{
-		"list":  list,
-		"total": count,
+		"list":       list,
+		"total":      count,
+		"hasCollect": has,
 	}
 	return
 }

+ 4 - 3
api/internal/logic/prmonitorlistlogic.go

@@ -29,10 +29,11 @@ func NewPrMonitorListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PrM
 func (l *PrMonitorListLogic) PrMonitorList(req *types.PrMonitorListReq) (resp *types.Reply, err error) {
 	logx.Info(fmt.Sprintf("%+v", req))
 	resp = &types.Reply{}
-	list, count := service.GetMonitorList(req)
+	list, count, has := service.GetMonitorList(req)
 	resp.Data = map[string]interface{}{
-		"list":  list,
-		"total": count,
+		"list":       list,
+		"total":      count,
+		"hasMonitor": has,
 	}
 	return
 }

+ 14 - 14
api/internal/service/prListService.go

@@ -19,10 +19,11 @@ var (
 	fields    = []string{"_id", "title", "publishtime", "dataweight", "detail", "site", "spidercode", "toptype", "subtype", "type", "area", "city", "district", "s_topscopeclass", "s_subscopeclass", "bidamount", "budget", "buyerclass", "buyer", "winner", "bidopentime", "buyertel", "buyerperson", "agency", "agencytel", "agencyperson", "s_winner", "winnertel", "winnerperson", "signendtime", "bidendtime", "projectinfo", "entidlist"}
 )
 
-func GetMonitorList(req *types.PrMonitorListReq) (resultList []map[string]interface{}, total int64) {
+func GetMonitorList(req *types.PrMonitorListReq) (resultList []map[string]interface{}, total int64, hasMonitor bool) {
 
-	bList, b := T.Mgo.Find("follow_customer", map[string]string{"userId": req.MgoUserId}, `{_id: 1}`, nil, false, -1, -1)
+	bList, b := T.Mgo.Find("follow_customer", map[string]interface{}{"userId": req.MgoUserId}, `{_id: 1}`, nil, false, -1, -1)
 	if b && len(*bList) > 0 {
+		hasMonitor = true
 		var bName []string
 		for _, v := range *bList {
 			if name := common.ObjToString(v["name"]); name != "" {
@@ -37,37 +38,37 @@ func GetMonitorList(req *types.PrMonitorListReq) (resultList []map[string]interf
 			for _, v := range strings.Split(scopeClass, ",") {
 				should = append(should, fmt.Sprintf(shouldMul, v))
 			}
-			esQuery1 = fmt.Sprintf(esQ1, strings.ReplaceAll(strings.Join(bName, ","), ",", `","`), should, strings.ReplaceAll(strings.Join(fields, ","), ",", `","`), pageStart, req.PageSize)
+			esQuery1 = fmt.Sprintf(esQ1, strings.ReplaceAll(strings.Join(bName, ","), ",", `","`), strings.Join(should, ","), strings.ReplaceAll(strings.Join(fields, ","), ",", `","`), pageStart, req.PageSize)
 		} else {
 			esQuery1 = fmt.Sprintf(esQ2, strings.ReplaceAll(strings.Join(bName, ","), ",", `","`), strings.ReplaceAll(strings.Join(fields, ","), ",", `","`), pageStart, req.PageSize)
 		}
+		logx.Info("esQuery1---", esQuery1)
 		total, result := elastic.GetWithCount("bidding", "bidding", "", esQuery1)
 		if total == 0 {
-			return nil, 0
+			return nil, 0, hasMonitor
 		}
 		for _, m := range *result {
 			resultList = append(resultList, GetInfoData(m))
 		}
-		return resultList, total
+		return resultList, total, hasMonitor
 	} else {
-		return nil, 0
+		return nil, 0, false
 	}
 }
 
-func GetCollectList(req *types.PrCollectListReq) (resultList []map[string]interface{}, total int64) {
+func GetCollectList(req *types.PrCollectListReq) (resultList []map[string]interface{}, total int64, has bool) {
 	scopeClass := FindBusiness(req.EntId, req.MgoUserId)
 	info := T.JianyuMysql.Find("bdcollection", map[string]interface{}{"userid": req.UserId}, "", "id desc", -1, -1)
 	var ids []interface{}
 	if info == nil || len(*info) == 0 {
-		return make([]map[string]interface{}, 0), 0
+		return make([]map[string]interface{}, 0), 0, false
 	}
+	has = true
 	for _, m := range *info {
 		if bid := common.ObjToString(m["bid"]); bid != "" {
 			ids = append(ids, mongodb.StringTOBsonId(bid))
 		}
 	}
-	logx.Info("scopeClass---", scopeClass)
-	logx.Info("ids---", ids)
 	if len(ids) > 200 {
 		ids = ids[:200]
 	}
@@ -81,6 +82,7 @@ func GetCollectList(req *types.PrCollectListReq) (resultList []map[string]interf
 			if tp := common.ObjToString(m["toptype"]); tp == "采购意向" || tp == "预告" || tp == "招标" {
 				for _, s := range strings.Split(scopeClass, ",") {
 					if top := common.ObjToString(m["s_topscopeclass"]); strings.Contains(top, s) {
+						m["_id"] = mongodb.BsonIdToSId(m["_id"])
 						resultList = append(resultList, GetInfoData(m))
 						break
 					}
@@ -88,20 +90,18 @@ func GetCollectList(req *types.PrCollectListReq) (resultList []map[string]interf
 			}
 		}
 	}
-	logx.Info("binfo---", len(*binfo))
-	logx.Info("resultList---", len(resultList))
 	total = int64(len(resultList))
 	start := (req.PageNum - 1) * req.PageSize
 	end := start + req.PageSize
 
 	// 处理边界情况
 	if start >= len(resultList) {
-		return make([]map[string]interface{}, 0), total
+		return make([]map[string]interface{}, 0), total, has
 	}
 	if end > len(resultList) {
 		end = len(resultList)
 	}
-	return resultList[start:end], total
+	return resultList[start:end], total, has
 }
 
 func GetInfoData(m map[string]interface{}) (result map[string]interface{}) {

+ 0 - 6
api/logs/access.log

@@ -1,6 +0,0 @@
-{"@timestamp":"2024-10-11T14:49:09.916+08:00","caller":"common/initconfig.go:53","content":"info--日志记录","level":"info"}
-{"@timestamp":"2024-10-11T14:49:09.916+08:00","caller":"common/initconfig.go:53","content":"error--日志记录","level":"info"}
-{"@timestamp":"2024-10-11T14:50:47.501+08:00","caller":"common/initconfig.go:53","content":"info--日志记录","level":"info"}
-{"@timestamp":"2024-10-11T14:50:47.501+08:00","caller":"common/initconfig.go:53","content":"error--日志记录","level":"info"}
-{"@timestamp":"2024-10-11T14:50:47.622+08:00","caller":"common/initconfig.go:83","content":"--初始化 mongodb--","level":"info"}
-{"@timestamp":"2024-10-11T14:50:47.624+08:00","caller":"common/initconfig.go:92","content":"--初始化 mongodb Bidding --","level":"info"}

+ 1 - 51
go.mod

@@ -3,15 +3,10 @@ module bp.jydev.jianyu360.cn/CRM/networkManage
 go 1.19
 
 require (
-	app.yhyue.com/moapp/jybase v0.0.0-20240424025716-c77615e9004e
+	app.yhyue.com/moapp/jybase v0.0.0-20241016090300-f39a281ac0ff
 	app.yhyue.com/moapp/jypkg v0.0.0-20230825092743-3bfc415bb5bb
-	bp.jydev.jianyu360.cn/BaseService/fileCenter v0.0.0-20231016051530-64b559fee531
 	bp.jydev.jianyu360.cn/BaseService/gateway v1.3.4
-	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.14-0.20230821092053-934ffe439a9d
-	bp.jydev.jianyu360.cn/CRM/baseCenter v0.0.0-20230904054652-d86e21ec57f3
-	bp.jydev.jianyu360.cn/SocialPlatform/socialPlatform v0.0.0-20230529115950-b726dfbf171f
 	github.com/ClickHouse/clickhouse-go/v2 v2.2.0
-	github.com/RoaringBitmap/roaring v1.5.0
 	github.com/gogf/gf/v2 v2.0.6
 	github.com/golang/protobuf v1.5.3
 	github.com/shopspring/decimal v1.3.1
@@ -21,61 +16,33 @@ require (
 
 require (
 	app.yhyue.com/moapp/esv1 v0.0.0-20220414031211-3da4123e648d // indirect
-	app.yhyue.com/moapp/jyMarketing v0.0.2-0.20230304035551-21bb1eedf547 // indirect
-	bp.jydev.jianyu360.cn/BaseService/entManageApplication v0.0.0-20230214091519-89a98c01ab0e // 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/bits-and-blooms/bitset v1.2.0 // 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.1 // indirect
 	github.com/coreos/go-systemd/v22 v22.5.0 // indirect
-	github.com/davecgh/go-spew v1.1.1 // indirect
-	github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // 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.1 // indirect
 	github.com/gogo/protobuf v1.3.2 // indirect
 	github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
-	github.com/golang/mock v1.6.0 // 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/uuid v1.3.0 // 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.15.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.15 // indirect
-	github.com/longbridgeapp/sqlparser v0.3.1 // indirect
 	github.com/mailru/easyjson v0.7.7 // 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.4 // 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/mschoch/smat v0.2.0 // 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/olivere/elastic/v7 v7.0.22 // indirect
 	github.com/openzipkin/zipkin-go v0.4.1 // indirect
@@ -87,7 +54,6 @@ require (
 	github.com/prometheus/client_model v0.3.0 // indirect
 	github.com/prometheus/common v0.42.0 // indirect
 	github.com/prometheus/procfs v0.10.1 // indirect
-	github.com/rivo/uniseg v0.2.0 // indirect
 	github.com/spaolacci/murmur3 v1.1.0 // indirect
 	github.com/xdg-go/pbkdf2 v1.0.0 // indirect
 	github.com/xdg-go/scram v1.1.2 // indirect
@@ -114,31 +80,15 @@ require (
 	go.uber.org/zap v1.24.0 // indirect
 	golang.org/x/crypto v0.12.0 // indirect
 	golang.org/x/net v0.14.0 // indirect
-	golang.org/x/oauth2 v0.7.0 // indirect
 	golang.org/x/sync v0.2.0 // indirect
 	golang.org/x/sys v0.11.0 // indirect
-	golang.org/x/term v0.11.0 // indirect
 	golang.org/x/text v0.12.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-20230526161137-0005af68ea54 // indirect
 	google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9 // indirect
 	google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // 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/yaml.v2 v2.4.0 // indirect
-	gopkg.in/yaml.v3 v3.0.1 // indirect
 	gorm.io/driver/mysql v1.0.5 // indirect
 	gorm.io/gorm v1.21.3 // indirect
-	jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20230710093759-d9d6c68de8b1 // 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
 )

Fișier diff suprimat deoarece este prea mare
+ 6 - 611
go.sum


Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff