WH01243 před 2 roky
rodič
revize
f006f69fad

+ 0 - 4
src/jfw/modules/bigmember/src/config.yaml

@@ -1,4 +0,0 @@
-Etcd:
-  Hosts:
-    - 127.0.0.1:2379
-  Key: powercheck.rpc

+ 76 - 81
src/jfw/modules/bigmember/src/config/config.go

@@ -1,100 +1,95 @@
 package config
 
 import (
-	qutil "app.yhyue.com/moapp/jybase/common"
-	"app.yhyue.com/moapp/jybase/mail"
-	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/middleGround"
-	"github.com/zeromicro/go-zero/core/conf"
-	"github.com/zeromicro/go-zero/rest"
+        qutil "app.yhyue.com/moapp/jybase/common"
+        "app.yhyue.com/moapp/jybase/mail"
+        "app.yhyue.com/moapp/jypkg/common/src/qfw/util/middleGround"
 )
 
 type config struct {
-	WebPort string
-	Mail    []struct {
-		Addr string
-		Port int
-		Pwd  string
-		User string
-	}
-	PortraitPool        int
-	PortraitCacheDay    int
-	PortraitScreenPool  int64
-	RdProLimit          int
-	FollowPushRpc       string
-	FollowEnt           followConfig
-	FollowProject       followConfig
-	AttachmentRPC       string
-	AttachmentMail      string
-	AttachmentMailTitle string
-	ReTry               int
-	Industry            map[string]interface{}
-	KeyMaxLength        int
-	WarnMailbox         []string
-	WarnMbTitle         string
-	TimeSpan            int
-	RegWinner           string
-	OldSubscribeMoveTip int64
-	Customers           []CustomerInfo
-	NewFreeUser         int64          //免费用户 -- 订阅升级新用户
-	FileUploadNum       map[string]int //每月附件下载次数
-	CreatePdfServer     string         //生成pdf文件服务地址
-	PdfServerPoor       int            //生成pdf线程数量控制
-	PdfDataApiWhiteList []string       //pdf数据接口白名单
-	MainWebDomain       string         //附件剑鱼地址
-	marketAnalysisPool  int
-	MarketAnalysisPool  struct {
-		Limit           int `json:"limit"`           //查询并发池
-		TimeOut         int `json:"timeOut"`         //并发池等待超时时长,单位秒
-		ProjectNumLimit int `json:"projectNumLimit"` //自定义报告限制项目个数
-	} `json:"marketAnalysisPool"` //市场分析
-	ForecastTime   int //中标预测结果redis 缓存时间
-	IsAddCacheTime int //isadd 接口数据存储时间 + 120 内随机数
-	IsAddUrls      struct {
-		Free      []string `json:"free"`
-		Vip       []string `json:"vip"`
-		BigMember []string `json:"bigMember"`
-		EntNiche  []string `json:"entNiche"`
-	}
-	PotentialSwitch       bool `json:"potentialSwitch"`       //潜在客户 潜在竞争对手 新逻辑开关
-	PortraitEntnicheCount int  `json:"portraitEntnicheCount"` //商机管理 默认画像每月权限次数
+        WebPort string
+        Mail    []struct {
+                Addr string
+                Port int
+                Pwd  string
+                User string
+        }
+        PortraitPool        int
+        PortraitCacheDay    int
+        PortraitScreenPool  int64
+        RdProLimit          int
+        FollowPushRpc       string
+        FollowEnt           followConfig
+        FollowProject       followConfig
+        AttachmentRPC       string
+        AttachmentMail      string
+        AttachmentMailTitle string
+        ReTry               int
+        Industry            map[string]interface{}
+        KeyMaxLength        int
+        WarnMailbox         []string
+        WarnMbTitle         string
+        TimeSpan            int
+        RegWinner           string
+        OldSubscribeMoveTip int64
+        Customers           []CustomerInfo
+        NewFreeUser         int64          //免费用户 -- 订阅升级新用户
+        FileUploadNum       map[string]int //每月附件下载次数
+        CreatePdfServer     string         //生成pdf文件服务地址
+        PdfServerPoor       int            //生成pdf线程数量控制
+        PdfDataApiWhiteList []string       //pdf数据接口白名单
+        MainWebDomain       string         //附件剑鱼地址
+        marketAnalysisPool  int
+        MarketAnalysisPool  struct {
+                Limit           int `json:"limit"`           //查询并发池
+                TimeOut         int `json:"timeOut"`         //并发池等待超时时长,单位秒
+                ProjectNumLimit int `json:"projectNumLimit"` //自定义报告限制项目个数
+        } `json:"marketAnalysisPool"` //市场分析
+        ForecastTime   int //中标预测结果redis 缓存时间
+        IsAddCacheTime int //isadd 接口数据存储时间 + 120 内随机数
+        IsAddUrls      struct {
+                Free      []string `json:"free"`
+                Vip       []string `json:"vip"`
+                BigMember []string `json:"bigMember"`
+                EntNiche  []string `json:"entNiche"`
+        }
+        PotentialSwitch       bool `json:"potentialSwitch"`       //潜在客户 潜在竞争对手 新逻辑开关
+        PortraitEntnicheCount int  `json:"portraitEntnicheCount"` //商机管理 默认画像每月权限次数
 
-	Claim struct {
-		Details  string `json:"details"`
-		ListPage string `json:"listPage"`
-	} `json:"claim"`
+        Claim struct {
+                Details  string `json:"details"`
+                ListPage string `json:"listPage"`
+        } `json:"claim"`
+        Etcd struct {
+                Hosts  string `json:"hosts"`
+                Key string `json:"key"`
+        } `json:"etcd"`
 }
 
 type CustomerInfo struct {
-	Name   string `json:"name"`
-	Wxer   string `json:"wxer"`
-	Remark string `json:"remark"`
+        Name   string `json:"name"`
+        Wxer   string `json:"wxer"`
+        Remark string `json:"remark"`
 }
 type followConfig struct {
-	Normal int
-	BigVip int
+        Normal int
+        BigVip int
 }
 
 var Config *config
-var EtcConfig *etcConfig
 var GmailAuth []*mail.GmailAuth
 
-type etcConfig struct {
-	rest.RestConf
-}
-
 func init() {
-	conf.MustLoad("config.yam", &EtcConfig)
-	//程序配置文件
-	qutil.ReadConfig(&Config)
-	qutil.ReadConfig("./baseApi.json", &middleGround.JyApiConfig) //初始化中台请求接口
-	conf.MustLoad("config.yam", &EtcConfig)
-	for _, v := range Config.Mail {
-		mail := &mail.GmailAuth{
-			SmtpHost: v.Addr,
-			SmtpPort: v.Port,
-			User:     v.User,
-			Pwd:      v.Pwd,
-		}
-		GmailAuth = append(GmailAuth, mail)
-	}
+        //程序配置文件
+        qutil.ReadConfig(&Config)
+        qutil.ReadConfig("./baseApi.json", &middleGround.JyApiConfig) //初始化中台请求接口
+        for _, v := range Config.Mail {
+                mail := &mail.GmailAuth{
+                        SmtpHost: v.Addr,
+                        SmtpPort: v.Port,
+                        User:     v.User,
+                        Pwd:      v.Pwd,
+                }
+                GmailAuth = append(GmailAuth, mail)
+        }
 }

+ 90 - 86
src/jfw/modules/bigmember/src/db.json

@@ -1,91 +1,95 @@
 {
-	"mongodb": {
-		"main": {
-			"address": "192.168.3.206:27080",
-	 		"size": 5,
-	 		"dbName": "qfw",
-			"replSet": ""
-		},
-		"log": {
-			"address": "192.168.3.206:27090",
-	 		"size": 5,
-	 		"dbName": "qfw",
-			"replSet": "",
-			"userName": "admin",
-			"password": "123456"
-		},
-		"ent": {
-			"address": "192.168.3.207:27001,192.168.3.206:27002",
-	 		"size": 5,
-	 		"dbName": "mixdata",
-			"replSet": "",
-			"collection": "qyxy",
-			"collection_change": "qyxy_change",
-			"userName": "jyDevGroup",
-			"password": "jy@DevGroup"
-		},
-		"bidding": {
-			"address": "192.168.3.207:27001,192.168.3.206:27002",
-	 		"size": 5,
-	 		"dbName": "qfw_data",
-			"collection": "bidding",
-			"collection_change": "bidding_back",
-			"userName": "jyDevGroup",
-			"password": "jy@DevGroup"
-		}
-	},
-	"elasticsearch": {
-		"main": {
-			"address": "http://192.168.3.206:9800",
-	    	"size": 30
-		}
+  "mongodb": {
+    "main": {
+      "address": "192.168.3.206:27080",
+      "size": 5,
+      "dbName": "qfw",
+      "replSet": ""
     },
-    "redis": {
-    	"main":{
-			"address": "other=192.168.3.206:1712,session=192.168.3.206:1712,push=192.168.3.206:1712,pushcache_1=192.168.3.206:1712,pushcache_2_a=192.168.3.206:1712,pushcache_2_b=192.168.3.206:1712,newother=192.168.3.206:1712"
-		}
+    "log": {
+      "address": "192.168.3.206:27090",
+      "size": 5,
+      "dbName": "qfw",
+      "replSet": "",
+      "userName": "admin",
+      "password": "123456"
     },
-    "mysql": {
-	    "main": {
-	        "dbName": "jianyu",
-	        "address": "192.168.3.11:3366",
-	        "userName": "root",
-	        "passWord": "Topnet123",
-			"maxOpenConns": 5,
-			"maxIdleConns": 5
-	    },
-      "base": {
-        "dBName": "base_service",
-        "address": "192.168.3.217:4000",
-        "userName": "root",
-        "passWord": "=PDT49#80Z!RVv52_z",
-        "maxOpenConns": 5,
-        "maxIdleConns": 5
-      },
-	    "push": {
-	        "dbName": "jianyu",
-	        "address": "192.168.3.11:3366",
-	        "userName": "root",
-	        "passWord": "Topnet123",
-			"maxOpenConns": 5,
-			"maxIdleConns": 5
-	    },
-      "global": {
-        "dBName": "global_common_data",
-        "address": "192.168.3.14:4000",
-        "userName": "root",
-        "passWord": "=PDT49#80Z!RVv52_z",
-        "maxOpenConns": 5,
-        "maxIdleConns": 5
-      },
-      "subject": {
-        "address": "192.168.3.217:4000",
-        "size": 5,
-        "dbName": "jianyu_subjectdb",
-        "userName": "root",
-        "password": "=PDT49#80Z!RVv52_z"
-      }
+    "ent": {
+      "address": "192.168.3.207:27001,192.168.3.206:27002",
+      "size": 5,
+      "dbName": "mixdata",
+      "replSet": "",
+      "collection": "qyxy",
+      "collection_change": "qyxy_change",
+      "userName": "jyDevGroup",
+      "password": "jy@DevGroup"
     },
-    "elascit_index":"projectset",
-    "elascit_type":"projectset"
+    "bidding": {
+      "address": "192.168.3.207:27001,192.168.3.206:27002",
+      "size": 5,
+      "dbName": "qfw_data",
+      "collection": "bidding",
+      "collection_change": "bidding_back",
+      "userName": "jyDevGroup",
+      "password": "jy@DevGroup"
+    }
+  },
+  "elasticsearch": {
+    "main": {
+      "address": "http://192.168.3.206:9800",
+      "size": 30
+    }
+  },
+  "redis": {
+    "main": {
+      "address": "other=192.168.3.206:1712,session=192.168.3.206:1712,push=192.168.3.206:1712,pushcache_1=192.168.3.206:1712,pushcache_2_a=192.168.3.206:1712,pushcache_2_b=192.168.3.206:1712,newother=192.168.3.206:1712"
+    }
+  },
+  "mysql": {
+    "main": {
+      "dbName": "jianyu",
+      "address": "192.168.3.11:3366",
+      "userName": "root",
+      "passWord": "Topnet123",
+      "maxOpenConns": 5,
+      "maxIdleConns": 5
+    },
+    "base": {
+      "dBName": "base_service",
+      "address": "192.168.3.217:4000",
+      "userName": "root",
+      "passWord": "=PDT49#80Z!RVv52_z",
+      "maxOpenConns": 5,
+      "maxIdleConns": 5
+    },
+    "push": {
+      "dbName": "jianyu",
+      "address": "192.168.3.11:3366",
+      "userName": "root",
+      "passWord": "Topnet123",
+      "maxOpenConns": 5,
+      "maxIdleConns": 5
+    },
+    "global": {
+      "dBName": "global_common_data",
+      "address": "192.168.3.14:4000",
+      "userName": "root",
+      "passWord": "=PDT49#80Z!RVv52_z",
+      "maxOpenConns": 5,
+      "maxIdleConns": 5
+    },
+    "subject": {
+      "address": "192.168.3.217:4000",
+      "size": 5,
+      "dbName": "jianyu_subjectdb",
+      "userName": "root",
+      "password": "=PDT49#80Z!RVv52_z"
+    }
+  },
+  "elascit_index": "projectset",
+  "elascit_type": "projectset",
+  "etcd": {
+    "hosts": "127.0.0.1:2379",
+    "key": "powercheck.rpc"
+  }
 }

+ 1 - 1
src/jfw/modules/bigmember/src/entity/followEnterprise.go

@@ -31,7 +31,7 @@ func CreateEntFollowManager(userid string, baseUserId, accountId, entId int64, p
 	if userid == "" {
 		return nil, errors.New("未登录")
 	}
-	bigMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+	bigMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.Config.Etcd.Hosts, config.Config.Etcd.Key)
 
 	defaultPageFlag := "entFollow"
 	if len(pageFlag) > 0 {

+ 1 - 1
src/jfw/modules/bigmember/src/entity/followProject.go

@@ -26,7 +26,7 @@ func CreateProjectFollowManager(userid string, baseUserId, accountId, entId int6
 	if userid == "" {
 		return nil, errors.New("未登录")
 	}
-	bigMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+	bigMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.Config.Etcd.Hosts, config.Config.Etcd.Key)
 
 	isBuy := bigMsg.CheckBigVipBackPower("followProject")
 	if len(mustBuy) > 0 && !isBuy {

+ 3 - 3
src/jfw/modules/bigmember/src/entity/portrait.go

@@ -28,7 +28,7 @@ func CreatePortraitManager(userid string, baseUserId, accountId, entId int64, pa
 	if userid == "" {
 		return nil, false, errors.New("未登录"), true
 	}
-	bigMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+	bigMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.Config.Etcd.Hosts, config.Config.Etcd.Key)
 
 	if pageFlag == "" {
 		return nil, false, errors.New("未知请求"), true
@@ -67,7 +67,7 @@ func CreatePortraitManagerForContacts(userid string, baseUserId, accountId, entI
 	if entName == "" {
 		return nil, errors.New("参数异常")
 	}
-	bigMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+	bigMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.Config.Etcd.Hosts, config.Config.Etcd.Key)
 
 	//0:采购单位;1:中标企业
 	switch entType {
@@ -120,7 +120,7 @@ func CreateSubVipPortraitManager(userid string, pageFlag, searchValue string, is
 		return nil, -1, errors.New("未知请求"), true
 	}
 	if pageFlag != "entDetail" { //需要权限校验的接口
-		bigMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+		bigMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.Config.Etcd.Hosts, config.Config.Etcd.Key)
 
 		if bigMsg.VipStatus <= 0 || bigMsg.Vip_BuySet.Upgrade != 1 { //免费用户留资体验
 			if searchValue != "" && jy.Portraitexperience(userid, searchValue, isWinner) {

+ 1 - 1
src/jfw/modules/bigmember/src/entity/trial.go

@@ -8,7 +8,7 @@ import (
 
 func GetUserTrialInfoById(userId string, baseUserId, accountId, entId int64) map[string]interface{} {
 	var res = map[string]interface{}{}
-	BigMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+	BigMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.Config.Etcd.Hosts, config.Config.Etcd.Key)
 
 	if BigMsg != nil {
 		//i_member_status:4 正在试用 ;i_member_trial:1是试用过;同时满足:当前试用阶段

+ 1 - 1
src/jfw/modules/bigmember/src/filter/sessionfilter.go

@@ -46,7 +46,7 @@ func (l *sessionfilter) Do(w http.ResponseWriter, req *http.Request) bool {
 	if req.URL.Path == "/bigmember/decision/freeDecInfo" || req.URL.Path == "/bigmember/analysis/projectName" || req.URL.Path == "/bigmember/analysis/projectInfo" || req.URL.Path == "/bigmember/project/getPdfDetail" {
 		return true
 	}
-	bigMeg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+	bigMeg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.Config.Etcd.Key, config.Config.Etcd.Key)
 	if !bigMeg.CheckBigVipBackPower(match[1]) {
 		R.ServeJson(w, req, &Result{Error_code_1004, Error_msg_1004, nil})
 		return false

+ 1 - 1
src/jfw/modules/bigmember/src/service/analysis/decision.go

@@ -83,7 +83,7 @@ func (this *Analysis) TrialInfo() {
 	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		//userInfo, ok := db.Mgo.FindById("user", userId, nil)
-		baseMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+		baseMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.Config.Etcd.Key, config.Config.Etcd.Key)
 
 		if baseMsg == nil {
 			return -2, nil

+ 1 - 1
src/jfw/modules/bigmember/src/service/analysis/forecastproject.go

@@ -190,7 +190,7 @@ func (this *Analysis) ForPContent() {
 				}
 			}
 			power := []int{}
-			powerMap := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile).PowerMap
+			powerMap := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.Config.Etcd.Key, config.Config.Etcd.Key).PowerMap
 			for k, _ := range powerMap {
 				power = append(power, k)
 			}

+ 1 - 1
src/jfw/modules/bigmember/src/service/analysis/potential.go

@@ -175,7 +175,7 @@ func (this *Analysis) CsORRsList() {
 				log.Println("大会员初始化 企业名称有误-", userId, main_userId)
 			}
 			//userInfo, ok := db.Mgo.FindById("user", main_userId, nil)
-			userInfo := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+			userInfo := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.Config.Etcd.Key, config.Config.Etcd.Key)
 
 			if userInfo != nil {
 				var isTrial = userInfo.Status == 4

+ 1 - 1
src/jfw/modules/bigmember/src/service/analysis/util.go

@@ -47,7 +47,7 @@ func (this *SelectC) UserStatusChecked() bool {
 	if this.PCOR == "R" {
 		serviceId = 8
 	}
-	userPower := jy.GetBigVipUserBaseMsg("10000", this.UserId, this.BaseUserId, this.AccountId, this.EntId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+	userPower := jy.GetBigVipUserBaseMsg("10000", this.UserId, this.BaseUserId, this.AccountId, this.EntId, config.Config.Etcd.Key, config.Config.Etcd.Key)
 
 	return userPower.Status > 0 && userPower.PowerMap[serviceId]
 }

+ 1 - 1
src/jfw/modules/bigmember/src/service/bidfile/bidfile.go

@@ -37,7 +37,7 @@ func (b *Bidfile) History() {
 		}
 		//获取用户权限详情
 		power := []int{}
-		bigPower := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+		bigPower := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.Config.Etcd.Key, config.Config.Etcd.Key)
 		for k, _ := range bigPower.PowerMap {
 			power = append(power, k)
 		}

+ 1 - 1
src/jfw/modules/bigmember/src/service/follow/projectPdf.go

@@ -125,7 +125,7 @@ func (this *FollowProject) GetPdfDetail() {
 
 //校验是否是付费用户
 func checkPay(userId string, baseUserId, accountId, entId int64) bool {
-	bigPower := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+	bigPower := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.Config.Etcd.Key, config.Config.Etcd.Key)
 
 	if bigPower.Status > 0 || bigPower.VipStatus > 0 {
 		return true

+ 2 - 2
src/jfw/modules/bigmember/src/service/portrait/subvipPortraitAction.go

@@ -236,7 +236,7 @@ func (this *SubVipPortrait) PortraitUsage() {
 	entId := qutil.Int64All(this.GetSession("entId"))
 	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		bigMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+		bigMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.Config.Etcd.Key, config.Config.Etcd.Key)
 
 		if bigMsg.VipStatus <= 0 && bigMsg.Vip_BuySet.Upgrade != 1 {
 			return nil, fmt.Errorf("非法请求")
@@ -284,7 +284,7 @@ func (this *SubVipPortrait) PortraitRecord() {
 		if pageSize < 1 || pageSize > 50 {
 			pageSize = 50
 		}
-		bigMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+		bigMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.Config.Etcd.Key, config.Config.Etcd.Key)
 		if bigMsg.VipStatus <= 0 && bigMsg.Vip_BuySet.Upgrade != 1 {
 			return nil, fmt.Errorf("非法请求")
 		}

+ 2 - 2
src/jfw/modules/bigmember/src/service/push/push.go

@@ -102,7 +102,7 @@ func (a *Action) Detail() {
 			"wxpush":         util.IntAll(o_member_jy["i_wxpush"]),
 		}
 		power := []int{}
-		BigMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+		BigMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.Config.Etcd.Key, config.Config.Etcd.Key)
 		for k, _ := range BigMsg.PowerMap {
 			power = append(power, k)
 		}
@@ -409,7 +409,7 @@ func OpenStatus(ojy map[string]interface{}, types, userId string, baseUserId, ac
 			"follow_ent":     util.IntAllDef(ojy["i_follow_ent"], 1),
 		}
 		power := []int{}
-		BigMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+		BigMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.Config.Etcd.Key, config.Config.Etcd.Key)
 		for k, _ := range BigMsg.PowerMap {
 			power = append(power, k)
 		}

+ 1 - 1
src/jfw/modules/bigmember/src/service/report/marketAnalysis.go

@@ -30,7 +30,7 @@ func checkPower(userId string, baseUserId, accountId, entId int64) (string, erro
 		return "", fmt.Errorf("未登录")
 	}
 	//仅购买《周报/月报/定制化市场分析报告》的大会员有权限
-	bigMeg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+	bigMeg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.Config.Etcd.Key, config.Config.Etcd.Key)
 	//if bigMeg.Status <= 0 || !bigMeg.CheckBigVipBackPower("report") {
 	//	return "", fmt.Errorf("非法请求")
 	//}

+ 5 - 5
src/jfw/modules/bigmember/src/service/use/use.go

@@ -140,7 +140,7 @@ func (u *Use) Add() {
 					log.Println("add err:", userid, err)
 				} else if followEntManager.HasPower {
 					for k, v := range ids {
-						BigMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+						BigMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.Config.Etcd.Key, config.Config.Etcd.Key)
 						if BigMsg.Status != 4 {
 							err = followEntManager.AddFollowEnt(v, "", true)
 							if err != nil {
@@ -455,7 +455,7 @@ func (u *Use) Attachment() {
 			rep.Rep = []map[string]interface{}{}
 		}
 		m := rep.Rep
-		BaseMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+		BaseMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.Config.Etcd.Key, config.Config.Etcd.Key)
 		status := BaseMsg.Status
 		if status <= 0 {
 			for _, v := range m {
@@ -544,7 +544,7 @@ func (u *Use) Equity() {
 			account := SubAccout(userid)          //子账号
 			surplus, _ := GetSurplusCount(userid) //剩余次数
 			power := []int{}                      //GetNewPower(userid)
-			powerMap := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile).PowerMap
+			powerMap := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.Config.Etcd.Key, config.Config.Etcd.Key).PowerMap
 			for k, _ := range powerMap {
 				power = append(power, k)
 			}
@@ -787,7 +787,7 @@ func (u *Use) IsAdd() {
 		  userInfo.CustomerService = config.Config.Customers
 		  return Result{Data: userInfo}*/
 		//resp := grpc.PowerCheck.Check("10000", userid, baseUserId, accountId, entId)
-		bigPower := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+		bigPower := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.Config.Etcd.Key, config.Config.Etcd.Key)
 		userInfo = &UserInfo{
 			BigMemberStatus: bigPower.Status,
 			Combo:           level_map[bigPower.Status],
@@ -858,7 +858,7 @@ func (u *Use) Aiused_history() {
 		}
 		//获取用户权限详情
 		power := []int{} //GetNewPower(userid)
-		bigPower := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+		bigPower := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.Config.Etcd.Key, config.Config.Etcd.Key)
 		for k, _ := range bigPower.PowerMap {
 			power = append(power, k)
 		}

+ 7 - 7
src/jfw/modules/publicapply/src/bidcollection/entity/entity.go

@@ -174,12 +174,12 @@ type BidInfo struct {
 }
 
 //收藏招标信息(批量收藏)|取消收藏(批量取消)
-func BidCollOrRemByIds(bidAction BidAction, userid string,baseUserId,entId,accountId int64) map[string]interface{} {
+func BidCollOrRemByIds(bidAction BidAction, userid string, baseUserId, entId, accountId int64) map[string]interface{} {
 	var i = 0
 	ok, msg := true, ""
 	insertValue := []interface{}{}
 	maxCount := config.BidCollConfig.FreeUserCollLimit
-	isPay, _ := Power(userid, baseUserId,entId,accountId)
+	isPay, _ := Power(userid, baseUserId, entId, accountId)
 	redisArr := []string{}
 	if isPay {
 		maxCount = config.BidCollConfig.PayUserCollLimit
@@ -252,7 +252,7 @@ type LabelInfo struct {
 }
 
 //新增标签(并使用)|删除标签 RV0=
-func LabelAction(labInfo *LabelInfo, userid string,baseUserId,entId,accountId int64) map[string]interface{} {
+func LabelAction(labInfo *LabelInfo, userid string, baseUserId, entId, accountId int64) map[string]interface{} {
 	ibool, ok, msg := true, true, ""
 	redisArr := []string{}
 	if labInfo.Laction == "D" && labInfo.Lids != "" {
@@ -333,7 +333,7 @@ func LabelAction(labInfo *LabelInfo, userid string,baseUserId,entId,accountId in
 				collMap[v] = true
 			}
 			maxCount := config.BidCollConfig.FreeUserCollLimit
-			isPay, _ := Power(userid, baseUserId,entId,accountId)
+			isPay, _ := Power(userid, baseUserId, entId, accountId)
 			if isPay {
 				maxCount = config.BidCollConfig.PayUserCollLimit
 			}
@@ -389,14 +389,14 @@ func LabelAction(labInfo *LabelInfo, userid string,baseUserId,entId,accountId in
 	}
 }
 
-func GetCollList(c *util.CollList, userid string,baseUserId,entId,accountId int64) map[string]interface{} {
+func GetCollList(c *util.CollList, userid string, baseUserId, entId, accountId int64) map[string]interface{} {
 	pagesize_max := config.BidCollConfig.Pagesize
 	rdata := map[string]interface{}{
 		"count":        0,
 		"haveNextPage": false,
 		"res":          []map[string]interface{}{},
 	}
-	isPay, _ := Power(userid, baseUserId,entId,accountId)
+	isPay, _ := Power(userid, baseUserId, entId, accountId)
 	if !isPay {
 		pagesize_max = config.BidCollConfig.FreePageSize
 	}
@@ -448,7 +448,7 @@ func Power(userid string, baseUserId, entId, accountId int64) (bool, map[string]
 		if resp.Member.Status > 0 {
 			isMember = true
 		}
-		if qu.IntAll(v["power_source"]) != 1 && qu.IntAll(v["status"]) == 1 {
+		if resp.Entniche.PowerSource != 1 && resp.Entniche.Status == 1 {
 			isEnt = true
 		}
 		privatedata = resp.Ent.PrivateGD

+ 40 - 0
src/jfw/modules/publicapply/src/grpc/powerCheckCenter.go

@@ -0,0 +1,40 @@
+package grpc
+
+import (
+	"bp.jydev.jianyu360.cn/BaseService/powerCheckCenter/rpc/pb"
+	"bp.jydev.jianyu360.cn/BaseService/powerCheckCenter/rpc/powercheck"
+	"context"
+	"github.com/gogf/gf/v2/frame/g"
+	"github.com/gogf/gf/v2/os/gctx"
+	"github.com/zeromicro/go-zero/core/discov"
+	"github.com/zeromicro/go-zero/zrpc"
+	"log"
+)
+
+var PowerCheck = &powerCheck{}
+
+type powerCheck struct {
+}
+
+func (p *powerCheck) Check(appid, userId string, baseUserId, accountId, entId int64) *pb.CheckResp {
+	var ctx = gctx.New()
+	client, err := zrpc.NewClient(zrpc.RpcClientConf{
+		Etcd: discov.EtcdConf{
+			Hosts: g.Cfg().MustGet(ctx, "etcd.hosts").Strings(),
+			Key:   g.Cfg().MustGet(ctx, "powercheckKey").String(),
+		},
+	})
+	if err != nil {
+		log.Println(err)
+		return nil
+	}
+	defer client.Conn().Close()
+	resp, err := powercheck.NewPowerCheck(client).Check(context.Background(), &pb.CheckReq{
+		Appid:      appid,
+		Userid:     userId,
+		BaseUserId: baseUserId,
+		AccountId:  accountId,
+		EntId:      entId,
+	})
+	return resp
+}