Răsfoiți Sursa

权限中台添加

WH01243 2 ani în urmă
părinte
comite
12073e756e
27 a modificat fișierele cu 1343 adăugiri și 1160 ștergeri
  1. 4 4
      src/jfw/modules/bigmember/src/config.yaml
  2. 81 75
      src/jfw/modules/bigmember/src/config/config.go
  3. 2 2
      src/jfw/modules/bigmember/src/entity/followEnterprise.go
  4. 3 3
      src/jfw/modules/bigmember/src/entity/followProject.go
  5. 9 6
      src/jfw/modules/bigmember/src/entity/portrait.go
  6. 5 3
      src/jfw/modules/bigmember/src/entity/trial.go
  7. 7 2
      src/jfw/modules/bigmember/src/filter/sessionfilter.go
  8. 4 2
      src/jfw/modules/bigmember/src/go.mod
  9. 5 4
      src/jfw/modules/bigmember/src/go.sum
  10. 0 40
      src/jfw/modules/bigmember/src/grpc/powerCheckCenter.go
  11. 6 2
      src/jfw/modules/bigmember/src/service/analysis/decision.go
  12. 5 1
      src/jfw/modules/bigmember/src/service/analysis/forecastproject.go
  13. 16 6
      src/jfw/modules/bigmember/src/service/analysis/potential.go
  14. 9 4
      src/jfw/modules/bigmember/src/service/analysis/util.go
  15. 7 3
      src/jfw/modules/bigmember/src/service/bidfile/bidfile.go
  16. 35 11
      src/jfw/modules/bigmember/src/service/follow/enterprise.go
  17. 43 13
      src/jfw/modules/bigmember/src/service/follow/project.go
  18. 15 11
      src/jfw/modules/bigmember/src/service/follow/projectPdf.go
  19. 57 15
      src/jfw/modules/bigmember/src/service/portrait/memberPortraitAction.go
  20. 50 12
      src/jfw/modules/bigmember/src/service/portrait/subvipPortraitAction.go
  21. 15 8
      src/jfw/modules/bigmember/src/service/push/push.go
  22. 15 6
      src/jfw/modules/bigmember/src/service/report/marketAnalysis.go
  23. 5 2
      src/jfw/modules/bigmember/src/service/trial/trial.go
  24. 814 805
      src/jfw/modules/bigmember/src/service/use/use.go
  25. 6 6
      src/jfw/modules/publicapply/src/bidcollection/entity/entity.go
  26. 124 113
      src/jfw/modules/publicapply/src/bidcollection/service/service.go
  27. 1 1
      src/jfw/modules/publicapply/src/config.yaml

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

@@ -1,4 +1,4 @@
-etcd:
-  hosts:
-  - 192.168.3.206:2379
-powercheckKey: "powercheck.rpc" #用户中台rpc
+Etcd:
+  Hosts:
+    - 127.0.0.1:2379
+  Key: powercheck.rpc

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

@@ -1,94 +1,100 @@
 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/gogf/gf/v2/frame/g"
-        "github.com/gogf/gf/v2/os/gcfg"
+	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"
 )
 
 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"`
 }
 
 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() {
-        g.Cfg().GetAdapter().(*gcfg.AdapterFile).SetFileName("config.yaml")
-        //程序配置文件
-        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)
-        }
+	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)
+	}
 }

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

@@ -27,11 +27,11 @@ type EntFollow struct {
 }
 
 // CreateEntFollowManager 企业关注相关方法
-func CreateEntFollowManager(userid string, pageFlag ...string) (*EntFollow, error) {
+func CreateEntFollowManager(userid string, baseUserId, accountId, entId int64, pageFlag ...string) (*EntFollow, error) {
 	if userid == "" {
 		return nil, errors.New("未登录")
 	}
-	bigMsg := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo)
+	bigMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
 
 	defaultPageFlag := "entFollow"
 	if len(pageFlag) > 0 {

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

@@ -6,13 +6,13 @@ import (
 	"fmt"
 	"jy/src/jfw/modules/bigmember/src/config"
 	"jy/src/jfw/modules/bigmember/src/db"
+	"jy/src/jfw/modules/bigmember/src/util"
 	"log"
 	"sort"
 	"strconv"
 	"strings"
 	"sync"
 	"time"
-	"jy/src/jfw/modules/bigmember/src/util"
 
 	qutil "app.yhyue.com/moapp/jybase/common"
 	elastic "app.yhyue.com/moapp/jybase/esv1"
@@ -22,11 +22,11 @@ import (
 )
 
 // CreateProjectFollowManager 项目关注相关方法
-func CreateProjectFollowManager(userid string, mustBuy ...bool) (*ProjectFollow, error) {
+func CreateProjectFollowManager(userid string, baseUserId, accountId, entId int64, mustBuy ...bool) (*ProjectFollow, error) {
 	if userid == "" {
 		return nil, errors.New("未登录")
 	}
-	bigMsg := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo)
+	bigMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
 
 	isBuy := bigMsg.CheckBigVipBackPower("followProject")
 	if len(mustBuy) > 0 && !isBuy {

+ 9 - 6
src/jfw/modules/bigmember/src/entity/portrait.go

@@ -3,6 +3,7 @@ package entity
 import (
 	"errors"
 	"fmt"
+	"jy/src/jfw/modules/bigmember/src/config"
 	"jy/src/jfw/modules/bigmember/src/db"
 	"log"
 	"strings"
@@ -23,11 +24,11 @@ const (
 )
 
 // CreatePortraitManager 大会员
-func CreatePortraitManager(userid string, pageFlag string) (*Portrait, bool, error, bool) {
+func CreatePortraitManager(userid string, baseUserId, accountId, entId int64, pageFlag string) (*Portrait, bool, error, bool) {
 	if userid == "" {
 		return nil, false, errors.New("未登录"), true
 	}
-	bigMsg := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo)
+	bigMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
 
 	if pageFlag == "" {
 		return nil, false, errors.New("未知请求"), true
@@ -59,14 +60,15 @@ func CreatePortraitManager(userid string, pageFlag string) (*Portrait, bool, err
  * 3.免费用户(如免费用户、老版商机管理、老版超级订阅)通过一次留资可以解锁画像权限,查看画像的所有内容。
  */
 // CreatePortraitManagerForContacts 画像通讯里权限验证
-func CreatePortraitManagerForContacts(userid string, entType int64, entName string) (*Portrait, error) {
+func CreatePortraitManagerForContacts(userid string, baseUserId, accountId, entId int64, entType int64, entName string) (*Portrait, error) {
 	if userid == "" {
 		return nil, errors.New("未登录")
 	}
 	if entName == "" {
 		return nil, errors.New("参数异常")
 	}
-	bigMsg := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo)
+	bigMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+
 	//0:采购单位;1:中标企业
 	switch entType {
 	case 0:
@@ -110,7 +112,7 @@ func CreatePortraitManagerForContacts(userid string, entType int64, entName stri
 
 //CreateSubVipPortraitManager 超级订阅权限校验
 //int -1无权限 1免费权限 2超级订阅次数&采购单位流量包 3使用体验
-func CreateSubVipPortraitManager(userid string, pageFlag, searchValue string, isWinner bool) (*Portrait, int, error, bool) {
+func CreateSubVipPortraitManager(userid string, pageFlag, searchValue string, isWinner bool, baseUserId, accountId, entId int64) (*Portrait, int, error, bool) {
 	if userid == "" {
 		return nil, -1, errors.New("未登录"), true
 	}
@@ -118,7 +120,8 @@ func CreateSubVipPortraitManager(userid string, pageFlag, searchValue string, is
 		return nil, -1, errors.New("未知请求"), true
 	}
 	if pageFlag != "entDetail" { //需要权限校验的接口
-		bigMsg := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo)
+		bigMsg := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+
 		if bigMsg.VipStatus <= 0 || bigMsg.Vip_BuySet.Upgrade != 1 { //免费用户留资体验
 			if searchValue != "" && jy.Portraitexperience(userid, searchValue, isWinner) {
 				return &Portrait{userid}, 3, nil, true

+ 5 - 3
src/jfw/modules/bigmember/src/entity/trial.go

@@ -1,13 +1,15 @@
 package entity
 
 import (
-	"jy/src/jfw/modules/bigmember/src/db"
 	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"jy/src/jfw/modules/bigmember/src/config"
+	"jy/src/jfw/modules/bigmember/src/db"
 )
 
-func GetUserTrialInfoById(userId string) map[string]interface{} {
+func GetUserTrialInfoById(userId string, baseUserId, accountId, entId int64) map[string]interface{} {
 	var res = map[string]interface{}{}
-	BigMsg := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo)
+	BigMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+
 	if BigMsg != nil {
 		//i_member_status:4 正在试用 ;i_member_trial:1是试用过;同时满足:当前试用阶段
 		//member_trial:0:未试用过;1:正在试用;-1:已试用过;

+ 7 - 2
src/jfw/modules/bigmember/src/filter/sessionfilter.go

@@ -2,9 +2,11 @@ package filter
 
 import (
 	. "app.yhyue.com/moapp/jybase/api"
+	qu "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"jy/src/jfw/modules/bigmember/src/config"
 	"jy/src/jfw/modules/bigmember/src/db"
 	"net/http"
-	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 	"regexp"
 
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
@@ -33,6 +35,9 @@ func (l *sessionfilter) Do(w http.ResponseWriter, req *http.Request) bool {
 		return true
 	}
 	userId, ok := session.Get("userId").(string)
+	baseUserId := qu.Int64All(session.Get("base_user_id"))
+	entId := qu.Int64All(session.Get("entId"))
+	accountId := qu.Int64All(session.Get("accountId"))
 	if !ok || userId == "" {
 		R.ServeJson(w, req, &Result{Error_code_1004, Error_msg_1004, nil})
 		return false
@@ -41,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(userId, db.Mysql, db.Mgo)
+	bigMeg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
 	if !bigMeg.CheckBigVipBackPower(match[1]) {
 		R.ServeJson(w, req, &Result{Error_code_1004, Error_msg_1004, nil})
 		return false

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

@@ -5,8 +5,8 @@ go 1.18
 require (
 	app.yhyue.com/moapp/esv1 v0.0.0-20220414031211-3da4123e648d
 	app.yhyue.com/moapp/jybase v0.0.0-20221229074840-790b25997170
-	app.yhyue.com/moapp/jypkg v0.0.0-20221229090523-854669eee0ff
-	bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230105092632-86c294a87b14
+	app.yhyue.com/moapp/jypkg v0.0.0-20230106055658-e5f85a4ffd9c
+	bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230106052936-bd3ab7edf7a4
 	github.com/donnie4w/go-logger v0.0.0-20170827050443-4740c51383f4
 	github.com/gogf/gf/v2 v2.0.6
 	github.com/zeromicro/go-zero v1.4.3
@@ -34,6 +34,7 @@ require (
 	github.com/go-redis/redis/v8 v8.11.5 // indirect
 	github.com/go-sql-driver/mysql v1.7.0 // indirect
 	github.com/gogo/protobuf v1.3.2 // indirect
+	github.com/golang-jwt/jwt/v4 v4.4.3 // indirect
 	github.com/golang/mock v1.6.0 // indirect
 	github.com/golang/protobuf v1.5.2 // indirect
 	github.com/golang/snappy v0.0.4 // indirect
@@ -41,6 +42,7 @@ require (
 	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/google/uuid v1.3.0 // 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

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

@@ -4,12 +4,12 @@ app.yhyue.com/moapp/jyPoints v1.1.1/go.mod h1:SvP8p5L3jGrejHiH2LXfgCg/NPlFiKBC5Y
 app.yhyue.com/moapp/jybase v0.0.0-20220427020729-974c1a148186/go.mod h1:qNRA0sHuYqcLoYoP8irpaWnW9YsXixe6obBIkwaXpD0=
 app.yhyue.com/moapp/jybase v0.0.0-20221229074840-790b25997170 h1:gjx6+x7P1Vp/++OyfuEdR3Bcjj4/HrgIaRnE1cMTP3k=
 app.yhyue.com/moapp/jybase v0.0.0-20221229074840-790b25997170/go.mod h1:efAeRPDpJ13JuNODuqtfLlKQSQgCbnUcwGPzhFU5krY=
-app.yhyue.com/moapp/jypkg v0.0.0-20221229090523-854669eee0ff h1:l4Dn9mg6+y6voFomnLcGyoIRT0dYG9bZIXh09qI2Ido=
-app.yhyue.com/moapp/jypkg v0.0.0-20221229090523-854669eee0ff/go.mod h1:R19Q6Q1AOM47lY194ZQ6qdggbjkijDufoDnJndnRrRM=
+app.yhyue.com/moapp/jypkg v0.0.0-20230106055658-e5f85a4ffd9c h1:3tmWsZPTkhmkPJ1fbDLqrklgnooC1DRNwsjxEoMYbwg=
+app.yhyue.com/moapp/jypkg v0.0.0-20230106055658-e5f85a4ffd9c/go.mod h1:7D6zNxrg+Tma3VC43TLu7XPczubl4uJavua89kaFS1Q=
 app.yhyue.com/moapp/message v0.0.0-20221202072401-d825fc65512c h1:CrcvbsXZ4aQkNikBi7FUUQZNnY8hKsNo2LLe/SqeXs8=
 app.yhyue.com/moapp/message v0.0.0-20221202072401-d825fc65512c/go.mod h1:b0zZHev3gmJao1Fo+2Z2KPVjsuLOJVvVxf+kCnu9WkA=
-bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230105092632-86c294a87b14 h1:J8i5nK8wgrXe/yG1LCqe0IJljrm0wfrYBTh6KqN5KyU=
-bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230105092632-86c294a87b14/go.mod h1:5nimT8GJh46AyfeeDeyRlDQygMlO7TRM8Pwm41Gxemc=
+bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230106052936-bd3ab7edf7a4 h1:Xv1D9avDKeaM5kQTisF/pIt8y7B7yQ/hAxuWEg75LMs=
+bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230106052936-bd3ab7edf7a4/go.mod h1:5nimT8GJh46AyfeeDeyRlDQygMlO7TRM8Pwm41Gxemc=
 cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw=
@@ -594,6 +594,7 @@ github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP
 github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
 github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
 github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
+github.com/golang-jwt/jwt/v4 v4.4.3 h1:Hxl6lhQFj4AnOX6MLrsCb/+7tCj7DxP7VA+2rDIq5AU=
 github.com/golang-jwt/jwt/v4 v4.4.3/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
 github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ=

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

@@ -1,40 +0,0 @@
-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
-}

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

@@ -4,7 +4,7 @@ package analysis
 import (
 	"encoding/json"
 	"fmt"
-	"jy/src/jfw/modules/bigmember/src/db"
+	"jy/src/jfw/modules/bigmember/src/config"
 	"jy/src/jfw/modules/bigmember/src/entity"
 	"jy/src/jfw/modules/bigmember/src/util"
 	"log"
@@ -78,9 +78,13 @@ func (this *Analysis) ProjectInfoByBW() {
 func (this *Analysis) TrialInfo() {
 	defer qutil.Catch()
 	userId, _ := this.GetSession("userId").(string)
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		//userInfo, ok := db.Mgo.FindById("user", userId, nil)
-		baseMsg := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo)
+		baseMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+
 		if baseMsg == nil {
 			return -2, nil
 		}

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

@@ -4,6 +4,7 @@ package analysis
 import (
 	"encoding/json"
 	"fmt"
+	"jy/src/jfw/modules/bigmember/src/config"
 	"jy/src/jfw/modules/bigmember/src/db"
 	"jy/src/jfw/modules/bigmember/src/util"
 
@@ -128,6 +129,9 @@ func getForecastProjectSql(scd *util.ViewCondition) string {
 func (this *Analysis) ForPContent() {
 	defer qutil.Catch()
 	userId, _ := this.GetSession("userId").(string)
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		id := this.GetString("id")     //项目预测id
 		keys := this.GetString("keys") //关键词
@@ -186,7 +190,7 @@ func (this *Analysis) ForPContent() {
 				}
 			}
 			power := []int{}
-			powerMap := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo).PowerMap
+			powerMap := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile).PowerMap
 			for k, _ := range powerMap {
 				power = append(power, k)
 			}

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

@@ -3,15 +3,15 @@ package analysis
 
 import (
 	. "app.yhyue.com/moapp/jybase/api"
+	qutil "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/redis"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"encoding/json"
+	"fmt"
 	"jy/src/jfw/modules/bigmember/src/config"
 	"jy/src/jfw/modules/bigmember/src/db"
-	"encoding/json"
 	"jy/src/jfw/modules/bigmember/src/entity"
-	"fmt"
 	"log"
-	qutil "app.yhyue.com/moapp/jybase/common"
-	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
-	"app.yhyue.com/moapp/jybase/redis"
 	"sort"
 	"strings"
 	"sync"
@@ -25,6 +25,9 @@ import (
 // 大会员首页
 func (this *Analysis) PotIndex() {
 	userId, _ := this.GetSession("userId").(string)
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	defer qutil.Catch()
 	r := func() Result {
 		if this.Method() != "POST" {
@@ -37,6 +40,9 @@ func (this *Analysis) PotIndex() {
 			json.Unmarshal(this.Body(), &ptst)
 		}
 		ptst.UserId = userId
+		ptst.BaseUserId = baseUserId
+		ptst.AccountId = accountId
+		ptst.EntId = entId
 		if !ptst.UserStatusChecked() {
 			return Result{Data: nil, Error_msg: Error_msg_1004}
 		}
@@ -126,6 +132,9 @@ func (this *Analysis) CsORRsList() {
 	}
 	if this.Method() == METHOD {
 		userId, _ := this.GetSession("userId").(string)
+		baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+		entId := qutil.Int64All(this.GetSession("entId"))
+		accountId := qutil.Int64All(this.GetSession("accountId"))
 		var entName = "" //企业名称
 		//接受前端参数
 		getRes := new(SelectC)
@@ -166,7 +175,8 @@ func (this *Analysis) CsORRsList() {
 				log.Println("大会员初始化 企业名称有误-", userId, main_userId)
 			}
 			//userInfo, ok := db.Mgo.FindById("user", main_userId, nil)
-			userInfo := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo)
+			userInfo := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+
 			if userInfo != nil {
 				var isTrial = userInfo.Status == 4
 				var c_limitcount = 5

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

@@ -1,19 +1,20 @@
 package analysis
 
 import (
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 	"bytes"
 	"crypto/hmac"
 	"crypto/sha1"
-	"jy/src/jfw/modules/bigmember/src/db"
 	"encoding/base64"
 	"encoding/json"
 	"hash"
 	"io"
+	"jy/src/jfw/modules/bigmember/src/config"
+	"jy/src/jfw/modules/bigmember/src/db"
+	"jy/src/jfw/modules/bigmember/src/util"
 	"net/url"
-	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 	"sort"
 	"strings"
-	"jy/src/jfw/modules/bigmember/src/util"
 )
 
 type SignStr struct {
@@ -35,6 +36,9 @@ type SelectC struct {
 	IsIndex        bool                   //是否首页查询
 	EntName        string                 //我的企业
 	UserId         string
+	BaseUserId     int64
+	EntId          int64
+	AccountId      int64
 }
 
 // UserStatusChecked 查看权限
@@ -43,7 +47,8 @@ func (this *SelectC) UserStatusChecked() bool {
 	if this.PCOR == "R" {
 		serviceId = 8
 	}
-	userPower := jy.GetBigVipUserBaseMsg(this.UserId, db.Mysql, db.Mgo)
+	userPower := jy.GetBigVipUserBaseMsg("10000", this.UserId, this.BaseUserId, this.AccountId, this.EntId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+
 	return userPower.Status > 0 && userPower.PowerMap[serviceId]
 }
 

+ 7 - 3
src/jfw/modules/bigmember/src/service/bidfile/bidfile.go

@@ -1,6 +1,7 @@
 package bidfile
 
 import (
+	"jy/src/jfw/modules/bigmember/src/config"
 	"jy/src/jfw/modules/bigmember/src/db"
 	"jy/src/jfw/modules/bigmember/src/util"
 	"time"
@@ -22,6 +23,9 @@ type Bidfile struct {
 func (b *Bidfile) History() {
 	r := func() Result {
 		userid := qu.ObjToString(b.GetSession("userId"))
+		baseUserId := qu.Int64All(b.GetSession("base_user_id"))
+		entId := qu.Int64All(b.GetSession("entId"))
+		accountId := qu.Int64All(b.GetSession("accountId"))
 		if userid == "" {
 			return Result{Data: nil, Error_msg: "未登录"}
 		}
@@ -33,11 +37,11 @@ func (b *Bidfile) History() {
 		}
 		//获取用户权限详情
 		power := []int{}
-		bigPower := jy.GetBigVipUserBaseMsg(mainid, db.Mysql, db.Mgo)
+		bigPower := jy.GetBigVipUserBaseMsg("10000", userid, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
 		for k, _ := range bigPower.PowerMap {
 			power = append(power, k)
 		}
-		res := db.Mysql.SelectBySql(`select explain_time,user_id from bidfile_history 
+		res := db.Mysql.SelectBySql(`select explain_time,user_id from bidfile_history
 		where main_id=?
 		and is_delete =0 and explain_time is not null order by explain_time desc`, userid)
 		userPhoneMap := map[string]string{}
@@ -60,7 +64,7 @@ func (b *Bidfile) History() {
 		}
 		bidfile_endtime := "2021年11月15日" //目前招标文件解读到11/15到期
 		bed := GetTime("2006年01月02日", bidfile_endtime)
-		d := db.Mysql.SelectBySql(`SELECT l_endtime AS endtime FROM bigmember_service_user 
+		d := db.Mysql.SelectBySql(`SELECT l_endtime AS endtime FROM bigmember_service_user
 				WHERE s_serviceid =11 AND s_userid =? AND i_status = 0`, mainid)
 		if d != nil && len(*d) > 0 {
 			endtime := qu.ObjToString((*d)[0]["endtime"])

+ 35 - 11
src/jfw/modules/bigmember/src/service/follow/enterprise.go

@@ -2,12 +2,12 @@ package follow
 
 import (
 	. "app.yhyue.com/moapp/jybase/api"
-	"jy/src/jfw/modules/bigmember/src/entity"
+	qutil "app.yhyue.com/moapp/jybase/common"
 	"errors"
 	"fmt"
-	"log"
-	qutil "app.yhyue.com/moapp/jybase/common"
+	"jy/src/jfw/modules/bigmember/src/entity"
 	"jy/src/jfw/modules/bigmember/src/util"
+	"log"
 
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
 )
@@ -28,13 +28,16 @@ type FollowEnt struct {
 // Association 中标企业联想
 func (this *FollowEnt) Association() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		entName := this.GetString("entName")
 		returnData := []map[string]interface{}{}
 		if entName == "" {
 			return returnData, nil
 		}
-		followEntManager, err := entity.CreateEntFollowManager(userId)
+		followEntManager, err := entity.CreateEntFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}
@@ -53,8 +56,11 @@ func (this *FollowEnt) Association() {
 // FollowCheck 企业是否关注
 func (this *FollowEnt) FollowCheck() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		followEntManager, err := entity.CreateEntFollowManager(userId)
+		followEntManager, err := entity.CreateEntFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}
@@ -76,8 +82,11 @@ func (this *FollowEnt) FollowCheck() {
 // List 关注中标企业列表
 func (this *FollowEnt) List() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		followEntManager, err := entity.CreateEntFollowManager(userId)
+		followEntManager, err := entity.CreateEntFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}
@@ -109,8 +118,11 @@ func (this *FollowEnt) List() {
 
 func (this *FollowEnt) PcSimpleFollowList() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		followEntManager, err := entity.CreateEntFollowManager(userId)
+		followEntManager, err := entity.CreateEntFollowManager(userId, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}
@@ -133,12 +145,15 @@ func (this *FollowEnt) PcSimpleFollowList() {
 // AddFollow 添加关注企业
 func (this *FollowEnt) AddFollow() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		entId := this.GetString("entId")
 		if entId == "" {
 			return nil, errors.New("企业为空")
 		}
-		followEntManager, err := entity.CreateEntFollowManager(userId)
+		followEntManager, err := entity.CreateEntFollowManager(userId, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}
@@ -157,9 +172,12 @@ func (this *FollowEnt) AddFollow() {
 // DelFollow 取关企业
 func (this *FollowEnt) DelFollow() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		entId := this.GetString("entId")
-		followEntManager, err := entity.CreateEntFollowManager(userId)
+		followEntManager, err := entity.CreateEntFollowManager(userId, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}
@@ -178,8 +196,11 @@ func (this *FollowEnt) DelFollow() {
 // EntChangeList 企业基本信息变更
 func (this *FollowEnt) EntChangeList() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		cepm, err := entity.CreateEntFollowManager(userId, "entChange")
+		cepm, err := entity.CreateEntFollowManager(userId, baseUserId, accountId, entId, "entChange")
 
 		if err != nil {
 			return nil, err
@@ -205,8 +226,11 @@ func (this *FollowEnt) EntChangeList() {
 // ChangeGroup 更换关注企业分组
 func (this *FollowEnt) ChangeGroup() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		cepm, err := entity.CreateEntFollowManager(userId)
+		cepm, err := entity.CreateEntFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}

+ 43 - 13
src/jfw/modules/bigmember/src/service/follow/project.go

@@ -2,13 +2,13 @@ package follow
 
 import (
 	. "app.yhyue.com/moapp/jybase/api"
-	"jy/src/jfw/modules/bigmember/src/entity"
+	qutil "app.yhyue.com/moapp/jybase/common"
 	"errors"
 	"fmt"
+	"jy/src/jfw/modules/bigmember/src/entity"
+	"jy/src/jfw/modules/bigmember/src/util"
 	"log"
-	qutil "app.yhyue.com/moapp/jybase/common"
 	"strings"
-	"jy/src/jfw/modules/bigmember/src/util"
 
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
 )
@@ -33,8 +33,11 @@ type FollowProject struct {
 // AddProject 项目关注
 func (this *FollowProject) AddProject() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		projectManager, err := entity.CreateProjectFollowManager(userId)
+		projectManager, err := entity.CreateProjectFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}
@@ -58,8 +61,11 @@ func (this *FollowProject) AddProject() {
 // CancelProject 取消关注
 func (this *FollowProject) CancelProject() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		projectManager, err := entity.CreateProjectFollowManager(userId)
+		projectManager, err := entity.CreateProjectFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}
@@ -83,8 +89,11 @@ func (this *FollowProject) CancelProject() {
 // FollowCheck 是否关注项目
 func (this *FollowProject) FollowCheck() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		projectManager, err := entity.CreateProjectFollowManager(userId)
+		projectManager, err := entity.CreateProjectFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}
@@ -110,11 +119,14 @@ func (this *FollowProject) FollowList() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
 	entUserId := qutil.IntAll(this.GetSession("entUserId"))
 	isClaim := qutil.IntAll(this.GetString("isClaim"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	name := this.GetString("name")
 	area := this.GetString("area")
 	areaAll := strings.Split(area, ",")
 	rData, errMsg := func() (interface{}, error) {
-		projectManager, err := entity.CreateProjectFollowManager(userId)
+		projectManager, err := entity.CreateProjectFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}
@@ -173,8 +185,11 @@ func IsArea(areaAll []string, area string) bool {
 // FollowDetail 关注项目详情页&设置
 func (this *FollowProject) FollowDetail() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		projectManager, err := entity.CreateProjectFollowManager(userId)
+		projectManager, err := entity.CreateProjectFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}
@@ -265,8 +280,11 @@ func mergeFollowDetail(followInfo, projectInfo map[string]interface{}, sid strin
 // FollowRead 项目信息已读
 func (this *FollowProject) FollowRead() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		projectManager, err := entity.CreateProjectFollowManager(userId)
+		projectManager, err := entity.CreateProjectFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}
@@ -290,8 +308,11 @@ func (this *FollowProject) FollowRead() {
 // Remove30Day 批量删除30天没有更新的项目
 func (this *FollowProject) Remove30Day() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		projectManager, err := entity.CreateProjectFollowManager(userId)
+		projectManager, err := entity.CreateProjectFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}
@@ -313,8 +334,11 @@ func (this *FollowProject) Remove30Day() {
 // AddTime 添加提醒时间&开标时间
 func (this *FollowProject) AddTime() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		projectManager, err := entity.CreateProjectFollowManager(userId)
+		projectManager, err := entity.CreateProjectFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}
@@ -339,8 +363,11 @@ func (this *FollowProject) AddTime() {
 // RemindSwitch 项目提醒开关
 func (this *FollowProject) RemindSwitch() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		projectManager, err := entity.CreateProjectFollowManager(userId)
+		projectManager, err := entity.CreateProjectFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}
@@ -363,9 +390,12 @@ func (this *FollowProject) RemindSwitch() {
 // ScreenArea 获取已关注的项目地区
 func (this *FollowProject) ScreenArea() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	entUserId := qutil.IntAll(this.GetSession("entUserId"))
 	rData, errMsg := func() (interface{}, error) {
-		projectManager, err := entity.CreateProjectFollowManager(userId)
+		projectManager, err := entity.CreateProjectFollowManager(userId, baseUserId, accountId, entId)
 		if err != nil {
 			return nil, err
 		}

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

@@ -2,22 +2,22 @@ package follow
 
 import (
 	. "app.yhyue.com/moapp/jybase/api"
-	"jy/src/jfw/modules/bigmember/src/config"
-	"jy/src/jfw/modules/bigmember/src/db"
+	qutil "app.yhyue.com/moapp/jybase/common"
+	elastic "app.yhyue.com/moapp/jybase/esv1"
+	"app.yhyue.com/moapp/jybase/mongodb"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 	"encoding/json"
 	"fmt"
 	"io/ioutil"
+	"jy/src/jfw/modules/bigmember/src/config"
+	"jy/src/jfw/modules/bigmember/src/db"
+	"jy/src/jfw/modules/bigmember/src/util"
 	"log"
-	"app.yhyue.com/moapp/jybase/mongodb"
 	"net"
 	"net/http"
-	qutil "app.yhyue.com/moapp/jybase/common"
-	elastic "app.yhyue.com/moapp/jybase/esv1"
-	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 	"regexp"
 	"strings"
 	"time"
-	"jy/src/jfw/modules/bigmember/src/util"
 )
 
 var ClientPool chan *http.Client
@@ -54,13 +54,16 @@ func NewClient() *http.Client {
 //GetPdfFile 下载项目内容pdf文件
 func (this *FollowProject) GetPdfFile() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		sid := util.DecodeId(this.GetString("sid")) //获取信息id
 		if sid == "" {
 			return nil, fmt.Errorf("未知项目")
 		}
 		//校验是否为付费用户
-		if !checkPay(userId) {
+		if !checkPay(userId, baseUserId, accountId, entId) {
 			return "", fmt.Errorf("非法请求")
 		}
 		pid, lastTime, err := getProjectSimpleData(sid)
@@ -121,8 +124,9 @@ func (this *FollowProject) GetPdfDetail() {
 }
 
 //校验是否是付费用户
-func checkPay(userId string) bool {
-	bigPower := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo)
+func checkPay(userId string, baseUserId, accountId, entId int64) bool {
+	bigPower := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+
 	if bigPower.Status > 0 || bigPower.VipStatus > 0 {
 		return true
 	}
@@ -141,7 +145,7 @@ func checkPay(userId string) bool {
 	}
 	res := db.Mysql.SelectBySql(`SELECT i.name,i.phone,i.status,i.auth_status,u.power FROM entniche_user u LEFT JOIN entniche_info i
 			ON u.ent_id=i.id
-			WHERE u.phone=? 
+			WHERE u.phone=?
 			ORDER BY  i.status DESC,i.auth_status DESC, CASE WHEN i.phone=? THEN 0  ELSE 1 END  ASC`, phone, phone)
 	if res != nil && len(*res) > 0 {
 		for _, v := range *res {

+ 57 - 15
src/jfw/modules/bigmember/src/service/portrait/memberPortraitAction.go

@@ -39,8 +39,11 @@ type EntPortrait struct {
 //EntDetail 企业基本信息
 func (this *EntPortrait) EntDetail() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		cepm, _, err, _ := entity.CreatePortraitManager(userId, "entDetail")
+		cepm, _, err, _ := entity.CreatePortraitManager(userId, baseUserId, accountId, entId, "entDetail")
 		if err != nil {
 			return nil, err
 		}
@@ -60,8 +63,11 @@ func (this *EntPortrait) EntDetail() {
 //WinnerContacts 中标企业历史联系人
 func (this *EntPortrait) WinnerContacts() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		cepm, hasPower, err, _ := entity.CreatePortraitManager(userId, "entPortrait")
+		cepm, hasPower, err, _ := entity.CreatePortraitManager(userId, baseUserId, accountId, entId, "entPortrait")
 		if err != nil {
 			return nil, err
 		}
@@ -86,19 +92,22 @@ func (this *EntPortrait) WinnerContacts() {
 // WinnerSelects 企业画像可供筛选的条件
 func (this *EntPortrait) WinnerSelects() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		entId := util.DecodeId(this.GetString("entId"))
 		if entId == "" {
 			return nil, fmt.Errorf("企业参数异常")
 		}
-		_, _, err, _ := entity.CreatePortraitManager(userId, "entNewMsg")
+		_, _, err, _ := entity.CreatePortraitManager(userId, baseUserId, accountId, entid, "entNewMsg")
 		if err != nil {
 			return nil, err
 		}
 		//if !hasPower {
 		//	return nil, fmt.Errorf("非法请求")
 		//}
-		pwp := &entity.PortraitScreen{Ent: entId}
+		pwp := &entity.PortraitScreen{Ent: qutil.InterfaceToStr(entId)}
 		return pwp.GetProjectSelectItems(true)
 	}()
 	if errMsg != nil {
@@ -110,12 +119,15 @@ func (this *EntPortrait) WinnerSelects() {
 //WinnerNewMsg 企业画像-最新项目动态
 func (this *EntPortrait) WinnerNewMsg() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		entId := util.DecodeId(this.GetString("entId"))
 		if entId == "" {
 			return nil, fmt.Errorf("企业参数异常")
 		}
-		cepm, hasPower, err, _ := entity.CreatePortraitManager(userId, "entNewMsg")
+		cepm, hasPower, err, _ := entity.CreatePortraitManager(userId, baseUserId, accountId, entid, "entNewMsg")
 		if err != nil {
 			return nil, err
 		}
@@ -156,12 +168,15 @@ func (this *EntPortrait) WinnerNewMsg() {
 //WinnerNewMsgExport 企业画像-最新项目动态
 func (this *EntPortrait) WinnerNewMsgExport() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		entId := util.DecodeId(this.GetString("entId"))
 		if entId == "" {
 			return nil, fmt.Errorf("企业参数异常")
 		}
-		cepm, hasPower, err, free := entity.CreatePortraitManager(userId, "entNewMsg")
+		cepm, hasPower, err, free := entity.CreatePortraitManager(userId, baseUserId, accountId, entid, "entNewMsg")
 		if err != nil {
 			return nil, err
 		}
@@ -207,8 +222,11 @@ func (this *EntPortrait) WinnerNewMsgExport() {
 //WinnerPortrait 企业画像-画像数据查询
 func (this *EntPortrait) WinnerPortrait() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		cepm, hasPower, err, _ := entity.CreatePortraitManager(userId, "entPortrait")
+		cepm, hasPower, err, _ := entity.CreatePortraitManager(userId, baseUserId, accountId, entid, "entPortrait")
 		if err != nil {
 			return nil, err
 		}
@@ -237,8 +255,11 @@ func (this *EntPortrait) WinnerPortrait() {
 //WinnerMiniPortrait 三级页中标单位引流数据展示(免费)
 func (this *EntPortrait) WinnerMiniPortrait() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		cepm, _, err, _ := entity.CreatePortraitManager(userId, "entPortrait")
+		cepm, _, err, _ := entity.CreatePortraitManager(userId, baseUserId, accountId, entid, "entPortrait")
 		if err != nil {
 			return nil, err
 		}
@@ -271,12 +292,15 @@ func (this *EntPortrait) WinnerMiniPortrait() {
 //dev.6.2.1免费用户可筛选画像
 func (this *EntPortrait) BuyerSelects() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		buyer := this.GetString("buyer")
 		if buyer == "" {
 			return nil, fmt.Errorf("企业参数异常")
 		}
-		_, _, err, _ := entity.CreatePortraitManager(userId, "buyerPortrait")
+		_, _, err, _ := entity.CreatePortraitManager(userId, baseUserId, accountId, entid, "buyerPortrait")
 		if err != nil {
 			return nil, err
 		}
@@ -292,8 +316,11 @@ func (this *EntPortrait) BuyerSelects() {
 //BuyerNewMsg 采购单位画像-最新招标动态(免费用户仅可查看3条记录,付费50条)
 func (this *EntPortrait) BuyerNewMsg() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		cepm, hasPower, err, _ := entity.CreatePortraitManager(userId, "buyerPortrait")
+		cepm, hasPower, err, _ := entity.CreatePortraitManager(userId, baseUserId, accountId, entid, "buyerPortrait")
 		if err != nil {
 			return nil, err
 		}
@@ -333,8 +360,11 @@ func (this *EntPortrait) BuyerNewMsg() {
 
 func (this *EntPortrait) BuyerNewMsgExport() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		cepm, hasPower, err, free := entity.CreatePortraitManager(userId, "buyerPortrait")
+		cepm, hasPower, err, free := entity.CreatePortraitManager(userId, baseUserId, accountId, entid, "buyerPortrait")
 		if err != nil {
 			return nil, err
 		}
@@ -378,8 +408,11 @@ func (this *EntPortrait) BuyerNewMsgExport() {
 //BuyerContacts 采购单位联系人(必须开通会员)
 func (this *EntPortrait) BuyerContacts() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		cepm, hasPower, err, _ := entity.CreatePortraitManager(userId, "buyerPortrait")
+		cepm, hasPower, err, _ := entity.CreatePortraitManager(userId, baseUserId, accountId, entid, "buyerPortrait")
 		if err != nil {
 			return nil, err
 		}
@@ -404,8 +437,11 @@ func (this *EntPortrait) BuyerContacts() {
 //BuyerPortrait 采购单位画像-数据(免费用户可查看基本信息、项目统计、合作企业资本、年龄及地区分布)
 func (this *EntPortrait) BuyerPortrait() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		cepm, hasPower, err, _ := entity.CreatePortraitManager(userId, "buyerPortrait")
+		cepm, hasPower, err, _ := entity.CreatePortraitManager(userId, baseUserId, accountId, entid, "buyerPortrait")
 		if err != nil {
 			return nil, err
 		}
@@ -435,8 +471,11 @@ func (this *EntPortrait) BuyerPortrait() {
 //BuyerMiniPortrait 三级页采购单位引流数据展示(免费)
 func (this *EntPortrait) BuyerMiniPortrait() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		cepm, _, err, _ := entity.CreatePortraitManager(userId, "buyerPortrait")
+		cepm, _, err, _ := entity.CreatePortraitManager(userId, baseUserId, accountId, entid, "buyerPortrait")
 		if err != nil {
 			return nil, err
 		}
@@ -476,11 +515,14 @@ func (this *EntPortrait) BuyerMiniPortrait() {
 // PortraitContacts 画像通讯录
 func (this *EntPortrait) PortraitContacts() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		entType, _ := this.GetInt("entType")
 		entName := this.GetString("entName")
 		// 画像通讯里访问权限
-		cepm, err := entity.CreatePortraitManagerForContacts(userId, entType, entName)
+		cepm, err := entity.CreatePortraitManagerForContacts(userId, baseUserId, accountId, entid, entType, entName)
 
 		if err != nil {
 			return nil, err

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

@@ -3,6 +3,7 @@ package portrait
 import (
 	"errors"
 	"fmt"
+	"jy/src/jfw/modules/bigmember/src/config"
 	"jy/src/jfw/modules/bigmember/src/db"
 	"jy/src/jfw/modules/bigmember/src/entity"
 	"jy/src/jfw/modules/bigmember/src/util"
@@ -40,12 +41,15 @@ type SubVipPortrait struct {
 //SubVipEntDetail 超级订阅升级版查询基本信息
 func (this *SubVipPortrait) SubVipEntDetail() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		entId := util.DecodeId(this.GetString("entId"))
 		if entId == "" {
 			return nil, fmt.Errorf("参数异常")
 		}
-		cepm, _, err, _ := entity.CreateSubVipPortraitManager(userId, "entDetail", entId, true)
+		cepm, _, err, _ := entity.CreateSubVipPortraitManager(userId, "entDetail", entId, true, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}
@@ -64,12 +68,15 @@ func (this *SubVipPortrait) SubVipEntDetail() {
 //SubVipWinnerNewMsg 超级订阅升级版查看最新中标动态
 func (this *SubVipPortrait) SubVipWinnerNewMsg() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		entId := util.DecodeId(this.GetString("entId"))
 		if entId == "" {
 			return nil, fmt.Errorf("参数异常")
 		}
-		cepm, power, err, _ := entity.CreateSubVipPortraitManager(userId, "entNewMsg", entId, true)
+		cepm, power, err, _ := entity.CreateSubVipPortraitManager(userId, "entNewMsg", entId, true, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}
@@ -111,12 +118,15 @@ func (this *SubVipPortrait) SubVipWinnerNewMsg() {
 //WinnerNewMsgExport 超级订阅升级版查看最新中标动态数据导出
 func (this *SubVipPortrait) WinnerNewMsgExport() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		entId := util.DecodeId(this.GetString("entId"))
 		if entId == "" {
 			return nil, fmt.Errorf("参数异常")
 		}
-		cepm, power, err, free := entity.CreateSubVipPortraitManager(userId, "entNewMsg", entId, true)
+		cepm, power, err, free := entity.CreateSubVipPortraitManager(userId, "entNewMsg", entId, true, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}
@@ -162,12 +172,15 @@ func (this *SubVipPortrait) WinnerNewMsgExport() {
 //SubVipNewMsgSelects 获取画像可筛选项
 func (this *SubVipPortrait) SubVipNewMsgSelects() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		entId := util.DecodeId(this.GetString("entId"))
 		if entId == "" {
 			return nil, fmt.Errorf("参数异常")
 		}
-		_, _, err, _ := entity.CreateSubVipPortraitManager(userId, "entNewMsg", entId, true)
+		_, _, err, _ := entity.CreateSubVipPortraitManager(userId, "entNewMsg", entId, true, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}
@@ -183,12 +196,15 @@ func (this *SubVipPortrait) SubVipNewMsgSelects() {
 //SubVipPortrait 超级订阅升级版查看企业画像
 func (this *SubVipPortrait) SubVipPortrait() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		entId := util.DecodeId(this.GetString("entId"))
 		if entId == "" {
 			return nil, fmt.Errorf("参数异常")
 		}
-		cepm, power, err, _ := entity.CreateSubVipPortraitManager(userId, "entPortrait", entId, true)
+		cepm, power, err, _ := entity.CreateSubVipPortraitManager(userId, "entPortrait", entId, true, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}
@@ -216,8 +232,12 @@ func (this *SubVipPortrait) SubVipPortrait() {
 //PortraitUsage 超级订阅升级版画像浏览量查询
 func (this *SubVipPortrait) PortraitUsage() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		bigMsg := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo)
+		bigMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
+
 		if bigMsg.VipStatus <= 0 && bigMsg.Vip_BuySet.Upgrade != 1 {
 			return nil, fmt.Errorf("非法请求")
 		}
@@ -249,6 +269,9 @@ func (this *SubVipPortrait) PortraitUsage() {
 //PortraitRecord 超级订阅升级版画像查看记录
 func (this *SubVipPortrait) PortraitRecord() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		year, _ := this.GetInteger("year")
 		month, _ := this.GetInteger("month")
@@ -261,7 +284,7 @@ func (this *SubVipPortrait) PortraitRecord() {
 		if pageSize < 1 || pageSize > 50 {
 			pageSize = 50
 		}
-		bigMsg := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo)
+		bigMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
 		if bigMsg.VipStatus <= 0 && bigMsg.Vip_BuySet.Upgrade != 1 {
 			return nil, fmt.Errorf("非法请求")
 		}
@@ -305,12 +328,15 @@ func (this *SubVipPortrait) PortraitRecord() {
 //BuyerSelects 超级订阅筛选画像
 func (this *SubVipPortrait) BuyerSelects() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		buyer := this.GetString("buyer")
 		if buyer == "" {
 			return nil, fmt.Errorf("参数异常")
 		}
-		_, _, err, _ := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyer, false)
+		_, _, err, _ := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyer, false, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}
@@ -326,6 +352,9 @@ func (this *SubVipPortrait) BuyerSelects() {
 //BuyerNewMsg 超级订阅采购单位画像动态
 func (this *SubVipPortrait) BuyerNewMsg() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		buyer := this.GetString("buyer")
 		if buyer == "" {
@@ -333,7 +362,7 @@ func (this *SubVipPortrait) BuyerNewMsg() {
 		}
 		pageNum, _ := this.GetInteger("pageNum")
 		pageSize, _ := this.GetInteger("pageSize")
-		cepm, power, err, _ := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyer, false)
+		cepm, power, err, _ := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyer, false, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}
@@ -369,12 +398,15 @@ func (this *SubVipPortrait) BuyerNewMsg() {
 //BuyerNewMsgExport 超级订阅采购单位画像动态数据导出
 func (this *SubVipPortrait) BuyerNewMsgExport() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		buyer := this.GetString("buyer")
 		if buyer == "" {
 			return nil, fmt.Errorf("参数异常")
 		}
-		cepm, power, err, free := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyer, false)
+		cepm, power, err, free := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyer, false, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}
@@ -416,12 +448,15 @@ func (this *SubVipPortrait) BuyerNewMsgExport() {
 //BuyerContacts 超级订阅采购单位联系人
 func (this *SubVipPortrait) BuyerContacts() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		buyerName := this.GetString("buyer")
 		if buyerName == "" {
 			return nil, fmt.Errorf("企业参数异常")
 		}
-		cepm, power, err, _ := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyerName, false)
+		cepm, power, err, _ := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyerName, false, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}
@@ -445,12 +480,15 @@ func (this *SubVipPortrait) BuyerContacts() {
 //BuyerPortrait 超级订阅采购单位画像-数据
 func (this *SubVipPortrait) BuyerPortrait() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entid := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
 		buyerName := this.GetString("buyer")
 		if buyerName == "" {
 			return nil, fmt.Errorf("参数异常")
 		}
-		cepm, power, err, _ := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyerName, false)
+		cepm, power, err, _ := entity.CreateSubVipPortraitManager(userId, "buyerPortrait", buyerName, false, baseUserId, accountId, entid)
 		if err != nil {
 			return nil, err
 		}

+ 15 - 8
src/jfw/modules/bigmember/src/service/push/push.go

@@ -2,11 +2,12 @@ package push
 
 import (
 	. "app.yhyue.com/moapp/jybase/api"
-	. "jy/src/jfw/modules/bigmember/src/db"
-	"encoding/json"
-	"log"
 	util "app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"encoding/json"
+	"jy/src/jfw/modules/bigmember/src/config"
+	. "jy/src/jfw/modules/bigmember/src/db"
+	"log"
 	"time"
 
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
@@ -37,6 +38,9 @@ type pushSet struct {
 //4.6.0修改 只把有权益的存入map返给前端, k:权益 v:是否开启
 func (a *Action) Items() {
 	userId, _ := a.GetSession("userId").(string)
+	baseUserId := util.Int64All(a.GetSession("base_user_id"))
+	entId := util.Int64All(a.GetSession("entId"))
+	accountId := util.Int64All(a.GetSession("accountId"))
 	user, _ := Mgo.FindById("user", userId, `{"i_member_status":1,"i_vip_status":1,"s_phone":1,"s_m_phone":1,"o_member_jy":1}`)
 	s_phone, _ := (*user)["s_phone"].(string)
 	if s_phone == "" {
@@ -52,8 +56,8 @@ func (a *Action) Items() {
 	}
 	if member_status > 0 {
 		o_member_jy, _ := (*user)["o_member_jy"].(map[string]interface{})
-		data["member_subscribe"] = OpenStatus(o_member_jy, "member_subscribe", userId) //大会员订阅
-		delete(data, "free_subscribe")                                                 //有大会员订阅没有免费订阅
+		data["member_subscribe"] = OpenStatus(o_member_jy, "member_subscribe", userId, baseUserId, accountId, entId) //大会员订阅
+		delete(data, "free_subscribe")                                                                               //有大会员订阅没有免费订阅
 	}
 	if member_status <= 0 && vip_status <= 0 {
 		data["follow_ent"] = true     //企业关注
@@ -72,6 +76,9 @@ func (a *Action) Items() {
 }
 func (a *Action) Detail() {
 	userId, _ := a.GetSession("userId").(string)
+	baseUserId := util.Int64All(a.GetSession("base_user_id"))
+	entId := util.Int64All(a.GetSession("entId"))
+	accountId := util.Int64All(a.GetSession("accountId"))
 	if !R.CheckReqParam(a.ResponseWriter, a.Request, "item") {
 		return
 	}
@@ -95,7 +102,7 @@ func (a *Action) Detail() {
 			"wxpush":         util.IntAll(o_member_jy["i_wxpush"]),
 		}
 		power := []int{}
-		BigMsg := jy.GetBigVipUserBaseMsg(userId, Mysql, Mgo)
+		BigMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
 		for k, _ := range BigMsg.PowerMap {
 			power = append(power, k)
 		}
@@ -387,7 +394,7 @@ func (a *Action) Update() {
 }
 
 //判断按钮是否全部开启
-func OpenStatus(ojy map[string]interface{}, types, userId string) bool {
+func OpenStatus(ojy map[string]interface{}, types, userId string, baseUserId, accountId, entId int64) bool {
 	push, data := M{}, M{}
 	pushStatus, subscribe := false, false
 	switch types {
@@ -402,7 +409,7 @@ func OpenStatus(ojy map[string]interface{}, types, userId string) bool {
 			"follow_ent":     util.IntAllDef(ojy["i_follow_ent"], 1),
 		}
 		power := []int{}
-		BigMsg := jy.GetBigVipUserBaseMsg(userId, Mysql, Mgo)
+		BigMsg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
 		for k, _ := range BigMsg.PowerMap {
 			power = append(power, k)
 		}

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

@@ -5,9 +5,9 @@ import (
 	"jy/src/jfw/modules/bigmember/src/config"
 	"jy/src/jfw/modules/bigmember/src/db"
 	"jy/src/jfw/modules/bigmember/src/entity/marketAnalysis"
+	"jy/src/jfw/modules/bigmember/src/util"
 	"log"
 	"time"
-	"jy/src/jfw/modules/bigmember/src/util"
 
 	. "app.yhyue.com/moapp/jybase/api"
 	qutil "app.yhyue.com/moapp/jybase/common"
@@ -25,12 +25,12 @@ type MarketAnalysis struct {
 }
 
 // checkPower 权限校验
-func checkPower(userId string) (string, error) {
+func checkPower(userId string, baseUserId, accountId, entId int64) (string, error) {
 	if userId == "" {
 		return "", fmt.Errorf("未登录")
 	}
 	//仅购买《周报/月报/定制化市场分析报告》的大会员有权限
-	bigMeg := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo)
+	bigMeg := jy.GetBigVipUserBaseMsg("10000", userId, baseUserId, accountId, entId, config.EtcConfig.Host, config.EtcConfig.KeyFile)
 	//if bigMeg.Status <= 0 || !bigMeg.CheckBigVipBackPower("report") {
 	//	return "", fmt.Errorf("非法请求")
 	//}
@@ -40,8 +40,11 @@ func checkPower(userId string) (string, error) {
 // DoAnalysis 开始分析报告
 func (this *MarketAnalysis) DoAnalysis() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		pid, powerErr := checkPower(userId)
+		pid, powerErr := checkPower(userId, baseUserId, accountId, entId)
 		if powerErr != nil {
 			return nil, powerErr
 		}
@@ -73,8 +76,11 @@ func (this *MarketAnalysis) DoAnalysis() {
 // GetAnalysisResult 获取分析结果
 func (this *MarketAnalysis) GetAnalysisResult() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		pid, powerErr := checkPower(userId)
+		pid, powerErr := checkPower(userId, baseUserId, accountId, entId)
 		if powerErr != nil {
 			return nil, powerErr
 		}
@@ -103,8 +109,11 @@ func (this *MarketAnalysis) GetAnalysisResult() {
 // AnalysisHistory 分析报告历史
 func (this *MarketAnalysis) AnalysisHistory() {
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		pid, powerErr := checkPower(userId)
+		pid, powerErr := checkPower(userId, baseUserId, accountId, entId)
 		if powerErr != nil {
 			return nil, powerErr
 		}

+ 5 - 2
src/jfw/modules/bigmember/src/service/trial/trial.go

@@ -2,9 +2,9 @@ package trial
 
 import (
 	. "app.yhyue.com/moapp/jybase/api"
+	qutil "app.yhyue.com/moapp/jybase/common"
 	"jy/src/jfw/modules/bigmember/src/entity"
 	"log"
-	qutil "app.yhyue.com/moapp/jybase/common"
 
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
 )
@@ -17,8 +17,11 @@ type Trial struct {
 func (this *Trial) UserInfo() {
 	defer qutil.Catch()
 	userId := qutil.ObjToString(this.GetSession("userId"))
+	baseUserId := qutil.Int64All(this.GetSession("base_user_id"))
+	entId := qutil.Int64All(this.GetSession("entId"))
+	accountId := qutil.Int64All(this.GetSession("accountId"))
 	rData, errMsg := func() (interface{}, error) {
-		info := entity.GetUserTrialInfoById(userId)
+		info := entity.GetUserTrialInfoById(userId, baseUserId, accountId, entId)
 		return info, nil
 	}()
 	if errMsg != nil {

Fișier diff suprimat deoarece este prea mare
+ 814 - 805
src/jfw/modules/bigmember/src/service/use/use.go


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

@@ -174,12 +174,12 @@ type BidInfo struct {
 }
 
 //收藏招标信息(批量收藏)|取消收藏(批量取消)
-func BidCollOrRemByIds(bidAction BidAction, userid string) 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, 0)
+	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) 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) map[string]interface{} {
 				collMap[v] = true
 			}
 			maxCount := config.BidCollConfig.FreeUserCollLimit
-			isPay, _ := Power(userid, 0)
+			isPay, _ := Power(userid, baseUserId,entId,accountId)
 			if isPay {
 				maxCount = config.BidCollConfig.PayUserCollLimit
 			}
@@ -389,14 +389,14 @@ func LabelAction(labInfo *LabelInfo, userid string) map[string]interface{} {
 	}
 }
 
-func GetCollList(c *util.CollList, userid string) 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, 0)
+	isPay, _ := Power(userid, baseUserId,entId,accountId)
 	if !isPay {
 		pagesize_max = config.BidCollConfig.FreePageSize
 	}

+ 124 - 113
src/jfw/modules/publicapply/src/bidcollection/service/service.go

@@ -1,146 +1,157 @@
 package service
 
 import (
-	"encoding/json"
-	"jy/src/jfw/modules/publicapply/src/bidcollection/entity"
-	"jy/src/jfw/modules/publicapply/src/config"
-	"jy/src/jfw/modules/publicapply/src/util"
+        "encoding/json"
+        "jy/src/jfw/modules/publicapply/src/bidcollection/entity"
+        "jy/src/jfw/modules/publicapply/src/config"
+        "jy/src/jfw/modules/publicapply/src/util"
 
-	. "app.yhyue.com/moapp/jybase/api"
-	qu "app.yhyue.com/moapp/jybase/common"
+        . "app.yhyue.com/moapp/jybase/api"
+        qu "app.yhyue.com/moapp/jybase/common"
 )
 
 //招标信息是否被收藏
 func (this *ServiceStruct) IsCollAction() {
-	userId, _ := this.GetSession("userId").(string)
-	defer qu.Catch()
-	r := func() Result {
-		if this.Method() != "POST" {
-			return Result{Data: nil, Error_msg: Error_msg_1005}
-		}
-		if this.GetString("bids") == "" {
-			return Result{Data: nil, Error_msg: Error_msg_1003}
-		}
-		if this.GetString("label") != "" {
-			return Result{Data: entity.IsCollByBidsBackInfo(this.GetString("bids"), userId)}
-		}
-		return Result{Data: entity.IsCollByBids(this.GetString("bids"), userId)}
-	}()
-	this.ServeJson(r)
+        userId, _ := this.GetSession("userId").(string)
+        defer qu.Catch()
+        r := func() Result {
+                if this.Method() != "POST" {
+                        return Result{Data: nil, Error_msg: Error_msg_1005}
+                }
+                if this.GetString("bids") == "" {
+                        return Result{Data: nil, Error_msg: Error_msg_1003}
+                }
+                if this.GetString("label") != "" {
+                        return Result{Data: entity.IsCollByBidsBackInfo(this.GetString("bids"), userId)}
+                }
+                return Result{Data: entity.IsCollByBids(this.GetString("bids"), userId)}
+        }()
+        this.ServeJson(r)
 }
 
 //获取标签
 func (this *ServiceStruct) GetLabelAction() {
-	userId, _ := this.GetSession("userId").(string)
-	defer qu.Catch()
-	r := func() Result {
-		if this.Method() != "POST" {
-			return Result{Data: nil, Error_msg: Error_msg_1005}
-		}
-		return Result{Data: entity.GetLabelByUser(userId)}
-	}()
-	this.ServeJson(r)
+        userId, _ := this.GetSession("userId").(string)
+        defer qu.Catch()
+        r := func() Result {
+                if this.Method() != "POST" {
+                        return Result{Data: nil, Error_msg: Error_msg_1005}
+                }
+                return Result{Data: entity.GetLabelByUser(userId)}
+        }()
+        this.ServeJson(r)
 }
 
 //招标信息收藏|移除收藏
 func (this *ServiceStruct) BCAction() {
-	userId, _ := this.GetSession("userId").(string)
-	defer qu.Catch()
-	r := func() Result {
-		if this.Method() != "POST" {
-			return Result{Data: nil, Error_msg: Error_msg_1005}
-		}
-		bidAction := new(entity.BidAction)
-		if string(this.Body()) == "" {
-			return Result{Data: nil, Error_msg: Error_msg_1003}
-		}
-		//接收参数
-		json.Unmarshal(this.Body(), &bidAction)
-		if len((*bidAction).Binfo) == 0 {
-			return Result{Data: nil, Error_msg: Error_msg_1002}
-		}
-		m := entity.BidCollOrRemByIds(*bidAction, userId)
-		return Result{Data: m["status"], Error_msg: qu.ObjToString(m["msg"])}
-	}()
-	this.ServeJson(r)
+        userId, _ := this.GetSession("userId").(string)
+        baseUserId := qu.Int64All(this.GetSession("base_user_id"))
+        entId := qu.Int64All(this.GetSession("entId"))
+        accountId := qu.Int64All(this.GetSession("accountId"))
+        defer qu.Catch()
+        r := func() Result {
+                if this.Method() != "POST" {
+                        return Result{Data: nil, Error_msg: Error_msg_1005}
+                }
+                bidAction := new(entity.BidAction)
+                if string(this.Body()) == "" {
+                        return Result{Data: nil, Error_msg: Error_msg_1003}
+                }
+                //接收参数
+                json.Unmarshal(this.Body(), &bidAction)
+                if len((*bidAction).Binfo) == 0 {
+                        return Result{Data: nil, Error_msg: Error_msg_1002}
+                }
+                m := entity.BidCollOrRemByIds(*bidAction, userId, baseUserId, entId, accountId)
+                return Result{Data: m["status"], Error_msg: qu.ObjToString(m["msg"])}
+        }()
+        this.ServeJson(r)
 }
 
 //添加或绑定标签|删除标签
 func (this *ServiceStruct) LabelAction() {
-	userId, _ := this.GetSession("userId").(string)
-	defer qu.Catch()
-	r := func() Result {
-		if this.Method() != "POST" {
-			return Result{Data: nil, Error_msg: Error_msg_1005}
-		}
-		labelInfo := new(entity.LabelInfo)
-		if string(this.Body()) == "" {
-			return Result{Data: nil, Error_msg: Error_msg_1003}
-		}
-		//接收参数
-		json.Unmarshal(this.Body(), &labelInfo)
-		if len(labelInfo.Binfo) == 0 && labelInfo.Lids == "" && labelInfo.Lname == "" {
-			return Result{Data: nil, Error_msg: Error_msg_1002}
-		}
-		m := entity.LabelAction(labelInfo, userId)
-		return Result{Data: m["status"], Error_msg: qu.ObjToString(m["msg"])}
-	}()
-	this.ServeJson(r)
+        userId, _ := this.GetSession("userId").(string)
+        baseUserId := qu.Int64All(this.GetSession("base_user_id"))
+        entId := qu.Int64All(this.GetSession("entId"))
+        accountId := qu.Int64All(this.GetSession("accountId"))
+        defer qu.Catch()
+        r := func() Result {
+                if this.Method() != "POST" {
+                        return Result{Data: nil, Error_msg: Error_msg_1005}
+                }
+                labelInfo := new(entity.LabelInfo)
+                if string(this.Body()) == "" {
+                        return Result{Data: nil, Error_msg: Error_msg_1003}
+                }
+                //接收参数
+                json.Unmarshal(this.Body(), &labelInfo)
+                if len(labelInfo.Binfo) == 0 && labelInfo.Lids == "" && labelInfo.Lname == "" {
+                        return Result{Data: nil, Error_msg: Error_msg_1002}
+                }
+                m := entity.LabelAction(labelInfo, userId, baseUserId, entId, accountId)
+                return Result{Data: m["status"], Error_msg: qu.ObjToString(m["msg"])}
+        }()
+        this.ServeJson(r)
 }
 
 //收藏列表
 func (this *ServiceStruct) CollList() {
-	userId, _ := this.GetSession("userId").(string)
-	defer qu.Catch()
-	r := func() Result {
-		if this.Method() != "POST" {
-			return Result{Data: nil, Error_msg: Error_msg_1005}
-		}
-		collList := new(util.CollList)
-		if string(this.Body()) == "" {
-			return Result{Data: nil, Error_msg: Error_msg_1003}
-		}
-		//接收参数
-		if err := json.Unmarshal(this.Body(), &collList); err != nil {
-			return Result{Data: nil, Error_msg: Error_msg_1003}
-		}
-		//
-		return Result{Data: entity.GetCollList(collList, userId)}
-	}()
-	this.ServeJson(r)
+        userId, _ := this.GetSession("userId").(string)
+        baseUserId := qu.Int64All(this.GetSession("base_user_id"))
+        entId := qu.Int64All(this.GetSession("entId"))
+        accountId := qu.Int64All(this.GetSession("accountId"))
+        defer qu.Catch()
+        r := func() Result {
+                if this.Method() != "POST" {
+                        return Result{Data: nil, Error_msg: Error_msg_1005}
+                }
+                collList := new(util.CollList)
+                if string(this.Body()) == "" {
+                        return Result{Data: nil, Error_msg: Error_msg_1003}
+                }
+                //接收参数
+                if err := json.Unmarshal(this.Body(), &collList); err != nil {
+                        return Result{Data: nil, Error_msg: Error_msg_1003}
+                }
+                //
+                return Result{Data: entity.GetCollList(collList, userId, baseUserId, entId, accountId)}
+        }()
+        this.ServeJson(r)
 }
 
 //新增标签
 func (this *ServiceStruct) AddLabel() {
-	userId, _ := this.GetSession("userId").(string)
-	defer qu.Catch()
-	r := func() Result {
-		if this.Method() != "POST" {
-			return Result{Data: nil, Error_msg: Error_msg_1005}
-		}
-		if this.GetString("name") == "" {
-			return Result{Data: nil, Error_msg: Error_msg_1003}
-		}
-		rdata := entity.AddLab(this.GetString("name"), userId)
-		return Result{Data: rdata["labid"], Error_msg: qu.ObjToString(rdata["msg"])}
-	}()
-	this.ServeJson(r)
+        userId, _ := this.GetSession("userId").(string)
+        defer qu.Catch()
+        r := func() Result {
+                if this.Method() != "POST" {
+                        return Result{Data: nil, Error_msg: Error_msg_1005}
+                }
+                if this.GetString("name") == "" {
+                        return Result{Data: nil, Error_msg: Error_msg_1003}
+                }
+                rdata := entity.AddLab(this.GetString("name"), userId)
+                return Result{Data: rdata["labid"], Error_msg: qu.ObjToString(rdata["msg"])}
+        }()
+        this.ServeJson(r)
 }
 
 //是否有权限(超级订阅、商机管理、大会员)
 func (this *ServiceStruct) Power() {
-	defer qu.Catch()
-	userId, _ := this.GetSession("userId").(string)
-	entId := qu.IntAll(this.GetSession("entId"))
-	r := func() Result {
-		m, msg := map[string]interface{}{}, ""
-		if userId != "" {
-			_, m = entity.Power(userId, entId)
-			registedate, _ := m["registedate"].(int64)
-			m["isOld"] = registedate != 0 && registedate < config.Config.BidSearchOldUserLimit
-			delete(m, "registedate")
-		}
-		return Result{Data: m, Error_msg: msg}
-	}()
-	this.ServeJson(r)
+        defer qu.Catch()
+        userId, _ := this.GetSession("userId").(string)
+        entId := qu.Int64All(this.GetSession("entId"))
+        baseUserId := qu.Int64All(this.GetSession("base_user_id"))
+        accountId := qu.Int64All(this.GetSession("accountId"))
+        r := func() Result {
+                m, msg := map[string]interface{}{}, ""
+                if userId != "" {
+                        _, m = entity.Power(userId, baseUserId, entId, accountId)
+                        registedate, _ := m["registedate"].(int64)
+                        m["isOld"] = registedate != 0 && registedate < config.Config.BidSearchOldUserLimit
+                        delete(m, "registedate")
+                }
+                return Result{Data: m, Error_msg: msg}
+        }()
+        this.ServeJson(r)
 }

+ 1 - 1
src/jfw/modules/publicapply/src/config.yaml

@@ -1,4 +1,4 @@
 etcd:
   hosts:
   - 192.168.3.206:2379
-powercheckKey: "powercheck.rpc" #用户中台rpc
+powercheckKey: "powercheck.rpc" #权限校验中台rpc

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