wangchuanjin 2 年之前
父節點
當前提交
b987c69401

+ 3 - 1
src/go.mod

@@ -4,11 +4,12 @@ go 1.18
 
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a
-	app.yhyue.com/moapp/jypkg v0.0.0-20230209055147-4cf703ace114
+	app.yhyue.com/moapp/jypkg v0.0.0-20230210020312-75e22a7a7be4
 	bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230129060002-f69424aa14ba
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
 	github.com/dchest/captcha v1.0.0
 	github.com/fsnotify/fsnotify v1.6.0
+	github.com/go-xweb/httpsession v0.0.0-20141220075701-356d3b4d38d6
 	github.com/gogf/gf/v2 v2.2.6
 	github.com/robfig/cron v1.2.0
 	go.mongodb.org/mongo-driver v1.11.1
@@ -54,6 +55,7 @@ require (
 	github.com/jinzhu/now v1.1.1 // indirect
 	github.com/json-iterator/go v1.1.12 // indirect
 	github.com/klauspost/compress v1.13.6 // indirect
+	github.com/lunny/csession v0.0.0-20130910075847-fe53c5de3dfd // indirect
 	github.com/magiconair/properties v1.8.6 // indirect
 	github.com/mattn/go-colorable v0.1.9 // indirect
 	github.com/mattn/go-isatty v0.0.14 // indirect

+ 6 - 2
src/go.sum

@@ -13,8 +13,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20220802080941-07f401baab8b/go.mod h1:HelrO6tc
 app.yhyue.com/moapp/jybase v0.0.0-20230109015757-aa3d5e19b196/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
 app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a h1:wD4aWPSYdiX1cIP4lzzPD2s7fYhKa3muIf97l9tonJE=
 app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
-app.yhyue.com/moapp/jypkg v0.0.0-20230209055147-4cf703ace114 h1:89J5Zq4bfnocIpEWBn19PnfaT+8Dh+Rv4X8QoTwxCpg=
-app.yhyue.com/moapp/jypkg v0.0.0-20230209055147-4cf703ace114/go.mod h1:sa5YRPqTQLOVBmpltjT21EkQ7DfJbUZFARUb4ZJ7U+k=
+app.yhyue.com/moapp/jypkg v0.0.0-20230210020312-75e22a7a7be4 h1:bzZsVBu3XOef3dDkfR3+01h8JBG1LchE+ClhUiAA9HQ=
+app.yhyue.com/moapp/jypkg v0.0.0-20230210020312-75e22a7a7be4/go.mod h1:sa5YRPqTQLOVBmpltjT21EkQ7DfJbUZFARUb4ZJ7U+k=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae h1:6rDDaz6yxvE8viTSzEBwKYOFWq14TMfuBivSazUZMz4=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae/go.mod h1:b0zZHev3gmJao1Fo+2Z2KPVjsuLOJVvVxf+kCnu9WkA=
 bp.jydev.jianyu360.cn/BP/jynsq v0.0.0-20220222052708-ebc43af90698/go.mod h1:ojo/AUH9Yr1wzarEjOaNMkj1Cet/9r8IgLyba64Z52E=
@@ -612,6 +612,8 @@ github.com/go-test/deep v1.0.7/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V
 github.com/go-xorm/builder v0.3.4/go.mod h1:KxkQkNN1DpPKTedxXyTQcmH+rXfvk4LZ9SOOBoZBAxw=
 github.com/go-xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:56xuuqnHyryaerycW3BfssRdxQstACi0Epw/yC5E2xM=
 github.com/go-xorm/xorm v0.7.9/go.mod h1:XiVxrMMIhFkwSkh96BW7PACl7UhLtx2iJIHMdmjh5sQ=
+github.com/go-xweb/httpsession v0.0.0-20141220075701-356d3b4d38d6 h1:DUiWdm3rS8cC96Y0XeVkDeizzEK6X+qiNgXytLVtbkM=
+github.com/go-xweb/httpsession v0.0.0-20141220075701-356d3b4d38d6/go.mod h1:lwPk13GS+i/NK4FkMm68IcJrAwiu+HtjYa1Y4kW59aY=
 github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0=
 github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY=
 github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg=
@@ -872,6 +874,8 @@ github.com/lib/pq v1.10.6/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
 github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
 github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
 github.com/longbridgeapp/sqlparser v0.3.1/go.mod h1:GIHaUq8zvYyHLCLMJJykx1CdM6LHtkUih/QaJXySSx4=
+github.com/lunny/csession v0.0.0-20130910075847-fe53c5de3dfd h1:DXxmBCahjva4Ox4AWOv6pR1Csv33zSj97SaLOElfIsw=
+github.com/lunny/csession v0.0.0-20130910075847-fe53c5de3dfd/go.mod h1:3w9PScemEkJoLw3OYvLWMoD8XRCmXgGwsSpT6pFpJ0g=
 github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo=
 github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
 github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=

+ 2 - 12
src/jfw/front/dataExport.go

@@ -420,12 +420,7 @@ func (d *DataExport) SuperSearchExport() error {
 		WordsMode:       wordsMode,                                   //搜索关键词模式;默认0:包含所有,1:包含任意
 		AdditionalWords: d.GetString("additionalWords"),              //关键词:附加关键词(副:五组,每组最多15个字符)
 	}
-<<<<<<< HEAD
-	selectType := strings.Join(jy.GetVipState( d.Session(), *config.Middleground, userId).GetQueryItems(d.GetString("selectType"), util.Int64All(config.Sysconfig["bidSearchOldUserLimit"])), ",")
-=======
-	entId := util.IntAll(d.GetSession("entId"))
-	selectType := strings.Join(jy.GetVipState(public.Mysql, public.MQFW, userId, entId).GetQueryItems(d.GetString("selectType"), util.Int64All(config.Sysconfig["bidSearchOldUserLimit"])), ",")
->>>>>>> master
+	selectType := strings.Join(jy.GetVipState(d.Session(), *config.Middleground, userId).GetQueryItems(d.GetString("selectType"), util.Int64All(config.Sysconfig["bidSearchOldUserLimit"])), ",")
 	//数据回显
 	d.SetSession("Echo_timeslot", d.GetString("timeslot"))
 	d.SetSession("Echo_keywords", reqData.Keywords)
@@ -443,16 +438,11 @@ func (d *DataExport) SuperSearchExport() error {
 	d.SetSession("Echo_fileExists", reqData.FileExists)
 	d.SetSession("Echo_city", reqData.City)
 	d.SetSession("Echo_bid_field", reqData.BidField) // 领域类型 0101-医疗行业
-<<<<<<< HEAD
-
-	saveData := reqData.PassBidSearchExport(config.Sysconfig)
-=======
 	d.SetSession("Echo_searchGroup", reqData.SearchGroup)
 	d.SetSession("Echo_searchMode", reqData.SearchMode)
 	d.SetSession("Echo_wordsMode", reqData.WordsMode)
 	d.SetSession("Echo_additionalWords", reqData.AdditionalWords)
-	saveData := reqData.PassBidSearchExport()
->>>>>>> master
+	saveData := reqData.PassBidSearchExport(config.Sysconfig)
 	saveData["selectType"] = selectType
 	saveData["s_openid"] = openid
 	saveData["s_userid"] = userId

+ 16 - 14
src/jfw/front/searchOptimize.go

@@ -3,17 +3,19 @@ package front
 import (
 	"encoding/json"
 	"fmt"
-	"jfw/config"
-	"jfw/public"
+	"jy/src/jfw/config"
 	"log"
-	"qfw/util"
-	"qfw/util/bidsearch"
-	"qfw/util/elastic"
-	"qfw/util/jy"
-	"qfw/util/redis"
 	"strconv"
 	"strings"
 	"time"
+
+	util "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/encrypt"
+	elastic "app.yhyue.com/moapp/jybase/esv1"
+	"app.yhyue.com/moapp/jybase/redis"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/bidsearch"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	pc "app.yhyue.com/moapp/jypkg/public"
 )
 
 const (
@@ -242,7 +244,7 @@ func (so *SearchOptimize) GetSearchKeyWordsQueryStr() string {
 	//主关键词词组
 	if so.KeyWords != "" {
 		if so.SearchMode == 1 {
-			if ikWords := jy.HttpEs(so.KeyWords, "ik_smart", public.DbConf.Elasticsearch.Main.Address); ikWords != "" {
+			if ikWords := jy.HttpEs(so.KeyWords, "ik_smart", pc.DbConf.Elasticsearch.Main.Address); ikWords != "" {
 				so.KeyWords = strings.ReplaceAll(ikWords, "+", " ")
 			}
 		}
@@ -255,7 +257,7 @@ func (so *SearchOptimize) GetSearchKeyWordsQueryStr() string {
 				addWords []string
 			)
 			for _, awv := range strings.Split(so.AdditionalWords, ",") {
-				if ikWords := jy.HttpEs(awv, "ik_smart", public.DbConf.Elasticsearch.Main.Address); ikWords != "" {
+				if ikWords := jy.HttpEs(awv, "ik_smart", pc.DbConf.Elasticsearch.Main.Address); ikWords != "" {
 					addWords = append(addWords, strings.ReplaceAll(ikWords, "+", " "))
 				}
 			}
@@ -738,7 +740,7 @@ func SearchListFormat(industry string, repl []map[string]interface{}, b bool) (l
 			}
 			v["detail"] = detail
 		}
-		v["_id"] = util.EncodeArticleId2ByCheck(util.ObjToString(v["_id"]))                                        //加密信息id
+		v["_id"] = encrypt.EncodeArticleId2ByCheck(util.ObjToString(v["_id"]))                                     //加密信息id
 		v["s_subscopeclass"] = IndustryFormat(industry, strings.Trim(util.ObjToString(v["s_subscopeclass"]), ",")) //行业
 		v["industry"] = IndustryFormat(industry, strings.Trim(util.ObjToString(v["s_subscopeclass"]), ","))        //行业
 		if budget, ok := v["budget"].(float64); ok && budget > 0 {                                                 //预算
@@ -796,10 +798,10 @@ func SearchListFormat(industry string, repl []map[string]interface{}, b bool) (l
 					}
 				}
 				winnerInfo = append(winnerInfo, &WinnerInfo{
-					Winner:       wv,                                                                                                         //中标企业 需要单独处理
-					WinnerTel:    util.ObjToString(v["winnertel"]),                                                                           //中标企业联系电话
-					WinnerPerson: util.ObjToString(v["winnerperson"]),                                                                        //中标企业联系人
-					WinnerId:     util.If(winnerId != "" && len([]rune(winnerId)) > 12, util.EncodeArticleId2ByCheck(winnerId), "").(string), //中标企业加密id  存在winnerId 异常的情况
+					Winner:       wv,                                                                                                            //中标企业 需要单独处理
+					WinnerTel:    util.ObjToString(v["winnertel"]),                                                                              //中标企业联系电话
+					WinnerPerson: util.ObjToString(v["winnerperson"]),                                                                           //中标企业联系人
+					WinnerId:     util.If(winnerId != "" && len([]rune(winnerId)) > 12, encrypt.EncodeArticleId2ByCheck(winnerId), "").(string), //中标企业加密id  存在winnerId 异常的情况
 				})
 			}
 			v["winnerInfo"] = winnerInfo

+ 1 - 5
src/jfw/front/shorturl.go

@@ -398,9 +398,6 @@ func (s *Short) Article(stype, id string) error {
 			return s.Redirect(surl)
 		}
 	} else {
-<<<<<<< HEAD
-		sids := encrypt.CommonDecodeArticle(stype, id)
-=======
 		if stype == "content" {
 			//工作桌面内嵌 快照页
 			if !strings.Contains(s.Request.URL.String(), "aside") {
@@ -413,8 +410,7 @@ func (s *Short) Article(stype, id string) error {
 				return s.Redirect(fmt.Sprintf("%s%s%s", config.Sysconfig["workDesktopUrl"].(string), config.Sysconfig["webdomain"].(string), url.QueryEscape(fmt.Sprintf("%s%s", s.Request.URL.String(), paramSuffix))))
 			}
 		}
-		sids := util.CommonDecodeArticle(stype, id)
->>>>>>> master
+		sids := encrypt.CommonDecodeArticle(stype, id)
 		if len(sids) == 0 || (len(sids) > 0 && sids[0] == "") {
 			s.Redirect("/notin/page", 302)
 			return nil

+ 6 - 30
src/jfw/front/supsearch.go

@@ -248,22 +248,16 @@ func (p *Pcsearch) GetNewBids() error {
 	bidField := p.GetString("bid_field")
 	userId, _ := p.GetSession("userId").(string)
 	baseUserId := p.GetSession("base_user_id")
-	entId := util.IntAll(p.GetSession("entId"))
 	searchGroup, _ := p.GetInteger("searchGroup") //搜索分组;默认0:全部;1:招标采购搜索;2:超前项目。
-	vipStatus := jy.GetVipState(public.Mysql, public.MQFW, userId, entId)
+	vipStatus := jy.GetVipState(p.Session(), *config.Middleground, userId)
 	// 如果是领域化数据j
 	if bidField != "" {
 		if domainPageType, ok := DomainPageType[bidField]; ok {
 			pageType = domainPageType
 			//bidField = domainPageType
 		}
-<<<<<<< HEAD
-		vipStatus := jy.GetVipState(p.Session(), *config.Middleground, userId)
-		if (vipStatus.BigMember <= 0 && vipStatus.VipState <= 0) || (!jy.HasBidFieldPower(config.Middleground, util.Int64All(baseUserId), MedicalFunctionCode)) {
-=======
 		//领域化数据 如果没有权限直接返回空数据
-		if (vipStatus.BigMember <= 0 && vipStatus.VipState <= 0) || (!jy.HasBidFieldPower(config.ResourceApi.HasPowers, fmt.Sprint(util.Int64All(baseUserId)), MedicalFunctionCode)) {
->>>>>>> master
+		if (vipStatus.BigMember <= 0 && vipStatus.VipState <= 0) || (!jy.HasBidFieldPower(config.Middleground, util.Int64All(baseUserId), MedicalFunctionCode)) {
 			p.ServeJson(map[string]interface{}{
 				"list":      []map[string]interface{}{},
 				"count":     0,
@@ -342,7 +336,6 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 	userId, _ := p.GetSession("userId").(string)
 	phone, _ := p.GetSession("phone").(string)
 	baseUserId := p.GetSession("base_user_id")
-	entId := util.IntAll(p.GetSession("entId"))
 	noLoginBl := false
 	if userId == "" {
 		//未登录用户访问全部信息类型 需要过滤掉 拟建和采购意向
@@ -372,13 +365,9 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 	if selectType == "" {
 		selectType = "title,content"
 	}
-<<<<<<< HEAD
-	isPayedUser, publishtime, queryItems, _, _ := bidsearch.PublicSearch(userId, selectType, publishtime, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]), 0, pageSize, p.Session(), *config.Middleground)
-=======
-	userInfo := jy.GetVipState(public.Mysql, public.MQFW, userId, entId)
+	userInfo := jy.GetVipState(p.Session(), *config.Middleground, userId)
 	queryItems := userInfo.GetQueryItems(selectType, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]))
 	isPayedUser := userInfo.IsPayedUser()
->>>>>>> master
 	if isPayedUser {
 		buyerclass = p.GetString("buyerclass")
 		hasBuyerTel, hasWinnerTel = p.GetString("buyertel"), p.GetString("winnertel")
@@ -402,17 +391,13 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 		notkey = util.ObjToString(p.GetSession("Echo_notkey"))
 		fileExists = util.ObjToString(p.GetSession("Echo_fileExists"))
 		city = util.ObjToString(p.GetSession("Echo_city"))
-<<<<<<< HEAD
-		bidField = util.ObjToString(p.GetSession("Echo_bid_field")) // 领域化数据 0101-医疗行业
-		_, _, queryItems, _, _ = bidsearch.PublicSearch(userId, selectType, publishtime, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]), 0, pageSize, p.Session(), *config.Middleground)
-=======
+		bidField = util.ObjToString(p.GetSession("Echo_bid_field"))              // 领域化数据 0101-医疗行业
 		territorialization = util.ObjToString(p.GetSession("Echo_bid_field"))    // 领域化数据 0101-医疗行业
 		searchGroup = util.IntAll(p.GetSession("Echo_searchGroup"))              //搜索分组;默认0:全部;1:招标采购搜索;2:超前项目。
 		searchMode = util.IntAll(p.GetSession("Echo_searchMode"))                //搜索模式;默认0:精准模式(不进行系统分词);1:模糊模式(进行系统分词)。
 		wordsMode = util.IntAll(p.GetSession("Echo_wordsMode"))                  //搜索关键词模式;默认0:包含所有关键词;1:包含任意关键词。
 		additionalWords = util.ObjToString(p.GetSession("Echo_additionalWords")) //关键词:附加关键词(副:五组,每组最多15个字符 每组,号隔开)
 		queryItems = userInfo.GetQueryItems(selectType, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]))
->>>>>>> master
 	}
 	keywordsLimit := util.IntAllDef(config.Sysconfig["keywordsLimit"], 35)
 	searchLimit := public.IsSearchLimit(queryItems)
@@ -439,14 +424,9 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 	//医疗领域化信息 用户前提是大会员 超级订阅,才有领域化功能的权限
 	if territorialization != "" {
 		isSearch = false
-<<<<<<< HEAD
-		vipStatus := jy.GetVipState(p.Session(), *config.Middleground, userId)
-		if vipStatus.BigMember > 0 || vipStatus.VipState > 0 {
-			if jy.HasBidFieldPower(config.Middleground, util.Int64All(baseUserId), MedicalFunctionCode) {
-=======
+		userInfo := jy.GetVipState(p.Session(), *config.Middleground, userId)
 		if userInfo.BigMember > 0 || userInfo.VipState > 0 {
-			if jy.HasBidFieldPower(config.ResourceApi.HasPowers, fmt.Sprint(util.Int64All(baseUserId)), MedicalFunctionCode) {
->>>>>>> master
+			if jy.HasBidFieldPower(config.Middleground, util.Int64All(baseUserId), MedicalFunctionCode) {
 				isSearch = true
 			}
 		}
@@ -465,11 +445,7 @@ func (p *Pcsearch) PcSearchIndex(module string) error {
 				}
 			}
 			if isLimit == 1 {
-<<<<<<< HEAD
-				secondKWS, _, _, _, secondFlag, count, totalPage, list = bidsearch.SearchData("pc", p.Request, 1, util.ObjToString(p.GetSession("userId")), secondKWS, s_word, area, city, publishtime, subtype, industry, minprice, maxprice, "", buyerclass, hasBuyerTel, hasWinnerTel, fileExists, 0, true, queryItems, field, notkey, isPayedUser, searchTypeSwitch, bidField, pageSize, config.Sysconfig)
-=======
 				count, total, list = so.GetBidSearchList(false)
->>>>>>> master
 			}
 		} else {
 			p.DisableHttpCache()

+ 2 - 26
src/jfw/front/swordfish.go

@@ -90,7 +90,6 @@ func (m *Front) PcAjaxReq() {
 	tabularflag := m.GetString("tabularflag")
 	userId := util.ObjToString(m.GetSession("userId"))
 	phone := util.ObjToString(m.GetSession("phone"))
-	entId := util.IntAll(m.GetSession("entId"))
 	baseUserId := m.GetSession("base_user_id")
 	currentPage, _ := m.GetInteger("pageNumber")
 	pageSize, _ := m.GetInteger("pageSize")
@@ -103,9 +102,9 @@ func (m *Front) PcAjaxReq() {
 		//判断用户是否登录进行表格查询,否则返回基本数据
 		tabularflag = ""
 	}
-	userInfo := jy.GetVipState(public.Mysql, public.MQFW, userId, entId)
+	userInfo := jy.GetVipState(m.Session(), *config.Middleground, userId)
 	if territorialization != "" { // 如果是领域化数据 判断是否是付费用户 是否有权限
-		if (userInfo.BigMember <= 0 && userInfo.VipState <= 0) || (!jy.HasBidFieldPower(config.ResourceApi.HasPowers, fmt.Sprint(util.Int64All(baseUserId)), MedicalFunctionCode)) {
+		if (userInfo.BigMember <= 0 && userInfo.VipState <= 0) || (!jy.HasBidFieldPower(config.Middleground, util.Int64All(baseUserId), MedicalFunctionCode)) {
 			m.ServeJson(map[string]interface{}{
 				"list": []map[string]interface{}{},
 			})
@@ -199,7 +198,6 @@ func (m *Front) PcAjaxReq_Bak() {
 	bidField := m.GetString("bid_field") // 领域类型 0101- 医疗
 	tabularflag := m.GetString("tabularflag")
 	userId := util.ObjToString(m.GetSession("userId"))
-	entId := util.IntAll(m.GetSession("entId"))
 	baseUserId := m.GetSession("base_user_id")
 	currentPage, _ := m.GetInteger("pageNumber")
 	pageSize, _ := m.GetInteger("pageSize")
@@ -212,14 +210,8 @@ func (m *Front) PcAjaxReq_Bak() {
 	}
 	reqType := m.GetString("reqType")
 	if bidField != "" { // 如果是领域化数据 判断是否是付费用户 是否有权限
-<<<<<<< HEAD
-
 		vipStatus := jy.GetVipState(m.Session(), *config.Middleground, userId)
 		if (vipStatus.BigMember <= 0 && vipStatus.VipState <= 0) || (!jy.HasBidFieldPower(config.Middleground, util.Int64All(baseUserId), MedicalFunctionCode)) {
-=======
-		vipStatus := jy.GetVipState(public.Mysql, public.MQFW, userId, entId)
-		if (vipStatus.BigMember <= 0 && vipStatus.VipState <= 0) || (!jy.HasBidFieldPower(config.ResourceApi.HasPowers, fmt.Sprint(util.Int64All(baseUserId)), MedicalFunctionCode)) {
->>>>>>> master
 			m.ServeJson(map[string]interface{}{
 				"list": []map[string]interface{}{},
 			})
@@ -265,11 +257,7 @@ func (m *Front) PcAjaxReq_Bak() {
 		start                     int
 		city                      string //城市
 	)
-<<<<<<< HEAD
 	isPayedUser, publishtime, queryItems, currentPage, start = bidsearch.PublicSearch(userId, selectType, publishtime, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]), currentPage, pageSize, m.Session(), *config.Middleground)
-=======
-	isPayedUser, publishtime, queryItems, currentPage, start = bidsearch.PublicSearch(userId, selectType, publishtime, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]), currentPage, pageSize, entId)
->>>>>>> master
 	if isPayedUser {
 		buyerclass = m.GetString("buyerclass")
 		hasBuyerTel, hasWinnerTel = m.GetString("buyertel"), m.GetString("winnertel")
@@ -486,7 +474,6 @@ func (m *Front) Getpage() error {
 func (m *Front) WxsearchlistPaging() {
 	defer util.Catch()
 	userId, _ := m.GetSession("userId").(string)
-	entId := util.IntAll(m.GetSession("entId"))
 	var list *[]map[string]interface{}
 	var b_word, a_word, secondFlag, secondKWS string
 	var secondList []map[string]interface{}
@@ -525,12 +512,7 @@ func (m *Front) WxsearchlistPaging() {
 			var notkey string = ""                        //排除词
 			var fileExists = m.GetString("fileExists")    //是否有附件--所有用户都可用此功能 0:全部;1:有附件;-1:无附件
 			var city string = ""                          //城市
-<<<<<<< HEAD
 			vipStatus := jy.GetVipState(m.Session(), *config.Middleground, userId)
-=======
-
-			vipStatus := jy.GetVipState(public.Mysql, public.MQFW, userId, entId)
->>>>>>> master
 			isPayedUser = vipStatus.IsPayedUser()
 			queryItems := vipStatus.GetQueryItems(selectType, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]))
 			if isPayedUser {
@@ -1993,13 +1975,7 @@ func (f *Front) HistorypushPaging() error {
 func (m *Front) Subscribe() error {
 	isBuyed := false
 	if userId, _ := m.GetSession("userId").(string); userId != "" {
-<<<<<<< HEAD
-
 		vStatus := jy.GetVipState(m.Session(), *config.Middleground, userId)
-=======
-		entId := util.IntAll(m.GetSession("entId"))
-		vStatus := jy.GetVipState(public.Mysql, public.MQFW, userId, entId)
->>>>>>> master
 		isBuyed = vStatus.VipState > 0
 	}
 	m.T["isBuyed"] = isBuyed

+ 0 - 7
src/jfw/front/ws_dataExport.go

@@ -381,15 +381,8 @@ func (wd *WsDataExport) SearchExport() error {
 		WordsMode:       wordsMode,                                    //搜索关键词模式;默认0:包含所有,1:包含任意
 		AdditionalWords: wd.GetString("additionalWords"),              //关键词:附加关键词(副:五组,每组最多15个字符)
 	}
-<<<<<<< HEAD
 	saveData := reqData.PassBidSearchExport(config.Sysconfig)
-
 	saveData["selectType"] = strings.Join(jy.GetVipState(wd.Session(), *config.Middleground, userId).
-=======
-	entId := util.IntAll(wd.GetSession("entId"))
-	saveData := reqData.PassBidSearchExport()
-	saveData["selectType"] = strings.Join(jy.GetVipState(public.Mysql, public.MQFW, userId, entId).
->>>>>>> master
 		GetQueryItems(wd.GetString("selectType"), util.Int64All(config.Sysconfig["bidSearchOldUserLimit"])), ",")
 	saveData["s_openid"] = openid
 	saveData["s_userid"] = userId

+ 2 - 8
src/jfw/modules/app/src/app/front/swordfish.go

@@ -262,7 +262,6 @@ func (m *Front) WxsearchlistPaging() {
 	pageNum, _ := m.GetInteger("pageNum")
 	searchvalue := strings.TrimSpace(m.GetString("searchvalue"))
 	userid := util.ObjToString(m.GetSession("userId"))
-	entId := util.IntAll(m.GetSession("entId"))
 	if userid != "" {
 		//历史记录
 		history := redis.GetStr("other", "s_"+userid)
@@ -299,12 +298,7 @@ func (m *Front) WxsearchlistPaging() {
 		buyerclass := ""                              //采购单位类别
 		var notkey string = ""                        //排除词
 		fileExists = m.GetString("fileExists")        //是否有附件--所有用户都可用此功能 0:全部;1:有附件;-1:无附件
-
-<<<<<<< HEAD
-		isPayedUser, publishtime, queryItems, pageNum, _ = bidsearch.PublicSearch(userid, selectType, publishtime, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]), pageNum, 50,  m.Session(),  *config.Middleground)
-=======
-		isPayedUser, publishtime, queryItems, pageNum, _ = bidsearch.PublicSearch(userid, selectType, publishtime, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]), pageNum, 50, entId)
->>>>>>> master
+		isPayedUser, publishtime, queryItems, pageNum, _ = bidsearch.PublicSearch(userid, selectType, publishtime, util.Int64All(config.Sysconfig["bidSearchOldUserLimit"]), pageNum, 50, m.Session(), *config.Middleground)
 		if isPayedUser {
 			buyerclass = m.GetString("buyerclass")
 			hasBuyerTel, hasWinnerTel = m.GetString("buyertel"), m.GetString("winnertel")
@@ -312,7 +306,7 @@ func (m *Front) WxsearchlistPaging() {
 			city = m.GetString("city")
 		}
 		//校验是否有大会员中标企业查询权限
-		bigBaseMsg := jy.GetBigVipUserBaseMsg( m.Session(),  *config.Middleground)
+		bigBaseMsg := jy.GetBigVipUserBaseMsg(m.Session(), *config.Middleground)
 		if bigBaseMsg.CheckBigVipBackPower("search") {
 			winner = m.GetString("winner")
 		}

+ 379 - 428
src/jfw/modules/app/src/app/front/ws_dataExport.go

@@ -1,378 +1,332 @@
 package front
 
 import (
-    "encoding/json"
-    "errors"
-    "fmt"
-    "jy/src/jfw/modules/app/src/jfw/config"
-    "log"
-    "regexp"
-    "strconv"
-    "strings"
-    "time"
+	"encoding/json"
+	"errors"
+	"fmt"
+	"jy/src/jfw/modules/app/src/jfw/config"
+	"log"
+	"regexp"
+	"strconv"
+	"strings"
+	"time"
 
-    util "app.yhyue.com/moapp/jybase/common"
-    . "app.yhyue.com/moapp/jybase/date"
-    "app.yhyue.com/moapp/jybase/encrypt"
-    "app.yhyue.com/moapp/jybase/go-xweb/xweb"
-    "app.yhyue.com/moapp/jybase/redis"
-    "app.yhyue.com/moapp/jypkg/common/src/qfw/util/dataexport"
-    "app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
-    "app.yhyue.com/moapp/jypkg/public"
-    "go.mongodb.org/mongo-driver/bson"
+	util "app.yhyue.com/moapp/jybase/common"
+	. "app.yhyue.com/moapp/jybase/date"
+	"app.yhyue.com/moapp/jybase/encrypt"
+	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
+	"app.yhyue.com/moapp/jybase/redis"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/dataexport"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"app.yhyue.com/moapp/jypkg/public"
+	"go.mongodb.org/mongo-driver/bson"
 )
 
 type WsDataExport struct {
-    *xweb.Action
-    searchExport      xweb.Mapper `xweb:"/jyapp/front/dataExport/searchExport"`      //app数据导出
-    toCreateOrderPage xweb.Mapper `xweb:"/jyapp/front/dataExport/toCreateOrderPage"` //app数据导出-订单支付
-    sendMailVerify    xweb.Mapper `xweb:"/jyapp/front/dataExport/sendMailVerify"`    //发送邮箱验证码
-    checkMailVerify   xweb.Mapper `xweb:"/jyapp/front/dataExport/checkMailVerify"`   //验证邮箱验证码
-    checkPhoneVerify  xweb.Mapper `xweb:"/jyapp/front/dataExport/checkPhoneVerify"`  //验证手机号
-    previewData       xweb.Mapper `xweb:"/jyapp/front/dataExport/previewData/(.*)"`  //app数据导出-数据预览页面
-    getPreview        xweb.Mapper `xweb:"/jyapp/front/dataExport/getPreview"`        //app数据导出-预览数据
-    toOrderDetail     xweb.Mapper `xweb:"/jyapp/front/dataExport/toOrderDetail"`     //订单详情
+	*xweb.Action
+	searchExport      xweb.Mapper `xweb:"/jyapp/front/dataExport/searchExport"`      //app数据导出
+	toCreateOrderPage xweb.Mapper `xweb:"/jyapp/front/dataExport/toCreateOrderPage"` //app数据导出-订单支付
+	sendMailVerify    xweb.Mapper `xweb:"/jyapp/front/dataExport/sendMailVerify"`    //发送邮箱验证码
+	checkMailVerify   xweb.Mapper `xweb:"/jyapp/front/dataExport/checkMailVerify"`   //验证邮箱验证码
+	checkPhoneVerify  xweb.Mapper `xweb:"/jyapp/front/dataExport/checkPhoneVerify"`  //验证手机号
+	previewData       xweb.Mapper `xweb:"/jyapp/front/dataExport/previewData/(.*)"`  //app数据导出-数据预览页面
+	getPreview        xweb.Mapper `xweb:"/jyapp/front/dataExport/getPreview"`        //app数据导出-预览数据
+	toOrderDetail     xweb.Mapper `xweb:"/jyapp/front/dataExport/toOrderDetail"`     //订单详情
 
 }
 
 func init() {
-    xweb.AddAction(&WsDataExport{})
+	xweb.AddAction(&WsDataExport{})
 }
 
 func (w *WsDataExport) GetPreview() error {
-    userId := util.ObjToString(w.GetSession("userId"))
-    if userId == "" {
-        return errors.New("未登录")
-    }
-    _res := make(map[string]interface{})
-    //数据预览每天限制50次
-    incurKey := fmt.Sprintf("PreviewData_%s_%d", w.GetSession("userId"), time.Now().Day())
-    times := util.IntAll(redis.Get("other", incurKey))
-    if times >= 50 {
-        _res["msg"] = "超出预览次数"
-        w.ServeJson(map[string]interface{}{
-            "res": _res,
-        })
-        return nil
-    }
-    if times == 0 {
-        redis.Put("other", incurKey, 1, 24*60*60)
-    } else {
-        redis.Incr("other", incurKey)
-    }
-    _id := encrypt.SE.Decode4Hex(w.GetString("_id"))
-    dataType := w.GetString("dataType")
-    //从500条数据中筛选字段最全五条
-    scd := dataexport.GetSqlObjFromId(public.MQFW, _id)
-    kws := scd.Keyword
-    res, err := dataexport.GetDataExportSearchResult(public.Mgo_Bidding, public.DbConf.Mongodb.Bidding.DbName, public.DbConf.Elasticsearch.Main.Address, scd, dataType, -1)
-    if res == nil || err != nil {
-        return w.Render("/pc/dataExport_noDataErr.html", &w.T)
-    }
-    msgCount := dataexport.GetDataExportSearchCountByScdId(public.MQFW, public.Mgo_Bidding, public.DbConf.Mongodb.Bidding.DbName, public.DbConf.Elasticsearch.Main.Address, _id)
-    //格式化字段
-    res_screen := dataexport.ScreenData(res, dataType, 20, kws)
-    var EntArr = []string{}
-    if dataType == "2" {
-        for _, v := range res_screen {
-            //高级字段查询且winner不为空
-            if v["s_winner"] != nil && v["s_winner"] != "" {
-                EntArr = append(EntArr, v["s_winner"].(string))
-            }
-        }
-    }
-    list := dataexport.FormatExportData(public.Mgo_Ent, &res_screen, config.Sysconfig["webdomain"].(string), dataType, true)
-    if msgCount > 20000 {
-        msgCount = 20000
-    }
-    _res["data"] = subUrl(list, dataType)
-    _res["dataType"] = dataType
-    _res["total"] = msgCount
-    w.ServeJson(map[string]interface{}{
-        "res": _res,
-    })
-    return nil
+	userId := util.ObjToString(w.GetSession("userId"))
+	if userId == "" {
+		return errors.New("未登录")
+	}
+	_res := make(map[string]interface{})
+	//数据预览每天限制50次
+	incurKey := fmt.Sprintf("PreviewData_%s_%d", w.GetSession("userId"), time.Now().Day())
+	times := util.IntAll(redis.Get("other", incurKey))
+	if times >= 50 {
+		_res["msg"] = "超出预览次数"
+		w.ServeJson(map[string]interface{}{
+			"res": _res,
+		})
+		return nil
+	}
+	if times == 0 {
+		redis.Put("other", incurKey, 1, 24*60*60)
+	} else {
+		redis.Incr("other", incurKey)
+	}
+	_id := encrypt.SE.Decode4Hex(w.GetString("_id"))
+	dataType := w.GetString("dataType")
+	//从500条数据中筛选字段最全五条
+	scd := dataexport.GetSqlObjFromId(public.MQFW, _id)
+	kws := scd.Keyword
+	res, err := dataexport.GetDataExportSearchResult(public.Mgo_Bidding, public.DbConf.Mongodb.Bidding.DbName, public.DbConf.Elasticsearch.Main.Address, scd, dataType, -1)
+	if res == nil || err != nil {
+		return w.Render("/pc/dataExport_noDataErr.html", &w.T)
+	}
+	msgCount := dataexport.GetDataExportSearchCountByScdId(public.MQFW, public.Mgo_Bidding, public.DbConf.Mongodb.Bidding.DbName, public.DbConf.Elasticsearch.Main.Address, _id)
+	//格式化字段
+	res_screen := dataexport.ScreenData(res, dataType, 20, kws)
+	var EntArr = []string{}
+	if dataType == "2" {
+		for _, v := range res_screen {
+			//高级字段查询且winner不为空
+			if v["s_winner"] != nil && v["s_winner"] != "" {
+				EntArr = append(EntArr, v["s_winner"].(string))
+			}
+		}
+	}
+	list := dataexport.FormatExportData(public.Mgo_Ent, &res_screen, config.Sysconfig["webdomain"].(string), dataType, true)
+	if msgCount > 20000 {
+		msgCount = 20000
+	}
+	_res["data"] = subUrl(list, dataType)
+	_res["dataType"] = dataType
+	_res["total"] = msgCount
+	w.ServeJson(map[string]interface{}{
+		"res": _res,
+	})
+	return nil
 }
 
 // 发送邮件
 func (w *WsDataExport) SendMailVerify() {
-    email := w.GetString("email")
-    if isEmail(email) {
-        var email_used = true
-        if email != w.GetSession("DataExportVerifyEmail") {
-            w.DelSession("CreatEVerifyTime")
-            //			openid := util.ObjToString(w.GetSession("s_m_openid"))
-            userId := util.ObjToString(w.GetSession("userId"))
-            emails := public.Mysql.FindOne("dataexport_order", map[string]interface{}{
-                "user_mail": email,
-                "user_id":   userId,
-            }, "user_mail", "")
-            if emails != nil && util.ObjToString((*emails)["user_mail"]) != "" {
-                email_used = false
-                w.T["success"] = true
-                w.T["errCode"] = 4
-                w.T["errMsg"] = "此邮箱已被验证"
-                w.SetSession("DataExportVerifyEmail_val", email)
-                w.SetSession("EMVerifySucess", true)
-            }
-        }
-        if email_used {
-            lastSendDEVerify := util.Int64All(w.GetSession("CreatEVerifyTime"))
-            timeSpaceing := lastSendDEVerify - time.Now().Unix() + 60*5
-            incurKey := fmt.Sprintf("SendEmail_%s_%d", w.GetSession("userId"), time.Now().Day())
-            if lastSendDEVerify == 0 || timeSpaceing < 0 {
-                //每日限制10次
-                times := util.IntAll(redis.Get("other", incurKey))
-                if times < 10 {
-                    if times == 0 {
-                        redis.Put("other", incurKey, 1, 24*60*60)
-                    } else {
-                        redis.Incr("other", incurKey)
-                    }
-                    //生成随机数
-                    verifyStr := strings.ToUpper(util.GetComplexRandom(6, 3, 3))
-                    w.SetSession("EMVerifySucess", false)
-                    w.SetSession("DataExportVerifyEmail", email)
-                    w.SetSession("DataExportVerify", verifyStr)
-                    w.SetSession("CreatEVerifyTime", time.Now().Unix())
-                    log.Println("====================", verifyStr, "====================", w.GetSession("DataExportVerify"))
-                    //发送邮箱验证码
-                    go public.SendMailIdentCode(email, verifyStr, config.GmailAuth)
-                    w.T["success"] = true
-                } else {
-                    w.T["success"] = false
-                    w.T["errCode"] = 3
-                    w.T["time"] = timeSpaceing
-                    w.T["errMsg"] = "验证码发送次数已达到今日上限"
-                }
+	email := w.GetString("email")
+	if isEmail(email) {
+		var email_used = true
+		if email != w.GetSession("DataExportVerifyEmail") {
+			w.DelSession("CreatEVerifyTime")
+			//			openid := util.ObjToString(w.GetSession("s_m_openid"))
+			userId := util.ObjToString(w.GetSession("userId"))
+			emails := public.Mysql.FindOne("dataexport_order", map[string]interface{}{
+				"user_mail": email,
+				"user_id":   userId,
+			}, "user_mail", "")
+			if emails != nil && util.ObjToString((*emails)["user_mail"]) != "" {
+				email_used = false
+				w.T["success"] = true
+				w.T["errCode"] = 4
+				w.T["errMsg"] = "此邮箱已被验证"
+				w.SetSession("DataExportVerifyEmail_val", email)
+				w.SetSession("EMVerifySucess", true)
+			}
+		}
+		if email_used {
+			lastSendDEVerify := util.Int64All(w.GetSession("CreatEVerifyTime"))
+			timeSpaceing := lastSendDEVerify - time.Now().Unix() + 60*5
+			incurKey := fmt.Sprintf("SendEmail_%s_%d", w.GetSession("userId"), time.Now().Day())
+			if lastSendDEVerify == 0 || timeSpaceing < 0 {
+				//每日限制10次
+				times := util.IntAll(redis.Get("other", incurKey))
+				if times < 10 {
+					if times == 0 {
+						redis.Put("other", incurKey, 1, 24*60*60)
+					} else {
+						redis.Incr("other", incurKey)
+					}
+					//生成随机数
+					verifyStr := strings.ToUpper(util.GetComplexRandom(6, 3, 3))
+					w.SetSession("EMVerifySucess", false)
+					w.SetSession("DataExportVerifyEmail", email)
+					w.SetSession("DataExportVerify", verifyStr)
+					w.SetSession("CreatEVerifyTime", time.Now().Unix())
+					log.Println("====================", verifyStr, "====================", w.GetSession("DataExportVerify"))
+					//发送邮箱验证码
+					go public.SendMailIdentCode(email, verifyStr, config.GmailAuth)
+					w.T["success"] = true
+				} else {
+					w.T["success"] = false
+					w.T["errCode"] = 3
+					w.T["time"] = timeSpaceing
+					w.T["errMsg"] = "验证码发送次数已达到今日上限"
+				}
 
-            } else {
-                w.T["success"] = false
-                w.T["errCode"] = 2
-                w.T["time"] = timeSpaceing
-                w.T["errMsg"] = "已发送,5分钟后再尝试"
-            }
-        }
-    } else {
-        w.T["success"] = false
-        w.T["errCode"] = 1
-        w.T["errMsg"] = "邮箱格式不正确"
-    }
-    w.ServeJson(&w.T)
+			} else {
+				w.T["success"] = false
+				w.T["errCode"] = 2
+				w.T["time"] = timeSpaceing
+				w.T["errMsg"] = "已发送,5分钟后再尝试"
+			}
+		}
+	} else {
+		w.T["success"] = false
+		w.T["errCode"] = 1
+		w.T["errMsg"] = "邮箱格式不正确"
+	}
+	w.ServeJson(&w.T)
 }
 
 // 验证手机号
 func (w *WsDataExport) CheckPhoneVerify() {
-    phone := w.GetString("phone")
-    verityResult := false
-    if isPhone(phone) {
-        verityResult = true
-        w.SetSession("DataExportVerifyPhone", phone)
-    }
-    w.T["success"] = verityResult
-    w.ServeJson(&w.T)
+	phone := w.GetString("phone")
+	verityResult := false
+	if isPhone(phone) {
+		verityResult = true
+		w.SetSession("DataExportVerifyPhone", phone)
+	}
+	w.T["success"] = verityResult
+	w.ServeJson(&w.T)
 }
 
 // CheckMailVerify 验证邮箱
 func (w *WsDataExport) CheckMailVerify() {
-    email := w.GetString("email")
-    emailVerity := w.GetString("emailVerity")
+	email := w.GetString("email")
+	emailVerity := w.GetString("emailVerity")
 
-    DataExportEmail := w.GetSession("DataExportVerifyEmail")
-    DataExportVerify := w.GetSession("DataExportVerify")
-    log.Println(email, emailVerity, "---", DataExportEmail, DataExportVerify)
-    verityResult := false
-    if emailVerity != "" && emailVerity == DataExportVerify && email != "" && email == DataExportEmail {
-        verityResult = true
-        w.DelSession("DataExportVerify")
-        w.DelSession("CreatEVerifyTime")
-        w.SetSession("EMVerifySucess", true)
-        w.SetSession("DataExportVerifyEmail_val", DataExportEmail)
-    }
-    w.T["success"] = verityResult
-    w.ServeJson(&w.T)
+	DataExportEmail := w.GetSession("DataExportVerifyEmail")
+	DataExportVerify := w.GetSession("DataExportVerify")
+	log.Println(email, emailVerity, "---", DataExportEmail, DataExportVerify)
+	verityResult := false
+	if emailVerity != "" && emailVerity == DataExportVerify && email != "" && email == DataExportEmail {
+		verityResult = true
+		w.DelSession("DataExportVerify")
+		w.DelSession("CreatEVerifyTime")
+		w.SetSession("EMVerifySucess", true)
+		w.SetSession("DataExportVerifyEmail_val", DataExportEmail)
+	}
+	w.T["success"] = verityResult
+	w.ServeJson(&w.T)
 }
 
 func (w *WsDataExport) PreviewData(_id string) error {
-    userId := util.ObjToString(w.GetSession("userId"))
-    if userId == "" {
-        return errors.New("未登录")
-    }
-    w.T["id"] = _id
-    w.T["dataType"] = w.GetString("dataType")
-    w.T["ttf"] = public.GetFontVersion() + "_" + public.PC
-    return w.Render("/dataExport/dataExport_previewData.html", &w.T)
+	userId := util.ObjToString(w.GetSession("userId"))
+	if userId == "" {
+		return errors.New("未登录")
+	}
+	w.T["id"] = _id
+	w.T["dataType"] = w.GetString("dataType")
+	w.T["ttf"] = public.GetFontVersion() + "_" + public.PC
+	return w.Render("/dataExport/dataExport_previewData.html", &w.T)
 }
 
 func subUrl(list *[]map[string]interface{}, dataType string) *[]map[string]interface{} {
-    for _, v := range *list {
-        //加密截取url
-        href := util.ObjToString(v["href"])
-        url := util.ObjToString(v["url"])
-        if len(url) > 40 { //截取剑鱼标讯地址
-            v["url"] = url[:40] + "*****" + url[len(url)-10:]
-        }
-        if len(href) > 40 { //截取原文地址
-            v["href"] = href[:40] + "*****" + href[len(href)-10:]
-        } else if len(href) > 0 {
-            v["href"] = href[:len(href)*8/10] + "*****"
-        }
-    }
-    var result []map[string]interface{}
-    bytes, marshalErr := json.Marshal(list)
-    if marshalErr != nil {
-        log.Println("数据导出字体混淆errMarshal", marshalErr)
-        return list
-    }
-    //字体混淆
-    hxb := public.GetFontConvertStr(public.ExConf.Font.ConvertVersionDefault, string(bytes), "pc")
-    unmarshalErr := json.Unmarshal([]byte(hxb), &result)
-    if unmarshalErr != nil {
-        log.Println("数据导出字体混淆unmarshalErr", unmarshalErr)
-        return list
-    }
-    return &result
+	for _, v := range *list {
+		//加密截取url
+		href := util.ObjToString(v["href"])
+		url := util.ObjToString(v["url"])
+		if len(url) > 40 { //截取剑鱼标讯地址
+			v["url"] = url[:40] + "*****" + url[len(url)-10:]
+		}
+		if len(href) > 40 { //截取原文地址
+			v["href"] = href[:40] + "*****" + href[len(href)-10:]
+		} else if len(href) > 0 {
+			v["href"] = href[:len(href)*8/10] + "*****"
+		}
+	}
+	var result []map[string]interface{}
+	bytes, marshalErr := json.Marshal(list)
+	if marshalErr != nil {
+		log.Println("数据导出字体混淆errMarshal", marshalErr)
+		return list
+	}
+	//字体混淆
+	hxb := public.GetFontConvertStr(public.ExConf.Font.ConvertVersionDefault, string(bytes), "pc")
+	unmarshalErr := json.Unmarshal([]byte(hxb), &result)
+	if unmarshalErr != nil {
+		log.Println("数据导出字体混淆unmarshalErr", unmarshalErr)
+		return list
+	}
+	return &result
 }
 
 func isEmail(value string) bool {
-    var emailPattern = regexp.MustCompile("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$")
-    return emailPattern.MatchString(value)
+	var emailPattern = regexp.MustCompile("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$")
+	return emailPattern.MatchString(value)
 }
 
 func (w *WsDataExport) PaySuccessPage() error {
-    defer util.Catch()
-    w.T["email"] = w.GetString("email")
-    w.T["pay_way"] = w.GetString("pay_way")
-    payTime, _ := strconv.ParseInt(w.GetString("payTime"), 10, 64)
-    w.T["payTime"] = FormatDateByInt64(&payTime, Date_Short_Layout)
-    w.T["orderCode"] = w.GetString("code")
-    return w.Render("/dataExport/dataExport_paySuccess.html", &w.T)
+	defer util.Catch()
+	w.T["email"] = w.GetString("email")
+	w.T["pay_way"] = w.GetString("pay_way")
+	payTime, _ := strconv.ParseInt(w.GetString("payTime"), 10, 64)
+	w.T["payTime"] = FormatDateByInt64(&payTime, Date_Short_Layout)
+	w.T["orderCode"] = w.GetString("code")
+	return w.Render("/dataExport/dataExport_paySuccess.html", &w.T)
 }
 
 // 创建订单页面
 func (w *WsDataExport) ToCreateOrderPage() error {
-    defer util.Catch()
-    id := encrypt.SE.Decode4Hex(w.GetString("id"))
-    userId := util.ObjToString(w.GetSession("userId"))
-    if userId == "" {
-        return errors.New("未登录")
-    }
-    msgCount := dataexport.GetDataExportSearchCountByScdId(public.MQFW, public.Mgo_Bidding, public.DbConf.Mongodb.Bidding.DbName, public.DbConf.Elasticsearch.Main.Address, id)
-    if msgCount > public.ExConf.MsgMaxCount || msgCount == -1 {
-        msgCount = public.ExConf.MsgMaxCount
-    }
-    if msgCount < 1 {
-        return w.Render("/dataExport/404.html", &w.T)
-    }
+	defer util.Catch()
+	id := encrypt.SE.Decode4Hex(w.GetString("id"))
+	userId := util.ObjToString(w.GetSession("userId"))
+	if userId == "" {
+		return errors.New("未登录")
+	}
+	msgCount := dataexport.GetDataExportSearchCountByScdId(public.MQFW, public.Mgo_Bidding, public.DbConf.Mongodb.Bidding.DbName, public.DbConf.Elasticsearch.Main.Address, id)
+	if msgCount > public.ExConf.MsgMaxCount || msgCount == -1 {
+		msgCount = public.ExConf.MsgMaxCount
+	}
+	if msgCount < 1 {
+		return w.Render("/dataExport/404.html", &w.T)
+	}
 
-    resEmail, _ := w.GetSession("DataExportVerifyEmail_val").(string)
-    resPhone, _ := w.GetSession("DataExportVerifyPhone_val").(string)
-    if resEmail != "" {
-        lastSendDEVerify := util.Int64All(w.GetSession("CreatEVerifyTime"))
-        timeSpaceing := lastSendDEVerify - time.Now().Unix() + 60*5
-        w.T["email"] = resEmail
-        w.T["timeSpaceing"] = timeSpaceing
-    }
-    if resPhone != "" {
-        w.T["phone"] = resPhone
-    }
+	resEmail, _ := w.GetSession("DataExportVerifyEmail_val").(string)
+	resPhone, _ := w.GetSession("DataExportVerifyPhone_val").(string)
+	if resEmail != "" {
+		lastSendDEVerify := util.Int64All(w.GetSession("CreatEVerifyTime"))
+		timeSpaceing := lastSendDEVerify - time.Now().Unix() + 60*5
+		w.T["email"] = resEmail
+		w.T["timeSpaceing"] = timeSpaceing
+	}
+	if resPhone != "" {
+		w.T["phone"] = resPhone
+	}
 
-    if resEmail == "" || resPhone == "" {
-        lastEmail, lastPhone := "", ""
-        if lastPhone, lastEmail = dataexport.GetLastExportPhoneAndMail(public.Mysql, userId, util.ObjToString(w.GetSession("entUserId"))); lastPhone == "" || lastEmail == "" {
-            userData, _ := mongodb.FindById("user", userId, `{"s_myemail":1,"s_phone":1,"s_m_phone":1}`)
-            if userData != nil && len(*userData) > 0 {
-                if lastEmail == "" {
-                    lastEmail, _ = (*userData)["s_myemail"].(string)
-                }
-                if lastPhone == "" {
-                    lastPhone, _ = util.If((*userData)["s_phone"] != nil, (*userData)["s_phone"], (*userData)["s_m_phone"]).(string)
-                }
-            }
-        }
-        if resEmail == "" && lastEmail != "" {
-            w.T["email"] = lastEmail
-            w.SetSession("EMVerifySucess", true)
-            w.SetSession("DataExportVerifyEmail_val", lastEmail)
-        }
+	if resEmail == "" || resPhone == "" {
+		lastEmail, lastPhone := "", ""
+		if lastPhone, lastEmail = dataexport.GetLastExportPhoneAndMail(public.Mysql, userId, util.ObjToString(w.GetSession("entUserId"))); lastPhone == "" || lastEmail == "" {
+			userData, _ := mongodb.FindById("user", userId, `{"s_myemail":1,"s_phone":1,"s_m_phone":1}`)
+			if userData != nil && len(*userData) > 0 {
+				if lastEmail == "" {
+					lastEmail, _ = (*userData)["s_myemail"].(string)
+				}
+				if lastPhone == "" {
+					lastPhone, _ = util.If((*userData)["s_phone"] != nil, (*userData)["s_phone"], (*userData)["s_m_phone"]).(string)
+				}
+			}
+		}
+		if resEmail == "" && lastEmail != "" {
+			w.T["email"] = lastEmail
+			w.SetSession("EMVerifySucess", true)
+			w.SetSession("DataExportVerifyEmail_val", lastEmail)
+		}
 
-        if resPhone == "" && lastPhone != "" {
-            w.SetSession("DataExportVerifyPhone_val", lastPhone)
-            w.T["phone"] = lastPhone
-        }
-    }
-    //支付方式
-    payway := w.GetString("payway")
-    if payway != "" {
-        w.T["payway"] = payway
-    }
-    //字段包
-    spec := w.GetString("dataspec")
-    if spec != "" {
-        w.T["dataspec"] = spec
-    }
-    w.T["_id"] = w.GetString("id")
-    w.T["msgCount"] = msgCount                                                             //信息总量
-    incurKey := fmt.Sprintf("PreviewData_%s_%d", w.GetSession("userId"), time.Now().Day()) //每日限制预览次数
-    w.T["PreviewData"] = util.IntAll(redis.Get("other", incurKey))
+		if resPhone == "" && lastPhone != "" {
+			w.SetSession("DataExportVerifyPhone_val", lastPhone)
+			w.T["phone"] = lastPhone
+		}
+	}
+	//支付方式
+	payway := w.GetString("payway")
+	if payway != "" {
+		w.T["payway"] = payway
+	}
+	//字段包
+	spec := w.GetString("dataspec")
+	if spec != "" {
+		w.T["dataspec"] = spec
+	}
+	w.T["_id"] = w.GetString("id")
+	w.T["msgCount"] = msgCount                                                             //信息总量
+	incurKey := fmt.Sprintf("PreviewData_%s_%d", w.GetSession("userId"), time.Now().Day()) //每日限制预览次数
+	w.T["PreviewData"] = util.IntAll(redis.Get("other", incurKey))
 
-    w.Render("/dataExport/dataExport_payOrder.html", &w.T)
-    return nil
+	w.Render("/dataExport/dataExport_payOrder.html", &w.T)
+	return nil
 }
 
 func isPhone(value string) bool {
-    var phonePattern = regexp.MustCompile("^[1][3-9][0-9]{9}$")
-    return phonePattern.MatchString(value)
+	var phonePattern = regexp.MustCompile("^[1][3-9][0-9]{9}$")
+	return phonePattern.MatchString(value)
 }
 
 // 微信数据导出
 func (wd *WsDataExport) SearchExport() error {
-<<<<<<< HEAD
-    openid := util.ObjToString(wd.GetSession("s_m_openid"))
-    userId := util.ObjToString(wd.GetSession("userId"))
-    if userId == "" {
-        return errors.New("未登录")
-    }
-    //接收超级搜索页面参数
-    reqData := public.BidSearchExport{
-        Keywords:     wd.GetString("searchvalue"),                  //搜索词
-        Publishtime:  wd.GetString("publishtime"),                  //发布时间
-        Area:         wd.GetString("scope"),                        //地区
-        Subtype:      wd.GetString("subtype"),                      //信息类型
-        Minprice:     wd.GetString("minprice"),                     //最低价格
-        Maxprice:     wd.GetString("maxprice"),                     //最高价格
-        Industry:     strings.TrimSpace(wd.GetString("industry")),  //选中的行业
-        SelectType:   wd.GetString("selectType"),                   //标题 or 全文
-        Buyerclass:   wd.GetString("buyerclass"),                   //采购单位行业
-        Winner:       wd.GetString("winner"),                       //中标单位
-        Hasbuyertel:  wd.GetString("buyertel"),                     //是否有采购电话
-        Haswinnertel: wd.GetString("winnertel"),                    //是否有中标电话
-        SelectIds:    strings.TrimSpace(wd.GetString("selectIds")), //选择信息id
-        Notkey:       wd.GetString("notkey"),                       //排除词
-        City:         wd.GetString("city"),                         //城市
-        FileExists:   wd.GetString("fileExists"),                   //有无附件
-    }
-    saveData := reqData.PassBidSearchExport(config.Sysconfig)
-    saveData["selectType"] = strings.Join(jy.GetVipState(wd.Session(), *config.Middleground, userId).
-        GetQueryItems(wd.GetString("selectType"), util.Int64All(config.Sysconfig["bidSearchOldUserLimit"])), ",")
-    saveData["s_openid"] = openid
-    saveData["s_userid"] = userId
-    saveData["comeinfrom"] = "supersearchPage"
-    region := util.If(reqData.Area == "全国", "", reqData.Area).(string)
-    if region != "" && reqData.City != "" {
-        region += "," + reqData.City
-    } else {
-        region = reqData.City
-    }
-    saveData["region"] = strings.Split(region, ",")
-    //是否开启 正文 标题同时搜索只搜正文的开关
-    saveData["searchTypeSwitch"], _ = config.Sysconfig["searchTypeSwitch"].(bool)
-    //存入数据库
-    _id := mongodb.Save(dataexport.ExportTable, saveData)
-
-    wd.ServeJson(bson.M{"_id": encrypt.SE.Encode2Hex(_id)})
-    return nil
-=======
 	openid := util.ObjToString(wd.GetSession("s_m_openid"))
 	userId := util.ObjToString(wd.GetSession("userId"))
 	if userId == "" {
@@ -404,9 +358,8 @@ func (wd *WsDataExport) SearchExport() error {
 		WordsMode:       wordsMode,                                    //搜索关键词模式;默认0:包含所有,1:包含任意
 		AdditionalWords: wd.GetString("additionalWords"),              //关键词:附加关键词(副:五组,每组最多15个字符)
 	}
-	entId := util.IntAll(wd.GetSession("entId"))
-	saveData := reqData.PassBidSearchExport()
-	saveData["selectType"] = strings.Join(jy.GetVipState(public.Mysql, public.MQFW, userId, entId).
+	saveData := reqData.PassBidSearchExport(config.Sysconfig)
+	saveData["selectType"] = strings.Join(jy.GetVipState(wd.Session(), *config.Middleground, userId).
 		GetQueryItems(wd.GetString("selectType"), util.Int64All(config.Sysconfig["bidSearchOldUserLimit"])), ",")
 	saveData["s_openid"] = openid
 	saveData["s_userid"] = userId
@@ -422,113 +375,111 @@ func (wd *WsDataExport) SearchExport() error {
 	saveData["searchTypeSwitch"], _ = config.Sysconfig["searchTypeSwitch"].(bool)
 	//存入数据库
 	_id := mongodb.Save(dataexport.ExportTable, saveData)
-
-	wd.ServeJson(bson.M{"_id": util.SE.Encode2Hex(_id)})
+	wd.ServeJson(bson.M{"_id": encrypt.SE.Encode2Hex(_id)})
 	return nil
->>>>>>> master
 }
 
 func (m *WsDataExport) ToOrderDetail() error {
-    userId := m.Session().Get("userId")
-    if userId == nil || userId == "" {
-        return m.Redirect("/jyapp/free/login")
-    }
-    orderCode := m.GetString("orderCode")
-    orderDetail := map[string]interface{}{}
-    filter := dataexport.SieveCondition{}
-    queryMap := map[string]interface{}{
-        "order_code": orderCode,
-        "user_id":    userId,
-    }
-    if orderCode != "" {
-        orderDetail = *public.Mysql.FindOne(tableName_order, queryMap, "", "")
-    }
-    orderDetail["order_code"] = orderCode
-    if orderDetail["pay_money"] != nil {
-        orderDetail["pay_money"] = float64(orderDetail["pay_money"].(int64)) / 100
-    }
-    if orderDetail["order_money"] != nil {
-        orderDetail["order_money"] = float64(orderDetail["order_money"].(int64)) / 100
-    }
-    if orderDetail["pay_time"] != nil {
-        pay_time := strings.Replace(orderDetail["pay_time"].(string), "-", ".", -1)
-        orderDetail["pay_time"] = pay_time
-    }
-    if orderDetail["create_time"] != nil {
-        create_time := strings.Replace(orderDetail["create_time"].(string), "-", ".", -1)
-        orderDetail["create_time"] = create_time
-    }
-    if orderDetail["filter"] != nil {
-        err := json.Unmarshal([]byte(orderDetail["filter"].(string)), &filter)
-        if err == nil {
-            publishtime := filter.PublishTime
-            if publishtime != "" {
-                timeArr := strings.Split(publishtime, "_")
-                if len(timeArr) == 2 {
-                    start, err := strconv.ParseInt(timeArr[0], 10, 64)
-                    end, erro := strconv.ParseInt(timeArr[1], 10, 64)
-                    //可能出现只选择一个时间
-                    if err == nil && erro == nil {
-                        filter.PublishTime = FormatDateByInt64(&start, layout_date) + "-" + FormatDateByInt64(&end, layout_date)
-                    } else if err != nil && erro == nil {
-                        filter.PublishTime = "-" + FormatDateByInt64(&end, layout_date)
-                    } else if err == nil && erro != nil {
-                        filter.PublishTime = FormatDateByInt64(&start, layout_date) + "-"
-                    }
-                }
-            }
-            filter.MinPrice = public.GetPriceDes_SieveCondition(filter.MinPrice, filter.MaxPrice)
-            orderDetail["filter"] = filter
-        } else {
-            log.Println("筛选条件-关键词-结构体反序列化-错误", err)
-        }
-    }
-    if orderDetail["applybill_type"] != nil && orderDetail["applybill_type"].(int64) == 0 {
-        orderDetail["applybill_type"] = "个人"
-    } else if orderDetail["applybill_type"] != nil && orderDetail["applybill_type"].(int64) == 1 {
-        orderDetail["applybill_type"] = "单位"
-    } else {
-        orderDetail["applybill_type"] = "-"
-    }
-    if orderDetail["applybill_status"] != nil && orderDetail["applybill_status"].(int64) == 1 {
-        orderDetail["applybill_status"] = "T" //已申请
-    } else {
-        orderDetail["applybill_status"] = "F" //未申请
-    }
-    //加密
-    if orderDetail["filter_id"] != nil {
-        orderDetail["filter_id"] = encrypt.SE.Encode2Hex(orderDetail["filter_id"].(string))
-    }
-    //卡卷id加密
-    if orderDetail["d_relation_id"] != "" {
-        orderDetail["userLotteryId"] = encrypt.SE.Encode2Hex(util.ObjToString(orderDetail["d_relation_id"]))
-    }
-    delete(orderDetail, "d_relation_id")
-    orderStatus := util.IntAll((orderDetail)["order_status"])
-    orderDetail["order_status"] = orderStatus
-    log.Println((orderDetail)["order_status"], "---", orderStatus, "---", orderDetail["order_status"])
-    if orderStatus == 1 {
-        orderDetail["transaction_id"] = func() string {
-            table := ""
-            // 0微信支付 1支付宝支付
-            if util.ObjToString(orderDetail["pay_way"]) == "wx_pc" || util.ObjToString(orderDetail["pay_way"]) == "wx_js" || util.ObjToString(orderDetail["pay_way"]) == "wx_app" {
-                table = "weixin_pay"
-                orderDetail["pay_way"] = "wx"
-            } else if util.ObjToString(orderDetail["pay_way"]) == "ali_pc" || util.ObjToString(orderDetail["pay_way"]) == "ali_app" {
-                orderDetail["pay_way"] = "ali"
-                table = "ali_pay"
-            } else {
-                return ""
-            }
-            wxPayMap := map[string]interface{}{}
-            wxPayMap["out_trade_no"] = orderDetail["out_trade_no"]
-            wxpay := public.Mysql.FindOne(table, wxPayMap, "", "")
-            if wxpay == nil {
-                return ""
-            }
-            return util.ObjToString((*wxpay)["transaction_id"])
-        }()
-    }
-    m.T["o"] = orderDetail
-    return m.Render("/dataExport/dataExport_toOrderDetail.html", &m.T)
+	userId := m.Session().Get("userId")
+	if userId == nil || userId == "" {
+		return m.Redirect("/jyapp/free/login")
+	}
+	orderCode := m.GetString("orderCode")
+	orderDetail := map[string]interface{}{}
+	filter := dataexport.SieveCondition{}
+	queryMap := map[string]interface{}{
+		"order_code": orderCode,
+		"user_id":    userId,
+	}
+	if orderCode != "" {
+		orderDetail = *public.Mysql.FindOne(tableName_order, queryMap, "", "")
+	}
+	orderDetail["order_code"] = orderCode
+	if orderDetail["pay_money"] != nil {
+		orderDetail["pay_money"] = float64(orderDetail["pay_money"].(int64)) / 100
+	}
+	if orderDetail["order_money"] != nil {
+		orderDetail["order_money"] = float64(orderDetail["order_money"].(int64)) / 100
+	}
+	if orderDetail["pay_time"] != nil {
+		pay_time := strings.Replace(orderDetail["pay_time"].(string), "-", ".", -1)
+		orderDetail["pay_time"] = pay_time
+	}
+	if orderDetail["create_time"] != nil {
+		create_time := strings.Replace(orderDetail["create_time"].(string), "-", ".", -1)
+		orderDetail["create_time"] = create_time
+	}
+	if orderDetail["filter"] != nil {
+		err := json.Unmarshal([]byte(orderDetail["filter"].(string)), &filter)
+		if err == nil {
+			publishtime := filter.PublishTime
+			if publishtime != "" {
+				timeArr := strings.Split(publishtime, "_")
+				if len(timeArr) == 2 {
+					start, err := strconv.ParseInt(timeArr[0], 10, 64)
+					end, erro := strconv.ParseInt(timeArr[1], 10, 64)
+					//可能出现只选择一个时间
+					if err == nil && erro == nil {
+						filter.PublishTime = FormatDateByInt64(&start, layout_date) + "-" + FormatDateByInt64(&end, layout_date)
+					} else if err != nil && erro == nil {
+						filter.PublishTime = "-" + FormatDateByInt64(&end, layout_date)
+					} else if err == nil && erro != nil {
+						filter.PublishTime = FormatDateByInt64(&start, layout_date) + "-"
+					}
+				}
+			}
+			filter.MinPrice = public.GetPriceDes_SieveCondition(filter.MinPrice, filter.MaxPrice)
+			orderDetail["filter"] = filter
+		} else {
+			log.Println("筛选条件-关键词-结构体反序列化-错误", err)
+		}
+	}
+	if orderDetail["applybill_type"] != nil && orderDetail["applybill_type"].(int64) == 0 {
+		orderDetail["applybill_type"] = "个人"
+	} else if orderDetail["applybill_type"] != nil && orderDetail["applybill_type"].(int64) == 1 {
+		orderDetail["applybill_type"] = "单位"
+	} else {
+		orderDetail["applybill_type"] = "-"
+	}
+	if orderDetail["applybill_status"] != nil && orderDetail["applybill_status"].(int64) == 1 {
+		orderDetail["applybill_status"] = "T" //已申请
+	} else {
+		orderDetail["applybill_status"] = "F" //未申请
+	}
+	//加密
+	if orderDetail["filter_id"] != nil {
+		orderDetail["filter_id"] = encrypt.SE.Encode2Hex(orderDetail["filter_id"].(string))
+	}
+	//卡卷id加密
+	if orderDetail["d_relation_id"] != "" {
+		orderDetail["userLotteryId"] = encrypt.SE.Encode2Hex(util.ObjToString(orderDetail["d_relation_id"]))
+	}
+	delete(orderDetail, "d_relation_id")
+	orderStatus := util.IntAll((orderDetail)["order_status"])
+	orderDetail["order_status"] = orderStatus
+	log.Println((orderDetail)["order_status"], "---", orderStatus, "---", orderDetail["order_status"])
+	if orderStatus == 1 {
+		orderDetail["transaction_id"] = func() string {
+			table := ""
+			// 0微信支付 1支付宝支付
+			if util.ObjToString(orderDetail["pay_way"]) == "wx_pc" || util.ObjToString(orderDetail["pay_way"]) == "wx_js" || util.ObjToString(orderDetail["pay_way"]) == "wx_app" {
+				table = "weixin_pay"
+				orderDetail["pay_way"] = "wx"
+			} else if util.ObjToString(orderDetail["pay_way"]) == "ali_pc" || util.ObjToString(orderDetail["pay_way"]) == "ali_app" {
+				orderDetail["pay_way"] = "ali"
+				table = "ali_pay"
+			} else {
+				return ""
+			}
+			wxPayMap := map[string]interface{}{}
+			wxPayMap["out_trade_no"] = orderDetail["out_trade_no"]
+			wxpay := public.Mysql.FindOne(table, wxPayMap, "", "")
+			if wxpay == nil {
+				return ""
+			}
+			return util.ObjToString((*wxpay)["transaction_id"])
+		}()
+	}
+	m.T["o"] = orderDetail
+	return m.Render("/dataExport/dataExport_toOrderDetail.html", &m.T)
 }

+ 1 - 1
src/jfw/modules/app/src/go.mod

@@ -4,7 +4,7 @@ go 1.18
 
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a
-	app.yhyue.com/moapp/jypkg v0.0.0-20230209055147-4cf703ace114
+	app.yhyue.com/moapp/jypkg v0.0.0-20230210020312-75e22a7a7be4
 	bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230209030331-362833655274
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
 	github.com/dchest/captcha v1.0.0

+ 2 - 2
src/jfw/modules/app/src/go.sum

@@ -13,8 +13,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20220802080941-07f401baab8b/go.mod h1:HelrO6tc
 app.yhyue.com/moapp/jybase v0.0.0-20221229065928-e4ba75127ac9/go.mod h1:efAeRPDpJ13JuNODuqtfLlKQSQgCbnUcwGPzhFU5krY=
 app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a h1:wD4aWPSYdiX1cIP4lzzPD2s7fYhKa3muIf97l9tonJE=
 app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
-app.yhyue.com/moapp/jypkg v0.0.0-20230209055147-4cf703ace114 h1:89J5Zq4bfnocIpEWBn19PnfaT+8Dh+Rv4X8QoTwxCpg=
-app.yhyue.com/moapp/jypkg v0.0.0-20230209055147-4cf703ace114/go.mod h1:sa5YRPqTQLOVBmpltjT21EkQ7DfJbUZFARUb4ZJ7U+k=
+app.yhyue.com/moapp/jypkg v0.0.0-20230210020312-75e22a7a7be4 h1:bzZsVBu3XOef3dDkfR3+01h8JBG1LchE+ClhUiAA9HQ=
+app.yhyue.com/moapp/jypkg v0.0.0-20230210020312-75e22a7a7be4/go.mod h1:sa5YRPqTQLOVBmpltjT21EkQ7DfJbUZFARUb4ZJ7U+k=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae h1:6rDDaz6yxvE8viTSzEBwKYOFWq14TMfuBivSazUZMz4=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae/go.mod h1:b0zZHev3gmJao1Fo+2Z2KPVjsuLOJVvVxf+kCnu9WkA=
 bp.jydev.jianyu360.cn/BP/jynsq v0.0.0-20220222052708-ebc43af90698/go.mod h1:ojo/AUH9Yr1wzarEjOaNMkj1Cet/9r8IgLyba64Z52E=

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

@@ -5,7 +5,7 @@ go 1.18
 require (
 	app.yhyue.com/moapp/esv1 v0.0.0-20220414031211-3da4123e648d
 	app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a
-	app.yhyue.com/moapp/jypkg v0.0.0-20230209022443-283a80f1b7fa
+	app.yhyue.com/moapp/jypkg v0.0.0-20230210020312-75e22a7a7be4
 	github.com/donnie4w/go-logger v0.0.0-20170827050443-4740c51383f4
 	github.com/gogf/gf/v2 v2.0.6
 	go.mongodb.org/mongo-driver v1.11.1
@@ -13,6 +13,7 @@ require (
 
 require (
 	app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae // indirect
+	bp.jydev.jianyu360.cn/BaseService/entManageApplication v0.0.0-20230209051900-1e7dcb8f83b7 // indirect
 	bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230207054315-b05f3dd4c4d3 // indirect
 	bp.jydev.jianyu360.cn/BaseService/resourceCenter v0.0.4 // indirect
 	bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230129060002-f69424aa14ba // indirect

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

@@ -13,11 +13,13 @@ app.yhyue.com/moapp/jybase v0.0.0-20220802080941-07f401baab8b/go.mod h1:HelrO6tc
 app.yhyue.com/moapp/jybase v0.0.0-20230109015757-aa3d5e19b196/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
 app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a h1:wD4aWPSYdiX1cIP4lzzPD2s7fYhKa3muIf97l9tonJE=
 app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
-app.yhyue.com/moapp/jypkg v0.0.0-20230209022443-283a80f1b7fa h1:0/2I4ubgDsRbKm7PeiVSTvYwZCK3anZQaEagsGBbI7E=
-app.yhyue.com/moapp/jypkg v0.0.0-20230209022443-283a80f1b7fa/go.mod h1:0DqPlGxaufZlKaLoRndTWG4j3qUQqJ6MNZCmoPcMqSg=
+app.yhyue.com/moapp/jypkg v0.0.0-20230210020312-75e22a7a7be4 h1:bzZsVBu3XOef3dDkfR3+01h8JBG1LchE+ClhUiAA9HQ=
+app.yhyue.com/moapp/jypkg v0.0.0-20230210020312-75e22a7a7be4/go.mod h1:sa5YRPqTQLOVBmpltjT21EkQ7DfJbUZFARUb4ZJ7U+k=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae h1:6rDDaz6yxvE8viTSzEBwKYOFWq14TMfuBivSazUZMz4=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae/go.mod h1:b0zZHev3gmJao1Fo+2Z2KPVjsuLOJVvVxf+kCnu9WkA=
 bp.jydev.jianyu360.cn/BP/jynsq v0.0.0-20220222052708-ebc43af90698/go.mod h1:ojo/AUH9Yr1wzarEjOaNMkj1Cet/9r8IgLyba64Z52E=
+bp.jydev.jianyu360.cn/BaseService/entManageApplication v0.0.0-20230209051900-1e7dcb8f83b7 h1:cw/PdRypNFcYOk4iWAfHjIFoMzIlXUfl9XAmWujBOPY=
+bp.jydev.jianyu360.cn/BaseService/entManageApplication v0.0.0-20230209051900-1e7dcb8f83b7/go.mod h1:7Xhygw0KBuL4h0G76FnFg4otQcA9bmOO0c8M0FCjAyQ=
 bp.jydev.jianyu360.cn/BaseService/gateway v0.0.0-20220419090715-88ddb32961be/go.mod h1:Yj4oabIGItuMoF0BXYLz2XAnF581kxgXBrvlUtIJrkI=
 bp.jydev.jianyu360.cn/BaseService/gateway v1.3.4/go.mod h1:BMLd/5wb3BIEGhnEgF9y1sJN9P5/Dw9kYsoiE9V8I9g=
 bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20230207054315-b05f3dd4c4d3 h1:jeItQ6RM1T6yPWc/5i4R6h3kViD+Rm2VnIEsc1gCFJA=

+ 14 - 9
src/jfw/modules/bigmember/src/service/push/push.go

@@ -1,16 +1,17 @@
 package push
 
 import (
-	. "app.yhyue.com/moapp/jybase/api"
-	util "app.yhyue.com/moapp/jybase/common"
-	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
-	"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"
 	"log"
 	"time"
+
+	. "app.yhyue.com/moapp/jybase/api"
+	util "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 )
 
 type Action struct {
@@ -38,10 +39,15 @@ type pushSet struct {
 //后期
 //4.6.0修改 只把有权益的存入map返给前端, k:权益 v:是否开启
 func (a *Action) Items() {
-	bigMsg := jy.GetBigVipUserBaseMsg( a.Session(), *config.Middleground)
+	bigMsg := jy.GetBigVipUserBaseMsg(a.Session(), *config.Middleground)
 	subScribeInfo := jy.GetSubScribeInfo(a.Session(), Mgo, "m", "10000")
 	data := M{}
 	data["super_subscribe"] = true //超级订阅
+	if bigMsg.VipStatus > 0 {
+		data["super_subscribe"] = true //超级订阅
+	} else {
+		data["free_subscribe"] = true //免费订阅
+	}
 	if bigMsg.Status > 0 {
 		data["member_subscribe"] = OpenStatus(*subScribeInfo, "member_subscribe", bigMsg) //大会员订阅
 		delete(data, "free_subscribe")
@@ -50,7 +56,6 @@ func (a *Action) Items() {
 		data["follow_ent"] = true     //企业关注
 		data["follow_project"] = true //项目关注
 	}
-
 	data["entniche"] = bigMsg.IsEntService
 	a.ServeJson(Result{
 		Data: data,
@@ -65,7 +70,7 @@ func (a *Action) Detail() {
 		return
 	}
 	var data M
-	bigMsg := jy.GetBigVipUserBaseMsg( a.Session(), *config.Middleground)
+	bigMsg := jy.GetBigVipUserBaseMsg(a.Session(), *config.Middleground)
 	switch a.GetString("item") {
 	case "member_subscribe":
 		o_member_jy := jy.GetSubScribeInfo(a.Session(), Mgo, "m", "10000")
@@ -84,8 +89,8 @@ func (a *Action) Detail() {
 			"wxpush":         util.IntAll((*o_member_jy)["i_wxpush"]),
 		}
 		power := []int{}
-		BigMsg := jy.GetBigVipUserBaseMsg( a.Session(),*config.Middleground)
-		for k,_ := range BigMsg.PowerMap {
+		BigMsg := jy.GetBigVipUserBaseMsg(a.Session(), *config.Middleground)
+		for k, _ := range BigMsg.PowerMap {
 			power = append(power, k)
 		}
 		data["power"] = power

+ 17 - 78
src/jfw/modules/bigmember/src/service/use/use.go

@@ -17,6 +17,7 @@ import (
 	elastic "app.yhyue.com/moapp/jybase/esv1"
 	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
 	"app.yhyue.com/moapp/jybase/mongodb"
+	"app.yhyue.com/moapp/jybase/redis"
 	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 
 	elastic1 "app.yhyue.com/moapp/esv1/gopkg.in/olivere/elastic.v1"
@@ -700,8 +701,9 @@ type UserInfo struct {
 //是否使用过首次使用
 func (u *Use) IsAdd() {
 	r := func() Result {
-		//uRefer := u.Refer()
+		uRefer := u.Refer()
 		var userInfo = &UserInfo{}
+		userid := qu.ObjToString(u.GetSession("userId"))
 		bigPower := jy.GetBigVipUserBaseMsg(u.Session(), *config.Middleground)
 		userInfo = &UserInfo{
 			BigMemberStatus: bigPower.Status,
@@ -723,78 +725,25 @@ func (u *Use) IsAdd() {
 			FreeBuyerPort:   bigPower.FreeBuyerPort,
 			FreeFile:        bigPower.FreeFile,
 			FreeHasKey:      bigPower.FreeHasKey,
+			VipBefore202209: bigPower.VipStatus > 0 && bigPower.VipStartDate < config.Config.ContextOldVipLimit, //超级订阅 超前项目权限
+		}
+		userInfo.EntName = bigPower.Data.Ent.Name
+		userInfo.EntRoleId = int(bigPower.Data.Ent.EntRoleId)
+		//是否是商机管理有效用户:1、管理员和员工已分配功能
+		userInfo.EntNiche = bigPower.EntnicheStatus == 1 && bigPower.Data.Entniche.IsEntPower > 0
+		userInfo.EntIsNew = bigPower.EntIsNew && userInfo.EntNiche
+		//有商机管理服务的用户 就不是商机管理用户
+		if userInfo.IsEntService = bigPower.Data.Ent.PowerSource > 0 && bigPower.Data.Entniche.IsEntPower > 0; userInfo.IsEntService {
+			userInfo.EntIsNew = false
+			userInfo.EntNiche = false
 		}
-<<<<<<< HEAD
 		power := []int{}
 		for k, _ := range bigPower.PowerMap {
 			power = append(power, k)
-=======
-		var (
-			userInfo      = &UserInfo{}
-			userCacheBool = false
-		)
-
-		baseInfoCacheKey := fmt.Sprintf(jy.IsGetUserBaseInfoRedisKey, userid)
-		if bytes, err := redis.GetBytes(jy.BaseInfoCacheDb, baseInfoCacheKey); err == nil && len(*bytes) > 0 {
-			err = json.Unmarshal(*bytes, &userInfo)
-			if err == nil {
-				userCacheBool = true
-			} else {
-				log.Println("缓存异常")
-			}
-		}
-		if !userCacheBool {
-			bigPower := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo)
-			userInfo = &UserInfo{
-				BigMemberStatus: bigPower.Status,
-				Combo:           level_map[bigPower.Status],
-				IsSubCount:      bigPower.Pid != "",
-				IsMemberTrial:   bigPower.HasTrial,
-				IsUsed:          bigPower.Used,
-				EntName:         bigPower.EntName,
-				EntNiche:        bigPower.EntnicheStatus > 0,
-				VipStatus:       bigPower.VipStatus,
-				Viper:           bigPower.Vip_BuySet.Upgrade > 0,
-				IsFree:          bigPower.VipStatus <= 0 && bigPower.Status <= 0 && bigPower.EntnicheStatus <= 0,
-				IsFreeUpgrade:   bigPower.IsUpgrade,
-				EntIsNew:        bigPower.EntIsNew,
-				IsEntService:    bigPower.IsEntService,
-				MemberPowerType: bigPower.MemberPowerType,
-				VipPowerType:    bigPower.VipPowerType,
-				VipBefore202209: bigPower.VipStatus > 0 && bigPower.VipStartDate < config.Config.ContextOldVipLimit, //超级订阅 超前项目权限
-			}
-			if entId == 0 && phone != "" {
-				entId = initEntSess(phone)
-			}
-			if entId > 0 && bigPower.EntInfo[entId] != nil {
-				userInfo.EntName = bigPower.EntInfo[entId].Name
-				userInfo.EntRoleId = bigPower.EntInfo[entId].RoleId
-				//是否是商机管理有效用户:1、管理员和员工已分配功能
-				userInfo.EntNiche = bigPower.EntInfo[entId].Status == 1 && bigPower.EntInfo[entId].IsPower
-				userInfo.EntIsNew = bigPower.EntInfo[entId].IsNew && userInfo.EntNiche
-				//有商机管理服务的用户 就不是商机管理用户
-				if userInfo.IsEntService = bigPower.EntInfo[entId].IsService && bigPower.EntInfo[entId].IsPower; userInfo.IsEntService {
-					userInfo.EntIsNew = false
-					userInfo.EntNiche = false
-				}
-			}
-			power := []int{}
-			for k, _ := range bigPower.PowerMap {
-				power = append(power, k)
-			}
-			userInfo.Powers = power
-			//是否是免费用户
-			userInfo.IsFree = bigPower.VipStatus <= 0 && bigPower.Status <= 0 && !userInfo.EntNiche
-			//存储缓存
-			go func() {
-				if bytes, err := json.Marshal(userInfo); err == nil && bytes != nil {
-					if redis.PutBytes(jy.BaseInfoCacheDb, baseInfoCacheKey, &bytes, config.Config.IsAddCacheTime+rand.Intn(120)) != nil {
-						log.Println("信息缓存异常")
-					}
-				}
-			}()
 		}
-		//不存缓存
+		userInfo.Powers = power
+		//是否是免费用户
+		userInfo.IsFree = bigPower.VipStatus <= 0 && bigPower.Status <= 0 && !userInfo.EntNiche
 		//vip
 		if userInfo.VipStatus > 0 {
 			vipBool := true
@@ -806,7 +755,6 @@ func (u *Use) IsAdd() {
 						break
 					}
 				}
-
 			}
 			if vipBool {
 				//没有大会员附件下载权限
@@ -830,20 +778,11 @@ func (u *Use) IsAdd() {
 						break
 					}
 				}
-
 			}
 			if freeBool {
-				//免费用户是否有关键词
-				user, ok := db.Mgo.FindById("user", userid, `{"o_jy":1}`)
-				if ok && user != nil {
-					o_jy, _ := (*user)["o_jy"].(map[string]interface{})
-					a_key, _ := o_jy["a_key"].([]interface{})
-					userInfo.FreeHasKey = len(a_key) > 0
-				}
 				//免费用户可查看企业画像次数//免费用户可查看采购单位画像次数//免费用户可以进行附件下载次数
 				userInfo.FreeEntPort, userInfo.FreeBuyerPort, userInfo.FreeFile = jy.FreeExperience(userid)
 			}
->>>>>>> master
 		}
 		userInfo.Powers = power
 		userInfo.CustomerService = config.Config.Customers

+ 0 - 15
src/jfw/modules/publicapply/src/attachmentdow/service/service.go

@@ -34,15 +34,8 @@ func (u *Dow) SupplyInfoFileDownload() {
 		if userid == "" {
 			return Result{Data: nil, Error_msg: "未登录"}
 		}
-
-<<<<<<< HEAD
 		BaseMsg := jy.GetBigVipUserBaseMsg(u.Session(), *config.Middleground)
 		vipStatus := jy.GetVipState(u.Session(), *config.Middleground, userid)
-=======
-		entId := qu.IntAll(u.GetSession("entId"))
-		BaseMsg := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo)
-		vipStatus := jy.GetVipState(db.Mysql, db.Mgo, userid, entId)
->>>>>>> master
 		isPower := false
 		//大会员下载权限判断
 		if BaseMsg.Status > 0 && BaseMsg.PowerMap[3] {
@@ -125,16 +118,8 @@ func (u *Dow) Subdow() {
 		if userid == "" {
 			return Result{Data: nil, Error_msg: "未登录"}
 		}
-<<<<<<< HEAD
 		BaseMsg := jy.GetBigVipUserBaseMsg(u.Session(), *config.Middleground)
 		vipStatus := jy.GetVipState(u.Session(), *config.Middleground, userid)
-=======
-
-		entId := qu.IntAll(u.GetSession("entId"))
-		BaseMsg := jy.GetBigVipUserBaseMsg(userid, db.Mysql, db.Mgo)
-		vipStatus := jy.GetVipState(db.Mysql, db.Mgo, userid, entId)
-
->>>>>>> master
 		var (
 			mon string
 			ss  int

+ 1 - 1
src/jfw/modules/publicapply/src/go.mod

@@ -4,7 +4,7 @@ go 1.18
 
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a
-	app.yhyue.com/moapp/jypkg v0.0.0-20230209055147-4cf703ace114
+	app.yhyue.com/moapp/jypkg v0.0.0-20230210020312-75e22a7a7be4
 	bp.jydev.jianyu360.cn/BaseService/userCenter v0.0.0-20230129060002-f69424aa14ba
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
 	github.com/gogf/gf/v2 v2.0.6

+ 2 - 2
src/jfw/modules/publicapply/src/go.sum

@@ -13,8 +13,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20220802080941-07f401baab8b/go.mod h1:HelrO6tc
 app.yhyue.com/moapp/jybase v0.0.0-20230109015757-aa3d5e19b196/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
 app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a h1:wD4aWPSYdiX1cIP4lzzPD2s7fYhKa3muIf97l9tonJE=
 app.yhyue.com/moapp/jybase v0.0.0-20230117032034-ad7c00ffe11a/go.mod h1:zB47XTeJvpcbtBRYgkQuxOICWNexiZfbUO+7aUf6mNs=
-app.yhyue.com/moapp/jypkg v0.0.0-20230209055147-4cf703ace114 h1:89J5Zq4bfnocIpEWBn19PnfaT+8Dh+Rv4X8QoTwxCpg=
-app.yhyue.com/moapp/jypkg v0.0.0-20230209055147-4cf703ace114/go.mod h1:sa5YRPqTQLOVBmpltjT21EkQ7DfJbUZFARUb4ZJ7U+k=
+app.yhyue.com/moapp/jypkg v0.0.0-20230210020312-75e22a7a7be4 h1:bzZsVBu3XOef3dDkfR3+01h8JBG1LchE+ClhUiAA9HQ=
+app.yhyue.com/moapp/jypkg v0.0.0-20230210020312-75e22a7a7be4/go.mod h1:sa5YRPqTQLOVBmpltjT21EkQ7DfJbUZFARUb4ZJ7U+k=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae h1:6rDDaz6yxvE8viTSzEBwKYOFWq14TMfuBivSazUZMz4=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae/go.mod h1:b0zZHev3gmJao1Fo+2Z2KPVjsuLOJVvVxf+kCnu9WkA=
 bp.jydev.jianyu360.cn/BP/jynsq v0.0.0-20220222052708-ebc43af90698/go.mod h1:ojo/AUH9Yr1wzarEjOaNMkj1Cet/9r8IgLyba64Z52E=

+ 53 - 298
src/jfw/modules/publicapply/src/userbase/entity/entity.go

@@ -1,13 +1,11 @@
 package entity
 
 import (
-<<<<<<< HEAD
 	"encoding/json"
 	"fmt"
 	"jy/src/jfw/modules/publicapply/src/config"
 	"jy/src/jfw/modules/publicapply/src/db"
 	"jy/src/jfw/modules/publicapply/src/userbase/initjson"
-	. "jy/src/jfw/modules/publicapply/src/userbase/initjson"
 	"net/url"
 	"strings"
 	"time"
@@ -25,51 +23,23 @@ type UserInfo struct {
 	Platform string //平台 PC WX APP
 	Names    string //功能名称
 	Session  *httpsession.Session
-=======
-    "config"
-    "db"
-    "encoding/json"
-    "fmt"
-    "net/url"
-    "qfw/util"
-    "qfw/util/jy"
-    "qfw/util/redis"
-    "strings"
-    "time"
-    "userbase/initjson"
-)
-
-type UserInfo struct {
-    UserId   string //用户id
-    Platform string //平台 PC WX APP
-    Names    string //功能名称
->>>>>>> master
 }
 
 type FuncNames struct {
-    Name string `json:"name"`
-    Url  string `json:"url"`
-    Img  string `json:"img"`
+	Name string `json:"name"`
+	Url  string `json:"url"`
+	Img  string `json:"img"`
 }
 
-<<<<<<< HEAD
 func NewUserInfo(userId, platform, names string, session *httpsession.Session) *UserInfo {
 	if platform == "" {
 		platform = "PC"
 	}
 	return &UserInfo{userId, platform, names, session}
-=======
-func NewUserInfo(userId, platform, names string) *UserInfo {
-    if platform == "" {
-        platform = "PC"
-    }
-    return &UserInfo{userId, platform, names}
->>>>>>> master
 }
 
 //保存
 func (this *UserInfo) SaveNameByUserId() bool {
-<<<<<<< HEAD
 	queryMap := map[string]interface{}{
 		"s_userId":   this.UserId,
 		"s_platform": this.Platform,
@@ -90,49 +60,25 @@ func (this *UserInfo) SaveNameByUserId() bool {
 			"s_platform":   this.Platform,
 		},
 	}
-	return db.Mgo.Update(BaseFuncInfo.Cfcollotion, queryMap, updateMap, true, false)
-=======
-    queryMap := map[string]interface{}{
-        "s_userId":   this.UserId,
-        "s_platform": this.Platform,
-    }
-    var namesarr = []string{}
-    if this.Names != "" {
-        for _, v := range strings.Split(this.Names, ",") {
-            if !ChargeMap[v] || IsPower(v, this.UserId) {
-                namesarr = append(namesarr, v)
-            }
-        }
-    }
-    updateMap := map[string]interface{}{
-        "$set": map[string]interface{}{
-            "l_createtime": time.Now().Unix(),
-            "s_userId":     this.UserId,
-            "s_names":      strings.Join(namesarr, ","),
-            "s_platform":   this.Platform,
-        },
-    }
-    return db.Mgo.Update(initjson.BaseFuncInfo.Cfcollotion, queryMap, updateMap, true, false)
->>>>>>> master
+	return db.Mgo.Update(initjson.BaseFuncInfo.Cfcollotion, queryMap, updateMap, true, false)
 }
 
 //获取用户已选功能或基本功能
 func (this *UserInfo) GetNameByUserId() (fns []*FuncNames) {
-<<<<<<< HEAD
 	queryMap := map[string]interface{}{
 		"s_userId":   this.UserId,
 		"s_platform": this.Platform,
 	}
-	res, ok := db.Mgo.FindOne(BaseFuncInfo.Cfcollotion, queryMap)
+	res, ok := db.Mgo.FindOne(initjson.BaseFuncInfo.Cfcollotion, queryMap)
 	if ok && len(*res) > 0 {
 		names := util.ObjToString((*res)["s_names"])
 		if names != "" {
 		L:
 			for _, nv := range strings.Split(names, ",") {
-				if len(fns) >= BaseFuncInfo.Total {
+				if len(fns) >= initjson.BaseFuncInfo.Total {
 					break
 				}
-				for _, v := range BaseFuncInfo.CommonFunctions {
+				for _, v := range initjson.BaseFuncInfo.CommonFunctions {
 					if v.Name == nv {
 						fns = append(fns, &FuncNames{
 							Name: v.Name,
@@ -145,7 +91,7 @@ func (this *UserInfo) GetNameByUserId() (fns []*FuncNames) {
 			}
 		}
 	} else {
-		for _, v := range BaseFuncInfo.CommonFunctions {
+		for _, v := range initjson.BaseFuncInfo.CommonFunctions {
 			if v.Isbase {
 				if v.Name == "订阅管理" && !IsPower(v.Name, this.Session) {
 					continue
@@ -156,65 +102,19 @@ func (this *UserInfo) GetNameByUserId() (fns []*FuncNames) {
 					Img:  thisByPlat(this.Platform, "img", &v),
 				})
 			}
-			if len(fns) >= BaseFuncInfo.Total {
+			if len(fns) >= initjson.BaseFuncInfo.Total {
 				break
 			}
 		}
 	}
 	return fns
-=======
-    queryMap := map[string]interface{}{
-        "s_userId":   this.UserId,
-        "s_platform": this.Platform,
-    }
-    res, ok := db.Mgo.FindOne(initjson.BaseFuncInfo.Cfcollotion, queryMap)
-    if ok && len(*res) > 0 {
-        names := util.ObjToString((*res)["s_names"])
-        if names != "" {
-        L:
-            for _, nv := range strings.Split(names, ",") {
-                if len(fns) >= initjson.BaseFuncInfo.Total {
-                    break
-                }
-                for _, v := range initjson.BaseFuncInfo.CommonFunctions {
-                    if v.Name == nv {
-                        fns = append(fns, &FuncNames{
-                            Name: v.Name,
-                            Url:  thisByPlat(this.Platform, "url", &v),
-                            Img:  thisByPlat(this.Platform, "img", &v),
-                        })
-                        continue L
-                    }
-                }
-            }
-        }
-    } else {
-        for _, v := range initjson.BaseFuncInfo.CommonFunctions {
-            if v.Isbase {
-                if v.Name == "订阅管理" && !IsPower(v.Name, this.UserId) {
-                    continue
-                }
-                fns = append(fns, &FuncNames{
-                    Name: v.Name,
-                    Url:  thisByPlat(this.Platform, "url", &v),
-                    Img:  thisByPlat(this.Platform, "img", &v),
-                })
-            }
-            if len(fns) >= initjson.BaseFuncInfo.Total {
-                break
-            }
-        }
-    }
-    return fns
->>>>>>> master
 }
 
 var ChargeMap = map[string]bool{}
 
 //获取所有用户可用功能
 func (this *UserInfo) AllNames() (fns []*FuncNames) {
-<<<<<<< HEAD
-	for _, v := range BaseFuncInfo.CommonFunctions {
+	for _, v := range initjson.BaseFuncInfo.CommonFunctions {
 		ChargeMap[v.Name] = v.Charge
 		if !v.Charge || IsPower(v.Name, this.Session) {
 			fns = append(fns, &FuncNames{
@@ -225,53 +125,39 @@ func (this *UserInfo) AllNames() (fns []*FuncNames) {
 		}
 	}
 	return fns
-=======
-    for _, v := range initjson.BaseFuncInfo.CommonFunctions {
-        ChargeMap[v.Name] = v.Charge
-        if !v.Charge || IsPower(v.Name, this.UserId) {
-            fns = append(fns, &FuncNames{
-                Name: v.Name,
-                Url:  thisByPlat(this.Platform, "url", &v),
-                Img:  thisByPlat(this.Platform, "img", &v),
-            })
-        }
-    }
-    return fns
->>>>>>> master
 }
 
 //
 func thisByPlat(platform, name string, bcv *initjson.BaseFunc) (res string) {
-    switch platform {
-    case "APP":
-        switch name {
-        case "url":
-            res = bcv.APP.Url
-        case "img":
-            res = bcv.APP.Img
-        }
-    case "WX":
-        switch name {
-        case "url":
-            res = bcv.WX.Url
-        case "img":
-            res = bcv.WX.Img
-        }
-    default:
-        switch name {
-        case "url":
-            res = bcv.PC.Url
-        case "img":
-            res = bcv.PC.Img
-        }
-    }
-    return
+	switch platform {
+	case "APP":
+		switch name {
+		case "url":
+			res = bcv.APP.Url
+		case "img":
+			res = bcv.APP.Img
+		}
+	case "WX":
+		switch name {
+		case "url":
+			res = bcv.WX.Url
+		case "img":
+			res = bcv.WX.Img
+		}
+	default:
+		switch name {
+		case "url":
+			res = bcv.PC.Url
+		case "img":
+			res = bcv.PC.Img
+		}
+	}
+	return
 }
 
 //查看是否有使用此功能的权限
-<<<<<<< HEAD
 func IsPower(name string, session *httpsession.Session) (b bool) {
-	BigPower := jy.GetBigVipUserBaseMsg( session,*config.Middleground)
+	BigPower := jy.GetBigVipUserBaseMsg(session, *config.Middleground)
 	if BigPower.Status > 0 {
 		switch name {
 		case "企业情报监控":
@@ -306,7 +192,7 @@ func HasIndustryTag(session *httpsession.Session, userId string) bool {
 		return res.(bool)
 	}
 	var hasTag bool
-	vipStatus := jy.GetVipState( session,*config.Middleground, userId)
+	vipStatus := jy.GetVipState(session, *config.Middleground, userId)
 	if vipStatus.VipState > 0 || vipStatus.BigMember > 0 || vipStatus.EntMember > 0 { // 仅免费用户查询
 		redis.Put("newother", cacheKey, hasTag, cacheTimeout)
 		return hasTag
@@ -368,143 +254,35 @@ func SellerTokenDecrypt(token string) (uId, sName string, sid int, desc map[stri
 		err = fmt.Errorf("token参数格式异常")
 		return
 	}
-=======
-func IsPower(name, userId string) (b bool) {
-    BigPower := jy.GetBigVipUserBaseMsg(userId, db.Mysql, db.Mgo)
-    if BigPower.Status > 0 {
-        switch name {
-        case "企业情报监控":
-            b = BigPower.PowerMap[4] || BigPower.PowerMap[12] || BigPower.PowerMap[13]
-        case "潜在客户挖掘", "客户关注":
-            b = BigPower.PowerMap[7]
-        case "潜在竞争对手/合作伙伴挖掘":
-            b = BigPower.PowerMap[8]
-        case "中标企业预测":
-            b = BigPower.PowerMap[15]
-        case "投标决策分析":
-            b = BigPower.PowerMap[6]
-        case "潜在项目预测":
-            b = BigPower.PowerMap[9]
-        case "周报", "月报", "定制化分析报告":
-            b = BigPower.PowerMap[10]
-        case "订阅管理":
-            b = util.If(BigPower.Pid == "", true, false).(bool)
-        default:
-            b = true
-        }
-    }
-    return b
-}
+	uId = param.Get("uid")
+	sName = param.Get("sName")
+	sid = util.IntAll(param.Get("sid"))
 
-// HasIndustryTag  是否有行业标签
-func HasIndustryTag(userId string, entId int) bool {
-    cacheKey := fmt.Sprintf("industryTag_%s", userId) // 缓存的key
-    cacheTimeout := 60 * 3                            // 缓存的时间-三分钟
-    //// 查缓存
-    if res := redis.Get("newother", cacheKey); res != nil {
-        return res.(bool)
-    }
-    var hasTag bool
-    vipStatus := jy.GetVipState(db.Mysql, db.Mgo, userId, entId)
-    if vipStatus.VipState > 0 || vipStatus.BigMember > 0 || vipStatus.EntMember > 0 { // 仅免费用户查询
-        redis.Put("newother", cacheKey, hasTag, cacheTimeout)
-        return hasTag
-    }
-    // 查免费用户订阅的关键词
-    rs, b := db.Mgo.FindById("user", userId, `"o_jy":1`)
-    if !b || rs == nil || len(*rs) == 0 || (*rs)["o_jy"] == nil {
-        // 没查到关键词
-        redis.Put("newother", cacheKey, hasTag, cacheTimeout)
-        return hasTag
-    }
-    oJY := (*rs)["o_jy"].(map[string]interface{})
-    if oJY["a_key"] == nil || oJY["a_key"].([]interface{}) == nil {
-        return hasTag
-    }
-    keys := util.ObjArrToMapArr(oJY["a_key"].([]interface{}))
-    if len(keys) == 0 {
-        redis.Put("newother", cacheKey, hasTag, cacheTimeout)
-        return hasTag
-    }
-    var valuesList []string
-    for i := 0; i < len(keys); i++ {
-        if key, b := keys[i]["key"]; b {
-            tmp := key.([]interface{})
-            if len(tmp) > 0 {
-                valuesList = append(valuesList, util.ObjToString(tmp[0]))
-            }
-        }
-    }
-    // 查是否是标签用户
-    q := "select id FROM rule_equipment where `key` regexp ?  LIMIT 1"
-    existRs := db.MysqlMedical.SelectBySql(q, strings.Join(valuesList, "|"))
-    if existRs == nil || len(*existRs) == 0 {
-        hasTag = false
-    } else {
-        hasTag = true
-    }
-    redis.Put("newother", cacheKey, hasTag, cacheTimeout) // 存缓存
-    return hasTag
-}
-
-func SellerTokenDecrypt(token string) (uId, sName string, sid int, desc map[string]interface{}, err error) {
-    if token == "" {
-        err = fmt.Errorf("缺少token")
-        return
-    }
-    param, err := url.ParseQuery(util.SE.Decode4Hex(token))
-    if err != nil {
-        err = fmt.Errorf("token格式异常")
-        return
-    }
-    //if qutil.Int64All(param.Get("t")) < time.Now().Unix()-int64(60*5) {
-    //	err = fmt.Errorf("链接已失效")
-    //	return
-    //}
-    //取参数
-    err = json.Unmarshal([]byte(param.Get("desc")), &desc)
-    if err != nil {
-        err = fmt.Errorf("token参数格式异常")
-        return
-    }
->>>>>>> master
-
-    uId = param.Get("uid")
-    sName = param.Get("sName")
-    sid = util.IntAll(param.Get("sid"))
-
-    if uId == "" || sName == "" || sid == 0 || len(desc) == 0 {
-        err = fmt.Errorf("缺少参数")
-        return
-    }
-    return
+	if uId == "" || sName == "" || sid == 0 || len(desc) == 0 {
+		err = fmt.Errorf("缺少参数")
+		return
+	}
+	return
 }
 
 //用户一次性弹窗信息集合
 type TipInfoStruct struct {
-<<<<<<< HEAD
 	UserId  string
 	DoType  string
 	TipName string
 	Session *httpsession.Session
-=======
-    UserId  string
-    DoType  string
-    TipName string
->>>>>>> master
 }
 
 //
 func NewTipInfo(userId, doType, tipName string) *TipInfoStruct {
-    return &TipInfoStruct{
-        UserId:  userId,
-        DoType:  doType,
-        TipName: tipName,
-    }
+	return &TipInfoStruct{
+		UserId:  userId,
+		DoType:  doType,
+		TipName: tipName,
+	}
 }
 
 //
-<<<<<<< HEAD
 func (this *TipInfoStruct) GetTipInfo() (flag int) {
 	queryMap := map[string]interface{}{
 		"s_userId": this.UserId,
@@ -523,42 +301,19 @@ func (this *TipInfoStruct) GetTipInfo() (flag int) {
 	} else { //查询是否提示弹框
 		//判断是否严重用户注册时间
 		if config.Config.TipInfo[this.TipName] > 0 {
-			userBase := jy.GetBigVipUserBaseMsg( this.Session,*config.Middleground)
+			userBase := jy.GetBigVipUserBaseMsg(this.Session, *config.Middleground)
 			//此时间点后注册的新用户
 			if userBase.Registedate > config.Config.TipInfo[this.TipName] {
 				return 999
 			}
 		}
+		queryMap[this.TipName] = map[string]interface{}{
+			"$gt": 0,
+		}
 		result, ok := db.Mgo.FindOneByField("tip_info", queryMap, map[string]interface{}{this.TipName: 1})
 		if ok && result != nil && len(*result) > 0 {
 			return util.IntAll((*result)[this.TipName])
 		}
 	}
 	return 0
-=======
-func (this *TipInfoStruct) GetTipInfo() (flag bool) {
-    queryMap := map[string]interface{}{
-        "s_userId": this.UserId,
-    }
-    if this.DoType == "know" { //我知道了 更新
-        flag = db.Mgo.Update("tip_info", queryMap, map[string]interface{}{
-            "$set": map[string]interface{}{
-                this.TipName: 1,
-                fmt.Sprintf("l_%s_updatetime", this.TipName): time.Now().Unix(),
-            },
-        }, true, false)
-    } else { //查询是否提示弹框
-        //判断是否严重用户注册时间
-        if config.Config.TipInfo[this.TipName] > 0 {
-            userBase := jy.GetBigVipUserBaseMsg(this.UserId, db.Mysql, db.Mgo)
-            //此时间点后注册的新用户
-            if userBase.Registedate > config.Config.TipInfo[this.TipName] {
-                return true
-            }
-        }
-        queryMap[this.TipName] = 1
-        flag = db.Mgo.Count("tip_info", queryMap) > 0
-    }
-    return flag
->>>>>>> master
 }

+ 0 - 7
src/jfw/modules/publicapply/src/userbase/service/service.go

@@ -84,7 +84,6 @@ func (this *ServiceStruct) IndustryTag() {
 	token := this.GetString("token")
 	var userId string
 	var err error
-	var entId int
 	if token != "" {
 		userId, _, _, _, err = entity.SellerTokenDecrypt(token)
 		if err != nil {
@@ -93,19 +92,13 @@ func (this *ServiceStruct) IndustryTag() {
 		}
 	} else {
 		userId, _ = this.GetSession("userId").(string)
-		entId = qu.IntAll(this.GetSession("entId"))
-
 	}
 	defer qu.Catch()
 	r := func() Result {
 		if this.Method() != "POST" {
 			return Result{Data: nil, Error_msg: Error_msg_1005}
 		}
-<<<<<<< HEAD
 		return Result{Data: entity.HasIndustryTag(this.Session(), userId)}
-=======
-		return Result{Data: entity.HasIndustryTag(userId, entId)}
->>>>>>> master
 	}()
 	this.ServeJson(r)
 }

+ 8 - 6
src/jfw/public/dataexport.go

@@ -2,15 +2,17 @@ package public
 
 import (
 	"fmt"
-	"jfw/config"
-	"jfw/modules/common/src/qfw/util/jy"
+	"jy/src/jfw/config"
 	"log"
-	"qfw/util"
-	"qfw/util/dataexport"
-	"qfw/util/mail"
 	"strings"
 	"sync"
 	"time"
+
+	util "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/encrypt"
+	"app.yhyue.com/moapp/jybase/mail"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/dataexport"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 )
 
 var ExConf *DataexportConfig
@@ -215,7 +217,7 @@ func (this *BidSearchExport) PassBidSearchExport() (returnData map[string]interf
 	if this.SelectIds != "" {
 		ids := []string{}
 		for _, encodeId := range strings.Split(this.SelectIds, ",") {
-			if tmp := util.CommonDecodeArticle("content", encodeId); len(tmp) > 0 {
+			if tmp := encrypt.CommonDecodeArticle("content", encodeId); len(tmp) > 0 {
 				if id := tmp[0]; id != "" {
 					ids = append(ids, id)
 				}