Browse Source

Merge branch 'feature/v4.7.55' of ssh://192.168.3.207:10022/qmx/jy into feature/v4.7.55

wangchuanjin 2 years ago
parent
commit
1e7b4052c0

+ 1 - 2
src/jfw/modules/bigmember/src/entity/claimCommon.go

@@ -18,11 +18,10 @@ type ProjectClaim struct {
 // ClaimPermissions 项目认领相关方法 Status 1: "专家版", 3: "商机版", 6: "商机版2.0",7: "专家版2.0",
 func ClaimPermissions(session *httpsession.Session) (*ProjectClaim, error) {
 	userid := util.ObjToString(session.Get("userId"))
-
 	if userid == "" {
 		return nil, errors.New("未登录")
 	}
-	bigMsg := jy.GetBigVipUserBaseMsg( session, *config.Middleground)
+	bigMsg := jy.GetBigVipUserBaseMsg(session, *config.Middleground)
 	if bigMsg.Status <= 0 {
 		return nil, errors.New("无权益")
 	} else {

+ 3 - 2
src/jfw/modules/bigmember/src/go.mod

@@ -5,7 +5,7 @@ go 1.18
 require (
 	app.yhyue.com/moapp/esv1 v0.0.0-20220414031211-3da4123e648d
 	app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a
-	app.yhyue.com/moapp/jypkg v0.0.0-20230206012003-5d4c95f141d8
+	app.yhyue.com/moapp/jypkg v0.0.0-20230207011456-5bf93ef29526
 	github.com/donnie4w/go-logger v0.0.0-20170827050443-4740c51383f4
 	github.com/gogf/gf/v2 v2.0.6
 	go.mongodb.org/mongo-driver v1.11.1
@@ -13,7 +13,8 @@ require (
 
 require (
 	app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae // indirect
-	bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230128033309-a6b26e74a68c // indirect
+	bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230206065131-a8c8e98e8a1f // indirect
+	bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.4 // indirect
 	bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230129060002-f69424aa14ba // indirect
 	github.com/BurntSushi/toml v0.4.1 // indirect
 	github.com/beorn7/perks v1.0.1 // indirect

+ 5 - 4
src/jfw/modules/bigmember/src/go.sum

@@ -13,20 +13,21 @@ app.yhyue.com/moapp/jybase v0.0.0-20220802080941-07f401baab8b/go.mod h1:HelrO6tc
 app.yhyue.com/moapp/jybase v0.0.0-20230109015757-aa3d5e19b196/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
 app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a h1:wD4aWPSYdiX1cIP4lzzPD2s7fYhKa3muIf97l9tonJE=
 app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
-app.yhyue.com/moapp/jypkg v0.0.0-20230206012003-5d4c95f141d8 h1:3vkKP2S15Pwe8A8412k2s29X9CaiKEQmg8lVHMi6D00=
-app.yhyue.com/moapp/jypkg v0.0.0-20230206012003-5d4c95f141d8/go.mod h1:NrRgv24VIpf/xMMvsGC1EgoD+z6z5ea3MqIVxEcSPhE=
+app.yhyue.com/moapp/jypkg v0.0.0-20230207011456-5bf93ef29526 h1:flPNVocLyDxYpNfEVzooyk2MZL8Sk3KY4lW1N6zR9+E=
+app.yhyue.com/moapp/jypkg v0.0.0-20230207011456-5bf93ef29526/go.mod h1:dWrHpP8IddYxjsh/nYB1loIww2sYV8oWOINiAqPsgCY=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae h1:6rDDaz6yxvE8viTSzEBwKYOFWq14TMfuBivSazUZMz4=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae/go.mod h1:b0zZHev3gmJao1Fo+2Z2KPVjsuLOJVvVxf+kCnu9WkA=
 bp.jydev.jianyu360.cn/BP/jynsq v0.0.0-20220222052708-ebc43af90698/go.mod h1:ojo/AUH9Yr1wzarEjOaNMkj1Cet/9r8IgLyba64Z52E=
 bp.jydev.jianyu360.cn/BaseService/gateway v0.0.0-20220419090715-88ddb32961be/go.mod h1:Yj4oabIGItuMoF0BXYLz2XAnF581kxgXBrvlUtIJrkI=
 bp.jydev.jianyu360.cn/BaseService/gateway v1.3.4/go.mod h1:BMLd/5wb3BIEGhnEgF9y1sJN9P5/Dw9kYsoiE9V8I9g=
-bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230128033309-a6b26e74a68c h1:g49jOlhZlBCJ3IgJA0rotfNf2Gh22pISffUtqxB8XtY=
-bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230128033309-a6b26e74a68c/go.mod h1:5nimT8GJh46AyfeeDeyRlDQygMlO7TRM8Pwm41Gxemc=
+bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230206065131-a8c8e98e8a1f h1:GGypCGojBHNnHOOQJY64CilUWxbbfOLpxhDBpmoDr/c=
+bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230206065131-a8c8e98e8a1f/go.mod h1:5nimT8GJh46AyfeeDeyRlDQygMlO7TRM8Pwm41Gxemc=
 bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.0-20220418005748-8ba5d936dd53/go.mod h1:E5lcDI3k4FESLxiAetCfWQTq8qfpy9cv0yN1oKoEO34=
 bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.0-20220419023723-0b32d4a41751/go.mod h1:6KL5LMEku83uRbre0W/bj5kXG2I6pJGBFtktmtp51yM=
 bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.0-20220419063004-233fc7ce006c/go.mod h1:6KL5LMEku83uRbre0W/bj5kXG2I6pJGBFtktmtp51yM=
 bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.0-20220420075831-0b59892e9982/go.mod h1:wsHNO91h37H+xE4ZNny0yd7mtpODeDJxbVYhIRMR+qw=
 bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.3/go.mod h1:Z353aucNO5hH4ZYjeKST3kE1PN3W8/uPc4J8s0Upz40=
+bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.4 h1:LXD8woSkDDtqCQ19S9TGvx7GVir300nGszoIidBTlGM=
 bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.4/go.mod h1:rRiGzKG4F/fmkNxXQCxrkxNWc8yf1SmW8qWCKfGIQSM=
 bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20220418072311-2062bed1e700/go.mod h1:KjcrxTzM96tBc6G4B8tlLBn1lrVy5UJYF8+eTdP4xAE=
 bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20220421015128-4a36f3eac5c5/go.mod h1:GT0QC4aaKDuXxAvaU4G02XjCc31TU1ctqBGqxQYOfC4=

+ 2 - 3
src/jfw/modules/bigmember/src/service/report/report.go

@@ -109,14 +109,13 @@ func (r *Report) Index() {
 	positionType := qutil.Int64All(r.GetSession("positionType"))
 	o_mb := &map[string]interface{}{}
 	if positionType == 0 {
-		data := jy.GetBigVipUserBaseMsg( r.Session(), *config.Middleground)
+		data := jy.GetBigVipUserBaseMsg(r.Session(), *config.Middleground)
 		if data.Data.Member.Pid == "" {
 			//没有父级
 			o_mb := jy.GetSubScribeInfo(r.Session(), Mgo, "m", "10000")
 			if o_mb != nil && (*o_mb)["o_member_jy"] != nil {
 				(*o_mb)["o_member_jy"] = o_mb
 			}
-
 		} else {
 			o_mb, ok = Mgo.FindById(C_User, userId, `{"o_member_jy":1,"s_member_mainid":1,"i_member_sub_status":1}`)
 			if ok && o_mb != nil && (*o_mb) != nil && (*o_mb)["s_member_mainid"] != nil && qutil.IntAllDef((*o_mb)["i_member_sub_status"], 0) == 1 { //如果是子账号 查询主账号信息
@@ -586,7 +585,7 @@ func getColl(referer, t string) (string, string) {
 	}
 }
 func isFree(userId string, positionType int64, session *httpsession.Session) bool {
-	bigVipBaseMsg := jy.GetBigVipUserBaseMsg( session, *config.Middleground)
+	bigVipBaseMsg := jy.GetBigVipUserBaseMsg(session, *config.Middleground)
 	if bigVipBaseMsg == nil {
 		return true
 	} else if bigVipBaseMsg.Data.Vip.Status <= 0 && bigVipBaseMsg.Data.Member.Status <= 0 {

+ 0 - 1
src/jfw/modules/bigmember/src/service/use/use.go

@@ -546,7 +546,6 @@ func (u *Use) Equity() {
 				o_member_jy, _ = db.Mgo.FindOneByField("user", map[string]interface{}{
 					"_id": mongodb.StringTOBsonId(userid),
 				}, `{"o_member_jy":1}`)
-
 				if o_member_jy != nil && len(*o_member_jy) > 0 {
 					(*person)["o_member_jy"] = o_member_jy
 				}

+ 39 - 35
src/jfw/modules/bigmember/src/util/power.go

@@ -1,56 +1,60 @@
 package util
 
 import (
-        qutil "app.yhyue.com/moapp/jybase/common"
-        "app.yhyue.com/moapp/jybase/go-xweb/httpsession"
-        "app.yhyue.com/moapp/jybase/mongodb"
-        "app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
-        "jy/src/jfw/modules/bigmember/src/config"
-        "jy/src/jfw/modules/bigmember/src/db"
-        "time"
+	qutil "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
+	"app.yhyue.com/moapp/jybase/mongodb"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"jy/src/jfw/modules/bigmember/src/config"
+	"jy/src/jfw/modules/bigmember/src/db"
+	"time"
 )
 
 //后期
 //获取用户主账号userid
 func MainUserId(session *httpsession.Session) (string, string, int) {
-        bigMsg := jy.GetBigVipUserBaseMsg( session, *config.Middleground)
-        return bigMsg.Data.Member.Pid, "phone", bigMsg.Status
+	bigMsg := jy.GetBigVipUserBaseMsg(session, *config.Middleground)
+	if bigMsg.Data.Member.Pid == "" {
+		userId := session.Get("userId").(string)
+		return userId, "phone", bigMsg.Status
+	}
+	return bigMsg.Data.Member.Pid, "phone", bigMsg.Status
 }
 
 //获取该用户所有主账号+子账号
 func AllAccount(session *httpsession.Session) []string {
-        mainId, _, _ := MainUserId(session)
-        account := []string{mainId}
-        data, ok := db.Mgo.Find("user", map[string]interface{}{"s_member_mainid": mainId, "i_member_sub_status": 1}, nil, `{"_id":1}`, false, -1, -1)
-        if ok && data != nil && len(*data) > 0 {
-                for _, v := range *data {
-                        account = append(account, mongodb.BsonIdToSId(v["_id"]))
-                }
-        }
-        return account
+	mainId, _, _ := MainUserId(session)
+	account := []string{mainId}
+	data, ok := db.Mgo.Find("user", map[string]interface{}{"s_member_mainid": mainId, "i_member_sub_status": 1}, nil, `{"_id":1}`, false, -1, -1)
+	if ok && data != nil && len(*data) > 0 {
+		for _, v := range *data {
+			account = append(account, mongodb.BsonIdToSId(v["_id"]))
+		}
+	}
+	return account
 }
 
 //招标文件解读次数
 func IsBidfilePower(session *httpsession.Session) (int, bool) {
-        overdue := false
-        count := 0
-        mainid, _, _ := MainUserId(session)
-        res := db.Mysql.SelectBySql(`select i_frequency from bigmember_service_user
+	overdue := false
+	count := 0
+	mainid, _, _ := MainUserId(session)
+	res := db.Mysql.SelectBySql(`select i_frequency from bigmember_service_user
 			where s_userid =? and s_serviceid=?  and i_status=0`, mainid, 11)
-        if res != nil && len(*res) > 0 {
-                count = qutil.IntAll((*res)[0]["i_frequency"])
-                bidfile_endtime := "2021年11月15日" //目前招标文件解读到11/15到期
-                bed := GetTime("2006年01月02日", bidfile_endtime)
-                overdue = true
-                n := time.Now()
-                if bed.Before(n) {
-                        overdue = false
-                }
-        }
-        return count, overdue
+	if res != nil && len(*res) > 0 {
+		count = qutil.IntAll((*res)[0]["i_frequency"])
+		bidfile_endtime := "2021年11月15日" //目前招标文件解读到11/15到期
+		bed := GetTime("2006年01月02日", bidfile_endtime)
+		overdue = true
+		n := time.Now()
+		if bed.Before(n) {
+			overdue = false
+		}
+	}
+	return count, overdue
 }
 
 func GetTime(layout, t string) time.Time {
-        times, _ := time.ParseInLocation(layout, t, time.Local)
-        return times
+	times, _ := time.ParseInLocation(layout, t, time.Local)
+	return times
 }

+ 3 - 1
src/jfw/modules/publicapply/src/dataexport/entity/collection.go

@@ -10,7 +10,9 @@ func IsPay(session *httpsession.Session) bool {
 	isVip, isMember, isEnt := false, false, false
 	data := jy.GetBigVipUserBaseMsg(session, *config.Middleground)
 	isVip = data.Data.Vip.Status > 0
-	isEnt = data.Data.Entniche.Status > 0
+	if data.Data.Entniche.Status == 1 && data.Data.Entniche.IsEntPower == 1 && data.Data.Entniche.IsNew == 1 {
+		isEnt = true
+	}
 	isMember = data.Data.Member.Status > 0
 	return isVip || isEnt || isMember
 }

+ 5 - 13
src/jfw/modules/publicapply/src/db.json

@@ -36,13 +36,13 @@
   },
   "elasticsearch": {
     "main": {
-      "address": "http://192.168.3.206:9800",
+      "address": "http://192.168.3.206:9800,http://192.168.3.206:9801",
       "size": 30
     }
   },
   "redis": {
-    "main": {
-      "address": "other=192.168.3.206:1712,session=192.168.3.11:1713,newother=192.168.3.206:1712"
+    "main":{
+      "address": "other=192.168.3.11:1712,session=192.168.3.11:1713,newother=192.168.3.11:1712"
     }
   },
   "mysql": {
@@ -61,16 +61,8 @@
       "passWord": "Topnet123",
       "maxOpenConns": 5,
       "maxIdleConns": 5
-    },
-    "medical": {
-      "dBName": "medical_field_data",
-      "address": "192.168.3.14:4000",
-      "userName": "root",
-      "passWord": "=PDT49#80Z!RVv52_z",
-      "maxOpenConns": 5,
-      "maxIdleConns": 5
     }
   },
-  "bdcollection": "bdcollection",
-  "bdlabel": "bdlabel"
+  "bdcollection":"bdcollection",
+  "bdlabel":"bdlabel"
 }

+ 4 - 1
src/jfw/modules/publicapply/src/me/me.go

@@ -59,7 +59,10 @@ func (m *Me) MyInfo() {
 		} else {
 			isPassCount = redis.GetInt("pushcache_2_a", "oncecount_"+tedayNum+"_"+userId) >= 150
 		}
-		isEnt := user.Data.Entniche.Status > 0
+		isEnt := false
+		if user.Data.Entniche.Status == 1 && user.Data.Entniche.IsNew == 1 && user.Data.Entniche.PowerSource != 1 {
+			isEnt = true
+		}
 		if isEnt {
 			r["userType"] = "entniche"
 			/* o_entniche := jy.GetSubScribeInfo(m.Session(), db.Mgo, "s", "10000")

+ 16 - 12
src/jfw/modules/publicapply/src/subscribePush/entity/historyPush.go

@@ -1,18 +1,19 @@
 package entity
 
 import (
+	util "app.yhyue.com/moapp/jybase/common"
+	elastic "app.yhyue.com/moapp/jybase/esv1"
 	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 	"encoding/json"
 	"fmt"
 	"jy/src/jfw/modules/publicapply/src/config"
 	"jy/src/jfw/modules/publicapply/src/db"
+	es "jy/src/jfw/modules/publicapply/src/subscribePush/entity/service"
 	"log"
+	"strconv"
 	"strings"
 	"time"
-
-	util "app.yhyue.com/moapp/jybase/common"
-	elastic "app.yhyue.com/moapp/jybase/esv1"
-	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 )
 
 type historyPush struct {
@@ -149,14 +150,18 @@ func (d *defaultPush) getUserInfo() (vc *ViewCondition, deptId int) {
 		}
 	case "s":
 		//商机管理
-		if data.Data.Entniche.Status > 0 {
-			//订阅词获取
-			entInfo := jy.GetSubScribeInfo(d.Session, db.Mgo, "s", "10000")
+		entUserId, _ := strconv.Atoi(d.UserId)
+		if d.UserId == "" || d.EntId == 0 {
+			return &ViewCondition{}, 0
+		}
+		var entInfo map[string]interface{}
+		entInfo, deptId = (&es.MatchJob{}).Start(d.EntId, entUserId)
+		if entInfo != nil && len(entInfo) > 0 {
 			isPayBool = true
-			tmpInfo.Items, _ = (*entInfo)["a_items"].([]interface{})
-			tmpInfo.BuyerClass, _ = (*entInfo)["a_buyerclass"].([]interface{})
-			tmpInfo.SubType, _ = (*entInfo)["a_infotype"].([]interface{})
-			tmpInfo.Area, _ = (*entInfo)["o_area"].(map[string]interface{})
+			tmpInfo.Items, _ = entInfo["a_items"].([]interface{})
+			tmpInfo.BuyerClass, _ = entInfo["a_buyerclass"].([]interface{})
+			tmpInfo.SubType, _ = entInfo["a_infotype"].([]interface{})
+			tmpInfo.Area, _ = entInfo["o_area"].(map[string]interface{})
 		}
 	default:
 		//免费用户
@@ -197,7 +202,6 @@ func (d *defaultPush) getDefaultDatasSQL(scd *ViewCondition) (str string) {
 	query_bool_should := `{"bool":{"should":[%s],"minimum_should_match": 1}}`
 	multi_match := `{"multi_match": {"query": %s,"type": "phrase", "fields": [%s]}}`
 	query_bool_must_and := `{"bool":{"must":[%s]%s}}`
-
 	bools := []string{}
 	musts := []string{}
 	//发布时间最新7天

+ 1 - 1
src/jfw/modules/publicapply/src/subscribePush/entity/keyWords.go

@@ -594,7 +594,7 @@ func DeleteKeyWords(types, deletekey, userId string, session *httpsession.Sessio
 func DeleteClass(types, classIndex, userId string, session *httpsession.Session) map[string]interface{} {
 	flag := true
 	positionType := qutil.Int64All(session.Get("positionType"))
-	if positionType != 1 {
+	if positionType == 0 {
 		items, saveData := []interface{}{}, map[string]interface{}{}
 		m := map[string]bool{}
 		for _, v := range strings.Split(classIndex, ",") {