فهرست منبع

Merge branch 'feature/v4.9.21' of https://jygit.jydev.jianyu360.cn/qmx/jy into dev/v4.9.21_wmh

wenmenghao321 1 سال پیش
والد
کامیت
8375dcb67e
100فایلهای تغییر یافته به همراه2151 افزوده شده و 891 حذف شده
  1. 3 3
      src/db.json
  2. 1 1
      src/go.mod
  3. 2 2
      src/go.sum
  4. 18 3
      src/jfw/front/classificationTag.go
  5. 1 1
      src/jfw/front/front.go
  6. 63 44
      src/jfw/front/pcIndex.go
  7. 9 0
      src/jfw/front/supsearch.go
  8. 213 29
      src/jfw/front/tags.go
  9. 10 0
      src/jfw/front/ws_dataExport.go
  10. 1 1
      src/jfw/modules/app/src/app/front/search.go
  11. 23 16
      src/jfw/modules/app/src/app/front/shorturl.go
  12. 4 1
      src/jfw/modules/app/src/app/front/swordfish.go
  13. 10 0
      src/jfw/modules/app/src/app/front/ws_dataExport.go
  14. 101 33
      src/jfw/modules/app/src/app/tag/ad.go
  15. 3 2
      src/jfw/modules/app/src/go.mod
  16. 15 2
      src/jfw/modules/app/src/go.sum
  17. 4 1
      src/jfw/modules/app/src/web/staticres/jyapp/css/wxinfocontent.css
  18. 4 3
      src/jfw/modules/app/src/web/templates/commonPay/paySuccess.html
  19. 1 1
      src/jfw/modules/app/src/web/templates/course/course_list.html
  20. 1 2
      src/jfw/modules/app/src/web/templates/dataExport/dataExport.html
  21. 5 5
      src/jfw/modules/app/src/web/templates/exhibition/index.html
  22. 5 5
      src/jfw/modules/app/src/web/templates/frontRouter/activity/free/202402.html
  23. 1 1
      src/jfw/modules/app/src/web/templates/vipsubscribe/vip_introduce.html
  24. 3 1
      src/jfw/modules/app/src/web/templates/vipsubscribe/vip_pay_success.html
  25. 1 1
      src/jfw/modules/app/src/web/templates/weixin/historypush.html
  26. 12 74
      src/jfw/modules/app/src/web/templates/weixin/search/mainSearch.html
  27. 28 20
      src/jfw/modules/app/src/web/templates/weixin/wxinfocontent.html
  28. 1 1
      src/jfw/modules/app/src/web/templates/weixin/wxpush.html
  29. 1 1
      src/jfw/modules/bigmember/src/entity/portraitBuyerSearch.go
  30. 1 1
      src/jfw/modules/bigmember/src/entity/portraitWinnerSearch.go
  31. 12 4
      src/jfw/modules/bigmember/src/entity/portrait_screen.go
  32. 0 4
      src/jfw/modules/bigmember/src/service/portrait/memberPortraitAction.go
  33. 5 7
      src/jfw/modules/bigmember/src/service/portrait/subvipPortraitAction.go
  34. 20 1
      src/jfw/modules/publicapply/src/activityday/consts/consts.go
  35. 51 29
      src/jfw/modules/publicapply/src/activityday/dao/dao.go
  36. 19 7
      src/jfw/modules/publicapply/src/activityday/dao/drawLottery.go
  37. 81 0
      src/jfw/modules/publicapply/src/activityday/dao/order.go
  38. 85 57
      src/jfw/modules/publicapply/src/activityday/dao/raffle.go
  39. 4 4
      src/jfw/modules/publicapply/src/activityday/service/raffle.go
  40. 1 2
      src/jfw/modules/publicapply/src/activityday/service/service.go
  41. 49 6
      src/jfw/modules/publicapply/src/activityday/util/user.go
  42. 27 7
      src/jfw/modules/publicapply/src/ad/entity/struct.go
  43. 31 18
      src/jfw/modules/publicapply/src/ad/service/actions.go
  44. 10 5
      src/jfw/modules/publicapply/src/detail/dao/bidding.go
  45. 9 15
      src/jfw/modules/publicapply/src/detail/dao/preAgent.go
  46. 30 0
      src/jfw/modules/publicapply/src/detail/util/util.go
  47. 1 1
      src/jfw/modules/publicapply/src/go.mod
  48. 2 2
      src/jfw/modules/publicapply/src/go.sum
  49. 37 2
      src/jfw/modules/subscribepay/src/config.json
  50. 22 2
      src/jfw/modules/subscribepay/src/config/config.go
  51. 97 12
      src/jfw/modules/subscribepay/src/entity/equityActive.go
  52. 10 0
      src/jfw/modules/subscribepay/src/entity/member.go
  53. 16 0
      src/jfw/modules/subscribepay/src/entity/subscribeVip.go
  54. 1 1
      src/jfw/modules/subscribepay/src/go.mod
  55. 2 1
      src/jfw/modules/subscribepay/src/invoice.json
  56. 8 0
      src/jfw/modules/subscribepay/src/service/commonAction.go
  57. 375 199
      src/jfw/modules/subscribepay/src/service/invoice.go
  58. 63 39
      src/jfw/modules/subscribepay/src/service/network.go
  59. 8 3
      src/jfw/modules/subscribepay/src/service/orderListDetails.go
  60. 59 0
      src/jfw/modules/subscribepay/src/test/test.http
  61. 3 0
      src/jfw/tag/a_init.go
  62. 95 37
      src/jfw/tag/ad.go
  63. 36 2
      src/web/staticres/common-module/active/202402/202402.js
  64. 65 50
      src/web/staticres/common-module/ad/js/index.js
  65. BIN
      src/web/staticres/common-module/exhibition/img/QRcode.png
  66. BIN
      src/web/staticres/common-module/exhibition/img/qr-code-shichang.png
  67. 64 50
      src/web/staticres/common-module/message-tip/js/index.js
  68. 1 1
      src/web/staticres/common-module/public/head.js
  69. 0 0
      src/web/staticres/common-module/track/j-track.amd.min.js
  70. 0 0
      src/web/staticres/common-module/track/j-track.es.min.js
  71. 0 0
      src/web/staticres/common-module/track/j-track.min.js
  72. BIN
      src/web/staticres/frontRouter/pc/activity/image/202404/header-banner-title@2x.png
  73. 29 3
      src/web/staticres/frontRouter/pc/activity/js/202402.js
  74. BIN
      src/web/staticres/images/index/new/shangwuhezuo-blue.png
  75. BIN
      src/web/staticres/images/index/new/shangwuhezuo.png
  76. 3 3
      src/web/staticres/js/biddingSearch.js
  77. 1 1
      src/web/staticres/js/index/index_2023.12.js
  78. 28 4
      src/web/staticres/js/selector/area-city-data.js
  79. 13 1
      src/web/staticres/public-pc/css/sub-page.css
  80. 35 3
      src/web/staticres/serviceSystem/js/serviceSystem.js
  81. 1 1
      src/web/templates/common/friend-link.html
  82. 1 1
      src/web/templates/common/pc-header-nav-second.html
  83. 2 2
      src/web/templates/common/pc-login-dialog.html
  84. 13 4
      src/web/templates/common/pcbottom.html
  85. 1 1
      src/web/templates/common/pchead.html
  86. 1 1
      src/web/templates/course/pc/course_detail.html
  87. 2 2
      src/web/templates/course/pc/course_list.html
  88. 5 5
      src/web/templates/course/weixin/course_list.html
  89. 1 1
      src/web/templates/dataMarket/dataInterface/index.html
  90. 5 5
      src/web/templates/exhibition/pc/index.html
  91. 3 3
      src/web/templates/exhibition/weixin/index.html
  92. 10 6
      src/web/templates/frontRouter/pc/activity/free/202402.html
  93. 2 2
      src/web/templates/frontRouter/pc/brand/free/index.html
  94. 1 1
      src/web/templates/frontRouter/pc/industryInfo/free/index.html
  95. 29 0
      src/web/templates/frontRouter/pc/partner/free/index.html
  96. 1 1
      src/web/templates/frontRouter/pc/school/free/index.html
  97. 6 6
      src/web/templates/frontRouter/pc/serviceSystem/free/index.html
  98. 4 4
      src/web/templates/frontRouter/pc/squeeze/sess/test.html
  99. 4 4
      src/web/templates/frontRouter/wx/activity/free/202402.html
  100. 6 3
      src/web/templates/order/pc/paySuccess.html

+ 3 - 3
src/db.json

@@ -32,7 +32,7 @@
   },
   "elasticsearch": {
     "main": {
-      "address": "http://192.168.3.241:9205,http://192.168.3.149:9200",
+      "address": "http://192.168.3.149:9200",
       "size": 30,
       "version": "v7",
       "userName": "",
@@ -41,7 +41,7 @@
       "esType": "bidding"
     },
     "other": {
-      "address": "http://192.168.3.241:9205,http://192.168.3.149:9200",
+      "address": "http://192.168.3.149:9200",
       "size": 30,
       "version": "v7",
       "userName": "",
@@ -50,7 +50,7 @@
       "esType": "bidding_year"
     },
     "free": {
-      "address": "http://192.168.3.241:9205,http://192.168.3.149:9200",
+      "address": "http://192.168.3.149:9200",
       "size": 30,
       "version": "v7",
       "userName": "",

+ 1 - 1
src/go.mod

@@ -6,7 +6,7 @@ require (
 	app.yhyue.com/moapp/jyMarketing v0.0.2-0.20230308011651-df591d32df88
 	app.yhyue.com/moapp/jybase v0.0.0-20240412015757-6d8429bb4dae
 	app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545
-	app.yhyue.com/moapp/jypkg v1.15.8-0.20240429101401-e9a346a1e7a0
+	app.yhyue.com/moapp/jypkg v1.19.7
 	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.16
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
 	github.com/bwmarrin/snowflake v0.3.0

+ 2 - 2
src/go.sum

@@ -20,8 +20,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20240412015757-6d8429bb4dae/go.mod h1:XHNATN6t
 app.yhyue.com/moapp/jyfs v0.0.0-20231024061508-480c270480d4/go.mod h1:61hzZ3dZHXL28BNl8BOgZsvM2S5UVY5YFzOkEUPrSu4=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545 h1:+Lak4m1zgsigQloOsvp8AJ+0XeX/+PGp9QP550xlbBQ=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545/go.mod h1:uFrsdUBFbETiJlEmr4PtJWPsZlUpPj2bHQRhryu6ggk=
-app.yhyue.com/moapp/jypkg v1.15.8-0.20240429101401-e9a346a1e7a0 h1:a9vx1dXTwJpvMYCSvQMb6EskDRjnzpzGRMw8JfseGtw=
-app.yhyue.com/moapp/jypkg v1.15.8-0.20240429101401-e9a346a1e7a0/go.mod h1:b3+0Q50iZYNaiYn7yR9bIIvIEsPvSy5figX7riSi/n4=
+app.yhyue.com/moapp/jypkg v1.19.7 h1:KA/q1pX/LfmbTGZ/vI3o75yxNpCCsDcmHw+/wWLzhV4=
+app.yhyue.com/moapp/jypkg v1.19.7/go.mod h1:b3+0Q50iZYNaiYn7yR9bIIvIEsPvSy5figX7riSi/n4=
 app.yhyue.com/moapp/message v0.0.0-20231204024949-8c7145bfc161 h1:WGi4OEIoqw6NpNFGioUEBZnjK9aBa+xJqf/5WY+QyhM=
 app.yhyue.com/moapp/message v0.0.0-20231204024949-8c7145bfc161/go.mod h1:0Oj8SB4pVjdCLD28sy2zyM3hS0WHGpNuVcakLW43GmI=
 bp.jydev.jianyu360.cn/BP/jynsq v0.0.0-20220222052708-ebc43af90698/go.mod h1:ojo/AUH9Yr1wzarEjOaNMkj1Cet/9r8IgLyba64Z52E=

+ 18 - 3
src/jfw/front/classificationTag.go

@@ -397,6 +397,12 @@ func RecommendationBeacon() []Signal {
 		return rData
 	}
 
+	var (
+		now         = time.Now()
+		startTime   = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-7, now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix()) //最近7天
+		endTime     = fmt.Sprint(now.Unix())
+		publishTime = fmt.Sprintf("%s_%s", startTime, endTime)
+	)
 	sy := sync.RWMutex{}
 	wg := sync.WaitGroup{}
 	var data, dataArr []Signal
@@ -405,8 +411,10 @@ func RecommendationBeacon() []Signal {
 		wg.Add(1)
 		go func(vst string) {
 			defer wg.Done()
-			var list []map[string]interface{}
-			_, _, lists := bidsearch.GetPcBidSearchData("", "", "", "", vst, "", "", "", "", "", "", "", "", 1, false, nil, bidSearch_field_1, "", false, false, "", 8, "")
+			var (
+				list []map[string]interface{}
+			)
+			_, _, lists := bidsearch.GetPcBidSearchData("", "", "", publishTime, vst, "", "", "", "", "", "", "", "", 1, false, nil, bidSearch_field_1, "", false, false, "", 8, "")
 			if lists != nil {
 				for _, v1 := range *lists {
 					v1["_id"] = encrypt.CommonEncodeArticle("content", v1["_id"].(string))
@@ -562,7 +570,14 @@ func NewIndexbids(session *httpsession.Session, r *http.Request) []map[string]in
 		data.Count = total
 	*/
 	// p397 收回查看拟建权限
-	_, _, lists := bidsearch.GetPcBidSearchData("", "", "", "", "招标预告,招标公告,招标结果,招标信用信息", "", "", "", "", "", "", "", "", 1, false, nil, bidSearch_field_1, "", false, false, "", 8, "")
+
+	var (
+		now         = time.Now()
+		startTime   = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-7, now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix()) //最近7天
+		endTime     = fmt.Sprint(now.Unix())
+		publishTime = fmt.Sprintf("%s_%s", startTime, endTime)
+	)
+	_, _, lists := bidsearch.GetPcBidSearchData("", "", "", publishTime, "招标预告,招标公告,招标结果,招标信用信息", "", "", "", "", "", "", "", "", 1, false, nil, bidSearch_field_1, "", false, false, "", 8, "")
 	if lists != nil {
 		for _, v1 := range *lists {
 			v1["_id"] = encrypt.CommonEncodeArticle("content", v1["_id"].(string))

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

@@ -1719,7 +1719,7 @@ func (f *Front) GetAdByCode() {
 			if k < len(ad_indexs) {
 				index = util.IntAll(ad_indexs[k])
 			}
-			m[v] = tag.Ad(v, index, f.Request.Host)
+			m[v] = tag.Ad(v, index, f.Request.Host, string(f.Session().Id()))
 		}
 	}
 	f.ServeJson(m)

+ 63 - 44
src/jfw/front/pcIndex.go

@@ -22,6 +22,7 @@ import (
 	"regexp"
 	"strconv"
 	"strings"
+	"sync"
 	"time"
 )
 
@@ -311,6 +312,8 @@ func GetNewArticle(typ int, pageSize int) (list []map[string]interface{}) {
 		typ = 1
 	}
 	rediskey := fmt.Sprintf("pcindex_newArticle_%d", typ)
+	redisKeySL := fmt.Sprintf("pcindex_newArticle_sl_%d", typ)
+	rl := &sync.Mutex{}
 	subtype := ""
 	switch typ {
 	case 1:
@@ -328,26 +331,45 @@ func GetNewArticle(typ int, pageSize int) (list []map[string]interface{}) {
 	}
 	if l, ok := redis.Get("other", rediskey).([]interface{}); ok && l != nil && len(l) > 0 {
 		list = util.ObjArrToMapArr(l)
-	} else {
-		_, _, lists := bidsearch.GetPcBidSearchData("", "", "", "", subtype, "", "", "", "", "", "", "", "", 1, false, nil, bidSearch_field_1, "", false, false, "", pageSize, "")
-		if lists != nil && len(*lists) > 5 {
-			*lists = (*lists)[0:6]
-			for _, v := range *lists {
-				// v["_id"] = EncodeArticleId2ByCheck(v["_id"].(string))
-				v["_id"] = encrypt.CommonEncodeArticle("indexcontent", v["_id"].(string))
-				delete(v, "toptype")
-				delete(v, "s_subscopeclass")
-				tmpdate := v["publishtime"]
-				v["publishtime"] = util.Int64All(tmpdate.(float64))
-				if v["budget"] != nil {
-					v["budget"] = ConversionMoeny(v["budget"])
-				} else if v["bidamount"] != nil {
-					v["budget"] = ConversionMoeny(v["bidamount"])
+	}
+	if list == nil || len(list) == 0 {
+		rl.Lock()
+		if l, ok := redis.Get("other", redisKeySL).([]interface{}); ok && l != nil && len(l) > 0 {
+			list = util.ObjArrToMapArr(l)
+		}
+		rl.Unlock()
+		if list == nil || len(list) == 0 {
+			var (
+				now         = time.Now()
+				startTime   = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-7, now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix()) //最近7天
+				endTime     = fmt.Sprint(now.Unix())
+				publishTime = fmt.Sprintf("%s_%s", startTime, endTime)
+			)
+			_, _, lists := bidsearch.GetPcBidSearchData("", "", "", publishTime, subtype, "", "", "", "", "", "", "", "", 1, false, nil, bidSearch_field_1, "", false, false, "", pageSize, "")
+			if lists != nil && len(*lists) > 5 {
+				*lists = (*lists)[0:6]
+				for _, v := range *lists {
+					// v["_id"] = EncodeArticleId2ByCheck(v["_id"].(string))
+					v["_id"] = encrypt.CommonEncodeArticle("indexcontent", v["_id"].(string))
+					delete(v, "toptype")
+					delete(v, "s_subscopeclass")
+					tmpdate := v["publishtime"]
+					v["publishtime"] = util.Int64All(tmpdate.(float64))
+					if v["budget"] != nil {
+						v["budget"] = ConversionMoeny(v["budget"])
+					} else if v["bidamount"] != nil {
+						v["budget"] = ConversionMoeny(v["bidamount"])
+					}
 				}
-			}
 
-			list = *lists
+				list = *lists
+			}
+		}
+		if list == nil || len(list) == 0 {
+			rl.Lock()
 			redis.Put("other", rediskey, list, 2*60*60)
+			redis.Put("other", redisKeySL, list, -1)
+			rl.Unlock()
 		}
 	}
 	return list
@@ -582,28 +604,18 @@ func (f *PcIndex) SearchResult(at, name string) error {
 		return f.Redirect("/swordfish/searchinfolist.html")
 	}
 	if area != "" || stype != "" || industry != "" || city != "" || keywords != "" {
+		var (
+			sl bool
+			rl = &sync.Mutex{}
+		)
 		//
 		list := redis.Get("other", "classify_"+name)
-		query1 := `{"query": {"bool": {"must":[`
-		if area != "" {
-			query1 += `{"term":{"area":"` + area + `"}}`
-		} else if stype != "" {
-			stype = getstype(stype)
-			query1 += `{"terms":{"subtype":[`
-			for k, v := range strings.Split(stype, ",") {
-				if k > 0 {
-					query1 += `,`
-				}
-				query1 += `"` + v + `"`
-			}
-			query1 += `]}}`
-			// query1 += `{"term":{"subtype":"` + stype + `"}}`
-		} else if industry != "" {
-			query1 += `{"term":{"industry":"` + industry + `"}}`
-		} else if city != "" {
-			query1 += `{"term":{"city":"` + city + `"}}`
+		if list == nil || len(list.([]interface{})) == 0 {
+			rl.Lock()
+			sl = true
+			list = redis.Get("other", "classify_sl_"+name)
+			rl.Unlock()
 		}
-		query1 += `],"should": [],"minimum_should_match": 0}}}`
 		//p353包含采购意向与拟建
 		//获取到昨天数据
 		if stype == "" {
@@ -613,19 +625,21 @@ func (f *PcIndex) SearchResult(at, name string) error {
 		}
 		var datas *[]map[string]interface{}
 		if list == nil || len(list.([]interface{})) == 0 {
+			sl = true
 			if keywords == "" {
-				//count := elastic.Count(INDEX, TYPE, query1)
 				currentPage = no
 				startPage = rand.New(rand.NewSource(time.Now().UnixNano())).Intn(currentPage * limitcount)
-				//count1 := util.IntAll(count)
-				//if count1 < startPage || startPage < 0 {
-				//	startPage = 0
-				//}
 				query := getLastNewsQuery(area, "", stype, industry, city)
 				datas = elastic.GetPage(INDEX, TYPE, query, bidSearch_sort, `"_id","title","publishtime","toptype","subtype","type","area","href","bidopentime","winner","buyer","bidamount","budget","s_subscopeclass","projectname"`, startPage, limitcount)
 			} else {
+				var (
+					now         = time.Now()
+					startTime   = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-7, now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix()) //最近7天
+					endTime     = fmt.Sprint(now.Unix())
+					publishTime = fmt.Sprintf("%s_%s", startTime, endTime)
+				)
 				//关键词  如果规定时间内未取到数据 则按照老规则取数据   //规则开发一半被砍 暂时注释
-				_, _, datas = bidsearch.GetPcBidSearchData(keywords, "", "", "", stype, key_industry, "", "", "", "", "", "", "", 0, true, nil, bidSearch_field_1, "", false, false, "", 300, "")
+				_, _, datas = bidsearch.GetPcBidSearchData(keywords, "", "", publishTime, stype, key_industry, "", "", "", "", "", "", "", 0, true, nil, bidSearch_field_1, "", false, false, "", 300, "")
 				if datas != nil && len(*datas) > limitcount {
 					*datas = (*datas)[0:limitcount]
 				}
@@ -635,13 +649,18 @@ func (f *PcIndex) SearchResult(at, name string) error {
 					v["_id"] = encrypt.CommonEncodeArticle("content", util.ObjToString(v["_id"]))
 				}
 			}
-			timeout := util.IntAllDef(config.Sysconfig["pcIndexHotCacheTime"], 7200)
-			redis.Put("other", "classify_"+name, datas, timeout)
 		} else {
 			b, _ := json.Marshal(list)
 			json.Unmarshal(b, &datas)
 		}
 		if datas != nil && len(*datas) > 0 {
+			if sl {
+				rl.Lock()
+				timeout := util.IntAllDef(config.Sysconfig["pcIndexHotCacheTime"], 7200)
+				redis.Put("other", "classify_"+name, datas, timeout)
+				redis.Put("other", "classify_sl_"+name, datas, -1) //二级缓存
+				rl.Unlock()
+			}
 			public.BidListConvert(industry, datas)
 			res = searchresulthtml(datas)
 		}

+ 9 - 0
src/jfw/front/supsearch.go

@@ -159,6 +159,15 @@ func (p *Pcsearch) ProposedProject() error {
 	var list *[]map[string]interface{}
 	var status = 1
 	var count int64
+	if publishtime == "" {
+		var (
+			now       = time.Now()
+			startTime = fmt.Sprint(time.Date(now.Year(), now.Month()-6, now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix()) //最近7天
+			endTime   = fmt.Sprint(now.Unix())
+		)
+		publishtime = fmt.Sprintf("%s_%s", startTime, endTime)
+	}
+
 	if len(s_word) > 0 {
 		status = 2
 		count, totalPage, list = bidsearch.GetPcBidSearchData(s_word, area, "", publishtime, subtype, "", "", "", "", "", "", "", "", 0, true, nil, bidSearch_field_1, "", false, false, "", pageSize, userId)

+ 213 - 29
src/jfw/front/tags.go

@@ -12,6 +12,7 @@ import (
 	"net/http"
 	"strconv"
 	"strings"
+	"sync"
 	"time"
 
 	qu "app.yhyue.com/moapp/jybase/common"
@@ -459,14 +460,26 @@ func IsInArr(arr []string, s string) bool {
 
 // 获取最新招标信息
 func (this *Tags) GetNewBidInfo() (list []map[string]interface{}) {
-	rediskey := fmt.Sprintf("pcindex_newArticle")
-	if l, ok := redis.Get("seoCache", rediskey).([]interface{}); ok && l != nil && len(l) > 0 {
-		list = qu.ObjArrToMapArr(l)
-	} else {
+	var (
+		redisKey   = fmt.Sprintf("pcindex_newArticle")
+		redisKeySL = fmt.Sprintf("pcindex_newArticle_second_level") //二级缓存
+		redisLock  = &sync.Mutex{}
+		ri         int
+		rn         = 3
+	)
+	var newBidInfos = func() (list []map[string]interface{}) {
 		// p397 未登录详情页最新招投标信息去掉拟建
-		_, _, lists := bidsearch.GetPcBidSearchData("", "", "", "", "招标预告,招标公告,招标结果,招标信用信息", "", "", "", "", "", "", "", "", 1, false, nil, bidSearch_field_1, "", false, false, "", 50, "")
-		if lists != nil && len(*lists) > 10 {
-			*lists = (*lists)[0:10]
+		var (
+			now         = time.Now()
+			startTime   = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-7, now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix()) //最近7天
+			endTime     = fmt.Sprint(now.Unix())
+			publishTime = fmt.Sprintf("%s_%s", startTime, endTime)
+		)
+		_, _, lists := bidsearch.GetPcBidSearchData("", "", "", publishTime, "招标预告,招标公告,招标结果,招标信用信息", "", "", "", "", "", "", "", "", 1, false, nil, bidSearch_field_1, "", false, false, "", 50, "")
+		if lists != nil && len(*lists) > 0 {
+			if len(*lists) > 10 {
+				*lists = (*lists)[:10]
+			}
 			for _, v := range *lists {
 				v["_id"] = encrypt.CommonEncodeArticle("content", v["_id"].(string))
 				delete(v, "toptype")
@@ -481,9 +494,71 @@ func (this *Tags) GetNewBidInfo() (list []map[string]interface{}) {
 				}
 			}
 			list = *lists
-			redis.Put("seoCache", rediskey, list, cacheTime)
+		}
+		return
+	}
+	var bidInfosByCache = func(rk string) (list []map[string]interface{}) {
+		if l, ok := redis.Get("seoCache", rk).([]interface{}); ok && l != nil && len(l) > 0 {
+			list = qu.ObjArrToMapArr(l)
+		}
+		return
+	}
+	var bidInfosToCache = func(list []map[string]interface{}) {
+		redis.Put("seoCache", redisKey, list, cacheTime)
+		ok := redis.Put("seoCache", redisKeySL, list, -1)
+		log.Println(redisKeySL, "--00--", ok)
+	}
+	list = bidInfosByCache(redisKey)
+	if len(list) == 0 {
+		list = bidInfosByCache(redisKeySL)
+		for {
+			if redisLock.TryLock() {
+				if len(list) == 0 {
+					list = newBidInfos()
+				}
+				if len(list) > 0 {
+					bidInfosToCache(list)
+				}
+				redisLock.Unlock()
+			}
+			ri++
+			if len(list) > 0 || ri >= rn {
+				break
+			}
+			time.Sleep(100 * time.Millisecond)
 		}
 	}
+	//rediskey := fmt.Sprintf("pcindex_newArticle")
+	//if l, ok := redis.Get("seoCache", rediskey).([]interface{}); ok && l != nil && len(l) > 0 {
+	//	list = qu.ObjArrToMapArr(l)
+	//} else {
+	//	// p397 未登录详情页最新招投标信息去掉拟建
+	//	var (
+	//		now         = time.Now()
+	//		startTime   = fmt.Sprint(time.Date(now.Year(), now.Month(), now.Day()-7, now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix()) //最近7天
+	//		endTime     = fmt.Sprint(now.Unix())
+	//		publishTime = fmt.Sprintf("%s_%s", startTime, endTime)
+	//	)
+	//	_, _, lists := bidsearch.GetPcBidSearchData("", "", "", publishTime, "招标预告,招标公告,招标结果,招标信用信息", "", "", "", "", "", "", "", "", 1, false, nil, bidSearch_field_1, "", false, false, "", 50, "")
+	//	if lists != nil && len(*lists) > 10 {
+	//		*lists = (*lists)[0:10]
+	//		for _, v := range *lists {
+	//			v["_id"] = encrypt.CommonEncodeArticle("content", v["_id"].(string))
+	//			delete(v, "toptype")
+	//			delete(v, "s_subscopeclass")
+	//			tmpdate := v["publishtime"]
+	//			v["publishtime"] = qu.Int64All(tmpdate.(float64))
+	//			v["date"] = time.Unix(qu.Int64All(tmpdate.(float64)), 0).Format(date.Date_Short_Layout)
+	//			if v["budget"] != nil {
+	//				v["budget"] = ConversionMoeny(v["budget"])
+	//			} else if v["bidamount"] != nil {
+	//				v["budget"] = ConversionMoeny(v["bidamount"])
+	//			}
+	//		}
+	//		list = *lists
+	//		redis.Put("seoCache", rediskey, list, cacheTime)
+	//	}
+	//}
 	return list
 }
 
@@ -655,13 +730,19 @@ func (r *reqLimit) Release() {
 // GetBidding
 // 金额限制在"1000"~"100000000";需求因es压力过大,只返回60%的数据
 func (this *Tags) GetBidding(industry, area, city, stype, keyword string, request *http.Request, responseWriter http.ResponseWriter, session *httpsession.Session) ([]map[string]interface{}, int64, bool) {
-	rediskey := fmt.Sprintf("pcseo_getbidding_%s_%s_%s_%s_%s", industry, area, city, stype, keyword)
-	rediskeyCount := fmt.Sprintf("pcseo_getbidding_count_%s_%s_%s_%s_%s", industry, area, city, stype, keyword)
-
-	if l, ok := redis.Get("seoCache", rediskey).([]interface{}); ok && l != nil {
-		count := redis.GetInt("seoCache", rediskeyCount)
-		return qu.ObjArrToMapArr(l), int64(count), false
-	} else {
+	var (
+		rediskey        = fmt.Sprintf("pcseo_getbidding_%s_%s_%s_%s_%s", industry, area, city, stype, keyword)
+		rediskeyCount   = fmt.Sprintf("pcseo_getbidding_count_%s_%s_%s_%s_%s", industry, area, city, stype, keyword)
+		redisKeySL      = fmt.Sprintf("pcseo_getbidding_sl_%s_%s_%s_%s_%s", industry, area, city, stype, keyword)
+		redisKeyCountSL = fmt.Sprintf("pcseo_getbidding_count_sl_%s_%s_%s_%s_%s", industry, area, city, stype, keyword)
+		redisLock       = &sync.Mutex{}
+		data            []map[string]interface{}
+		count           int64
+		b               bool
+		ri              int
+		rn              = 3
+	)
+	var biddingData = func() ([]map[string]interface{}, int64, bool) {
 		if area != "" || stype != "" || industry != "" || city != "" || keyword != "" {
 			if flag := reqLimitInit.Limit(context.Background()); flag == 1 {
 				defer reqLimitInit.Release()
@@ -683,21 +764,10 @@ func (this *Tags) GetBidding(industry, area, city, stype, keyword string, reques
 			starttime := fmt.Sprint(time.Date(now.Year()-1, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
 			endtime := fmt.Sprint(now.Unix())
 			var datas *[]map[string]interface{}
-			//var startPage int
 			var count int64
-			//currentPage := 5
 			limitCount := qu.IntAllDef(config.Seoconfig["tagsLimitCount"], 50)
 			if keyword == "" {
 				query := bidsearch.GetSearchQuery("", industry, "0.1", "1000", "", "", "", "", bidsearch.GetBidSearchQuery(area, city, fmt.Sprintf("%s_%s", starttime, endtime), stype, "", ""), "", false, seoBidField)
-				//count = elastic.Count(INDEX, TYPE, query)
-				//if count == 0 {
-				//	return nil, 0, false
-				//}
-				//startPage = rand.New(rand.NewSource(time.Now().UnixNano())).Intn(currentPage * limitCount)
-				//count1 := qu.IntAll(count)
-				//if count1 < startPage || startPage < 0 {
-				//	startPage = 0
-				//}
 				var countTmp int
 				datas, countTmp = elastic.GetOAPage(INDEX, TYPE, query, bidSearch_sort, seoBidField, 0, limitCount)
 				count = qu.Int64All(countTmp)
@@ -727,13 +797,127 @@ func (this *Tags) GetBidding(industry, area, city, stype, keyword string, reques
 					industry = strings.Split(industry, "_")[0]
 				}
 				public.BidListConvert(industry, datas)
-				redis.Put("seoCache", rediskey, datas, cacheTime)      //生产环境配置4G单独redis,超出4G自动清除
-				redis.Put("seoCache", rediskeyCount, count, cacheTime) //生产环境配置4G单独redis,超出4G自动清除
+				//redis.Put("seoCache", rediskey, datas, cacheTime)      //生产环境配置4G单独redis,超出4G自动清除
+				//redis.Put("seoCache", rediskeyCount, count, cacheTime) //生产环境配置4G单独redis,超出4G自动清除
 				return *datas, count, false
 			}
 		}
+		return nil, 0, false
+	}
+	var biddingByCache = func(rk, rc string) ([]map[string]interface{}, int64, bool) {
+		if l, ok := redis.Get("seoCache", rk).([]interface{}); ok && l != nil {
+			count := redis.GetInt("seoCache", rc)
+			return qu.ObjArrToMapArr(l), int64(count), false
+		}
+		return nil, 0, false
+	}
+	var biddingToCache = func(datas []map[string]interface{}, count int64) {
+		redis.Put("seoCache", rediskey, datas, cacheTime)      //生产环境配置4G单独redis,超出4G自动清除
+		redis.Put("seoCache", rediskeyCount, count, cacheTime) //生产环境配置4G单独redis,超出4G自动清除
+		redis.Put("seoCache", redisKeySL, datas, -1)           //生产环境配置4G单独redis,超出4G自动清除
+		redis.Put("seoCache", redisKeyCountSL, count, -1)      //生产环境配置4G单独redis,超出4G自动清除
+
+	}
+	//缓存数据
+	data, count, b = biddingByCache(rediskey, rediskeyCount)
+	if data == nil || len(data) == 0 || count == 0 {
+		data, count, b = biddingByCache(redisKeySL, redisKeyCountSL)
+		for {
+			if redisLock.TryLock() {
+				if data == nil || len(data) == 0 || count == 0 {
+					//获取数据库数据
+					data, count, b = biddingData()
+				}
+				//更新缓存
+				if data != nil && len(data) > 0 && count > 0 {
+					biddingToCache(data, count)
+				}
+				redisLock.Unlock()
+			}
+			ri++
+			if (data != nil && len(data) > 0 && count > 0) || ri >= rn {
+				break
+			}
+			time.Sleep(100 * time.Millisecond)
+		}
 	}
-	return nil, 0, false
+	return data, count, b
+	//if l, ok := redis.Get("seoCache", rediskey).([]interface{}); ok && l != nil {
+	//    count := redis.GetInt("seoCache", rediskeyCount)
+	//    return qu.ObjArrToMapArr(l), int64(count), false
+	//} else {
+	//    if area != "" || stype != "" || industry != "" || city != "" || keyword != "" {
+	//        if flag := reqLimitInit.Limit(context.Background()); flag == 1 {
+	//            defer reqLimitInit.Release()
+	//        } else {
+	//            if flag == -2 {
+	//                log.Println("等待队列已满")
+	//            } else if flag == -1 {
+	//                log.Println("等待超时")
+	//            }
+	//            return nil, 0, true
+	//        }
+	//
+	//        if public.Lst.IsLimited(request, responseWriter, session, false) == 1 { //没有被限制
+	//            defer public.Lst.Limit()
+	//        } else {
+	//            return nil, 0, true
+	//        }
+	//        now := time.Now()
+	//        starttime := fmt.Sprint(time.Date(now.Year()-1, now.Month(), now.Day(), now.Hour(), now.Minute(), now.Second(), 0, time.Local).Unix())
+	//        endtime := fmt.Sprint(now.Unix())
+	//        var datas *[]map[string]interface{}
+	//        //var startPage int
+	//        var count int64
+	//        //currentPage := 5
+	//        limitCount := qu.IntAllDef(config.Seoconfig["tagsLimitCount"], 50)
+	//        if keyword == "" {
+	//            query := bidsearch.GetSearchQuery("", industry, "0.1", "1000", "", "", "", "", bidsearch.GetBidSearchQuery(area, city, fmt.Sprintf("%s_%s", starttime, endtime), stype, "", ""), "", false, seoBidField)
+	//            //count = elastic.Count(INDEX, TYPE, query)
+	//            //if count == 0 {
+	//            //	return nil, 0, false
+	//            //}
+	//            //startPage = rand.New(rand.NewSource(time.Now().UnixNano())).Intn(currentPage * limitCount)
+	//            //count1 := qu.IntAll(count)
+	//            //if count1 < startPage || startPage < 0 {
+	//            //	startPage = 0
+	//            //}
+	//            var countTmp int
+	//            datas, countTmp = elastic.GetOAPage(INDEX, TYPE, query, bidSearch_sort, seoBidField, 0, limitCount)
+	//            count = qu.Int64All(countTmp)
+	//            if count == 0 {
+	//                return nil, 0, false
+	//            }
+	//        } else {
+	//            count, _, datas = bidsearch.GetPcBidSearchData(keyword, area, city, fmt.Sprintf("%s_%s", starttime, endtime), stype, industry, "", "", "", "", "", "", "", 0, true, []string{"title", "detail", "purchasing"}, seoBidField, "", false, false, "", limitCount, "")
+	//            if datas != nil && len(*datas) > limitCount {
+	//                *datas = (*datas)[0:limitCount]
+	//            }
+	//        }
+	//        if datas != nil && len(*datas) > 0 {
+	//            for _, v := range *datas {
+	//                v["_id"] = encrypt.CommonEncodeArticle("content", qu.ObjToString(v["_id"]))
+	//                v["date"] = time.Unix(qu.Int64All(v["publishtime"]), 0).Format(date.Date_Short_Layout)
+	//                highlight, _ := v["highlight"].(map[string][]string)
+	//                detail := ""
+	//                for _, val := range highlight["detail"] {
+	//                    detail += public.ClearHtml.ReplaceAllString(val, "")
+	//                }
+	//                if detail != "" {
+	//                    v["detail"] = detail
+	//                }
+	//            }
+	//            if strings.Contains(industry, "_") {
+	//                industry = strings.Split(industry, "_")[0]
+	//            }
+	//            public.BidListConvert(industry, datas)
+	//            redis.Put("seoCache", rediskey, datas, cacheTime)      //生产环境配置4G单独redis,超出4G自动清除
+	//            redis.Put("seoCache", rediskeyCount, count, cacheTime) //生产环境配置4G单独redis,超出4G自动清除
+	//            return *datas, count, false
+	//        }
+	//    }
+	//}
+	//return nil, 0, false
 }
 
 // 获取关键词

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

@@ -386,6 +386,16 @@ func (wd *WsDataExport) SearchExport() error {
 		AdditionalWords: wd.GetString("additionalWords"),              //关键词:附加关键词(副:五组,每组最多15个字符)
 		District:        wd.GetString("district"),
 	}
+	if reqData.Subtype == "" { //移动 数据导出分组
+		switch reqData.SearchGroup {
+		case 3:
+			reqData.Subtype = "招标公告"
+		case 4:
+			reqData.Subtype = "招标预告"
+		case 5:
+			reqData.Subtype = "招标结果"
+		}
+	}
 	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

+ 1 - 1
src/jfw/modules/app/src/app/front/search.go

@@ -104,7 +104,7 @@ func (p *Search) SearchIndex() {
 				if k < len(ad_indexs) {
 					index = util.IntAll(ad_indexs[k])
 				}
-				m[v] = tag.Ad(v, index, p.Request.Host)
+				m[v] = tag.Ad(v, index, p.Request.Host, string(p.Session().Id()))
 			}
 		}
 	}

+ 23 - 16
src/jfw/modules/app/src/app/front/shorturl.go

@@ -122,7 +122,7 @@ func (s *Short) Article(contentType, stype, id string) error {
 	)
 	//userId = "637dcf3ff143ed326e9e1589"
 	//登录用户 权限
-	if userId != "" {
+	if userId != "" && strings.Contains(s.Request.RequestURI, "article") {
 		//mobileHtmlKey := "jy_mobile_index_app"
 		var loginPageInfo = func() (body []byte) {
 			// 获取页面内容
@@ -192,15 +192,15 @@ func (s *Short) Article(contentType, stype, id string) error {
 	log.Printf("三级页userid:%s ips %v", userId, ips)
 	obj = wxvisitD(sid, userId, (isVip && isOldVip) || isEntniche || isMember)
 	if len(obj) > 0 {
-		if userId == "" && !ipTrue {
-			if util.ObjToString(obj["subtype"]) == "采购意向" || util.ObjToString(obj["subtype"]) == "拟建" {
-				rUrl := "/jyapp/free/login"
-				if util.ObjToString(obj["subtype"]) == "拟建" {
-					rUrl = fmt.Sprintf("%s?DisUrl=%s", rUrl, s.Request.URL)
-				}
-				return s.Redirect(rUrl)
-			}
-		}
+		//if userId == "" && !ipTrue {
+		//	if util.ObjToString(obj["subtype"]) == "采购意向" || util.ObjToString(obj["subtype"]) == "拟建" {
+		//		rUrl := "/jyapp/free/login"
+		//		if util.ObjToString(obj["subtype"]) == "拟建" {
+		//			rUrl = fmt.Sprintf("%s?DisUrl=%s", rUrl, s.Request.URL)
+		//		}
+		//		return s.Redirect(rUrl)
+		//	}
+		//}
 		if userId != "" {
 			if ((isVip && isOldVip) || isMember || isEntniche) || //老版本vip、大会员、商机管理
 				((isVip && !isOldVip) && (!(util.ObjToString(obj["subtype"]) == "拟建" || util.ObjToString(obj["subtype"]) == "采购意向"))) { //新超级订阅非采购意向”和“拟建项目”
@@ -270,7 +270,7 @@ func (s *Short) Article(contentType, stype, id string) error {
 		if userId == "" && ipTrue {
 			canRead = true
 		}
-		if canRead || (userId == "" && !ipTrue) {
+		if canRead || (userId == "" && !ipTrue && util.ObjToString(obj["subtype"]) != "拟建" && util.ObjToString(obj["subtype"]) != "采购意向") {
 			if belongUserId != "" && belongUserId != userId && util.ObjToString(obj["subtype"]) != "拟建" && userId != "" { //分享开打的
 				article_id := encrypt.CommonDecodeArticle(stype, id)[0]
 				key := fmt.Sprintf("integral_article_%s_%s_%s", article_id, belongUserId, userId)
@@ -367,12 +367,19 @@ func (s *Short) Article(contentType, stype, id string) error {
 				delete(obj, "href")
 			}
 		} else {
+			if obj["l_publishtime"] != nil {
+				obj["publishtimeShorDate"] = time.Unix(util.Int64All(obj["l_publishtime"]), 0).Format(date.Date_Short_Layout)
+			}
 			obj = map[string]interface{}{
-				"title":        obj["title"],
-				"_id":          obj["_id"],
-				"subtype":      obj["subtype"],
-				"hasSession":   false,
-				"originalShow": false,
+				"title":               obj["title"],
+				"_id":                 obj["_id"],
+				"subtype":             obj["subtype"],
+				"hasSession":          false,
+				"originalShow":        false,
+				"l_publishtime":       obj["l_publishtime"],
+				"publishtimeShorDate": obj["publishtimeShorDate"],
+				"area":                obj["area"],
+				"buyerclass":          obj["buyerclass"],
 			}
 		}
 		if userId == "" && ipTrue {

+ 4 - 1
src/jfw/modules/app/src/app/front/swordfish.go

@@ -304,6 +304,9 @@ func (m *Front) WxsearchlistPaging() {
 			hasBuyerTel, hasWinnerTel = m.GetString("buyertel"), m.GetString("winnertel")
 			notkey = m.GetString("notkey")
 			city = m.GetString("city")
+			if publishtime == "" {
+				publishtime = "fiveyear"
+			}
 		}
 		//校验是否有大会员中标企业查询权限
 		bigBaseMsg := jy.GetBigVipUserBaseMsg(m.Session(), *config.Middleground)
@@ -526,7 +529,7 @@ func wxvisitD(sid, userId string, isPayUser bool) (objdata map[string]interface{
 			if !isPayUser && (util.ObjToString(obj["subtype"]) == "拟建" || util.ObjToString(obj["subtype"]) == "采购意向") {
 				for k, _ := range obj {
 					if k != "title" && k != "area" && k != "subtype" && k != "detail" && k != "procurementlist" && k != "toptype" && k != "publishtime" && k != "budget" && k != "bidamount" && k != "site" && k != "spidercode" && k != "recommended_service" && k != "projectinfo" &&
-						k != "owner" && k != "total_investment" && k != "projectaddr" && k != "projectperiod" && k != "approvedept" && k != "approvecontent" && k != "approvecode" && k != "approvenumber" && k != "approvetime" && k != "approvestatus" && k != "project_scale" && k != "projectname" {
+						k != "buyerclass" && k != "owner" && k != "total_investment" && k != "projectaddr" && k != "projectperiod" && k != "approvedept" && k != "approvecontent" && k != "approvecode" && k != "approvenumber" && k != "approvetime" && k != "approvestatus" && k != "project_scale" && k != "projectname" {
 						delete(obj, k)
 					}
 				}

+ 10 - 0
src/jfw/modules/app/src/app/front/ws_dataExport.go

@@ -376,6 +376,16 @@ func (wd *WsDataExport) SearchExport() error {
 		AdditionalWords: wd.GetString("additionalWords"),              //关键词:附加关键词(副:五组,每组最多15个字符)
 		District:        wd.GetString("district"),                     //搜索词
 	}
+	if reqData.Subtype == "" { //移动 数据导出分组
+		switch reqData.SearchGroup {
+		case 3:
+			reqData.Subtype = "招标公告"
+		case 4:
+			reqData.Subtype = "招标预告"
+		case 5:
+			reqData.Subtype = "招标结果"
+		}
+	}
 	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

+ 101 - 33
src/jfw/modules/app/src/app/tag/ad.go

@@ -7,64 +7,132 @@ package tag
 **/
 
 import (
-	"encoding/json"
-	"fmt"
+	util "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 	"app.yhyue.com/moapp/jypkg/public"
+	"encoding/json"
+	"jy/src/jfw/modules/app/src/jfw/config"
 	"log"
+	"net/url"
 	"strings"
 	"time"
 
 	"app.yhyue.com/moapp/jybase/redis"
-	"runtime"
 )
 
 var mongodb = public.MQFW
 
-/**
+/*
+*
 标签用法传递代码、返回个数,如果为-1返回全部
 清除缓存请到后台,保存一下广告即可
 {{$s:=(Ad "s1" 1)}}
 {{range $t,$v := $s}}
+
 	{{$v.s_pic}}
 	{{range $k,$kv := $v}}
 		{{$k}}={{$kv}}
 	{{end}}
+
 {{end}}
-**/
-func Ad(s_code string, n int, host string) []adInfo {
-	defer func() {
-		if r := recover(); r != nil {
-			log.Println("[E]", r)
-			for skip := 0; ; skip++ {
-				_, file, line, ok := runtime.Caller(skip)
-				if !ok {
-					break
+*
+*/
+
+type jySession struct {
+	UserId       string `json:"userId"`       //上下文用户信息
+	BaseUserId   int64  `json:"base_user_id"` //新用户id
+	EntId        int64  `json:"entId"`        //当前企业id
+	EntName      string `json:"entName"`      //当前企业名称
+	Phone        string `json:"phone"`        //手机号
+	EntUserId    int64  `json:"entUserId"`    //当前企业用户id
+	UserName     string `json:"userName"`     //用户名称
+	PersonId     int64  `json:"personId"`     //自然人id
+	AccountId    int64  `json:"accountId"`    //账户id
+	EntAccountId int64  `json:"entAccountId"` //企业账户id
+	PositionId   int64  `json:"positionId"`   //职位id
+	PositionType int64  `json:"positionType"` //职位类型
+	MgoUserId    string `json:"mgoUserId"`    //mongodb用户id
+}
+
+var (
+// adSessionMap  = map[string]*jySession{}
+// adSessionLock = sync.Mutex{}
+)
+
+func Ad(sCode string, n int, host, sessionId string) []jy.AdInfo {
+	defer util.Catch()
+	log.Println("sessionId:", sessionId)
+	var (
+		isLogin  bool
+		baseInfo *jy.BigVipBaseMsg
+	)
+	if sessionId != "" {
+		sessionId, _ = url.QueryUnescape(sessionId)
+		//adSessionLock.Lock()
+		jyS := &jySession{}
+		//jyS := adSessionMap[sessionId]
+		//adSessionLock.Unlock()
+		if jyS == nil || jyS.UserId == "" {
+			rVal, err := redis.GetBytes("session", sessionId)
+			if err == nil {
+				if err = json.Unmarshal(*rVal, &jyS); err != nil {
+					log.Println("ad session err:", err.Error())
 				}
-				go log.Printf("%v,%v\n", file, line)
 			}
 		}
-	}()
-	obj := redis.Get("other", "ad_"+s_code)
-	if obj != nil {
-		return adHandle(obj.([]interface{}), s_code, host)
-	} else {
-		f := ""
-		if n > -1 {
-			f = `{"a_son":{"$slice":[0,` + fmt.Sprintf("%d", n) + `]}}`
-		} else {
-			f = `{"a_son":1}`
-		}
-		res, ok := mongodb.FindOneByField("ad", `{"s_code":"`+s_code+`"}`, f)
-		if ok && res != nil && (*res)["a_son"] != nil {
-			son := (*res)["a_son"].([]interface{})
-			if len(son) > 0 {
-				redis.PutCKV("other", "ad_"+s_code, son)
+		if jyS != nil && jyS.UserId != "" {
+			baseInfo = jy.GetBigVipUserBaseMsgBySessVal(map[string]interface{}{
+				"base_user_id": jyS.BaseUserId,
+				"entId":        jyS.EntId,
+				"positionType": jyS.PositionType,
+				"accountId":    jyS.AccountId,
+				"positionId":   jyS.PositionId,
+				"userId":       jyS.UserId,
+			}, *config.Middleground)
+			if baseInfo != nil && baseInfo.Uid != "" {
+				isLogin = true
+				//adSessionLock.Lock()
+				//adSessionMap[sessionId] = jyS
+				//adSessionLock.Unlock()
 			}
-			return adHandle(son, s_code, host)
 		}
 	}
-	return nil
+	adf := jy.AdFunc{
+		AdCodes:   []string{sCode},
+		UserInfo:  baseInfo,
+		Mgo:       &public.MQFW,
+		MySql:     public.Mysql,
+		Host:      host,
+		Ads:       nil,
+		OrderCode: "",
+		IsLogin:   isLogin,
+	}
+	ads := adf.GetAdInfos()[sCode]
+	if n > 0 {
+		return ads[:n]
+	}
+	return ads
+	//obj := redis.Get("other", "ad_"+sCode)
+	//if obj != nil {
+	//	return adHandle(obj.([]interface{}), sCode, host)
+	//} else {
+	//	f := ""
+	//	if n > -1 {
+	//		f = `{"a_son":{"$slice":[0,` + fmt.Sprintf("%d", n) + `]}}`
+	//	} else {
+	//		f = `{"a_son":1}`
+	//	}
+	//	res, ok := mongodb.FindOneByField("ad", `{"s_code":"`+sCode+`"}`, f)
+	//	if ok && res != nil && (*res)["a_son"] != nil {
+	//		son := (*res)["a_son"].([]interface{})
+	//		if len(son) > 0 {
+	//			redis.PutCKV("other", "ad_"+sCode, son)
+	//		}
+	//		return adHandle(son, sCode, host)
+	//	}
+	//}
+	//return nil
 }
 
 type adInfo struct {
@@ -88,7 +156,7 @@ type adInfo struct {
 	S_script string `json:"s_script"` //脚本代码
 }
 
-//广告位信息处理
+// 广告位信息处理
 func adHandle(data []interface{}, s_code, host string) []adInfo {
 	var res = []adInfo{}
 	if len(data) > 0 {

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

@@ -1,11 +1,12 @@
 module jy/src/jfw/modules/app/src
 
-go 1.18
+go 1.21
+
 
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20240412015757-6d8429bb4dae
 	app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545
-	app.yhyue.com/moapp/jypkg v1.15.8-0.20240429101401-e9a346a1e7a0
+	app.yhyue.com/moapp/jypkg v1.19.7
 	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.16
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
 	github.com/gogf/gf/v2 v2.7.0

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

@@ -20,8 +20,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20240412015757-6d8429bb4dae/go.mod h1:XHNATN6t
 app.yhyue.com/moapp/jyfs v0.0.0-20231024061508-480c270480d4/go.mod h1:61hzZ3dZHXL28BNl8BOgZsvM2S5UVY5YFzOkEUPrSu4=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545 h1:+Lak4m1zgsigQloOsvp8AJ+0XeX/+PGp9QP550xlbBQ=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545/go.mod h1:uFrsdUBFbETiJlEmr4PtJWPsZlUpPj2bHQRhryu6ggk=
-app.yhyue.com/moapp/jypkg v1.15.8-0.20240429101401-e9a346a1e7a0 h1:a9vx1dXTwJpvMYCSvQMb6EskDRjnzpzGRMw8JfseGtw=
-app.yhyue.com/moapp/jypkg v1.15.8-0.20240429101401-e9a346a1e7a0/go.mod h1:b3+0Q50iZYNaiYn7yR9bIIvIEsPvSy5figX7riSi/n4=
+app.yhyue.com/moapp/jypkg v1.19.7 h1:KA/q1pX/LfmbTGZ/vI3o75yxNpCCsDcmHw+/wWLzhV4=
+app.yhyue.com/moapp/jypkg v1.19.7/go.mod h1:b3+0Q50iZYNaiYn7yR9bIIvIEsPvSy5figX7riSi/n4=
 app.yhyue.com/moapp/message v0.0.0-20231204024949-8c7145bfc161 h1:WGi4OEIoqw6NpNFGioUEBZnjK9aBa+xJqf/5WY+QyhM=
 app.yhyue.com/moapp/message v0.0.0-20231204024949-8c7145bfc161/go.mod h1:0Oj8SB4pVjdCLD28sy2zyM3hS0WHGpNuVcakLW43GmI=
 bp.jydev.jianyu360.cn/BP/jynsq v0.0.0-20220222052708-ebc43af90698/go.mod h1:ojo/AUH9Yr1wzarEjOaNMkj1Cet/9r8IgLyba64Z52E=
@@ -855,10 +855,12 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5
 github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137/go.mod h1:OMCwj8VM1Kc9e19TLln2VL61YJF0x1XFtfdL4JdbSyE=
 github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc=
 github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302 h1:uvdUDbHQHO85qeSydJtItA4T55Pw6BtAejd0APRJOCE=
+github.com/alicebob/gopher-json v0.0.0-20230218143504-906a9b012302/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc=
 github.com/alicebob/miniredis/v2 v2.17.0/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I=
 github.com/alicebob/miniredis/v2 v2.22.0/go.mod h1:XNqvJdQJv5mSuVMc0ynneafpnL/zv52acZ6kqeS0t88=
 github.com/alicebob/miniredis/v2 v2.30.5/go.mod h1:b25qWj4fCEsBeAAR2mlb0ufImGC6uH3VlUfb/HS5zKg=
 github.com/alicebob/miniredis/v2 v2.32.1 h1:Bz7CciDnYSaa0mX5xODh6GUITRSx+cVhjNoOR4JssBo=
+github.com/alicebob/miniredis/v2 v2.32.1/go.mod h1:AqkLNAfUm0K07J28hnAyyQKf/x0YkCY/g5DCtuL01Mw=
 github.com/aliyun/aliyun-oss-go-sdk v2.1.6+incompatible/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8=
 github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
 github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
@@ -889,7 +891,9 @@ github.com/bos-hieu/mongostore v0.0.2/go.mod h1:8AbbVmDEb0yqJsBrWxZIAZOxIfv/tsP8
 github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA=
 github.com/bradleypeabody/gorilla-sessions-memcache v0.0.0-20181103040241-659414f458e1/go.mod h1:dkChI7Tbtx7H1Tj7TqGSZMOeGpMP5gLHtjroHd4agiI=
 github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
+github.com/bsm/ginkgo/v2 v2.12.0/go.mod h1:SwYbGRRDovPVboqFv0tPTcG1sN61LM1Z4ARdbAV9g4c=
 github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
+github.com/bsm/gomega v1.27.10/go.mod h1:JyEr/xRbxbtgWNi8tIEVPUYZ5Dzef52k01W3YH0H+O0=
 github.com/bufbuild/protocompile v0.4.0/go.mod h1:3v93+mbWn/v3xzN+31nwkJfrEpAUwp+BagBSZWx+TP8=
 github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE=
 github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
@@ -1001,6 +1005,7 @@ github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8
 github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g=
 github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k=
 github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
+github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps=
 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
 github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
 github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU=
@@ -1087,6 +1092,7 @@ github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqw
 github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
 github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
 github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
+github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
 github.com/go-test/deep v1.0.7/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8=
 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=
@@ -1135,6 +1141,7 @@ github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0L
 github.com/golang/glog v1.1.0/go.mod h1:pfYeQZ3JWZoXTV5sFc986z3HTpwQs9At6P4ImfuP3NQ=
 github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ=
 github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68=
+github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w=
 github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
 github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
@@ -1228,6 +1235,7 @@ github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLe
 github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
 github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
 github.com/google/pprof v0.0.0-20211214055906-6f57359322fd h1:1FjCyPC+syAzJ5/2S8fqdZK1R22vvA0J7JZKcuOIQ7Y=
+github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg=
 github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
 github.com/google/s2a-go v0.1.0/go.mod h1:OJpEgntRZo8ugHpF9hkoLJbS5dSI20XZeXJ9JVywLlM=
 github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A=
@@ -1533,6 +1541,7 @@ github.com/onsi/ginkgo/v2 v2.4.0/go.mod h1:iHkDK1fKGcBoEHT5W7YBq4RFWaQulw+caOMkA
 github.com/onsi/ginkgo/v2 v2.5.0/go.mod h1:Luc4sArBICYCS8THh8v3i3i5CuSZO+RaQRaJoeNwomw=
 github.com/onsi/ginkgo/v2 v2.7.0/go.mod h1:yjiuMwPokqY1XauOgju45q3sJt6VzQ/Fict1LFVcsAo=
 github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4=
+github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o=
 github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA=
 github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
 github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
@@ -1550,6 +1559,7 @@ github.com/onsi/gomega v1.24.0/go.mod h1:Z/NWtiqwBrwUt4/2loMmHL63EDLnYHmVbuBpDr2
 github.com/onsi/gomega v1.24.1/go.mod h1:3AOiACssS3/MajrniINInwbfOOtfZvplPzuRSmvt1jM=
 github.com/onsi/gomega v1.26.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM=
 github.com/onsi/gomega v1.29.0 h1:KIA/t2t5UBzoirT4H9tsML45GEbo3ouUnBHsCfD2tVg=
+github.com/onsi/gomega v1.29.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ=
 github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
 github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
 github.com/openzipkin/zipkin-go v0.3.0/go.mod h1:4c3sLeE8xjNqehmF5RpAFLPLJxXscc0R4l6Zg0P1tTQ=
@@ -1646,6 +1656,7 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR
 github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
 github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
 github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
+github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
 github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
 github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
 github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU=
@@ -1764,6 +1775,7 @@ github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da/go.mod h1:E1AXubJB
 github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA=
 github.com/yuin/gopher-lua v1.1.0/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw=
 github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M=
+github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw=
 github.com/yusufpapurcu/wmi v1.2.2/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
 github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
 github.com/zeebo/xxh3 v1.0.2/go.mod h1:5NWz9Sef7zIDm2JHfFlcQvNekmcEl9ekUZQQKCYaDcA=
@@ -2397,6 +2409,7 @@ golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4=
 golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc=
 golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM=
 golang.org/x/tools v0.16.1 h1:TLyB3WofjdOEepBHAU20JdNC1Zbg87elYofWYAY5oZA=
+golang.org/x/tools v0.16.1/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0=
 golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
 golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

+ 4 - 1
src/jfw/modules/app/src/web/staticres/jyapp/css/wxinfocontent.css

@@ -296,7 +296,7 @@ body .loading_ p span {
 
 .toolbar .tool_bottom {
     display: flex;
-    margin-top: 13px;
+    margin-top: 6px;
     margin-bottom:16px;
     align-items: center;
     justify-content: space-between;
@@ -1340,6 +1340,9 @@ ul {
 .noLoginShow{
   padding: 0 6px 80px;
 }
+.option-login {
+  margin-top: 20px;
+}
 .noLoginShow .serve-option{
   padding: 0 0 18px;
   margin: 0 auto;

+ 4 - 3
src/jfw/modules/app/src/web/templates/commonPay/paySuccess.html

@@ -170,7 +170,7 @@
 
    // 根据支付订单类型 加载广告位
     // 超级订阅、数据流量包、数据导出(线上支付方式)、课程产品
-    if (orderType === 'subvip' || orderType === 'dataPack' || orderType === 'dataExport' || orderType === 'onlineCourse' || orderType === 'course') {
+    if (orderType === 'member' || orderType === 'subvip' || orderType === 'dataPack' || orderType === 'dataExport' || orderType === 'onlineCourse' || orderType === 'course') {
         var Activedatastring = `xxx`
 
         switch (orderType) {
@@ -192,7 +192,8 @@
             case 'course':
             Activedatastring = 'course'
                 break;
-
+            case 'member':
+            Activedatastring = 'member'
             default:
                 break;
         }
@@ -206,7 +207,7 @@
      * @param {Array|String} active_codes_map 广告id标识符--数组集合["jy-wx-course-pay-success"]
      * @param {String} isAppsion 请求环境、app、weixin、pc
      */
-        getActive.getActiveInfo(Activedata,'App')
+        getActive.getActiveInfo(Activedata,'App', {{.T.orderCode}})
 
     }
 

+ 1 - 1
src/jfw/modules/app/src/web/templates/course/course_list.html

@@ -42,7 +42,7 @@
 	                <!-- Add Pagination -->
 	                <div class="swiper-pagination"></div>
 	            </div>
-				{{$s_top:=(Ad "jy-appcourse-list-top" -1 .Host)}}
+				{{$s_top:=(Ad "jy-appcourse-list-top" -1 .Host (cookie "SESSIONID"))}}
 				<script>
 					var ADTopList={{$s_top}}
 					if (ADTopList!=null){

+ 1 - 2
src/jfw/modules/app/src/web/templates/dataExport/dataExport.html

@@ -361,9 +361,8 @@
                 </div>
               </div>
             </div>
-  <!--                  {{$s_top:=(Ad "jy-wxsearch-home-top" -1 .Host)}}-->
             <script>
-            {{$sd:=(Ad "jy-app-dataexport-screen-top" -1 .Host)}}
+            {{$sd:=(Ad "jy-app-dataexport-screen-top" -1 .Host (cookie "SESSIONID"))}}
               var ADTopList={{$sd}}
               // var ADTopList=[]
               if(ADTopList.length>0){

+ 5 - 5
src/jfw/modules/app/src/web/templates/exhibition/index.html

@@ -53,7 +53,7 @@
         </div>
       </div>
       {{$picNum := false}}
-      {{range $i, $v :=Ad "app-exhibition-index-top" -1 .Host}}
+      {{range $i, $v :=Ad "app-exhibition-index-top" -1 .Host (cookie "SESSIONID")}}
       {{if ge $i 0}}
       {{$picNum = true}}
       {{end}}
@@ -64,7 +64,7 @@
       <div class="content bannerSwiper">
         <div class="swiper-wrapper">
           <!-- 两端图尺寸不一致因此需要区分 -->
-          {{range $i, $v :=Ad "app-exhibition-index-top" -1 .Host}}
+          {{range $i, $v :=Ad "app-exhibition-index-top" -1 .Host (cookie "SESSIONID")}}
           <div class="swiper-slide" onclick="golink({{$v.S_link}})">
             <!-- pc 图 -->
             <img class="m_hide" src="{{$v.S_pic}}" alt="{{$v.S_remark}}">
@@ -265,9 +265,9 @@
     window.addEventListener('pageshow', function () {
       if(sessionStorage.getItem('status_login')){
         sessionStorage.removeItem('status_login')
-        window.location.reload(); 
+        window.location.reload();
 
-      }   
+      }
    });
     function goCustomerPage () {
       if (goTemplateData.params.loginFlag) {
@@ -289,7 +289,7 @@
       if(link){
         window.location.href = link
       }
-      
+
     }
   </script>
   <!--百度统计-->

+ 5 - 5
src/jfw/modules/app/src/web/templates/frontRouter/activity/free/202402.html

@@ -40,7 +40,7 @@
                 <div class="header-banner-content">
                     <div class="header-banner-content-time">${activeStartTime} - ${activeEndTime}</div>
                     <div class="header-banner-machine">
-                        <div class="machine-title">${activityConf.cost}剑鱼币抽会员</div>
+                        <div class="machine-title" v-if="pointsMold">${activityConf.cost}剑鱼币抽会员</div>
                         <div class="machine-ani-content machine-canvas" id="ballBox">
                             <div class="machine-ball-list">
                                 <div class="machine-ball-item"
@@ -56,7 +56,7 @@
                             </div>
                         </div>
                         <div class="machine-ani-content machine-mask"></div>
-                        <div class="machine-balance-container">
+                        <div class="machine-balance-container" v-if="pointsMold">
                             <p class="my-coin-count" v-if="hasLogin">我的剑鱼币:${coinCount}</p>
                             <p class="my-coin-count" v-else @click="toLogin" class="pointer">我的剑鱼币:登录查看</p>
                             <div class="add-jianyu-coin" v-if="hasLogin">
@@ -66,10 +66,10 @@
                         </div>
 
                         <div class="machine-confirm pointer" @click="startChou" id="start-choujiang">
-                            <div class="machine-button-tip tip-right" v-if="activityConf.status === 0">${activityConf.cost}剑鱼币</div>
+                            <div class="machine-button-tip tip-right" v-if="activityConf.status === 0 && pointsMold">${activityConf.cost}剑鱼币</div>
                             <template v-else>
                                 <div class="machine-button-tip tip-left" v-if="tipInfo.countdown">开始倒数计时:${tipInfo.countdownText}</div>
-                                <div class="machine-button-tip tip-left" v-else>${tipInfo.text}</div>
+                                <div class="machine-button-tip tip-left" v-else-if="tipInfo.text">${tipInfo.text}</div>
                             </template>
                             <div class="machine-pointer" v-show="pointerShow"></div>
                         </div>
@@ -194,7 +194,7 @@
     <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/public/js/wx-sdk-share.js?v={{Msg "seo" "version"}}'></script>
     <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/public/js/app-share-sheet.js?v={{Msg "seo" "version"}}'></script>
     <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/active/202402/egg-debounce-animations.js?v={{Msg "seo" "version"}}'></script>
-    <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/active/202402/202402.js?v={{Msg "seo" "version"}}'></script>
+    <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/common-module/active/202402/202402.js?v={{Msg "seo" "version"}}1'></script>
     {{include "/common/baiducc.html"}}
 </body>
 

+ 1 - 1
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_introduce.html

@@ -111,7 +111,7 @@
 <!--<script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/js/check-bind-phone.js?v={{Msg "seo" "version"}}'></script>-->
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/js/common.js?v={{Msg "seo" "mod_version"}}'></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/big-member/js/utils.js?v={{Msg "seo" "mod_version"}}'></script>
-{{$s:=(Ad "jy-app-vip-buypage-tips" -1 .Host)}}
+{{$s:=(Ad "jy-app-vip-buypage-tips" -1 .Host (cookie "SESSIONID"))}}
 <script>
   var ADList={{$s}}
   var ADHtml="";

+ 3 - 1
src/jfw/modules/app/src/web/templates/vipsubscribe/vip_pay_success.html

@@ -92,6 +92,8 @@
 <script>
 
   var title = {{.T.title}}
+  var orderCode = {{.T.orderCode}}
+  console.log(orderCode)
 //   if (title.indexOf('超级订阅') !== -1) {
 //     getActiveInfo()
 //   }
@@ -111,7 +113,7 @@
      * @param {Array|String} active_codes_map 广告id标识符--数组集合["jy-wx-course-pay-success"]
      * @param {String} isAppsion 请求环境、app、weixin、pc
      */
-        getActive.getActiveInfo(Activedata,'App')
+        getActive.getActiveInfo(Activedata,'App', orderCode)
 
     // }
 

+ 1 - 1
src/jfw/modules/app/src/web/templates/weixin/historypush.html

@@ -412,7 +412,7 @@
 </div>
 {{include "/common/baiducc.html"}}
 <div id="advertscript" class="hidden">
-    {{$s:=(Ad "jyapp-wxpush-middle" -1 .Host)}}
+    {{$s:=(Ad "jyapp-wxpush-middle" -1 .Host (cookie "SESSIONID"))}}
     {{if $s}}
         <script>
             var ADList ={{$s}}

+ 12 - 74
src/jfw/modules/app/src/web/templates/weixin/search/mainSearch.html

@@ -693,18 +693,8 @@
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/js/dateFunc.js?v={{Msg "seo" "version"}}'></script>
 <script src='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/js/message-index.js?v={{Msg "seo" "version"}}'></script>
 <script>
-  {
-    {
-      $s:= (Ad
-      "jy-app-sharepolitely-float" - 1.Host
-    )
-    }
-  }
-  var ADList = {
-  {
-    $s
-  }
-  }
+  {{ $s:= (Ad "jy-app-sharepolitely-float" - 1.Host (cookie "SESSIONID"))}}
+  var ADList = {{$s}}
   var ADHtml = "";
   if (ADList.length > 0) {
     var AD = ADList[0]
@@ -847,22 +837,9 @@
   var adv_url = "/datareport/page/introduce";
   var adv_img = "/jyapp/images/reportTip.png?v=51430"
   var adv_within = "";//是否是外部链接打开
-  {
-    {
-      $s:= (Ad
-      "jyapp-wxsearch-index" - 1.Host
-    )
-    }
-  }
-  {
-    {
-      if $s}
-  }
-  var ADList = {
-  {
-    $s
-  }
-  }
+  {{$s:= (Ad "jyapp-wxsearch-index" - 1.Host  (cookie "SESSIONID"))}}
+  {{if $s}}
+  var ADList = {{$s}}
   if (ADList.length > 0) {
     var AD = ADList[0]
     if (AD.s_link) {
@@ -878,54 +855,15 @@
       adv_within = AD.o_extend.linktype;
     }
   }
-  {
-    {
-      end
-    }
-  }
-  var userId = {
-  {
-    session
-    "userId"
-  }
-  }
-  ;
-  var pageSize = {
-  {.
-    T.pageSize
-  }
-  }
-  ;
+  {{ end }}
+  var userId = {{ session "userId" }};
+  var pageSize = {{.T.pageSize}};
   var encode = "DB4WER4VWyoaAw9GWwgMGU1wEQ4CDQ1b";
-  SuperSearch.industry = {
-  {.
-    T.industry
-  }
-  }
-  ;
-  SuperSearch.sortArray = {
-  {.
-    T.sortArray
-  }
-  }
-  ;
+  SuperSearch.industry = {{.T.industry}};
+  SuperSearch.sortArray = {{.T.sortArray}};
   localStorage.removeItem("redSpotLastAjaxTime");
-  var CDN = {
-  {
-    Cdns.Host
-    "seo"
-    "cdn" | SafeUrl
-  }
-  }
-  ;
-  var VERSION = {
-  {
-    Msg
-    "seo"
-    "version"
-  }
-  }
-  ;
+  var CDN = {{ Cdns.Host "seo" "cdn" | SafeUrl }} ;
+  var VERSION = {{ Msg "seo" "version" }};
   var isIosExam = false;
   var isIosExamPhone = false;
   window.addEventListener('pageshow', function () {

+ 28 - 20
src/jfw/modules/app/src/web/templates/weixin/wxinfocontent.html

@@ -596,7 +596,7 @@
                       <div class="right-container">
                           <div class="collec_star">
                               <span class="icon weishoucang"></span>
-                              <span class="icon-text">收藏</span>
+                              <span class="icon-text">标讯收藏</span>
                           </div>
                           {{if or .T.obj.projectname .T.obj.projectcode}}<div class="follow" style="top:1px !important;">{{if .T.obj.followFlag}}<i class="glyphicon yiguanzhu"></i>已关注{{else}}<i class="glyphicon weiguanzhu"></i>关注项目{{end}}</div><!--<a href="/swordfish/share/-1" style="text-decoration: none;color:#24C0D7;"><span class="follow"><i class="glyphicon weiguanzhu"></i></span>关注项目</a>-->{{end}}
                           <div class="forward-share">
@@ -698,7 +698,7 @@
                         <div class="right-container">
                             <div class="collec_star">
                                 <span class="icon weishoucang"></span>
-                                <span class="icon-text">收藏</span>
+                                <span class="icon-text">标讯收藏</span>
                             </div>
                             {{if or .T.obj.projectname .T.obj.projectcode}}<span class="follow">{{if .T.obj.followFlag}}<i class="glyphicon yiguanzhu"></i>已关注{{else}}<i class="glyphicon weiguanzhu"></i>关注项目{{end}}</span><!--<a href="/swordfish/share/-1" style="text-decoration: none;color:#24C0D7;"><span class="follow"><i class="glyphicon weiguanzhu"></i></span>关注项目</a>-->{{end}}
                             <div class="forward-share">
@@ -999,7 +999,7 @@
               </div>
             </div>
             <!--S 登录引导置底 S-->
-            <div class="login-guide">
+            <div class="login-guide" style="display: none;">
               <img src="/jyapp/images/adbottom.png?v={{Msg "seo" "version"}}" alt="">
             </div>
             <!--E 登录引导置底 E-->
@@ -1029,7 +1029,7 @@
         <!--E-- NPS评分 --E-->
         {{if and (not .T.isIosExam) (not .T.isIosExamPhone)}}
             <div class="adv">
-                {{$s:=(Ad "jyapp-wxcontent-bottom" -1 .Host)}}
+                {{$s:=(Ad "jyapp-wxcontent-bottom" -1 .Host (cookie "SESSIONID"))}}
                 {{if $s}}
                     <div class="adv-division">
                         <div class="sion-left"></div>
@@ -1214,20 +1214,6 @@
         winner_con = s_winner;
     }
 
-    // 未登录展示登录模块
-    if(!userId) {
-      $('.noLoginShow').show()
-      // $('.share-gift').hide()
-      $('.bid-dec-in').hide()
-      $('.bigvip_drain').hide()
-      $('.abs').hide()
-      $('.adv').hide()
-      $('.login-guide').show()
-      $('.forward-share').hide()
-    } else {
-      $('.login-guide').hide()
-    }
-
     if(!industry){
         if(subscopeclass!=null){
             industry = subscopeclass.split(",")[0];
@@ -1268,6 +1254,27 @@
     // 是否超前项目(<拟建>、<采购意向>)
     var advanceProject = subtype == '拟建'|| subtype == '采购意向'
 
+    // 未登录展示登录模块
+    if(!userId) {
+      $('.noLoginShow').show()
+      // $('.share-gift').hide()
+      $('.bid-dec-in').hide()
+      $('.bigvip_drain').hide()
+      $('.abs').hide()
+      $('.adv').hide()
+      if (advanceProject) {
+        $('.login-guide').hide()
+        $('.tag-breadcrumb-navigation').hide()
+        $('.option-login').hide()
+      } else {
+        $('.login-guide').show()
+        $('.tag-breadcrumb-navigation').show()
+      }
+      $('.forward-share').hide()
+    } else {
+      $('.login-guide').hide()
+    }
+
     if (area!=""&&area!=null){
         count++
     }
@@ -1708,6 +1715,7 @@
 
     //留资弹窗页面
     $(document).on('click', '.free-btn-reword', function() {
+        return appAutoLogin()
         var subType = {{.T.obj.subtype}}
         var sourceKey = 'article_slogan'
         if(!canRead) {
@@ -1953,7 +1961,7 @@
           }
         }
         if(!userId) {
-          this.info.btntext = '登后解锁会员查看'
+          this.info.btntext = '登后解锁会员查看'
         } else {
           this.info.btntext = '点击进入'
         }
@@ -3613,7 +3621,7 @@
         } else {
             // 取消收藏
             $icon.removeClass('shoucang').addClass('weishoucang')
-            $text.text('收藏')
+            $text.text('标讯收藏')
             $('.collec_list').html()
             $('.collec_list').hide()
         }

+ 1 - 1
src/jfw/modules/app/src/web/templates/weixin/wxpush.html

@@ -685,7 +685,7 @@ a{
 		<img onClick="window.location.href='{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/wxkeyset/keyset/index?v={{Msg "seo" "version"}}'" style="width: 200px;margin-top: 25px;" src="{{Cdns .Host "seo" "cdn"|SafeUrl}}/jyapp/images/wx/jydyshz.png?v={{Msg "seo" "version"}}">
 		</div>
 		</span>
-		{{$s:=(Ad "jyapp-wxpush-bottom" -1 .Host)}}
+		{{$s:=(Ad "jyapp-wxpush-bottom" -1 .Host (cookie "SESSIONID"))}}
 		{{if $s}}
 		<div style="padding:10px;">
 			<div class="adv-wxpush-bottom" id="D1">

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

@@ -98,7 +98,7 @@ func BuyerPortraitSearch(screen *PortraitScreen) (map[string]interface{}, error)
 	//文本输入框,字数限制50个字,超过上限不再允许输入内容
 	if screen.Match != "" {
 		if pareWord := screen.PareMatchWord(); pareWord != "" {
-			findFields := fmt.Sprintf(`"%s"`, strings.Join(screen.PareMatchType(), "\",\""))
+			findFields := fmt.Sprintf(`"%s"`, strings.Join(screen.PareMatchType(true), "\",\""))
 			var keywordArr []string
 			for _, keyword := range strings.Split(pareWord, " ") {
 				if keyword == "" {

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

@@ -188,7 +188,7 @@ func GetWinnerPortraitSearch(screen *PortraitScreen) (map[string]interface{}, er
 		//文本输入框,字数限制50个字,超过上限不再允许输入内容
 		if screen.Match != "" {
 			if pareWord := screen.PareMatchWord(); pareWord != "" {
-				findFields := fmt.Sprintf(`"%s"`, strings.Join(screen.PareMatchType(), "\",\""))
+				findFields := fmt.Sprintf(`"%s"`, strings.Join(screen.PareMatchType(true), "\",\""))
 				var keywordArr []string
 				for _, keyword := range strings.Split(pareWord, " ") {
 					if keyword == "" {

+ 12 - 4
src/jfw/modules/bigmember/src/entity/portrait_screen.go

@@ -82,7 +82,7 @@ func (pwp *PortraitScreen) PareMatchWord() string {
 }
 
 // PareMatchType 格式筛选搜索,默认筛选为标题和正文
-func (ps *PortraitScreen) PareMatchType() (items []string) {
+func (ps *PortraitScreen) PareMatchType(isProject bool) (items []string) {
 	for _, t := range strings.Split(ps.MatchRange, ",") {
 		if t == "buyer" {
 			items = append(items, "buyer.mbuyer")
@@ -91,11 +91,19 @@ func (ps *PortraitScreen) PareMatchType() (items []string) {
 		} else if t == "agency" {
 			items = append(items, "agency.magency")
 		} else if t == "purchasing" {
-			items = append(items, []string{"purchasing", "projectname.pname"}...)
+			if isProject {
+				items = append(items, []string{"purchasing", "projectname.sname"}...)
+			} else {
+				items = append(items, []string{"purchasing", "projectname.pname"}...)
+			}
 		}
 	}
 	if len(items) == 0 { //默认查询项目名称和标的物
-		items = append(items, []string{"purchasing", "projectname.pname"}...)
+		if isProject {
+			items = append(items, []string{"purchasing", "projectname.sname"}...)
+		} else {
+			items = append(items, []string{"purchasing", "projectname.pname"}...)
+		}
 	}
 	ps.ShowMatch = strings.Join(items, ",")
 	return
@@ -187,7 +195,7 @@ func (pwp *PortraitProjectScreen) CommonPare(isWinner bool) (mustQueryArr []stri
 		if pareWord := pwp.Screen.PareMatchWord(); pareWord != "" {
 			pwp.Screen.KeyWordArr = nil
 			var keywordQueryArr []string
-			findFields := fmt.Sprintf(`"%s"`, strings.Join(pwp.Screen.PareMatchType(), "\",\""))
+			findFields := fmt.Sprintf(`"%s"`, strings.Join(pwp.Screen.PareMatchType(false), "\",\""))
 			for _, keyword := range strings.Split(pareWord, " ") {
 				if keyword == "" {
 					continue

+ 0 - 4
src/jfw/modules/bigmember/src/service/portrait/memberPortraitAction.go

@@ -208,8 +208,6 @@ func (this *EntPortrait) WinnerNewMsgExport() {
 			if err != nil {
 				return nil, err
 			}
-		} else {
-			pps.CommonPare(true)
 		}
 		_id, err := cepm.SaveExportRecord(pps, ids, entId, "winnerPortrait")
 		if err != nil {
@@ -424,8 +422,6 @@ func (this *EntPortrait) BuyerNewMsgExport() {
 			if err != nil {
 				return nil, err
 			}
-		} else {
-			pps.CommonPare(false)
 		}
 		_id, err := cepm.SaveExportRecord(pps, ids, buyer, "buyerPortrait")
 		if err != nil {

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

@@ -77,7 +77,7 @@ func (this *SubVipPortrait) SubVipWinnerNewMsg() {
 		if entId == "" {
 			return nil, fmt.Errorf("参数异常")
 		}
-		cepm, power, _, _ := entity.CreateSubVipPortraitManager(userId, "entNewMsg", entId, true, this.Session())
+		cepm, power, _, free := entity.CreateSubVipPortraitManager(userId, "entNewMsg", entId, true, this.Session())
 
 		pageNum, _ := this.GetInteger("pageNum")
 		pageSize, _ := this.GetInteger("pageSize")
@@ -86,7 +86,7 @@ func (this *SubVipPortrait) SubVipWinnerNewMsg() {
 			Screen: &entity.PortraitScreen{
 				Ent:        entId,
 				Match:      this.GetString("match"),
-				ExactMatch: this.GetString("matchType") == "1",
+				ExactMatch: this.GetString("exactMatch") == "1",
 				MatchRange: this.GetString("matchRange"),
 				Area:       this.GetString("area"),
 				ScopeClass: this.GetString("scopeClass"),
@@ -95,6 +95,7 @@ func (this *SubVipPortrait) SubVipWinnerNewMsg() {
 			},
 			PageNum:  pageNum,
 			PageSize: pageSize,
+			Free:     free,
 		})
 		if err != nil {
 			return nil, err
@@ -147,8 +148,6 @@ func (this *SubVipPortrait) WinnerNewMsgExport() {
 			if err != nil {
 				return nil, err
 			}
-		} else {
-			pps.CommonPare(true)
 		}
 		_id, err := cepm.SaveExportRecord(pps, ids, entId, "winnerPortrait")
 		if err != nil {
@@ -339,7 +338,7 @@ func (this *SubVipPortrait) BuyerNewMsg() {
 		}
 		pageNum, _ := this.GetInteger("pageNum")
 		pageSize, _ := this.GetInteger("pageSize")
-		cepm, power, err, _ := entity.CreateSubVipPortraitManagerForOpen(userId, "buyerNewMsg", buyer, false, this.Session())
+		cepm, power, err, free := entity.CreateSubVipPortraitManagerForOpen(userId, "buyerNewMsg", buyer, false, this.Session())
 		//if err != nil {
 		//	return nil, err
 		//}
@@ -358,6 +357,7 @@ func (this *SubVipPortrait) BuyerNewMsg() {
 			},
 			PageNum:  pageNum,
 			PageSize: pageSize,
+			Free:     free,
 		})
 		if err != nil {
 			return nil, err
@@ -406,8 +406,6 @@ func (this *SubVipPortrait) BuyerNewMsgExport() {
 			if err != nil {
 				return nil, err
 			}
-		} else {
-			pps.CommonPare(false)
 		}
 		_id, err := cepm.SaveExportRecord(pps, ids, buyer, "buyerPortrait")
 		if err != nil {

+ 20 - 1
src/jfw/modules/publicapply/src/activityday/consts/consts.go

@@ -15,6 +15,23 @@ const (
 
 	TimeOut       = 5
 	OneDayTimeOut = 24 * 60 * 60
+
+	UserAttributeGuest         = "g"   // 用户身份  g-未登录
+	UserAttributeFree          = "f"   // 用户身份  f-免费
+	UserAttributeMember        = "m"   // 用户身份 m-大会员
+	UserAttributeVip           = "v"   // 用户身份 v-超级订阅
+	UserAttributeEntniche      = "e"   // 用户身份 e-商机管理
+	UserAttributeLimitM        = "lm"  // 用户身份 大会员(非超级订阅的大会员)
+	UserAttributeLimitMV       = "lmv" // 用户身份 大会员且超级订阅
+	UserAttributeLimitV        = "lv"  // 用户身份 超级订阅(非大会员的超级订阅)
+	UserAttributeNotMV         = "nmv" // 用户身份 非超级订阅非大会员的用户(可能是商机管理用户、免费用户)
+	UB                         = true  //
+	OrderAttributeVipBuy       = "vb"  // 订单分类 vip购买
+	OrderAttributeVipRenew     = "vr"  // 订单分类 vip续费
+	OrderAttributeVipUpgrade   = "vu"  // 订单分类 vip升级
+	OrderAttributeBigMemberBuy = "bb"  // 订单分类 大会员购买
+	OrderAttributeNoHave       = "oan" //未查到对应订单信息
+
 )
 
 var (
@@ -32,6 +49,7 @@ var (
 	LotteryUserMsg_NoMore             = "今天已抢光,活动已结束"
 	TableActivityInfo                 = "jyactivities.activity_info"        // 活动信息表
 	TablePrizeInfo                    = "jyactivities.lottery_prize_info"   // 奖品信息表
+	TableOrderInfo                    = "jyactivities.lottery_prize_order"  // 活动关联订单信息表
 	TableUserAccount                  = "jyactivities.lottery_user_account" // 用户中奖信息表
 	TableEquityInfo                   = "jyactivities.equity_info"          // 第三方权权益码表
 	TableOrder                        = "jianyu.dataexport_order"           // 订单表
@@ -45,5 +63,6 @@ var (
 	LimitMsg                          = "每天仅限参与%d次活动,明天再来吧,有问题请联系客服。"
 	LimitRedis                        = "newother"
 	RedislimitOpushidKey              = "limit_opushid_%s"
-	ActivityCookieName                = "activityDay_%s" // activityDay__年月日
+	ActivityCookieName                = "activityDay_%s"   // activityDay__年月日
+	OrderErrMsg                       = "您当前条件不符合参与该抽奖活动!" //非常抱歉,您暂不满足抽奖条件!
 )

+ 51 - 29
src/jfw/modules/publicapply/src/activityday/dao/dao.go

@@ -8,7 +8,6 @@ import (
 	"fmt"
 	"jy/src/jfw/modules/publicapply/src/activityday/config"
 	"jy/src/jfw/modules/publicapply/src/activityday/consts"
-	"jy/src/jfw/modules/publicapply/src/activityday/util"
 	"jy/src/jfw/modules/publicapply/src/db"
 	"log"
 	"net/http"
@@ -30,13 +29,13 @@ type LotteryActiveInfoRes struct {
 }
 
 // GetLotteryActiveInfo 获取活动信息
-func GetLotteryActiveInfo(activeId int64, sess map[string]interface{}, session *httpsession.Session, req *http.Request) (activeInfo LotteryActiveInfoRes) {
+func GetLotteryActiveInfo(activeId int64, session *httpsession.Session, req *http.Request) (activeInfo LotteryActiveInfoRes) {
 	var (
 		err     error
 		prizeRs []map[string]interface{}
 		now     = time.Now()
 	)
-	r := NewRaffleInfo(sess, activeId, util.UserLabel(session), req, 0)
+	r := NewRaffleInfo(session, activeId, req, 0)
 	activeInfo = LotteryActiveInfoRes{
 		Lai:     &Lai{},
 		NowUnix: now.Unix(),
@@ -47,18 +46,21 @@ func GetLotteryActiveInfo(activeId int64, sess map[string]interface{}, session *
 	}
 	//活动期间
 	if r.DLai.ActiveStartTime <= now.Unix() && r.DLai.ActiveEndTime >= now.Unix() && config.Config.FASwitch {
-		//首次访问活动页面 赠送剑鱼币100
-		onceKey := fmt.Sprintf("activity_day_once_%s_%s", r.DLai.Name, r.UserInfo.UserId)
-		if ok, err := redis.Exists(consts.RedisNewCode, onceKey); err == nil && !ok {
-			err = r.PointHarvest(r.DLai.Cost)
-			if err == nil {
-				expireTime := 10 * 24 * 60 * 60
-				if r.DLai.ActiveEndTime > now.Unix() {
-					expireTime = int(r.DLai.ActiveEndTime - now.Unix())
+		//积分抽奖
+		if r.DLai.Mold == 1 {
+			//首次访问活动页面 赠送剑鱼币100
+			onceKey := fmt.Sprintf("activity_day_once_%s_%s", r.DLai.Name, r.UserInfo.UserId)
+			if ok, err := redis.Exists(consts.RedisNewCode, onceKey); err == nil && !ok {
+				err = r.PointHarvest(r.DLai.Cost)
+				if err == nil {
+					expireTime := 10 * 24 * 60 * 60
+					if r.DLai.ActiveEndTime > now.Unix() {
+						expireTime = int(r.DLai.ActiveEndTime - now.Unix())
+					}
+					redis.Put(consts.RedisNewCode, onceKey, now.Day(), expireTime)
+				} else {
+					log.Println("--首次 赠送--err -:", err.Error())
 				}
-				redis.Put(consts.RedisNewCode, onceKey, now.Day(), expireTime)
-			} else {
-				log.Println("--首次 赠送--err -:", err.Error())
 			}
 		}
 	}
@@ -84,6 +86,7 @@ func GetLotteryActiveInfo(activeId int64, sess map[string]interface{}, session *
 		Rule:             r.DLai.Rule,
 		ShareCopy:        r.DLai.ShareCopy,
 		Pic:              pic,
+		Mold:             r.DLai.Mold,
 	}
 	//奖品信息
 	if r.DLpi, err = r.PrizeInfo(); err != nil {
@@ -124,33 +127,52 @@ func GetLotteryActiveInfo(activeId int64, sess map[string]interface{}, session *
 		return
 	}
 	// 未登录用户 显示抽奖
-	if common.Int64All(sess["positionId"]) == 0 || r.DLai.Mold == 0 { //购买赠送奖品 只需要购买须知信息
+	if r.UserInfo.PositionId == 0 || r.DLai.Mold == 0 { //购买赠送奖品 只需要购买须知信息
 		activeInfo.Status = 0
 		return
 	}
-	//用户获奖信息
-	if r.DLua, err = r.UserAccountInfo(); err != nil {
-		log.Println("当前用户暂无中奖记录:", r.UserInfo.Phone)
-	}
 	//是否是活动结束日
 	lastDay := now.Format(date.Date_Short_Layout) == time.Unix(r.DLai.ActiveEndTime, 0).Local().Format(date.Date_Short_Layout)
-	if r.DLua != nil {
-		//今天抽奖机会是否已用完
-		if num := r.DLua.CheckTodayLotteryNum(); num >= r.DLai.DailyNum {
-			//今日抽奖机会已用完
-			err = fmt.Errorf(fmt.Sprintf(consts.LotteryUserMsg_Winner, date.FormatDateByInt64(&r.DLai.LotteryStartTime, date.Date_Time_Layout))) //明天可抽奖
-			//是否是活动结束当天
-			if lastDay {
-				err = fmt.Errorf(consts.LotteryUserMsg_WinnerNoMore)
+	timeStr := ""
+	switch activeInfo.Lai.Mold {
+	case 1:
+		timeStr = date.FormatDateByInt64(&r.DLai.LotteryStartTime, date.Date_Time_Layout)
+		//用户获奖信息
+		if r.DLua, err = r.UserAccountInfo(); err != nil {
+			log.Println(err.Error(), " :", r.UserInfo.Phone)
+		}
+		if r.DLua != nil {
+			//今天抽奖机会是否已用完
+			if num := r.DLua.CheckTodayLotteryNum(); num >= r.DLai.DailyNum {
+				//今日抽奖机会已用完
+				err = fmt.Errorf(fmt.Sprintf(consts.LotteryUserMsg_Winner, timeStr)) //明天可抽奖
+				//是否是活动结束当天
+				if lastDay {
+					err = fmt.Errorf(consts.LotteryUserMsg_WinnerNoMore)
+				}
+				activeInfo.Msg = err.Error()
+				return
 			}
-			activeInfo.Msg = err.Error()
+		}
+	case 2: //P527--订单分类
+		startOfDay := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location())
+		if r.DLai.LotteryStartTime != startOfDay.Unix() {
+			timeStr = date.FormatDateByInt64(&r.DLai.LotteryStartTime, date.Date_Time_Layout)
+		}
+		//今天抽奖机会是否已用完
+		OrderInfo := NewOrderInfo(activeId, r.UserInfo.PositionId, r.UserInfo.MgoUserId)
+		r.UserInfo.OrderAttribute = OrderInfo.OrderDataOptimization().OrderCode
+		activeInfo.Lai.Cost = int64(len(r.UserInfo.OrderAttribute))
+		if activeInfo.Lai.Cost < 1 {
+			activeInfo.Status = 0 // p527 没有抽奖权限的也显示成抽奖  点抽奖的时候再出弹框
+			log.Println("prompt_msg:", consts.OrderErrMsg)
 			return
 		}
 	}
 	//今日库存 及 有效奖品整理
 	if todayPrizeNum := r.EffectivePrizeInventory(); todayPrizeNum <= 0 {
 		//暂无库存
-		err = fmt.Errorf(fmt.Sprintf(consts.LotteryUserMsg_NoPreze, date.FormatDateByInt64(&r.DLai.LotteryStartTime, date.Date_Time_Layout)))
+		err = fmt.Errorf(fmt.Sprintf(consts.LotteryUserMsg_NoPreze, timeStr))
 		//是否是活动结束当天
 		if lastDay {
 			err = fmt.Errorf(consts.LotteryUserMsg_NoMore)

+ 19 - 7
src/jfw/modules/publicapply/src/activityday/dao/drawLottery.go

@@ -25,9 +25,12 @@ func (r *RaffleInfo) EffectivePrizeInventory() (num int) {
 	for _, lpi := range *r.DLpi {
 		//库存>0
 		if lpi.Inventory > 0 {
-			prizeKey := fmt.Sprintf(consts.PrizeKey, lpi.Name, lpi.Id, lpi.ActiveId, now.Day()) //当日此奖品消耗数量redis key
-			//今日库存
-			usableNum := lpi.DailyNum - redis.GetInt(consts.RedisCode, prizeKey)
+			usableNum := lpi.Inventory
+			if lpi.DailyNum > 0 { //每日可中奖数量 >0:限制;当<0的时候:不限制,库存有多少 可抽奖品就有多少
+				prizeKey := fmt.Sprintf(consts.PrizeKey, lpi.Name, lpi.Id, lpi.ActiveId, now.Day()) //当日此奖品消耗数量redis key
+				//今日库存
+				usableNum = lpi.DailyNum - redis.GetInt(consts.RedisCode, prizeKey)
+			}
 			if usableNum > 0 {
 				//此奖用户目标》》》当前用户是否能抽此奖
 				//中奖目标用户。默认空:全部用户,f:免费用户;v:超级订阅用户;m:大会员用户;e:商机管理用户
@@ -120,10 +123,19 @@ func (r *RaffleInfo) DistributePrize() (err error) {
 				now       = time.Now()
 				orderCode string
 			)
-			//TODO: 剑鱼币 消费---------------------先消费再奖励
-			if err = r.PointConsume(r.DLai.Cost); err != nil {
-				r.Steps = consts.Steps10
-				return
+			switch r.DLai.Mold {
+			case 1:
+				//TODO: 剑鱼币 消费---------------------先消费再奖励
+				if err = r.PointConsume(r.DLai.Cost); err != nil {
+					r.Steps = consts.Steps10
+					return
+				}
+			case 2:
+				//TODO: 订单次数 消费
+				if err = r.OrderConsume(tx); err != nil {
+					r.Steps = consts.Steps10
+					return
+				}
 			}
 			//TODO 更新奖品库存
 			updatePrizeInfo := fmt.Sprintf("UPDATE %s lpi SET lpi.inventory = lpi.inventory - 1 WHERE lpi.active_id = ? AND lpi.id = ?  AND lpi.state = 0;", consts.TablePrizeInfo)

+ 81 - 0
src/jfw/modules/publicapply/src/activityday/dao/order.go

@@ -0,0 +1,81 @@
+package dao
+
+import (
+	"app.yhyue.com/moapp/jybase/common"
+	"database/sql"
+	"fmt"
+	"jy/src/jfw/modules/publicapply/src/activityday/consts"
+	"jy/src/jfw/modules/publicapply/src/db"
+	"log"
+)
+
+type OrderInfo struct {
+	OrderCode  map[string]string //订单信息
+	ActiveId   int64             //活动id
+	PositionId int64
+	MgoUserId  string
+}
+
+func NewOrderInfo(aId, pId int64, mId string) *OrderInfo {
+	return &OrderInfo{
+		OrderCode:  map[string]string{},
+		ActiveId:   aId,
+		PositionId: pId,
+		MgoUserId:  mId,
+	}
+}
+
+// 满足抽奖的订单信息
+func (o *OrderInfo) OrderDataOptimization() *OrderInfo {
+	lotteryOrderSql := fmt.Sprintf(`SELECT order_code FROM %s  WHERE active_id = ? AND state = 0 AND (CASE WHEN position_id IS NOT NULL THEN position_id = ?  ELSE mgo_user_id = ? END)`, consts.TableOrderInfo)
+	orderInfos := db.BaseMysql.SelectBySql(lotteryOrderSql, o.ActiveId, o.PositionId, o.MgoUserId)
+	if orderInfos != nil && len(*orderInfos) > 0 {
+		for _, orderInfo := range *orderInfos {
+			orderCode := common.InterfaceToStr(orderInfo["order_code"])
+			if orderCode == "" {
+				continue
+			}
+			orderSql := fmt.Sprintf(`SELECT filter,product_type,vip_type FROM %s WHERE order_code = ?;`, consts.TableOrder)
+			orderDatas := db.BaseMysql.SelectBySql(orderSql, orderCode)
+			if orderDatas != nil && len(*orderDatas) > 0 {
+				orderData := (*orderDatas)[0]
+				productType := common.ObjToString(orderData["product_type"])
+				vipType := common.IntAll(orderData["vip_type"])
+				switch productType {
+				case "VIP订阅":
+					switch vipType {
+					case 1: //续费
+						o.OrderCode[orderCode] = consts.OrderAttributeVipRenew
+					case 2: //升级
+						o.OrderCode[orderCode] = consts.OrderAttributeVipUpgrade
+					default: //默认购买
+						o.OrderCode[orderCode] = consts.OrderAttributeVipBuy
+					}
+				case "大会员":
+					o.OrderCode[orderCode] = consts.OrderAttributeBigMemberBuy
+				}
+			}
+		}
+	}
+	return o
+}
+
+// 订单抽奖消耗
+func (r *RaffleInfo) OrderConsume(tx *sql.Tx) (err error) {
+	if r.DLai.Cost > 0 {
+		for k, v := range r.UserInfo.OrderAttribute {
+			if k != "" {
+				orderSql := fmt.Sprintf(`UPDATE %s SET state = 1 , update_time = NOW() WHERE order_code = ?`, consts.TableOrderInfo)
+				if i := db.BaseMysql.UpdateOrDeleteBySqlByTx(tx, orderSql, k); i > 0 {
+					r.UserInfo.OrderAttribute[k] = fmt.Sprintf("%s_used", v)
+					r.DLai.Cost--
+					log.Println(k, "--订单消耗--", v)
+					break
+				}
+			}
+		}
+	} else {
+		err = fmt.Errorf("您当前条件不符合参与该抽奖活动!")
+	}
+	return
+}

+ 85 - 57
src/jfw/modules/publicapply/src/activityday/dao/raffle.go

@@ -3,12 +3,14 @@ package dao
 import (
 	"app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/date"
+	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
 	"app.yhyue.com/moapp/jybase/redis"
 	"encoding/json"
 	"fmt"
 	"jy/src/jfw/modules/publicapply/src/activityday/consts"
 	dredis "jy/src/jfw/modules/publicapply/src/activityday/dao/redis"
 	"jy/src/jfw/modules/publicapply/src/activityday/entity"
+	autil "jy/src/jfw/modules/publicapply/src/activityday/util"
 	"jy/src/jfw/modules/publicapply/src/db"
 	"jy/src/jfw/modules/publicapply/src/util"
 	"log"
@@ -18,19 +20,16 @@ import (
 	"time"
 )
 
-const (
-	LimitMsg = "每天仅限参与%d次活动,明天再来吧,有问题请联系客服。"
-)
-
 type userInfo struct {
-	UserId        string
-	Phone         string
-	PositionId    int64
-	MgoUserId     string
-	PositionType  int
-	EntId         int64
-	EntUserId     int64
-	UserAttribute string //用户属性 f v m e
+	UserId         string
+	Phone          string
+	PositionId     int64
+	MgoUserId      string
+	PositionType   int
+	EntId          int64
+	EntUserId      int64
+	UserAttribute  string            //用户属性 f v m e
+	OrderAttribute map[string]string //订单类型 vb:vip购买;vr:vip续费;vu:vip升级;mb:大会员购买;
 }
 
 type RaffleInfo struct {
@@ -52,7 +51,24 @@ type RaffleInfo struct {
 	UA            string
 }
 
-func NewRaffleInfo(sess map[string]interface{}, activeId int64, uas []string, r *http.Request, cookieNum int) *RaffleInfo {
+func NewRaffleInfo(session *httpsession.Session, activeId int64, r *http.Request, cookieNum int) *RaffleInfo {
+	var (
+		sess = session.GetMultiple()
+		ui   = &userInfo{}
+	)
+	if common.ObjToString(sess["userId"]) != "" {
+		ui = &userInfo{
+			UserId:         common.ObjToString(sess["userId"]),
+			Phone:          common.ObjToString(sess["phone"]),
+			PositionId:     common.Int64All(sess["positionId"]),
+			MgoUserId:      common.ObjToString(sess["mgoUserId"]),
+			PositionType:   common.IntAll(sess["positionType"]),
+			EntId:          common.Int64All(sess["entId"]),
+			EntUserId:      common.Int64All(sess["entUserId"]),
+			UserAttribute:  strings.Join(autil.UserLabel(session), ","), //用户属性
+			OrderAttribute: map[string]string{},                         //订单分类
+		}
+	}
 	return &RaffleInfo{
 		activeId,
 		r,
@@ -62,16 +78,7 @@ func NewRaffleInfo(sess map[string]interface{}, activeId int64, uas []string, r
 		[]int{},
 		0,
 		&entity.LotteryPrizeInfo{},
-		&userInfo{
-			UserId:        common.ObjToString(sess["userId"]),
-			Phone:         common.ObjToString(sess["phone"]),
-			PositionId:    common.Int64All(sess["positionId"]),
-			MgoUserId:     common.ObjToString(sess["mgoUserId"]),
-			PositionType:  common.IntAll(sess["positionType"]),
-			EntId:         common.Int64All(sess["entId"]),
-			EntUserId:     common.Int64All(sess["entUserId"]),
-			UserAttribute: strings.Join(uas, ","), //用户属性
-		},
+		ui,
 		consts.Steps0,
 		map[string][]string{},
 		common.GetIp(r),
@@ -110,47 +117,66 @@ func (r *RaffleInfo) Raffle() (int, error, entity.WinnerPrizeInfo) {
 			now   = time.Now()
 			point int64
 		)
-		//剑鱼币信息
-		//TODO: 判断剑鱼币是否足够
-		point, err = r.PointIntegralBalance()
-		if err != nil {
-			return
-		}
 		//活动信息
 		if r.DLai, err = r.ActiveInfo(); err != nil {
 			return
 		}
-		//积分是否足够
-		if point < r.DLai.Cost {
-			err = fmt.Errorf("剑鱼币余额不足!")
-			return
-		}
 		//当前活动状态
 		if err = r.DLai.Check(); err != nil {
 			return
 		}
-		// 活动限制  1.同1个ip1天Xx次,2.同1个设备1天Xx次
-		if err = r.CheckLimit(); err != nil {
-			log.Println("异常用户:", r.UserInfo.Phone, err)
-			return -2, err, wpi
-		}
-		//用户获奖信息
-		if r.DLua, err = r.UserAccountInfo(); err != nil {
-			log.Println("当前用户暂无中奖记录:", r.UserInfo.Phone)
-		}
 		//是否是活动结束日
 		lastDay := now.Format(date.Date_Short_Layout) == time.Unix(r.DLai.ActiveEndTime, 0).Local().Format(date.Date_Short_Layout)
-		if r.DLua != nil {
-			//今天抽奖机会是否已用完
-			if num := r.DLua.CheckTodayLotteryNum(); num >= r.DLai.DailyNum {
-				//今日抽奖机会已用完
-				err = fmt.Errorf(fmt.Sprintf(consts.LotteryUserMsg_Winner, date.FormatDateByInt64(&r.DLai.LotteryStartTime, date.Date_Time_Layout))) //明天可抽奖
-				//是否是活动结束当天
-				if lastDay {
-					err = fmt.Errorf(consts.LotteryUserMsg_WinnerNoMore)
+		timeStr := ""
+		//剑鱼币信息
+		switch r.DLai.Mold {
+		case 1: //剑鱼币抽奖
+			//获取剑鱼币数量
+			point, err = r.PointIntegralBalance()
+			if err != nil {
+				return
+			}
+			//积分是否足够
+			if point < r.DLai.Cost {
+				err = fmt.Errorf("剑鱼币余额不足!")
+				return
+			}
+			// 活动限制  1.同1个ip1天Xx次,2.同1个设备1天Xx次
+			if err = r.CheckLimit(); err != nil {
+				log.Println("异常用户:", r.UserInfo.Phone, err)
+				return -2, err, wpi
+			}
+			//用户获奖信息
+			if r.DLua, err = r.UserAccountInfo(); err != nil {
+				log.Println(err.Error(), " :", r.UserInfo.Phone)
+			}
+			if r.DLua != nil {
+				//今天抽奖机会是否已用完
+				if num := r.DLua.CheckTodayLotteryNum(); num >= r.DLai.DailyNum {
+					//今日抽奖机会已用完
+					err = fmt.Errorf(fmt.Sprintf(consts.LotteryUserMsg_Winner, date.FormatDateByInt64(&r.DLai.LotteryStartTime, date.Date_Time_Layout))) //明天可抽奖
+					//是否是活动结束当天
+					if lastDay {
+						err = fmt.Errorf(consts.LotteryUserMsg_WinnerNoMore)
+					}
+					return
 				}
+			}
+			timeStr = date.FormatDateByInt64(&r.DLai.LotteryStartTime, date.Date_Time_Layout)
+		case 2: //订单抽奖
+			OrderInfo := NewOrderInfo(r.ActiveId, r.UserInfo.PositionId, r.UserInfo.MgoUserId)
+			r.UserInfo.OrderAttribute = OrderInfo.OrderDataOptimization().OrderCode
+			//获取活动期间 满足抽奖的订单信息
+			r.DLai.Cost = int64(len(r.UserInfo.OrderAttribute))
+			if r.DLai.Cost <= 0 {
+				errorCode = -2 //弹窗提示
+				err = fmt.Errorf(consts.OrderErrMsg)
 				return
 			}
+			startOfDay := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location())
+			if r.DLai.LotteryStartTime != startOfDay.Unix() {
+				timeStr = date.FormatDateByInt64(&r.DLai.LotteryStartTime, date.Date_Time_Layout)
+			}
 		}
 		//奖品信息
 		if r.DLpi, err = r.PrizeInfo(); err != nil {
@@ -159,7 +185,7 @@ func (r *RaffleInfo) Raffle() (int, error, entity.WinnerPrizeInfo) {
 		//今日库存 及 有效奖品整理
 		if todayPrizeNum := r.EffectivePrizeInventory(); todayPrizeNum <= 0 {
 			//暂无库存
-			err = fmt.Errorf(fmt.Sprintf(consts.LotteryUserMsg_NoPreze, date.FormatDateByInt64(&r.DLai.LotteryStartTime, date.Date_Time_Layout)))
+			err = fmt.Errorf(fmt.Sprintf(consts.LotteryUserMsg_NoPreze, timeStr))
 			//是否是活动结束当天
 			if lastDay {
 				err = fmt.Errorf(consts.LotteryUserMsg_NoMore)
@@ -170,7 +196,7 @@ func (r *RaffleInfo) Raffle() (int, error, entity.WinnerPrizeInfo) {
 		r.WeightsAccumulated()
 		if len(*r.DLpi) == 0 || len(r.WeightList) == 0 {
 			//暂无库存
-			err = fmt.Errorf(fmt.Sprintf(consts.LotteryUserMsg_NoPreze, date.FormatDateByInt64(&r.DLai.LotteryStartTime, date.Date_Time_Layout)))
+			err = fmt.Errorf(fmt.Sprintf(consts.LotteryUserMsg_NoPreze, timeStr))
 			//是否是活动结束当天
 			if lastDay {
 				err = fmt.Errorf(consts.LotteryUserMsg_NoMore)
@@ -182,7 +208,7 @@ func (r *RaffleInfo) Raffle() (int, error, entity.WinnerPrizeInfo) {
 		if r.Prize == nil || r.Prize.Name == "" {
 			log.Println("都到这了,居然没有奖品-.-!,肯定有问题。", r.UserInfo.Phone)
 			//今日抽奖机会已用完
-			err = fmt.Errorf(fmt.Sprintf(consts.LotteryUserMsg_Winner, date.FormatDateByInt64(&r.DLai.LotteryStartTime, date.Date_Time_Layout))) //明天可抽奖
+			err = fmt.Errorf(fmt.Sprintf(consts.LotteryUserMsg_Winner, timeStr)) //明天可抽奖
 			if lastDay {
 				err = fmt.Errorf(consts.LotteryUserMsg_WinnerNoMore)
 			}
@@ -293,7 +319,7 @@ func (r *RaffleInfo) CheckLimit() (err error) {
 	//  1. 判断ip
 	if r.DLai.IpNum > 0 && r.getCount("ip", r.Ip) >= r.DLai.IpNum {
 		log.Println("1 异常ip:", r.Ip, r.UserInfo.Phone)
-		return fmt.Errorf(LimitMsg, r.DLai.IpNum)
+		return fmt.Errorf(consts.LimitMsg, r.DLai.IpNum)
 	}
 	// 2. 如果是app 判断s_opushid
 	// 如果是app端 把s_opushid 存到redis里面
@@ -303,7 +329,7 @@ func (r *RaffleInfo) CheckLimit() (err error) {
 			times := common.IntAll(redis.Get(consts.LimitRedis, putKey))
 			if times >= r.DLai.DeviceNum {
 				log.Println("2 异常设备:", r.OpushId, r.UserInfo.Phone)
-				return fmt.Errorf(LimitMsg, r.DLai.DeviceNum)
+				return fmt.Errorf(consts.LimitMsg, r.DLai.DeviceNum)
 			}
 		}
 	}
@@ -312,7 +338,7 @@ func (r *RaffleInfo) CheckLimit() (err error) {
 		if r.CookieNum >= r.DLai.DeviceNum {
 			log.Println("3 异常CookieNum:", r.UA, r.R.UserAgent(), r.UserInfo.Phone, r.CookieNum)
 			log.Println("3 异常UA:", r.UA, r.R.UserAgent(), r.UserInfo.Phone)
-			return fmt.Errorf(LimitMsg, r.DLai.DeviceNum)
+			return fmt.Errorf(consts.LimitMsg, r.DLai.DeviceNum)
 		}
 	}
 	return nil
@@ -373,6 +399,8 @@ func (r *RaffleInfo) UserAccountInfo() (ua *Lua, err error) {
 			//此类奖品--中奖时间
 			r.PrizeTimesMap[pm] = append(r.PrizeTimesMap[pm], createTime)
 		}
+	} else {
+		err = fmt.Errorf("当前用户暂无中奖记录")
 	}
 	return
 }

+ 4 - 4
src/jfw/modules/publicapply/src/activityday/service/raffle.go

@@ -47,12 +47,12 @@ func (this *ActivityDay) Raffle() {
 		if aid <= 0 {
 			return api.Result{Error_code: -1, Error_msg: api.Error_msg_1002}
 		}
-		sessVal := this.Session().GetMultiple()
+		//sessVal := this.Session().GetMultiple()
+		r := dao.NewRaffleInfo(this.Session(), aid, this.Request, cookieNum)
 		//用户信息
-		if common.ObjToString(sessVal["userId"]) == "" {
+		if r.UserInfo.UserId == "" {
 			return api.Result{Error_code: -1, Error_msg: api.Error_msg_1001}
 		}
-		r := dao.NewRaffleInfo(sessVal, aid, autil.UserLabel(this.Session()), this.Request, cookieNum)
 		//
 		if err := autil.RequestValidation(r.UserInfo.PositionId); err != nil {
 			return api.Result{Error_code: -1, Error_msg: err.Error()}
@@ -62,7 +62,7 @@ func (this *ActivityDay) Raffle() {
 			wpi       entity.WinnerPrizeInfo
 			errorCode int
 		)
-
+		//--抽奖--
 		if errorCode, err, wpi = r.Raffle(); err != nil {
 			log.Println(r.UserInfo.Phone, "--抽奖异常:", err.Error())
 			var (

+ 1 - 2
src/jfw/modules/publicapply/src/activityday/service/service.go

@@ -54,8 +54,7 @@ func (d *ActivityDay) Info() {
 		if aid <= 0 {
 			return Result{Data: nil, Error_msg: Error_msg_1002}
 		}
-		sessVal := d.Session().GetMultiple()
-		info := dao.GetLotteryActiveInfo(aid, sessVal, d.Session(), d.Request)
+		info := dao.GetLotteryActiveInfo(aid, d.Session(), d.Request)
 		return Result{Data: info}
 	}()
 	d.ServeJson(r)

+ 49 - 6
src/jfw/modules/publicapply/src/activityday/util/user.go

@@ -3,25 +3,68 @@ package util
 import (
 	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
 	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	"jy/src/jfw/modules/publicapply/src/activityday/consts"
 	"jy/src/jfw/modules/publicapply/src/config"
 )
 
 func UserLabel(sess *httpsession.Session) (str []string) {
-	userBase := jy.GetBigVipUserBaseMsg(sess, *config.Middleground)
+	var (
+		userBase = jy.GetBigVipUserBaseMsg(sess, *config.Middleground)
+		isPay    bool
+	)
 	//大会员
 	if userBase.Status > 0 {
-		str = append(str, "m")
+		isPay = true
+		str = append(str, consts.UserAttributeMember)
 	}
 	//vip
 	if userBase.VipStatus > 0 {
-		str = append(str, "v")
+		isPay = true
+		str = append(str, consts.UserAttributeVip)
 	}
 	//商机管理
 	if userBase.EntnicheStatus > 0 {
-		str = append(str, "e")
+		isPay = true
+		str = append(str, consts.UserAttributeEntniche)
 	}
-	if len(str) == 0 {
-		str = append(str, "f")
+	if !isPay {
+		str = append(str, consts.UserAttributeFree)
+	}
+	switch {
+	case userBase.Status < 0 && userBase.VipStatus < 0:
+		switch {
+		case userBase.EntnicheStatus < 0:
+			// 免费用户
+			str = append(str, consts.UserAttributeFree)
+		default:
+			// 非超级订阅非大会员
+			str = append(str, consts.UserAttributeNotMV)
+			// 商机管理
+			str = append(str, consts.UserAttributeEntniche)
+
+		}
+	case userBase.Status > 0:
+		// 大会员
+		str = append(str, consts.UserAttributeMember)
+		switch {
+		case userBase.VipStatus > 0:
+			// 大会员且超级订阅
+			str = append(str, consts.UserAttributeLimitMV)
+		default:
+			// 大会员非超级订阅
+			str = append(str, consts.UserAttributeLimitM)
+		}
+	case userBase.VipStatus > 0:
+		// 超级订阅
+		str = append(str, consts.UserAttributeVip)
+		switch {
+		case userBase.Status < 0:
+			// 超级订阅非大会员
+			str = append(str, consts.UserAttributeLimitV)
+		}
+	case userBase.EntnicheStatus > 0:
+		// 商机管理用户
+		str = append(str, consts.UserAttributeEntniche)
 	}
 	return
 }

+ 27 - 7
src/jfw/modules/publicapply/src/ad/entity/struct.go

@@ -10,11 +10,15 @@ import (
 )
 
 const (
-	UserAttributeGuest    = "g" // 用户身份  g-未登录
-	UserAttributeFree     = "f" // 用户身份  f-免费
-	UserAttributeMember   = "m" // 用户身份 m-大会员
-	UserAttributeVip      = "v" // 用户身份 v-超级订阅
-	UserAttributeEntniche = "e" // 用户身份 e-商机管理
+	UserAttributeGuest    = "g"   // 用户身份  g-未登录
+	UserAttributeFree     = "f"   // 用户身份  f-免费
+	UserAttributeMember   = "m"   // 用户身份 m-大会员
+	UserAttributeVip      = "v"   // 用户身份 v-超级订阅
+	UserAttributeEntniche = "e"   // 用户身份 e-商机管理
+	UserAttributeLimitM   = "Lm"  // 用户身份 大会员(非超级订阅的大会员)
+	UserAttributeLimitMV  = "Lmv" // 用户身份 大会员且超级订阅
+	UserAttributeLimitV   = "Lv"  // 用户身份 超级订阅(非大会员的超级订阅)
+	UserAttributeNotMV    = "Nmv" // 用户身份 非超级订阅非大会员的用户(可能是商机管理用户、免费用户)
 )
 
 // AdInfo 广告信息
@@ -103,7 +107,7 @@ func Handle(session *httpsession.Session, data []interface{}, host string) []AdI
 	return res
 }
 
-// 获取用户身份信息  如果是多个身份就追加到一个列表里面
+// 获取用户身份信息  如果是符合多个身份就追加到一个列表里面
 func getUserAttribute(session *httpsession.Session) (userAttributes []string) {
 	o := util.GetUserBaseInfo(session)
 	// 未登录用户
@@ -114,12 +118,17 @@ func getUserAttribute(session *httpsession.Session) (userAttributes []string) {
 	// 1. 获取用户身份信息
 	userInfo := config.Middleground.PowerCheckCenter.Check("10000", o.MgoUserId, o.BaseUserId, o.AccountId, o.EntId, o.PositionType, o.PositionId)
 	if userInfo.Free.IsFree {
-		userAttributes = append(userAttributes, UserAttributeFree)
+		// 免费用户属于非大会员非商机管理用户
+		userAttributes = append(userAttributes, UserAttributeFree, UserAttributeNotMV)
 		return
 	}
 	// 判断是不是大会员
 	if userInfo.Member.Status > 0 {
 		userAttributes = append(userAttributes, UserAttributeMember)
+		// 仅大会员(非超级订阅的大会员)
+		if userInfo.Vip.Status <= 0 {
+			userAttributes = append(userAttributes, UserAttributeLimitM)
+		}
 	}
 	// 判断是不是商机管理
 	if userInfo.Entniche.Status > 0 && userInfo.Entniche.PowerSource < 1 {
@@ -128,6 +137,17 @@ func getUserAttribute(session *httpsession.Session) (userAttributes []string) {
 	// 判断是不是超级订阅
 	if userInfo.Vip.Status > 0 {
 		userAttributes = append(userAttributes, UserAttributeVip)
+		if userInfo.Member.Status <= 0 { // 仅超级订阅(非大会员的超级订阅)
+			userAttributes = append(userAttributes, UserAttributeLimitV)
+		}
+	}
+	// 大会员且超级订阅用户
+	if userInfo.Vip.Status > 0 && userInfo.Member.Status > 0 {
+		userAttributes = append(userAttributes, UserAttributeLimitMV)
+	}
+	// 大非会员且非超级订阅用户(商机管理用户)
+	if userInfo.Vip.Status <= 0 && userInfo.Member.Status <= 0 {
+		userAttributes = append(userAttributes, UserAttributeNotMV)
 	}
 	return
 }

+ 31 - 18
src/jfw/modules/publicapply/src/ad/service/actions.go

@@ -2,9 +2,11 @@ package service
 
 import (
 	"app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 	"encoding/json"
 	"errors"
 	"jy/src/jfw/modules/publicapply/src/ad/entity"
+	"jy/src/jfw/modules/publicapply/src/config"
 	"jy/src/jfw/modules/publicapply/src/db"
 	"log"
 
@@ -39,25 +41,36 @@ func (a *JyAdvertisement) GetJyAdList() {
 		adReqMsg := new(AdRequestMsg)
 		returnData := map[string]interface{}{}
 		if json.Unmarshal(a.Body(), &adReqMsg) == nil && len(adReqMsg.AdCode) > 0 {
-			for _, sCode := range adReqMsg.AdCode {
-				var adInfo []entity.AdInfo
-				obj := redis.Get("other", "ad_"+sCode)
-				if obj != nil {
-					adInfo = entity.Handle(a.Session(), obj.([]interface{}), a.Request.Host)
-				} else {
-					res, ok := db.Mgo.FindOneByField("ad", `{"s_code":"`+sCode+`"}`, `{"a_son":1}`)
-					if ok && res != nil && (*res)["a_son"] != nil {
-						son := (*res)["a_son"].([]interface{})
-						if len(son) > 0 {
-							redis.Put("other", "ad_"+sCode, son, int(entity.GetLastTime()))
-						}
-						adInfo = entity.Handle(a.Session(), son, a.Request.Host)
-					}
-				}
-				if len(adInfo) > 0 {
-					returnData[sCode] = adInfo
-				}
+			adFunc := jy.AdFunc{
+				AdCodes:   adReqMsg.AdCode,
+				UserInfo:  jy.GetBigVipUserBaseMsg(a.Session(), *config.Middleground),
+				Mgo:       &db.Mgo,
+				MySql:     db.Mysql,
+				Host:      a.Request.Host,
+				Ads:       nil,
+				OrderCode: a.Request.Header.Get("orderCode"), //订单
+				IsLogin:   common.ObjToString(a.GetSession("userId")) != "",
 			}
+			return adFunc.GetAdInfos(), nil
+			//for _, sCode := range adReqMsg.AdCode {
+			//	var adInfo []entity.AdInfo
+			//	obj := redis.Get("other", "ad_"+sCode)
+			//	if obj != nil {
+			//		adInfo = entity.Handle(a.Session(), obj.([]interface{}), a.Request.Host)
+			//	} else {
+			//		res, ok := db.Mgo.FindOneByField("ad", `{"s_code":"`+sCode+`"}`, `{"a_son":1}`)
+			//		if ok && res != nil && (*res)["a_son"] != nil {
+			//			son := (*res)["a_son"].([]interface{})
+			//			if len(son) > 0 {
+			//				redis.Put("other", "ad_"+sCode, son, int(entity.GetLastTime()))
+			//			}
+			//			adInfo = entity.Handle(a.Session(), son, a.Request.Host)
+			//		}
+			//	}
+			//	if len(adInfo) > 0 {
+			//		returnData[sCode] = adInfo
+			//	}
+			//}
 		}
 		return returnData, nil
 	}()

+ 10 - 5
src/jfw/modules/publicapply/src/detail/dao/bidding.go

@@ -364,11 +364,16 @@ func BiddingDataFormat(obj map[string]interface{}, id string) *entity.BidInfo {
             attachments := common.ObjToMap((*projectInfo)["attachments"])
             for _, attachment := range *attachments {
                 at := common.ObjToMap(attachment)
-                bi.Detail.Attachments = append(bi.Detail.Attachments, entity.Attachment{
-                    FileName: common.ObjToString((*at)["filename"]),
-                    FileType: common.ObjToString((*at)["ftype"]),
-                    FileSize: common.ObjToString((*at)["size"]),
-                })
+                if at != nil {
+                    fid := common.ObjToString((*at)["fid"])
+                    if fid != "" {
+                        bi.Detail.Attachments = append(bi.Detail.Attachments, entity.Attachment{
+                            FileName: common.ObjToString((*at)["filename"]),
+                            FileType: common.ObjToString((*at)["ftype"]),
+                            FileSize: common.ObjToString((*at)["size"]),
+                        })
+                    }
+                }
             }
         }
     }

+ 9 - 15
src/jfw/modules/publicapply/src/detail/dao/preAgent.go

@@ -10,7 +10,6 @@ import (
 	"jy/src/jfw/modules/publicapply/src/detail/consts"
 	"jy/src/jfw/modules/publicapply/src/detail/util"
 	"net/http"
-	"net/url"
 	"strings"
 	"time"
 )
@@ -62,14 +61,15 @@ func NewPreAgentReq(ui util.SessUserInfo, sess *httpsession.Session, r *http.Req
 	//}
 	if refer != "" {
 		req.Url = refer
-		urls := strings.Split(strings.Split(refer, ".html")[0], "/")
-		if len(urls) > 3 {
-			req.PageType = urls[len(urls)-2]
-			req.Id = urls[len(urls)-1]
-			if !strings.Contains(req.Id, "+") { //新加密算法解密
-				req.Id, _ = url.QueryUnescape(req.Id)
-			}
-		}
+		req.Id, req.PageType = util.BiddingIdHandle(req.Url)
+		//urls := strings.Split(strings.Split(refer, ".html")[0], "/")
+		//if len(urls) > 3 {
+		//	req.PageType = urls[len(urls)-2]
+		//	req.Id = urls[len(urls)-1]
+		//	if !strings.Contains(req.Id, "+") { //新加密算法解密
+		//		req.Id, _ = url.QueryUnescape(req.Id)
+		//	}
+		//}
 	}
 	params, err := util.GetParamsByUrl(r)
 	if err != nil {
@@ -137,12 +137,6 @@ func (p *PreAgentReq) PreAgent() (res PreAgentRes, err error) {
 			}
 		}
 	}
-	//id-解密
-	p.Id = encrypt.CommonDecodeArticle(p.PageType, p.Id)[0]
-	if p.Id == "" {
-		err = fmt.Errorf(api.Error_msg_1002)
-		return
-	}
 	//分销处理
 	if p.DisWord != "" {
 		if userId := GetUserIdByDisWord(p.DisWord, p.UserInfo.UserId); userId != "" {

+ 30 - 0
src/jfw/modules/publicapply/src/detail/util/util.go

@@ -3,6 +3,7 @@ package util
 import (
 	. "app.yhyue.com/moapp/jybase/api"
 	util "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/encrypt"
 	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
 	"encoding/json"
 	"fmt"
@@ -10,6 +11,7 @@ import (
 	"net/http"
 	"net/url"
 	"reflect"
+	"regexp"
 	"strconv"
 	"strings"
 	"time"
@@ -154,3 +156,31 @@ func DataFormat(data interface{}) Result {
 	}
 	return Result{Data: data}
 }
+
+var regArt = regexp.MustCompile(`/(article|nologin)/([^/]+)/(.+)\.html`)
+
+// 标讯详情页处理
+func BiddingIdHandle(href string) (id, pageType string) {
+	if strings.Contains(href, "link=") && strings.Contains(href, "page_workDesktop") {
+		hrefPage, err := url.QueryUnescape(href)
+		if err == nil {
+			href = strings.Split(hrefPage, "link=")[1]
+		}
+	}
+	if matches := regArt.FindStringSubmatch(href); len(matches) > 3 {
+		pageType = matches[2]
+		if encryptionId := matches[3]; encryptionId != "" {
+			if !strings.Contains(encryptionId, "=") {
+				_encryptionId, err := url.QueryUnescape(encryptionId)
+				if err == nil {
+					encryptionId = _encryptionId
+				}
+			}
+			ids := encrypt.CommonDecodeArticle(pageType, encryptionId)
+			if len(ids) > 0 {
+				id = ids[0]
+			}
+		}
+	}
+	return
+}

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

@@ -5,7 +5,7 @@ go 1.20
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20240226084952-7e7b38ef8a66
 	app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545
-	app.yhyue.com/moapp/jypkg v1.15.8-0.20240429101401-e9a346a1e7a0
+	app.yhyue.com/moapp/jypkg v1.19.7
 	bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20231222060155-36e225b61353
 	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.16
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67

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

@@ -20,8 +20,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20240226084952-7e7b38ef8a66/go.mod h1:XHNATN6t
 app.yhyue.com/moapp/jyfs v0.0.0-20231024061508-480c270480d4/go.mod h1:61hzZ3dZHXL28BNl8BOgZsvM2S5UVY5YFzOkEUPrSu4=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545 h1:+Lak4m1zgsigQloOsvp8AJ+0XeX/+PGp9QP550xlbBQ=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545/go.mod h1:uFrsdUBFbETiJlEmr4PtJWPsZlUpPj2bHQRhryu6ggk=
-app.yhyue.com/moapp/jypkg v1.15.8-0.20240429101401-e9a346a1e7a0 h1:a9vx1dXTwJpvMYCSvQMb6EskDRjnzpzGRMw8JfseGtw=
-app.yhyue.com/moapp/jypkg v1.15.8-0.20240429101401-e9a346a1e7a0/go.mod h1:b3+0Q50iZYNaiYn7yR9bIIvIEsPvSy5figX7riSi/n4=
+app.yhyue.com/moapp/jypkg v1.19.7 h1:KA/q1pX/LfmbTGZ/vI3o75yxNpCCsDcmHw+/wWLzhV4=
+app.yhyue.com/moapp/jypkg v1.19.7/go.mod h1:b3+0Q50iZYNaiYn7yR9bIIvIEsPvSy5figX7riSi/n4=
 app.yhyue.com/moapp/message v0.0.0-20231204024949-8c7145bfc161 h1:WGi4OEIoqw6NpNFGioUEBZnjK9aBa+xJqf/5WY+QyhM=
 app.yhyue.com/moapp/message v0.0.0-20231204024949-8c7145bfc161/go.mod h1:0Oj8SB4pVjdCLD28sy2zyM3hS0WHGpNuVcakLW43GmI=
 bp.jydev.jianyu360.cn/BP/jynsq v0.0.0-20220222052708-ebc43af90698/go.mod h1:ojo/AUH9Yr1wzarEjOaNMkj1Cet/9r8IgLyba64Z52E=

+ 37 - 2
src/jfw/modules/subscribepay/src/config.json

@@ -142,7 +142,7 @@
   "activityOrderCountdown": 30,
   "companySize": 10,
   "webSiteParameter": {
-    "addr": "https://webdev-qmx_admin.jydev.jianyu360.com/api/admin/",
+    "addr": "https://web2-qmx_admin.jydev.jianyu360.com/api/admin/",
     "action": "/message/sendMessageApi",
     "title": "你有新的未支付订单",
     "content": "购买超级订阅,立享专属限时优惠!点击前往支付>>",
@@ -173,7 +173,11 @@
     },
     "mailAlarm": {
       "to": [
-        "liumingliang@topnet.net.cn","zhaozhenzhen-jyyyb@topnet.net.cn","wangshan@topnet.net.cn","yanpeizhu@topnet.net.cn","yangliang@topnet.net.cn"
+        "liumingliang@topnet.net.cn",
+        "zhaozhenzhen-jyyyb@topnet.net.cn",
+        "wangshan@topnet.net.cn",
+        "yanpeizhu@topnet.net.cn",
+        "yangliang@topnet.net.cn"
       ],
       "title": "赠送兑换码活动库存告警",
       "reTry": 3,
@@ -199,5 +203,36 @@
       "040000": true
     }
   },
+  "payRaffle": {
+    "open": true,
+    "siteMsg": {
+      "callPlatform": "subscribepay",
+      "msgType": 1,
+      "title": "会员专属好礼",
+      "content": "%s免费领热门视听会员,点击参与活动,尊享多重会员权益。",
+      "link": "/swordfish/frontPage/activity/free/202402?id=%s",
+      "androidUrl": "/jyapp/frontPage/activity/free/202402?id=%s",
+      "iosUrl": "/jyapp/frontPage/activity/free/202402?id=%s",
+      "weChatUrl": "/weixin/frontPage/activity/free/202402?id=%s"
+    },
+    "activity": {
+      "m_1": {
+        "name": "购买大会员",
+        "activityId": 0
+      },
+      "v_1": {
+        "name": "购买超级订阅",
+        "activityId": 0
+      },
+      "v_2": {
+        "name": "续费超级订阅",
+        "activityId": 7
+      },
+      "v_3": {
+        "name": "升级超级订阅",
+        "activityId": 0
+      }
+    }
+  },
   "newOrderTime": 1709827200
 }

+ 22 - 2
src/jfw/modules/subscribepay/src/config/config.go

@@ -145,8 +145,27 @@ type config struct {
 		} `json:"sms"` // 短信配置
 		SaleDep map[string]bool // 代用户下单业绩归属部门配置 只有业绩归属为运营部才赠送
 	} `json:"equityActive"` // p459赠送视频权益活动配置
-
-	NewOrderTime int64 `json:"newOrderTime"`
+	PayRaffle struct {
+		Open    bool `json:"open"` // 活动开关
+		SiteMsg struct {
+			CallPlatform string `json:"callPlatform"`
+			MsgType      int    `json:"msgType"`
+			Title        string `json:"title"`
+			Content      string `json:"content"`
+			Link         string `json:"link"`
+			AndroidUrl   string `json:"androidUrl"`
+			IosUrl       string `json:"iosUrl"`
+			WeChatUrl    string `json:"weChatUrl"`
+		} `json:"siteMsg"`
+		Activity map[string]struct {
+			ActivityId int    `json:"activityId"`
+			Name       string `json:"name"`
+		} `json:"activity"`
+	} `json:"payRaffle"`
+	NewOrderTime   int64  `json:"newOrderTime"`
+	SigningSubject string `json:"signing_subject"` //管理后台订单发票签约主体配置
+	SubmitNum      int64  `json:"submit_num"`
+	OrderTime      int64  `json:"orderTime"`
 }
 type mgoConf struct {
 	Address           string
@@ -223,6 +242,7 @@ type Invoice struct {
 	Red_invoice_switch bool   //红冲发票是否可用开关
 	Red_invoice_msg    string //提示信息
 	Third_party_switch bool   //第三方开票开关
+	Order_createtime   int64  //24年之前的订单不能开票
 }
 
 type entnicheConfig struct {

+ 97 - 12
src/jfw/modules/subscribepay/src/entity/equityActive.go

@@ -3,6 +3,7 @@ package entity
 import (
 	"app.yhyue.com/moapp/jybase/common"
 	"app.yhyue.com/moapp/jybase/date"
+	"app.yhyue.com/moapp/jybase/encrypt"
 	"app.yhyue.com/moapp/jybase/redis"
 	"app.yhyue.com/moapp/jybase/sms"
 	"fmt"
@@ -18,17 +19,18 @@ import (
 const (
 	TableEquityInfo = "jyactivities.equity_info" // 营销权益信息表
 	//TableEquityActive     = "jyactivities.equity_active" // 营销权益活动表 P477和权益码兑换表合成一张表
-	TableEquityActive     = "jyactivities.activity_info" // 营销权益活动表
-	TableOrder            = "jianyu.dataexport_order"    // 订单表
-	TablebasePosition     = "base_service.base_position" // 用户职位表
-	valueStateGifted      = 1                            // 已赠送状态值
-	valueMoldMonth        = 0                            // 月度
-	valueMoldYear         = 1                            // 年度
-	valueOrderTypeCreate  = 1                            // 超级订阅订单类型: 购买
-	valueOrderTypeRenew   = 2                            // 续费
-	valueOrderTypeUpgrade = 3                            // 升级
-	valueCycleUnitYear    = 1                            // 周期单位为年
-	valueAreaCountAll     = -1                           //  全国
+	TableEquityActive      = "jyactivities.activity_info"       // 营销权益活动表
+	TableOrder             = "jianyu.dataexport_order"          // 订单表
+	TableLotteryPrizeOrder = "jyactivities.lottery_prize_order" // 下单后抽奖活动关联订单信息表
+	TablebasePosition      = "base_service.base_position"       // 用户职位表
+	valueStateGifted       = 1                                  // 已赠送状态值
+	valueMoldMonth         = 0                                  // 月度
+	valueMoldYear          = 1                                  // 年度
+	valueOrderTypeCreate   = 1                                  // 超级订阅订单类型: 购买
+	valueOrderTypeRenew    = 2                                  // 续费
+	valueOrderTypeUpgrade  = 3                                  // 升级
+	valueCycleUnitYear     = 1                                  // 周期单位为年
+	valueAreaCountAll      = -1                                 //  全国
 
 )
 
@@ -47,6 +49,7 @@ type EquityActive struct {
 	ProductType      string // 消息中的产品类型
 	OrderProductType string // 订单中的产品类型
 	SaleDep          string // 业绩归属部门  用于处理代用户下单的数据
+	OrderTypeCode    string // 订单类型编码 用于支付成功后抽奖使用 v_1超级订阅购买 v_2超级订阅续费 v_3 超级订阅升级 m_1 大会员购买
 }
 
 // GiftVip 赠送腾讯视频会员
@@ -198,7 +201,7 @@ func (e *EquityActive) setUserID() {
 	info := common.ObjToMap(rs)
 	phone := ""
 	if info != nil && len(*info) > 0 {
-		log.Println("equityActive 获取到redis保存的用户身份信息:", orderKey, info)
+		log.Println("equityActive 获取到redis保存的用户身份信息:", orderKey, info)
 		e.mgoId = common.ObjToString((*info)["mgoId"])
 		e.positionId = fmt.Sprintf("%v", common.IntAll((*info)["positionId"]))
 		phone = common.ObjToString((*info)["phone"])
@@ -217,6 +220,29 @@ func (e *EquityActive) setUserID() {
 	return
 }
 
+// 支付后发送抽奖消息 获取用户id
+func (e *EquityActive) setUserIDPayRaffle() {
+	orderKey := fmt.Sprintf("order_%s", e.OrderCode)
+	rs := redis.Get("other", orderKey)
+	info := common.ObjToMap(rs)
+	phone := ""
+	if info != nil && len(*info) > 0 {
+		log.Println("PayRaffle 获取到redis保存的用户身份信息:", orderKey, info)
+		e.mgoId = common.ObjToString((*info)["mgoId"])
+		e.positionId = fmt.Sprintf("%v", common.IntAll((*info)["positionId"]))
+		phone = common.ObjToString((*info)["phone"])
+	}
+	if phone != "" {
+		e.Phone = phone
+	}
+	// 如果没有redis取到说明是代用户下单的订单
+	// 代用户下单的现在只有个人版的 所以可以直接从订单里面取用户mgoId
+	if e.mgoId == "" && bson.IsObjectIdHex(e.UserId) {
+		e.mgoId = e.UserId
+	}
+	return
+}
+
 // 发送消息
 func (e *EquityActive) sendVipMsg(eName, code, ex_end_time string) {
 	// 发送短信
@@ -279,3 +305,62 @@ func (e *EquityActive) isYearVip() bool {
 	log.Println("isYearVip 判断是否为年度订单:", query, e.UserId, count)
 	return count > 0
 }
+
+// SendPayRaffleMsg 支付成后发送抽奖消息
+func (e *EquityActive) SendPayRaffleMsg() {
+	// 获取用户id
+	e.setUserIDPayRaffle()
+	if e.mgoId == "" {
+		log.Println("SendPayRaffleMsg 未获取到有效的mgoId", e.OrderCode)
+		return
+	}
+	// 判断订单类型 是否有配置发抽奖消息的活动
+	activityInfo, exist := config.Config.PayRaffle.Activity[e.OrderTypeCode]
+	if !exist || activityInfo.ActivityId <= 0 {
+		log.Println("该订单类型未配置有效活动id", e.OrderTypeCode)
+		return
+	}
+	// 判断活动是否在进行中
+	now := date.NowFormat(date.Date_Full_Layout)
+	query := fmt.Sprintf("SELECT count(*) FROM %s where state=0  and start_time<=? and end_time>=? and mold=2 and id=?;", TableEquityActive)
+	count := util.Mysql.CountBySql(query, now, now, activityInfo.ActivityId)
+	if count <= 0 {
+		return
+	}
+	// 存抽奖机会表
+	prizeOrder := map[string]interface{}{
+		"active_id":   activityInfo.ActivityId,
+		"phone":       e.Phone,
+		"position_id": e.positionId,
+		"mgo_user_id": e.mgoId,
+		"order_code":  e.OrderCode,
+		"create_time": date.NowFormat(date.Date_Full_Layout),
+		"state":       0,
+	}
+	b := util.Mysql.Insert(TableLotteryPrizeOrder, prizeOrder)
+	if b <= 0 {
+		log.Println("保存到抽奖机会表失败", prizeOrder)
+		return
+	}
+	siteMsg := config.Config.PayRaffle.SiteMsg
+	encodeId := encrypt.SE.EncodeString(fmt.Sprintf("%v", activityInfo.ActivityId))
+	// 处理活动地址
+	link := fmt.Sprintf(siteMsg.Link, encodeId)
+	iosUrl := fmt.Sprintf(siteMsg.IosUrl, encodeId)
+	androidUrl := fmt.Sprintf(siteMsg.AndroidUrl, encodeId)
+	weChatUrl := fmt.Sprintf(siteMsg.WeChatUrl, encodeId)
+	// 发送站内信
+	p := util.MessageParam{
+		UserIds:     e.mgoId,
+		PositionIds: e.positionId,
+		Title:       siteMsg.Title,
+		Content:     fmt.Sprintf(siteMsg.Content, activityInfo.Name),
+		MsgType:     siteMsg.MsgType,
+		SendMode:    2,
+		Link:        link,
+		IosUrl:      iosUrl,
+		AndroidUrl:  androidUrl,
+		WeChatUrl:   weChatUrl,
+	}
+	util.EquityActiveSend.SendStationMessages(p)
+}

+ 10 - 0
src/jfw/modules/subscribepay/src/entity/member.go

@@ -96,6 +96,16 @@ func (m *memberStruct) PayCallBack(param *CallBackParam) bool {
 						log.Println("大会员-初始化关键词组和筛选条件 err 订单信息:", orderCode)
 					}
 				}
+				// p527 支付成功后发送抽奖消息
+				if config.Config.PayRaffle.Open {
+					equityActive := EquityActive{
+						UserId:           userId,
+						OrderCode:        orderCode,
+						OrderProductType: "大会员",
+						OrderTypeCode:    "m_1",
+					}
+					equityActive.SendPayRaffleMsg()
+				}
 			}
 		}
 	}

+ 16 - 0
src/jfw/modules/subscribepay/src/entity/subscribeVip.go

@@ -295,6 +295,22 @@ func (this *vipSubscribeStruct) PayCallBack(param *CallBackParam) bool {
 				log.Println("VIP-初始化关键词组和筛选条件 err 订单信息:", orderCode)
 			}
 		}
+		// p527 支付成功后发送抽奖消息
+		if config.Config.PayRaffle.Open {
+			equityActive := EquityActive{UserId: userId,
+				Phone:            phone,
+				OrderCode:        orderCode,
+				OrderType:        vmsg.OrderType,
+				CycleUnit:        vmsg.Cycleunit,
+				OrderProductType: "VIP订阅",
+				CycleCount:       vmsg.Cyclecount,
+				AreaCount:        vmsg.NewBuyset.AreaCount,
+				SaleDep:          saleDep,
+				OrderTypeCode:    fmt.Sprintf("v_%v", vmsg.OrderType),
+			}
+			equityActive.SendPayRaffleMsg()
+		}
+
 	}
 	return flag
 }

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

@@ -12,6 +12,7 @@ require (
 	github.com/ClickHouse/clickhouse-go/v2 v2.2.0
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
 	github.com/gogf/gf/v2 v2.7.0
+	github.com/google/uuid v1.6.0
 	github.com/shopspring/decimal v1.3.1
 	github.com/tealeg/xlsx v1.0.5
 	go.mongodb.org/mongo-driver v1.14.0
@@ -56,7 +57,6 @@ require (
 	github.com/google/gnostic-models v0.6.8 // indirect
 	github.com/google/go-cmp v0.6.0 // indirect
 	github.com/google/gofuzz v1.2.0 // indirect
-	github.com/google/uuid v1.6.0 // indirect
 	github.com/gorilla/websocket v1.5.0 // indirect
 	github.com/grokify/html-strip-tags-go v0.0.1 // indirect
 	github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 // indirect

+ 2 - 1
src/jfw/modules/subscribepay/src/invoice.json

@@ -12,5 +12,6 @@
   "invoice_switch": true,
   "red_invoice_switch": false,
   "red_invoice_msg": "由于系统升级,线上换开发票功能暂时维护阶段,如需换开请直接联系在线客服!",
-  "third_party_switch": false
+  "third_party_switch": false,
+  "order_createtime": 1704038400
 }

+ 8 - 0
src/jfw/modules/subscribepay/src/service/commonAction.go

@@ -635,6 +635,14 @@ func (this *CommonAction) Createorder() {
 			//P506
 			cacheKey = fmt.Sprintf("key_phrases_v_%s", mgoId)
 		} else if product == "大会员" {
+			// p527
+			orderKey := fmt.Sprintf("order_%s", inserMap.OrderCode)
+			uInfo := map[string]interface{}{
+				"mgoId":      mgoId,
+				"positionId": positionId,
+				"phone":      phone,
+			}
+			redis.Put("other", orderKey, uInfo, 60*60*24*3)
 			//P506
 			cacheKey = fmt.Sprintf("key_phrases_m_%s", mgoId)
 		}

+ 375 - 199
src/jfw/modules/subscribepay/src/service/invoice.go

@@ -27,16 +27,20 @@ import (
 
 type Invoice struct {
 	*xweb.Action
-	addinvoice        xweb.Mapper `xweb:"/invoice/add"`       //开发票
-	showinvoice       xweb.Mapper `xweb:"/invoice/show"`      //查看发票
-	callbackinvoice   xweb.Mapper `xweb:"/invoice/callback"`  //开发票回调
-	newReplaceinvoice xweb.Mapper `xweb:"/invoice/replace"`   //换发票
-	refundinvoice     xweb.Mapper `xweb:"/invoice/refund"`    //退票
-	invoiceinfo       xweb.Mapper `xweb:"/invoice/info"`      //订单详情数据
-	available         xweb.Mapper `xweb:"/invoice/available"` //是否可用开发票
-	invoiceswitch     xweb.Mapper `xweb:"/invoice/switch"`    //发票开关
-	invoiceQuery      xweb.Mapper `xweb:"/invoice/query"`     //发票信息查询
-	invoiceSubmit     xweb.Mapper `xweb:"/invoice/submit"`    //发票信息提交
+	addinvoice        xweb.Mapper `xweb:"/invoice/add"`            //开发票
+	showinvoice       xweb.Mapper `xweb:"/invoice/show"`           //查看发票
+	newInvoiceShow    xweb.Mapper `xweb:"/invoice/newShow"`        //查看发票
+	showinvoiceList   xweb.Mapper `xweb:"/invoice/showList"`       //新查看发票 p537
+	callbackinvoice   xweb.Mapper `xweb:"/invoice/callback"`       //开发票回调
+	replaceinvoice    xweb.Mapper `xweb:"/invoice/replace"`        //换发票
+	newReplaceinvoice xweb.Mapper `xweb:"/invoice/newReplace"`     //新换发票
+	refundinvoice     xweb.Mapper `xweb:"/invoice/refund"`         //退票
+	invoiceinfo       xweb.Mapper `xweb:"/invoice/info"`           //订单详情数据
+	available         xweb.Mapper `xweb:"/invoice/available"`      //是否可用开发票
+	invoiceswitch     xweb.Mapper `xweb:"/invoice/switch"`         //发票开关
+	invoiceQuery      xweb.Mapper `xweb:"/invoice/query"`          //发票信息查询
+	invoiceSubmit     xweb.Mapper `xweb:"/invoice/submit"`         //发票信息提交
+	getCompanyCode    xweb.Mapper `xweb:"/invoice/getCompanyCode"` //开票联想税号
 }
 
 var dbname = "invoice"
@@ -181,6 +185,7 @@ func (this *Invoice) Invoiceswitch() {
 	}
 }
 
+// Addinvoice 用户端-线上开票只能选电子普票
 func (this *Invoice) Addinvoice() error {
 	defer qutil.Catch()
 	userId := qutil.ObjToString(this.GetSession("userId"))
@@ -202,18 +207,14 @@ func (this *Invoice) Addinvoice() error {
 		pos := qutil.IntAllDef(last, 0)
 		locks[pos].Lock()
 		defer locks[pos].Unlock()
-		u := util.Mysql.FindOne("dataexport_order", map[string]interface{}{"order_code": order_code, "user_id": userId, "applyBill_status": map[string]interface{}{"ne": 2}}, "order_money,product_type,order_channel,pay_way,pay_money,is_backstage_order,billingMode", "")
+		u := util.Mysql.FindOne("dataexport_order", map[string]interface{}{"order_code": order_code, "user_id": userId, "applyBill_status": map[string]interface{}{"ne": 2}}, "order_money,product_type,pay_way,pay_money,is_backstage_order,billingMode,signing_subject,return_status,applybill_status", "")
 		if u != nil {
 			//后端代用户下单支持开票 order_channel = xdqd04
-			if qutil.IntAll((*u)["billingMode"]) == 1 && (qutil.IntAll((*u)["is_backstage_order"]) != 1 || qutil.InterfaceToStr((*u)["order_channel"]) == "xdqd04") {
+			if qutil.IntAll((*u)["billingMode"]) == 1 && (qutil.IntAll((*u)["is_backstage_order"]) != 1 || (qutil.IntAll((*u)["is_backstage_order"]) == 1 && qutil.ObjToString((*u)["signing_subject"]) == "h01" && qutil.IntAll((*u)["return_status"]) == 1 && qutil.IntAll((*u)["applybill_status"]) == 0)) {
 				var prices float64
 				//公对公转账 账单金额可以修改 开发票应取实付金额 pay_money
 				//微信支付宝支付 pay_money为订单金额减去微信or支付包红包
-				if qutil.ObjToString((*u)["pay_way"]) == "transferAccounts" {
-					prices = qutil.Float64All((*u)["pay_money"]) / float64(100)
-				} else {
-					prices = qutil.Float64All((*u)["order_money"]) / float64(100)
-				}
+				prices = qutil.Float64All((*u)["pay_money"]) / float64(100)
 				price = strconv.FormatFloat(prices, 'f', -1, 64)
 				product_name = (*u)["product_type"].(string)
 				applyBill_status = 1
@@ -449,24 +450,21 @@ func (this *Invoice) ShowinvoiceList() {
 		"ris": config.InvoiceConfig.Red_invoice_switch,
 		"rim": config.InvoiceConfig.Red_invoice_msg,
 	}
-	invoices := util.Mysql.SelectBySql(fmt.Sprintf(`SELECT * FROM invoice WHERE order_code = '%s'`, order_code))
-	if invoices != nil {
+	invoices := ShowList(order_code)
+	if invoices != nil && len(invoices) > 0 {
 		isIos := util.IsMobileIOS(this.Request.UserAgent())
 		var invoiceData []map[string]interface{}
-		for _, data := range *invoices {
-			delete(data, "user_id")
-			var changed bool
-			if data["only_Identifying"] != nil {
-				//查询是否换票
-				changed = util.Mysql.CountBySql(`SELECT count(*) FROM invoice   WHERE order_code = '?' and invoice_status in (0,1) and only_Identifying = ?`, order_code, data["only_Identifying"]) > 1
+		for _, data := range invoices {
+			//是否换过票
+			isChanged := qutil.IntAll(data["isChanged"]) > 1
+			if isChanged && data["invoice_changed"] == 0 { //换过票的 只展示换票后的数据
+				continue
 			}
-			//if changed && data["invoice_status"] == 0 { //此纪录为换票中的发票
-			//	continue
-			//}
-			data["changed"] = changed
-			data["status"] = "processing"
+			delete(data, "user_id")
+			isJyInvoice := !strings.Contains(qutil.InterfaceToStr(data["url"]), "/jyInvoice/") //非数电票
+			isJyEntity := data["invoicing_entity"] != nil && qutil.InterfaceToStr(data["invoicing_entity"]) != config.Config.SigningSubject
+			data["changed"] = qutil.If(isJyInvoice || isChanged || isJyEntity, true, false)
 			if url := qutil.InterfaceToStr(data["url"]); url != "" {
-				data["status"] = "success"
 				//ios 移动端
 				if isIos {
 					//国家税务局-增值税电子发票公共服务平台
@@ -475,9 +473,18 @@ func (this *Invoice) ShowinvoiceList() {
 					}
 				}
 			}
+			var isReopen bool
+			if data["invoice_status"] == -1 {
+				isReopen = util.Mysql.Count("invoice_fail_record", map[string]interface{}{
+					"only_Identifying": data["only_Identifying"],
+					"order_code":       order_code,
+				})+1 >= config.Config.SubmitNum
+			}
+			data["isReopen"] = isReopen
 			invoiceData = append(invoiceData, data)
 		}
 		this.ServeJson(map[string]interface{}{
+			"status":        "success",
 			"invoiceData":   invoiceData,
 			"redSwitchInfo": redSwitchInfo,
 		})
@@ -490,12 +497,39 @@ func (this *Invoice) ShowinvoiceList() {
 		}
 
 		this.ServeJson(map[string]interface{}{
+			"status":        "fail",
 			"orderData":     data,
 			"redSwitchInfo": redSwitchInfo,
 		})
 	}
 }
 
+func ShowList(order_code string) []map[string]interface{} {
+	data := util.Mysql.SelectBySql(fmt.Sprintf(`SELECT *,(
+  SELECT count(1) as count FROM invoice b WHERE b.order_code = a.order_code and  b.only_Identifying is not null and b.only_Identifying = a.only_Identifying
+) as isChanged FROM invoice a WHERE order_code = '%s' and invoice_status != -2 and invoice_variety is not null and invoice_variety not  LIKE '%s' ORDER BY create_time DESC`, order_code, "%纸质%"))
+	if data == nil {
+		return nil
+	}
+	return *data
+}
+
+func (this *Invoice) NewInvoiceShow() {
+	stype := this.GetString("stype")
+	code := this.GetString("code")
+	data := make(map[string]interface{})
+	switch stype {
+	case "1": //订单回显金额
+		data["pay_money"] = ResidueMoney(code)
+	case "2": //发票信息回显
+		invoice := util.Mysql.FindOne("invoice", map[string]interface{}{"id": code}, "id,order_code,invoice_money,invoice_type,invoice_content,invoice_variety,company_name,phone,mail,taxpayer_identnum,invoice_money,invoice_order_money,company_address,bank_name,recipient,delivery_address,bank_account,company_phone", "")
+		data["invoice"] = invoice
+	}
+	this.ServeJson(map[string]interface{}{
+		"data": data,
+	})
+}
+
 // 开发票回调
 func (this *Invoice) Callbackinvoice() {
 	isRed, _ := this.GetBool("isRed")
@@ -1070,16 +1104,17 @@ func (this *Invoice) NewReplaceinvoice() {
 		return
 	}
 	invoice_type := this.GetString("invoice_type")
-	phone := this.GetString("phone_num")
-	e_mail := this.GetString("email")
-	company_name := this.GetString("company")
-	id_num := strings.ToUpper(this.GetString("id_num")) //纳税人识别号
+	phone := this.GetString("phone")
+	e_mail := this.GetString("mail")
+	company_name := this.GetString("company_name")
+	id_num := strings.ToUpper(this.GetString("taxpayer_identnum")) //纳税人识别号
 	invoice_status := 0
-	userId := qutil.ObjToString(this.GetSession("userId"))
+	//userId := qutil.ObjToString(this.GetSession("userId"))  支持扫描换票
 	//order_code := this.GetString("order_code")
 	sid := this.GetString("sid")
-	oRes := util.Mysql.FindOne(dbname, map[string]interface{}{"id": sid, "user_id": userId, "invoie_changed": 0}, "", "") //仅线上开发票可换票
-	if oRes != nil && len(*oRes) > 0 {
+	oRes := util.Mysql.FindOne(dbname, map[string]interface{}{"id": sid, "invoie_changed": 0}, "", "") //仅线上开发票可换票
+	if oRes != nil && len(*oRes) > 0 &&
+		((*oRes)["invoicing_entity"] == nil || qutil.InterfaceToStr((*oRes)["invoicing_entity"]) == config.Config.SigningSubject) {
 		var (
 			qSql    string
 			errCode []string
@@ -1088,39 +1123,51 @@ func (this *Invoice) NewReplaceinvoice() {
 		)
 		if qutil.IntAll((*oRes)["invoice_status"]) == -2 {
 			this.ServeJson(map[string]interface{}{
-				"error_code": -1,
-				"error_msg":  "发票状态错误",
+				"invoice_status": -2,
 			})
 			return
 		}
-		if invoice_order_code := qutil.InterfaceToStr((*oRes)["invoice_order_code"]); invoice_order_code == "" ||
-			len(strings.Split(invoice_order_code, ",")) <= 1 {
-			resArr = append(resArr, *oRes)
-		} else { //多订单联合开票
-			qSql = fmt.Sprintf(`SELECT * FROM invoice WHERE invoice_order_code = '%s'`, qutil.InterfaceToStr((*oRes)["invoice_order_code"]))
+		if invoice_order_code := qutil.InterfaceToStr((*oRes)["invoice_order_code"]); len(strings.Split(invoice_order_code, ",")) > 1 {
+			qSql = fmt.Sprintf(`SELECT * FROM invoice WHERE invoice_order_code = '%s' `, qutil.InterfaceToStr((*oRes)["invoice_order_code"]))
 			res1 := util.Mysql.SelectBySql(qSql)
 			if res1 != nil && len(*res1) > 0 {
 				resArr = *res1
 			}
+		} else { //多订单联合开票
+			resArr = append(resArr, *oRes)
 		}
 		var isMail bool
+		tm := time.Now()
 		for _, res := range resArr {
-			newUuid := uuid.New()
 			if res["only_Identifying"] == nil { //无唯一id 允许换票一次 生成唯一id
+				newUuid := uuid.New()
 				res["only_Identifying"] = newUuid
 				util.Mysql.Update(dbname, map[string]interface{}{"id": res["id"]}, map[string]interface{}{"only_Identifying": newUuid})
+			} else if util.Mysql.Count(dbname, map[string]interface{}{
+				"order_code":       res["order_code"],
+				"user_id":          res["user_id"],
+				"only_Identifying": res["only_Identifying"],
+			}) > 1 {
+				continue
 			}
+			res["phone"] = this.GetString("phone")
+			res["mail"] = this.GetString("mail")
+			res["invoice_content"] = this.GetString("invoice_content")
+			res["company_phone"] = this.GetString("company_phone")
+			res["taxpayer_identnum"] = this.GetString("taxpayer_identnum")
+			res["operable_time"] = FormatDate(&tm, Date_Full_Layout)
+			res["remark"] = this.GetString("remark")
+			res["invoice_variety"] = this.GetString("invoice_variety")
+			res["bank_account"] = this.GetString("bank_account")
+			res["company_address"] = this.GetString("company_address")
+			res["bank_name"] = this.GetString("bank_name")
+			res["recipient"] = this.GetString("recipient")
+			res["delivery_address"] = this.GetString("delivery_address")
+			res["product_type"] = this.GetString("bank_name")
 			data := res
 			delete(data, "id")
 			switch IsEdit(res, phone, e_mail, id_num, company_name, invoice_type) {
 			case true:
-				if util.Mysql.Count(dbname, map[string]interface{}{
-					"order_code":       res["order_code"],
-					"user_id":          userId,
-					"only_Identifying": res["only_Identifying"],
-				}) > 1 {
-					continue
-				}
 				var html string
 				if invoice_type == "个人" {
 					emailHtml := emailHtml_gr
@@ -1133,9 +1180,8 @@ func (this *Invoice) NewReplaceinvoice() {
 				}
 				data["invoice_changed"] = 1
 				data["invoice_status"] = 1
-				data["billing_time"] = time.Now().Unix()
-				data["create_time"] = time.Now().Unix()
-				data["user_id"] = userId
+				data["billing_time"] = tm.Unix()
+				data["create_time"] = tm.Unix()
 				order_id := util.Mysql.Insert(dbname, data)
 				if order_id == -1 {
 					errCode = append(errCode, fmt.Sprintf("%s_%s", res["order_code"], res["invoice_order_code"]))
@@ -1147,7 +1193,7 @@ func (this *Invoice) NewReplaceinvoice() {
 			case false:
 				if util.Mysql.Count(dbname, map[string]interface{}{
 					"order_code":       res["order_code"],
-					"user_id":          userId,
+					"user_id":          res["user_id"],
 					"only_Identifying": res["only_Identifying"],
 				}) > 1 {
 					continue
@@ -1163,8 +1209,7 @@ func (this *Invoice) NewReplaceinvoice() {
 					dataexport_data["applybill_company"] = company_name
 				}
 				dataexport_data["user_mail"] = e_mail
-				util.Mysql.Update("dataexport_order", map[string]interface{}{"order_code": res["order_code"], "user_id": userId}, dataexport_data)
-
+				util.Mysql.Update("dataexport_order", map[string]interface{}{"order_code": res["order_code"]}, dataexport_data)
 				data["mail"] = e_mail
 				data["phone"] = phone
 				data["invoice_type"] = invoice_type
@@ -1172,7 +1217,6 @@ func (this *Invoice) NewReplaceinvoice() {
 				data["taxpayer_identnum"] = id_num
 				data["invoice_changed"] = 1
 				data["create_time"] = time.Now().Unix()
-				data["user_id"] = userId
 				data["invoice_status"] = invoice_status
 				order_id := util.Mysql.Insert(dbname, data)
 				if order_id == -1 {
@@ -1190,8 +1234,7 @@ func (this *Invoice) NewReplaceinvoice() {
 	} else {
 		if qutil.IntAll((*oRes)["invoice_status"]) < 0 {
 			this.ServeJson(map[string]interface{}{
-				"error_code": -1,
-				"error_msg":  "发票状态错误",
+				"invoice_status": invoice_status,
 			})
 			return
 		}
@@ -1323,6 +1366,19 @@ func LastInvoiceSource(orderCode string) int64 {
 	}
 	return 0
 }
+
+// 查询订单最后开票状态
+func QmxInvoice(res map[string]interface{}) bool {
+	if res["is_backstage_order"] == 1 && res["order_channel"] != "xdqd04" {
+		if res["return_status"] == 1 && util.Mysql.Count("invoice", map[string]interface{}{
+			"order_code": res["order_code"],
+		}) == 0 && res["signing_subject"] == config.Config.SigningSubject {
+			return true
+		}
+	}
+	return false
+}
+
 func (this *Invoice) Available() {
 	u := util.Mysql.FindOne("dataexport_order", map[string]interface{}{"order_code": this.GetString("order_code")}, "pay_time", "")
 	status := 0
@@ -1359,22 +1415,173 @@ func delReplaceInvoice(query map[string]interface{}) bool {
 	return util.Mysql.Delete(dbname, query)
 }
 
-// 发票信息提交
+func InvoiceAmount(orderCode string) (invoicedMoney int64) {
+	invoicedInfo := util.Mysql.SelectBySql(fmt.Sprintf("SELECT invoice_order_money,only_Identifying FROM invoice WHERE order_code = '%s' and invoice_status>=0", orderCode))
+	if invoicedInfo != nil && len(*invoicedInfo) > 0 {
+		onlyMap := make(map[string]int64)
+		for _, m := range *invoicedInfo {
+			if m["only_Identifying"] != nil { //过滤换票过程中的数据
+				onlyMap[qutil.InterfaceToStr(m["only_Identifying"])] = qutil.Int64All(m["invoice_order_money"])
+			} else {
+				invoicedMoney += qutil.Int64All(m["invoice_order_money"])
+			}
+		}
+		if len(onlyMap) > 0 {
+			for _, i := range onlyMap {
+				invoicedMoney += i
+			}
+		}
+	}
+	return
+}
+
+// InvoiceSubmit 发票信息提交
 func (this *Invoice) InvoiceSubmit() {
+	if !R.CheckReqParam(this.ResponseWriter, this.Request, "invoice_variety", "invoiceContent", "invoice_type", "phone", "mail") {
+		this.ServeJson(NewResult("", errors.New("缺少参数")))
+		return
+	}
+	if this.GetString("invoice_type") == "单位" && !R.CheckReqParam(this.ResponseWriter, this.Request, "company_name", "taxpayer_identnum") {
+		this.ServeJson(NewResult("", errors.New("缺少参数")))
+		return
+	}
 	now := time.Now()
-	onlyIdentifying := encrypt.SE.DecodeString(this.GetString("onlyIdentifying"))
-	invoiceMoney := encrypt.SE.DecodeString(this.GetString("invoiceMoney"))
-	operator := encrypt.SE.Decode4HexByCheck(this.GetString("operator"))
-	if onlyIdentifying == "" || invoiceMoney == "" {
-		this.ServeJson(NewResult("", errors.New("传入参数不正确")))
+	again, _ := this.GetInteger("again")                       //是否是失败重新开票 0 首次提交  1 再此提交
+	oldOnlyIdentifying := this.GetString("oldOnlyIdentifying") //最后一次失败的发票信息唯一标识
+	data := map[string]interface{}{
+		//"order_code":          orderCode,
+		"company_name":    this.GetString("company_name"),
+		"phone":           this.GetString("phone"),
+		"mail":            this.GetString("mail"),
+		"invoice_type":    this.GetString("invoice_type"),
+		"invoice_content": this.GetString("invoiceContent"),
+		"invoice_status":  0,
+		"invoice_changed": 0,
+		//"invoice_order_code":  orderCode,
+		"company_phone":     this.GetString("company_phone"),
+		"taxpayer_identnum": this.GetString("taxpayer_identnum"),
+		"create_time":       time.Now().Unix(),
+		//"user_id":           userId,
+		"operable_time": FormatDate(&now, Date_Full_Layout),
+		//"invoice_money":       payMoney,
+		//"invoice_order_money": payMoney,
+		"invoicing_entity": "北京剑鱼信息技术有限公司",
+		"remark":           this.GetString("remark"),
+		"source":           0,
+		"invoice_variety":  this.GetString("invoice_variety"),
+		"bank_account":     this.GetString("bank_account"),
+		//"only_Identifying":    onlyIdentifying,
+		"company_address":  this.GetString("company_address"),
+		"bank_name":        this.GetString("bank_name"),
+		"recipient":        this.GetString("recipient"),
+		"delivery_address": this.GetString("delivery_address"),
+		//"product_type":        qutil.ObjToString((*orderInfo)["product_type"]),
+	}
+	if again == 1 {
+		err := OpenInvoiceAgain(oldOnlyIdentifying, data)
+		if err != nil {
+			this.ServeJson(NewResult("", err))
+			return
+		}
+		this.ServeJson(NewResult("保存信息成功", nil))
 		return
 	}
-	data := util.Mysql.FindOne("invoice", map[string]interface{}{
+	source, _ := this.GetInteger("source")
+	switch source {
+	case 0: //用户端开票
+		userId := qutil.ObjToString(this.GetSession("userId"))
+		if userId == "" {
+			this.ServeJson(NewResult("", errors.New("userId为空")))
+			return
+		}
+		orderCode := this.GetString("order_code")
+		err := JyOpenInvoice(orderCode, userId, data)
+		if err != nil {
+			this.ServeJson(NewResult("", err))
+			return
+		}
+	case 1: //管理后台扫码开票
+		onlyIdentifying := encrypt.SE.DecodeString(this.GetString("onlyIdentifying"))
+		invoiceMoney := encrypt.SE.DecodeString(this.GetString("invoiceMoney"))
+		operator := encrypt.SE.Decode4HexByCheck(this.GetString("operator"))
+		if onlyIdentifying == "" || invoiceMoney == "" {
+			this.ServeJson(NewResult("", errors.New("传入参数不正确")))
+			return
+		}
+		err := AdminOpenInvoice(onlyIdentifying, invoiceMoney, operator, data)
+		if err != nil {
+			this.ServeJson(NewResult("", err))
+			return
+		}
+	}
+	this.ServeJson(NewResult("保存信息成功", nil))
+}
+
+func OpenInvoiceAgain(oldOnlyIdentifying string, data map[string]interface{}) error {
+	if oldOnlyIdentifying == "" {
+		return errors.New("缺少关键参数")
+	}
+	ok := InvoiceFailRecord(oldOnlyIdentifying)
+	if !ok {
+		return errors.New("插入失败记录出错")
+	}
+	if util.Mysql.Count("invoice_fail_record", map[string]interface{}{"only_Identifying": oldOnlyIdentifying}) >= int64(config.Config.SubmitNum) {
+		return errors.New("提交次数已达上限")
+	}
+	if !util.Mysql.Update("invoice", map[string]interface{}{"only_Identifying": oldOnlyIdentifying}, data) {
+		return errors.New("再次开票更新发票信息出错")
+	}
+	return nil
+}
+
+func JyOpenInvoice(orderCode, userId string, data map[string]interface{}) error {
+	onlyIdentifying := fmt.Sprintf("%s%s%s", "aa", time.Now().Format("150405"), qutil.GetRandom(4))
+	orderInfo := util.Mysql.FindOne("dataexport_order", map[string]interface{}{"order_code": orderCode}, "product_type,user_mail,pay_money,create_time,signing_subject", "")
+	if orderInfo == nil {
+		return errors.New("订单不存在")
+	}
+	createTime, _ := time.ParseInLocation("2006-01-02 15:04:05", qutil.ObjToString((*orderInfo)["create_time"]), time.Local)
+	if createTime.Unix() < config.InvoiceConfig.Order_createtime {
+		return errors.New("2024年之前的订单不在开票")
+	}
+	if qutil.ObjToString((*orderInfo)["signing_subject"]) == "h02" {
+		return errors.New("签约主体为拓普")
+	}
+	invoicedMoney := InvoiceAmount(orderCode) //已开票金额
+	invoiceMoney := qutil.Int64All((*orderInfo)["pay_money"]) - invoicedMoney
+	data["order_code"] = orderCode
+	data["invoice_order_code"] = orderCode
+	data["only_Identifying"] = onlyIdentifying
+	data["invoice_money"] = invoiceMoney
+	data["invoice_order_money"] = invoiceMoney
+	data["product_type"] = qutil.ObjToString((*orderInfo)["product_type"])
+	data["user_id"] = userId
+	if !util.Mysql.ExecTx("用户端开发票", func(tx *sql.Tx) bool {
+		if util.Mysql.InsertByTx(tx, "invoice", data) <= 0 {
+			log.Println("插入invoice出错", orderCode)
+			return false
+		}
+		if !util.Mysql.UpdateByTx(tx, "dataexport_order", map[string]interface{}{
+			"order_code": orderCode,
+		}, map[string]interface{}{
+			"applybill_status": 1,
+		}) {
+			log.Println("更新dataexport_order出错", orderCode)
+			return false
+		}
+		return true
+	}) {
+		return errors.New("用户端开票插入数据出错")
+	}
+	return nil
+}
+
+func AdminOpenInvoice(onlyIdentifying, invoiceMoney, operator string, data map[string]interface{}) error {
+	oldData := util.Mysql.FindOne("invoice", map[string]interface{}{
 		"only_Identifying": onlyIdentifying,
 	}, "id", "")
-	if data != nil {
-		this.ServeJson(NewResult("", errors.New("该订单发票信息已经提交过申请")))
-		return
+	if oldData != nil {
+		return errors.New("该订单发票信息已经提交过申请")
 	}
 	orderArr := []string{}
 	mailOrderArr := []string{}
@@ -1393,49 +1600,31 @@ func (this *Invoice) InvoiceSubmit() {
 	//提交时订单金额再做一次校验
 	for orderCode, money := range orderMap {
 		if ResidueMoney(orderCode) < qutil.Int64All(money) {
-			this.ServeJson(NewResult("", errors.New("该订单发票信息已经提交过申请")))
-			return
+			return errors.New("该订单发票信息已经提交过申请")
 		}
 	}
 	if !util.Mysql.ExecTx("发票信息保存", func(tx *sql.Tx) bool {
 		for orderCode, money := range orderMap {
-			userId := GetUserId(orderCode)
-			orderInfo := util.Mysql.FindOne("dataexport_order", map[string]interface{}{"order_code": orderCode}, "product_type,user_mail", "")
+			orderInfo := util.Mysql.FindOne("dataexport_order", map[string]interface{}{"order_code": orderCode}, "product_type,user_mail,user_id,create_time", "")
 			productType := ""
 			if orderInfo != nil {
 				productType = qutil.InterfaceToStr((*orderInfo)["product_type"])
 			}
-			data := map[string]interface{}{
-				"order_code":          orderCode,
-				"company_name":        this.GetString("company_name"),
-				"phone":               this.GetString("phone"),
-				"mail":                this.GetString("mail"),
-				"invoice_type":        this.GetString("invoice_type"),
-				"invoice_content":     "信息技术服务-技术服务费",
-				"invoice_status":      0,
-				"invoice_changed":     0,
-				"invoice_order_code":  strings.Join(orderArr, ","),
-				"company_phone":       this.GetString("company_phone"),
-				"taxpayer_identnum":   this.GetString("taxpayer_identnum"),
-				"create_time":         time.Now().Unix(),
-				"user_id":             userId,
-				"operator":            operator,
-				"operable_time":       FormatDate(&now, Date_Full_Layout),
-				"invoice_money":       Allmoney,
-				"invoice_order_money": money,
-				"invoicing_entity":    "北京剑鱼信息技术有限公司",
-				"remark":              this.GetString("remark"),
-				"source":              1,
-				"invoice_variety":     this.GetString("invoice_variety"),
-				"bank_account":        this.GetString("bank_account"),
-				"only_Identifying":    onlyIdentifying,
-				"company_address":     this.GetString("company_address"),
-				"bank_name":           this.GetString("bank_name"),
-				"recipient":           this.GetString("recipient"),
-				"delivery_address":    this.GetString("delivery_address"),
-				"product_type":        productType,
+			createTime, _ := time.ParseInLocation("2006-01-02 15:04:05", qutil.ObjToString((*orderInfo)["create_time"]), time.Local)
+			if createTime.Unix() < config.InvoiceConfig.Order_createtime {
+				log.Println("2024年之前的订单不在开票", orderCode)
+				return false
 			}
+			data["order_code"] = orderCode
+			data["invoice_order_code"] = strings.Join(orderArr, ",")
+			data["only_Identifying"] = onlyIdentifying
+			data["invoice_money"] = Allmoney
+			data["invoice_order_money"] = money
+			data["product_type"] = productType
+			data["user_id"] = qutil.ObjToString((*orderInfo)["user_id"])
+			data["operator"] = operator
 			if util.Mysql.Insert("invoice", data) <= 0 {
+				log.Println("扫码开票插入invoice表出错", orderCode)
 				return false
 			}
 			//订单发票状态改成已申请
@@ -1444,85 +1633,47 @@ func (this *Invoice) InvoiceSubmit() {
 			}, map[string]interface{}{
 				"applybill_status": 1,
 			}) {
+				log.Println("扫码开票更新dataexport_order表出错", orderCode)
 				return false
 			}
 		}
-		if this.GetString("invoice_variety") == "电子普通发票" && Allmoney < 1000000 {
-			//走航天金税开票
-			var orders = []map[string]interface{}{}
-			var items = []map[string]interface{}{}
-			prices := qutil.Float64All(Allmoney) / float64(100)
-			price := strconv.FormatFloat(prices, 'f', -1, 64)
-			item := map[string]interface{}{
-				"name":        "技术服务费",
-				"code":        config.InvoiceConfig.Code,
-				"yhzcbs":      config.InvoiceConfig.Tax_policy,
-				"lineType":    config.InvoiceConfig.Invoice_nature,
-				"taxRate":     config.InvoiceConfig.Tax_rate,
-				"taxPrice":    price,
-				"totalAmount": price,
-				"quantity":    "1",
-			}
-			items = append(items, item)
-			order := map[string]interface{}{
-				"billNo": onlyIdentifying,
-				"items":  items,
-			}
-			orders = append(orders, order)
-			body := map[string]interface{}{
-				"Swno":      onlyIdentifying,
-				"custType":  "03",
-				"orders":    orders,
-				"custTaxNo": this.GetString("taxpayer_identnum"),
-				"changed":   "0",
-				"phone":     this.GetString("phone"),
-			}
-			if this.GetString("invoice_type") == "单位" {
-				body["custName"] = this.GetString("company_name")
-			} else {
-				body["custName"] = "个人"
-			}
-			if config.InvoiceConfig.Third_party_switch {
-				go htjs(body, orderArr, this.GetString("invoice_type"), this.GetString("company_name"), this.GetString("taxpayer_identnum"), this.GetString("mail"), this.GetString("phone"))
-			}
-		} else {
-			//给王航发信息
-			recipientStr := ""
-			deliveryAddressStr := ""
-			if this.GetString("invoice_variety") == "纸质普通发票" || this.GetString("invoice_variety") == "纸质专用发票" {
-				recipientStr = fmt.Sprintf("<p class=\"item\">\n      <span class=\"label\">收件人:</span>\n      <span class=\"value\">%s</span>\n    </p>", this.GetString("recipient"))
-				deliveryAddressStr = fmt.Sprintf("<p class=\"item\">\n      <span class=\"label\">收件地址:</span>\n      <span class=\"value\">%s</span>\n    </p>", this.GetString("delivery_address"))
-			}
-			prices := qutil.Float64All(Allmoney) / float64(100)
-			price := strconv.FormatFloat(prices, 'f', -1, 64)
-			html := fmt.Sprintf(email_format_new,
-				FormatDate(&now, Date_Full_Layout),
-				strings.Join(orderArr, ","),
-				strings.Join(mailOrderArr, ","),
-				price,
-				this.GetString("invoice_variety"),
-				qutil.InterfaceToStr(qutil.If(this.GetString("invoice_type") == "", "--", this.GetString("invoice_type"))),
-				qutil.InterfaceToStr(qutil.If(this.GetString("company_name") == "", "--", this.GetString("company_name"))),
-				qutil.InterfaceToStr(qutil.If(this.GetString("taxpayer_identnum") == "", "--", this.GetString("taxpayer_identnum"))),
-				qutil.InterfaceToStr(qutil.If(this.GetString("company_address") == "", "--", this.GetString("company_address"))),
-				qutil.InterfaceToStr(qutil.If(this.GetString("company_phone") == "", "--", this.GetString("company_phone"))),
-				qutil.InterfaceToStr(qutil.If(this.GetString("bank_name") == "", "--", this.GetString("bank_name"))),
-				qutil.InterfaceToStr(qutil.If(this.GetString("bank_account") == "", "--", this.GetString("bank_account"))),
-				qutil.InterfaceToStr(qutil.If(this.GetString("remark") == "", "--", this.GetString("remark"))),
-				recipientStr,
-				this.GetString("phone"),
-				deliveryAddressStr,
-			)
-			for _, v := range strings.Split(config.Config.FinanceMail, ",") {
-				go InvoiceSendMail(v, html, fmt.Sprintf("客户申请开具%s", this.GetString("invoice_variety")))
+		return true
+	}) {
+		return errors.New("发票信息保存失败")
+	}
+	return nil
+}
+
+func InvoiceFailRecord(oldOnlyIdentifying string) bool {
+	//开票失败再次提交
+	invoiceData := util.Mysql.Find("invoice", map[string]interface{}{"only_Identifying": oldOnlyIdentifying, "invoice_status": -1}, "", "", -1, -1)
+	if invoiceData == nil && len(*invoiceData) <= 0 {
+		log.Println("未找到开票记录", oldOnlyIdentifying)
+		return false
+	}
+	//插入开票失败记录表
+	ok := util.Mysql.ExecTx("插入开票失败记录表", func(tx *sql.Tx) bool {
+		for _, val := range *invoiceData {
+			delete(val, "id")
+			if util.Mysql.InsertByTx(tx, "invoice_fail_record", val) <= 0 {
+				return false
 			}
 		}
 		return true
-	}) {
-		this.ServeJson(NewResult("", errors.New("发票信息保存失败")))
-		return
+	})
+	return ok
+}
+
+func (this *Invoice) GetCompanyCode() {
+	code := ""
+	companyInfo := util.Mysql.FindOne("entniche_info", map[string]interface{}{"name": this.GetString("companyName")}, "code", "")
+	if companyInfo != nil && len(*companyInfo) > 0 {
+		code = qutil.ObjToString((*companyInfo)["code"])
 	}
-	this.ServeJson(NewResult("保存信息成功", nil))
+	this.ServeJson(NewResult(map[string]interface{}{
+		"code": code,
+	}, nil))
+	return
 }
 
 // 发票信息查询
@@ -1543,7 +1694,7 @@ func (this *Invoice) InvoiceQuery() {
 	}
 	invoiceOne := util.Mysql.FindOne("invoice", map[string]interface{}{
 		"only_Identifying": onlyIdentifying,
-	}, " bank_account, company_phone,company_name, phone, mail,company_phone, invoice_type, invoice_content, url, invoice_status, invoice_serialnum, taxpayer_identnum,    operator, operable_time, invoicing_entity, remark, invoice_variety, logistics_code, company_address, bank_name, recipient, delivery_address", "")
+	}, "id,invoice_changed,order_code, bank_account, company_phone,company_name, phone, mail,company_phone, invoice_type, invoice_content, url, invoice_status, invoice_serialnum, taxpayer_identnum,    operator, operable_time, invoicing_entity, remark, invoice_variety, logistics_code, company_address, bank_name, recipient, delivery_address", " create_time   DESC")
 	companyName := ""
 	if invoiceOne == nil {
 		//查询公司名称
@@ -1552,6 +1703,22 @@ func (this *Invoice) InvoiceQuery() {
 		if orderArr != nil && len(*orderArr) > 0 {
 			companyName = qutil.ObjToString((*orderArr)[0]["company_name"])
 		}
+	} else {
+		switch qutil.IntAll((*invoiceOne)["invoice_status"]) {
+		case 1:
+			//是否换票
+			isJyInvoice := !strings.Contains(qutil.InterfaceToStr((*invoiceOne)["url"]), "/jyInvoice/") //非数电票
+			isChanged := util.Mysql.Count("invoice", map[string]interface{}{
+				"only_Identifying": onlyIdentifying,
+				"order_code":       (*invoiceOne)["order_code"],
+			}) > 1
+			(*invoiceOne)["changed"] = qutil.If(isJyInvoice || isChanged, true, false)
+		case -1: //失败支持重新提交否
+			(*invoiceOne)["isReopen"] = util.Mysql.Count("invoice_fail_record", map[string]interface{}{
+				"only_Identifying": (*invoiceOne)["only_Identifying"],
+				"order_code":       (*invoiceOne)["order_code"],
+			})+1 >= config.Config.SubmitNum
+		}
 	}
 	this.ServeJson(NewResult(map[string]interface{}{
 		"orderCodes":   strings.Join(orderArr, ","),
@@ -1657,6 +1824,16 @@ func sendMail(invoiceType, orderCode, companyName, taxpayerIdentnum, mail, phone
 	}
 }
 
+// 剩余金额
+func InvoicePrice(orderData map[string]interface{}) int64 {
+	residueMoney := int64(0)
+	if qutil.Int64All(orderData["applybill_status"]) == 2 {
+		return residueMoney
+	}
+
+	return qutil.Int64All(orderData["pay_money"]) - InvoiceAmount(qutil.InterfaceToStr(orderData["order_code"]))
+}
+
 // 订单剩余金额查询
 func ResidueMoney(orderCode string) int64 {
 	residueMoney := int64(0)
@@ -1665,26 +1842,25 @@ func ResidueMoney(orderCode string) int64 {
 	if len(*orderData) == 0 || orderData == nil {
 		return residueMoney
 	}
-	if qutil.Int64All((*orderData)[0]["applybill_status"]) == 2 {
-		return residueMoney
-	}
+	return InvoicePrice((*orderData)[0])
+
 	//发票信息查询
-	invoiceData := util.Mysql.SelectBySql("select invoice_status,sum(invoice_order_money) as  money  from  invoice where  order_code=?  and  invoice_status>=0  GROUP BY  invoice_status", orderCode)
-	if len(*orderData) == 0 || orderData == nil {
-	} else {
-		//开过几次票
-		payMoney := qutil.Int64All((*orderData)[0]["pay_money"])
-		allMoney := int64(0)
-		for _, invoice := range *invoiceData {
-			invoice_status := qutil.Int64All(invoice["invoice_status"])
-			money := qutil.Int64All(invoice["money"])
-			if invoice_status == 0 {
-				return residueMoney
-			} else {
-				allMoney += money
-			}
-		}
-		residueMoney = payMoney - allMoney
-	}
-	return residueMoney
+	//invoiceData := util.Mysql.SelectBySql("select invoice_status,sum(invoice_order_money) as  money  from  invoice where  order_code=?  and  invoice_status>=0  GROUP BY  invoice_status", orderCode)
+	//if len(*orderData) == 0 || orderData == nil {
+	//} else {
+	//    //开过几次票
+	//    payMoney := qutil.Int64All((*orderData)[0]["pay_money"])
+	//    allMoney := int64(0)
+	//    for _, invoice := range *invoiceData {
+	//        invoice_status := qutil.Int64All(invoice["invoice_status"])
+	//        money := qutil.Int64All(invoice["money"])
+	//        if invoice_status == 0 {
+	//            return residueMoney
+	//        } else {
+	//            allMoney += money
+	//        }
+	//    }
+	//    residueMoney = payMoney - allMoney
+	//}
+	//return residueMoney
 }

+ 63 - 39
src/jfw/modules/subscribepay/src/service/network.go

@@ -8,11 +8,11 @@ import (
 	"log"
 	"net/http"
 	"strings"
+	"sync"
 
 	qutil "app.yhyue.com/moapp/jybase/common"
-	"app.yhyue.com/moapp/jybase/encrypt"
-	"app.yhyue.com/moapp/jybase/es"
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
+	"app.yhyue.com/moapp/jybase/redis"
 	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/dataexport"
 )
 
@@ -26,46 +26,35 @@ func (n *Network) ProjectExport() {
 	if export_id == "" {
 		return
 	}
+	exportIds := redis.GetStr("newother", fmt.Sprintf("network_export_%s", export_id))
 	args := []interface{}{}
-	for _, v := range strings.Split(encrypt.SE.DecodeStringByCheck(export_id), ",") {
+	wh, bIds := []string{}, []string{}
+	pool := make(chan bool, 3)
+	wait := &sync.WaitGroup{}
+	lock := &sync.Mutex{}
+	for _, v := range strings.Split(exportIds, ",") {
 		args = append(args, v)
-	}
-	rows, err := util.ClickhouseConn.Query(context.Background(), `select project_id,business_type from information.transaction_info where project_id=?`, args...)
-	if err != nil {
-		log.Println(err)
-		return
-	}
-	bIds := []string{}
-	pIds := []string{}
-	for rows.Next() {
-		var (
-			project_id    string
-			business_type string
-		)
-		if err := rows.Scan(&project_id, &business_type); err != nil {
-			log.Println(err)
-			continue
-		}
-		if business_type == "采购意向" {
-			bIds = append(bIds, project_id)
-		} else {
-			pIds = append(pIds, project_id)
+		wh = append(wh, "?")
+		if len(args) == 200 {
+			pool <- true
+			wait.Add(1)
+			go func(wh1 []string, args1 []interface{}) {
+				defer func() {
+					<-pool
+					wait.Done()
+				}()
+				ids := n.search(wh1, args1)
+				lock.Lock()
+				bIds = append(bIds, ids...)
+				lock.Unlock()
+			}(wh, args)
+			args = []interface{}{}
+			wh = []string{}
 		}
 	}
-	rows.Close()
-	if err := rows.Err(); err != nil {
-		log.Println(err)
-	}
-	if len(pIds) > 0 {
-		datas := es.VarEs.Get("projectset", "projectset", fmt.Sprintf(`{"query":{"bool":{"filter":{"terms":{"id":["%s"]}}}},"_source":["ids"]}`, strings.Join(pIds, `","`)))
-		if datas != nil {
-			for _, v := range *datas {
-				ids, _ := v["ids"].([]interface{})
-				for _, vv := range ids {
-					bIds = append(bIds, fmt.Sprint(vv))
-				}
-			}
-		}
+	wait.Wait()
+	if len(args) > 0 {
+		bIds = append(bIds, n.search(wh, args)...)
 	}
 	if len(bIds) == 0 {
 		return
@@ -75,11 +64,15 @@ func (n *Network) ProjectExport() {
 	}
 	bidList, err := dataexport.GetDataExportSearchResult(util.Mgo_bidding, config.Config.Mongobidding.DbName, config.Config.Elasticsearch, scd, "2", -2)
 	if err != nil {
+		log.Println("人脉通项目导出", export_id, err)
 		http.Error(n.ResponseWriter, err.Error(), http.StatusInternalServerError)
 		return
-	} else if bidList == nil {
+	} else if bidList == nil || len(*bidList) == 0 {
+		log.Println("人脉通项目导出", export_id, "未找到项目的标讯信息")
+		http.Error(n.ResponseWriter, "未找到项目的标讯信息", http.StatusInternalServerError)
 		return
 	}
+	log.Println("人脉通项目导出", export_id, len(*bidList))
 	bidList = dataexport.FormatExportData(util.MQFWENT, bidList, config.Config.WebDomain, "2")
 	file, err := util.ExportExcelFile(bidList, true)
 	if err != nil {
@@ -95,3 +88,34 @@ func (n *Network) ProjectExport() {
 		return
 	}
 }
+
+func (n *Network) search(wh []string, args []interface{}) []string {
+	bIds := []string{}
+	rows, err := util.ClickhouseConn.Query(context.Background(), `select info_id,info_ids from information.transaction_info where project_id in (`+strings.Join(wh, ",")+`)`, args...)
+	if err != nil {
+		log.Println(err)
+		return bIds
+	}
+	for rows.Next() {
+		var (
+			info_id  string
+			info_ids []string
+		)
+		if err := rows.Scan(&info_id, &info_ids); err != nil {
+			log.Println(err)
+			continue
+		}
+		if info_ids == nil || len(info_ids) == 0 {
+			if info_id != "" {
+				bIds = append(bIds, info_id)
+			}
+		} else {
+			bIds = append(bIds, info_ids...)
+		}
+	}
+	rows.Close()
+	if err := rows.Err(); err != nil {
+		log.Println(err)
+	}
+	return bIds
+}

+ 8 - 3
src/jfw/modules/subscribepay/src/service/orderListDetails.go

@@ -133,7 +133,7 @@ func (o *OrderListDetails) DeleteOrder() error {
 
 		var haveNextPage = false
 		var res = []map[string]interface{}{}
-		if fromPage == "" || fromPage != "pc" {
+		if fromPage != "pc" {
 			// haveNextPage, res, _ = o.Datas1(queryM, pageNum, 10)
 			haveNextPage, res, _ = o.Datas(sql, pageNum, 10)
 			if len(res) > 0 {
@@ -662,8 +662,13 @@ func (o *OrderListDetails) Datas(sql string, pageNum, pagesize_max int) (haveNex
 				go FortyEightHoursCancel(qutil.ObjToString(result[i]["order_code"]), create_time_stamp, time.Now().Unix())
 			}
 			//新增最后开票
-			result[i]["source"] = LastInvoiceSource(qutil.InterfaceToStr(result[i]["order_code"]))
-
+			//result[i]["source"] = LastInvoiceSource(qutil.InterfaceToStr(result[i]["order_code"])) p537 用户可查看所有发票
+			//如果是管理后台的单子 是否满足可开票
+			result[i]["qmx_invoice"] = QmxInvoice(result[i])
+			//剩余可开票金额
+			result[i]["invoice_price"] = InvoicePrice(result[i]) > 0
+			//是否存在可查看发票
+			result[i]["invoice_show"] = len(ShowList(qutil.InterfaceToStr(result[i]["order_code"]))) > 0
 		}
 	}
 	haveNextPage = len(result) >= pagesize_max

+ 59 - 0
src/jfw/modules/subscribepay/src/test/test.http

@@ -0,0 +1,59 @@
+POST  https://jybx-webtest.jydev.jianyu360.com/jypay/callback/testPay
+Content-Type: application/x-www-form-urlencoded
+
+ordercode=261350527427
+
+###
+POST  https://jybx3-webtest.jydev.jianyu360.com/jyapi/jybx/base/checkSearchScreen
+Content-Type: application/json
+Cookie: SESSIONID=4a60ae53625b98cf77942f9f2fb220e5e3bfcccb
+type: mdkp
+
+{
+  "searchvalue": "医院",
+  "selectType": "content,title",
+  "industry": "",
+  "minprice": "",
+  "maxprice": "",
+  "publishtime": "fiveyear",
+  "subtype": "",
+  "buyerclass": "",
+  "buyertel": "",
+  "winnertel": "",
+  "notkey": "",
+  "buyer": "",
+  "winner": "",
+  "agency": "",
+  "fileExists": "0",
+  "searchGroup": 0,
+  "searchMode": 0,
+  "wordsMode": 0,
+  "additionalWords": "",
+  "regionMap": {}
+}
+
+###
+POST http://localhost:86/jypay/common/createorder
+Content-Type: application/json
+Cookie: SESSIONID=4a60ae53625b98cf77942f9f2fb220e5e3bfcccb
+
+{
+  "product": "VIP订阅",
+  "productId": 1014,
+  "discountId": 32334,
+  "lotteryId": 32334,
+  "activityType": 4,
+  "token": null,
+  "data": {
+    "type": "firstBuy",
+    "areaCount": 1,
+    "time": "1年",
+    "orderType": 1,
+    "price": 30400,
+    "order_phone": "17104343122"
+  }
+}
+
+###
+POST  https://jybx-webtest.jydev.jianyu360.com/jypay/getDomain
+Content-Type: application/x-www-form-urlencoded

+ 3 - 0
src/jfw/tag/a_init.go

@@ -2,9 +2,12 @@ package tag
 
 import (
 	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
+	"app.yhyue.com/moapp/jypkg/public"
 	"jy/src/jfw/jyutil"
 )
 
+var mongodb = public.MQFW
+
 func init() {
 	xweb.RootApp().AddTmplVar("Msg", Msg)
 	xweb.RootApp().AddTmplVar("Ad", Ad)

+ 95 - 37
src/jfw/tag/ad.go

@@ -7,21 +7,18 @@ package tag
 **/
 
 import (
-	"encoding/json"
-	"fmt"
+	util "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/redis"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 	"app.yhyue.com/moapp/jypkg/public"
+	"encoding/json"
+	"jy/src/jfw/config"
 	"log"
-
+	"net/url"
 	"strings"
 	"time"
-
-	"runtime"
-
-	"app.yhyue.com/moapp/jybase/redis"
 )
 
-var mongodb = public.MQFW
-
 /**
 标签用法传递代码、返回个数,如果为-1返回全部
 清除缓存请到后台,保存一下广告即可
@@ -35,39 +32,100 @@ var mongodb = public.MQFW
 {{end}}
 **/
 
-func Ad(s_code string, n int, host string) []adInfo {
-	defer func() {
-		if r := recover(); r != nil {
-			log.Println("[E]", r)
-			for skip := 0; ; skip++ {
-				_, file, line, ok := runtime.Caller(skip)
-				if !ok {
-					break
+type jySession struct {
+	UserId       string `json:"userId"`       //上下文用户信息
+	BaseUserId   int64  `json:"base_user_id"` //新用户id
+	EntId        int64  `json:"entId"`        //当前企业id
+	EntName      string `json:"entName"`      //当前企业名称
+	Phone        string `json:"phone"`        //手机号
+	EntUserId    int64  `json:"entUserId"`    //当前企业用户id
+	UserName     string `json:"userName"`     //用户名称
+	PersonId     int64  `json:"personId"`     //自然人id
+	AccountId    int64  `json:"accountId"`    //账户id
+	EntAccountId int64  `json:"entAccountId"` //企业账户id
+	PositionId   int64  `json:"positionId"`   //职位id
+	PositionType int64  `json:"positionType"` //职位类型
+	MgoUserId    string `json:"mgoUserId"`    //mongodb用户id
+}
+
+var (
+// adSessionMap  = map[string]*jySession{}
+// adSessionLock = sync.Mutex{}
+)
+
+func Ad(sCode string, n int, host, sessionId string) []jy.AdInfo {
+	defer util.Catch()
+	log.Println("sessionId:", sessionId)
+	var (
+		isLogin  bool
+		baseInfo *jy.BigVipBaseMsg
+	)
+	if sessionId != "" {
+		sessionId, _ = url.QueryUnescape(sessionId)
+		//adSessionLock.Lock()
+		jyS := &jySession{}
+		//jyS := adSessionMap[sessionId]
+		//adSessionLock.Unlock()
+		if jyS == nil || jyS.UserId == "" {
+			rVal, err := redis.GetBytes("session", sessionId)
+			if err == nil {
+				if err = json.Unmarshal(*rVal, &jyS); err != nil {
+					log.Println("ad session err:", err.Error())
 				}
-				go log.Printf("%v,%v\n", file, line)
 			}
 		}
-	}()
-	obj := redis.Get("other", "ad_"+s_code)
-	if obj != nil {
-		return adHandle(obj.([]interface{}), s_code, host)
-	} else {
-		f := ""
-		if n > -1 {
-			f = `{"a_son":{"$slice":[0,` + fmt.Sprintf("%d", n) + `]}}`
-		} else {
-			f = `{"a_son":1}`
-		}
-		res, ok := mongodb.FindOneByField("ad", `{"s_code":"`+s_code+`"}`, f)
-		if ok && res != nil && (*res)["a_son"] != nil {
-			son := (*res)["a_son"].([]interface{})
-			if len(son) > 0 {
-				redis.PutCKV("other", "ad_"+s_code, son)
+		if jyS != nil && jyS.UserId != "" {
+			baseInfo = jy.GetBigVipUserBaseMsgBySessVal(map[string]interface{}{
+				"base_user_id": jyS.BaseUserId,
+				"entId":        jyS.EntId,
+				"positionType": jyS.PositionType,
+				"accountId":    jyS.AccountId,
+				"positionId":   jyS.PositionId,
+				"userId":       jyS.UserId,
+			}, *config.Middleground)
+			if baseInfo != nil && baseInfo.Uid != "" {
+				isLogin = true
+				//adSessionLock.Lock()
+				//adSessionMap[sessionId] = jyS
+				//adSessionLock.Unlock()
 			}
-			return adHandle(son, s_code, host)
 		}
 	}
-	return nil
+	adf := jy.AdFunc{
+		AdCodes:   []string{sCode},
+		UserInfo:  baseInfo,
+		Mgo:       &public.MQFW,
+		MySql:     public.Mysql,
+		Host:      host,
+		Ads:       nil,
+		OrderCode: "",
+		IsLogin:   isLogin,
+	}
+	ads := adf.GetAdInfos()[sCode]
+	if n > 0 {
+		return ads[:n]
+	}
+	return ads
+	//obj := redis.Get("other", "ad_"+s_code)
+	//if obj != nil {
+	//	return adHandle(obj.([]interface{}), s_code, host)
+	//} else {
+	//	f := ""
+	//	if n > -1 {
+	//		f = `{"a_son":{"$slice":[0,` + fmt.Sprintf("%d", n) + `]}}`
+	//	} else {
+	//		f = `{"a_son":1}`
+	//	}
+	//	res, ok := mongodb.FindOneByField("ad", `{"s_code":"`+s_code+`"}`, f)
+	//	if ok && res != nil && (*res)["a_son"] != nil {
+	//		son := (*res)["a_son"].([]interface{})
+	//		if len(son) > 0 {
+	//			redis.PutCKV("other", "ad_"+s_code, son)
+	//		}
+	//		return adHandle(son, s_code, host)
+	//	}
+	//}
+	//return nil
 }
 
 type adInfo struct {
@@ -89,7 +147,7 @@ type adInfo struct {
 	S_script string `json:"s_script"` //脚本代码
 }
 
-//广告位信息处理
+// 广告位信息处理
 func adHandle(data []interface{}, s_code, host string) []adInfo {
 	var res = []adInfo{}
 	if len(data) > 0 {

+ 36 - 2
src/web/staticres/common-module/active/202402/202402.js

@@ -74,6 +74,7 @@ var task = new Vue({
       prompt_msg: '',
       status: 0, // 状态 0-抽奖状态 1-未开始(倒计时) 2-根据prompt_msg展示文案
       now_unix: 0,
+      mold: 0
     },
     shareReady: false,
     shareInfo: {},
@@ -157,6 +158,25 @@ var task = new Vue({
     },
     getScreenMax: function () {
       return document.body.clientHeight < 600
+    },
+    // 判断显示不显示剑鱼币相关文案(根据活动类型)
+    pointsMold: function () {
+      var conf = this.activityConf
+      return conf.mold === 1
+    },
+    // 订单抽奖活动
+    orderMold: function () {
+      var conf = this.activityConf
+      return conf.mold === 2
+    },
+    // 抽奖次数
+    drawCount: function () {
+      var conf = this.activityConf
+      if (conf.mold === 2) {
+        return conf.cost
+      } else {
+        return 0
+      }
     }
   },
   created: function () {
@@ -518,16 +538,29 @@ var task = new Vue({
       if (conf.status >= 2) {
         return
       }
-      if (this.coinCount < conf.cost) {
+      // mold=1 剑鱼币抽奖活动 mold=2 订单抽奖活动
+      if (conf.mold === 1 && this.coinCount < conf.cost) {
         return this.$toast('剑鱼币余额不足')
       }
+      // 订单抽奖类型 抽奖次数为0
+      if (conf.mold === 2 && conf.cost <= 0) {
+        _this.showDialog({
+          title: '温馨提示',
+          confirmButtonText: '我知道了',
+          message: '您当前条件不符合参与该抽奖活动!',
+          messageAlign: 'center',
+          showCancelButton: false
+        }).then(function () {
+        }).catch(function () {})
+        return
+      }
       if (this.loading) {
         return
       }
       // 二次确认
       this.showDialog({
         title: '确定抽奖吗?',
-        message: '此次抽奖将消耗' + this.activityConf.cost + '剑鱼币',
+        message: conf.mold === 1  ? '此次抽奖将消耗' + this.activityConf.cost + '剑鱼币' : `您还有${this.drawCount}次抽奖机会,本次抽奖将消耗1次抽奖机会。`,
         messageAlign: 'center',
       }).then(function () {
         _this.confirmChou()
@@ -554,6 +587,7 @@ var task = new Vue({
             })
           } else if (res.error_code === -2) {
             _this.stopAnimateDelay(_this.animateMinDelay, function () {
+              // 订单抽奖不符合条件提示我知道了  剑鱼币提示联系客服
               _this.showDialog({
                 title: '温馨提示',
                 confirmButtonText: '联系客服',

+ 65 - 50
src/web/staticres/common-module/ad/js/index.js

@@ -57,9 +57,10 @@ var getActive = {
    * @param {Array|String} active_codes_map 广告id标识符--数组集合["jy-wx-course-pay-success"]
    * @param {String} active_tip_group 展示广告的容器demo节点
    * @param {String} isAppsion 请求环境、app、weixin、pc
+   * @param {String} orderCode 订单编号(应用场景:支付成功将订单编号塞到请求头里给后端,后端根据订单编号返回特定身份的广告位)
    * @returns {Object|Array}
    */
-  getActiveInfo: function (active_codes_map,isAppsion) {
+  getActiveInfo: function (active_codes_map,isAppsion, orderCode) {
     // 如果执行环境是app
     var isAppsionApp = isAppsion === 'App'
     $.ajax({
@@ -68,7 +69,7 @@ var getActive = {
       dataType: "json",
       traditional: true,
       //强制请求头数据格式 'application/json'
-      headers: {'Content-Type': 'application/json'},
+      headers: {'Content-Type': 'application/json', 'orderCode': orderCode},
       data:active_codes_map,
         // JSON.stringify({codes:["jy-wx-course-pay-success","jy-pc-dataPackage-pay-success"] })
         // JSON.stringify()
@@ -95,57 +96,71 @@ var getActive = {
         var that = this
         var isAppsionType = isAppsionApp
         if (isAppsionType) {
+          if (imgsrcArr.o_extend && imgsrcArr.o_extend.linktype) {
+            $(".active-tip-group").on('click', function () {
+              try {
+                // abroad: 外部链接  within: 内部链接
+                imgsrcArr.o_extend.linktype === 'abroad' ? JyObj.openExternalLink(imgsrcArr.s_link, imgsrcArr.o_extend.title || '剑鱼标讯') : location.href=imgsrcArr.s_link;
+              } catch (e) {
+                console.log(e);
+              }
+            })
+            if (isIOS()) {
+              $('.rules').css('margin-top', '0.28rem')
+            }
+          } else {
+            // APP 保存图片
+            $('.active-tip-group').off('click').on('click', function () {
+              if(!window.picImgUrl) {
+                  html2canvas(document.querySelector('.active-tip-group'), {
+                      // allowTaint: true,
+                      useCORS: true,
+                      backgroundColor: null,
+                      scale: 3,
+                      imageTimeout: 30000,
+                      allowTaint: true, // 允许跨域图片
+                  }).then(function(canvas) {
+                      var imgUrl = imgsrcArr.base64 || canvas.toDataURL('image/png')
+                      console.log(imgUrl)
+                      // $(".active-tip-group img").attr('src', imgUrl)
+                      imgUrl = imgUrl.replace('data:image/png;base64,', '')
+                      // console.log(imgUrl)
+                      window.picImgUrl = imgUrl
+                      try {
+                        if (typeof window.__compatibleAppFn === 'function') {
+                          window.__compatibleAppFn(JyObj.savePic, window.picImgUrl, '剑鱼标讯需要您的存储权限、电话权限,将用于帮助您下载、保存图片到本地,将内容成功分享到社交平台。')
+                        }
 
-          // APP 保存图片
-          $('.active-tip-group').off('click').on('click', function () {
-            if(!window.picImgUrl) {
-                html2canvas(document.querySelector('.active-tip-group'), {
-                    // allowTaint: true,
-                    useCORS: true,
-                    backgroundColor: null,
-                    scale: 3,
-                    imageTimeout: 30000,
-                    allowTaint: true, // 允许跨域图片
-                }).then(function(canvas) {
-                    var imgUrl = imgsrcArr.base64 || canvas.toDataURL('image/png')
-                    console.log(imgUrl)
-                    // $(".active-tip-group img").attr('src', imgUrl)
-                    imgUrl = imgUrl.replace('data:image/png;base64,', '')
-                    // console.log(imgUrl)
-                    window.picImgUrl = imgUrl
-                    try {
-                      if (typeof window.__compatibleAppFn === 'function') {
-                        window.__compatibleAppFn(JyObj.savePic, window.picImgUrl, '剑鱼标讯需要您的存储权限、电话权限,将用于帮助您下载、保存图片到本地,将内容成功分享到社交平台。')
-                      }
-
-                      setTimeout(function() {
-                          weui.toast('图片已保存,快去扫码识别吧', {
-                            duration: 800,
-                            className: 'text-overflow100'
-                          })
-                        }, 2300)
+                        setTimeout(function() {
+                            weui.toast('图片已保存,快去扫码识别吧', {
+                              duration: 800,
+                              className: 'text-overflow100'
+                            })
+                          }, 2300)
 
-                    } catch (e) {
-                      weui.toast('保存失败', {
-                        duration: 800,
-                        className: 'j-toast'
-                      })
-                      console.log(e)
-                      // location.href=imgsrcArr.s_link
-                    }
-                })
-            }else {
-              if (typeof window.__compatibleAppFn === 'function') {
-                window.__compatibleAppFn(JyObj.savePic, window.picImgUrl, '剑鱼标讯需要您的存储权限、电话权限,将用于帮助您下载、保存图片到本地,将内容成功分享到社交平台。')
-              }
-                setTimeout(function() {
-                  weui.toast('图片已保存,快去扫码识别吧', {
-                    duration: 800,
-                    className: 'text-overflow100'
+                      } catch (e) {
+                        weui.toast('保存失败', {
+                          duration: 800,
+                          className: 'j-toast'
+                        })
+                        console.log(e)
+                        // location.href=imgsrcArr.s_link
+                      }
                   })
-                }, 2300)
-            }
-         })
+              }else {
+                if (typeof window.__compatibleAppFn === 'function') {
+                  window.__compatibleAppFn(JyObj.savePic, window.picImgUrl, '剑鱼标讯需要您的存储权限、电话权限,将用于帮助您下载、保存图片到本地,将内容成功分享到社交平台。')
+                }
+                  setTimeout(function() {
+                    weui.toast('图片已保存,快去扫码识别吧', {
+                      duration: 800,
+                      className: 'text-overflow100'
+                    })
+                  }, 2300)
+              }
+          })
+          }
+          
         } // App打开新窗口等 用 @param {String} isAppsion === 'Applink'
         else if ((isAppsion === 'Applink') && imgsrcArr.o_extend && imgsrcArr.o_extend.linktype === 'abroad') {
           $(".active-tip-group").on('click', function () {

BIN
src/web/staticres/common-module/exhibition/img/QRcode.png


BIN
src/web/staticres/common-module/exhibition/img/qr-code-shichang.png


+ 64 - 50
src/web/staticres/common-module/message-tip/js/index.js

@@ -59,7 +59,8 @@ var getActive = {
    * @param {String} isAppsion 请求环境、app、weixin、pc
    * @returns {Object|Array}
    */
-  getActiveInfo: function (active_codes_map,isAppsion) {
+  getActiveInfo: function (active_codes_map,isAppsion, orderCode) {
+    console.log(orderCode, 'orderCode');
     // 如果执行环境是app
     var isAppsionApp = isAppsion === 'App'
     $.ajax({
@@ -68,7 +69,7 @@ var getActive = {
       dataType: "json",
       traditional: true,
       //强制请求头数据格式 'application/json'
-      headers: {'Content-Type': 'application/json'},
+      headers: {'Content-Type': 'application/json', 'orderCode': orderCode},
       data:active_codes_map,
         // JSON.stringify({codes:["jy-wx-course-pay-success","jy-pc-dataPackage-pay-success"] })
         // JSON.stringify()
@@ -95,57 +96,70 @@ var getActive = {
         var that = this
         var isAppsionType = isAppsionApp
         if (isAppsionType) {
+          if (imgsrcArr.o_extend && imgsrcArr.o_extend.linktype) {
+            $(".active-tip-group").on('click', function () {
+              try {
+                // abroad: 外部链接  within: 内部链接
+                imgsrcArr.o_extend.linktype === 'abroad' ? JyObj.openExternalLink(imgsrcArr.s_link, imgsrcArr.o_extend.title || '剑鱼标讯') : location.href=imgsrcArr.s_link;
+              } catch (e) {
+                console.log(e);
+              }
+            })
+            if (isIOS()) {
+              $('.rules').css('margin-top', '0.28rem')
+            }
+          } else {
+            // APP 保存图片
+            $('.active-tip-group').off('click').on('click', function () {
+              if(!window.picImgUrl) {
+                  html2canvas(document.querySelector('.active-tip-group'), {
+                      // allowTaint: true,
+                      useCORS: true,
+                      backgroundColor: null,
+                      scale: 3,
+                      imageTimeout: 30000,
+                      allowTaint: true, // 允许跨域图片
+                  }).then(function(canvas) {
+                      var imgUrl = imgsrcArr.base64 || canvas.toDataURL('image/png')
+                      console.log(imgUrl)
+                      // $(".active-tip-group img").attr('src', imgUrl)
+                      imgUrl = imgUrl.replace('data:image/png;base64,', '')
+                      // console.log(imgUrl)
+                      window.picImgUrl = imgUrl
+                      try {
+                        if (typeof window.__compatibleAppFn === 'function') {
+                          window.__compatibleAppFn(JyObj.savePic, window.picImgUrl, '剑鱼标讯需要您的存储权限、电话权限,将用于帮助您下载、保存图片到本地,将内容成功分享到社交平台。')
+                        }
 
-          // APP 保存图片
-          $('.active-tip-group').off('click').on('click', function () {
-            if(!window.picImgUrl) {
-                html2canvas(document.querySelector('.active-tip-group'), {
-                    // allowTaint: true,
-                    useCORS: true,
-                    backgroundColor: null,
-                    scale: 3,
-                    imageTimeout: 30000,
-                    allowTaint: true, // 允许跨域图片
-                }).then(function(canvas) {
-                    var imgUrl = imgsrcArr.base64 || canvas.toDataURL('image/png')
-                    console.log(imgUrl)
-                    // $(".active-tip-group img").attr('src', imgUrl)
-                    imgUrl = imgUrl.replace('data:image/png;base64,', '')
-                    // console.log(imgUrl)
-                    window.picImgUrl = imgUrl
-                    try {
-                      if (typeof window.__compatibleAppFn === 'function') {
-                        window.__compatibleAppFn(JyObj.savePic, window.picImgUrl, '剑鱼标讯需要您的存储权限、电话权限,将用于帮助您下载、保存图片到本地,将内容成功分享到社交平台。')
-                      }
-
-                      setTimeout(function() {
-                          weui.toast('图片已保存,快去扫码识别吧', {
-                            duration: 800,
-                            className: 'text-overflow100'
-                          })
-                        }, 2300)
+                        setTimeout(function() {
+                            weui.toast('图片已保存,快去扫码识别吧', {
+                              duration: 800,
+                              className: 'text-overflow100'
+                            })
+                          }, 2300)
 
-                    } catch (e) {
-                      weui.toast('保存失败', {
-                        duration: 800,
-                        className: 'j-toast'
-                      })
-                      console.log(e)
-                      // location.href=imgsrcArr.s_link
-                    }
-                })
-            }else {
-              if (typeof window.__compatibleAppFn === 'function') {
-                window.__compatibleAppFn(JyObj.savePic, window.picImgUrl, '剑鱼标讯需要您的存储权限、电话权限,将用于帮助您下载、保存图片到本地,将内容成功分享到社交平台。')
-              }
-                setTimeout(function() {
-                  weui.toast('图片已保存,快去扫码识别吧', {
-                    duration: 800,
-                    className: 'text-overflow100'
+                      } catch (e) {
+                        weui.toast('保存失败', {
+                          duration: 800,
+                          className: 'j-toast'
+                        })
+                        console.log(e)
+                        // location.href=imgsrcArr.s_link
+                      }
                   })
-                }, 2300)
-            }
-         })
+              }else {
+                if (typeof window.__compatibleAppFn === 'function') {
+                  window.__compatibleAppFn(JyObj.savePic, window.picImgUrl, '剑鱼标讯需要您的存储权限、电话权限,将用于帮助您下载、保存图片到本地,将内容成功分享到社交平台。')
+                }
+                  setTimeout(function() {
+                    weui.toast('图片已保存,快去扫码识别吧', {
+                      duration: 800,
+                      className: 'text-overflow100'
+                    })
+                  }, 2300)
+              }
+            })
+          }
         } // App打开新窗口等 用 @param {String} isAppsion === 'Applink'
         else if ((isAppsion === 'Applink') && imgsrcArr.o_extend && imgsrcArr.o_extend.linktype === 'abroad') {
           $(".active-tip-group").on('click', function () {

+ 1 - 1
src/web/staticres/common-module/public/head.js

@@ -55,7 +55,7 @@
       window.clab_tracker = tracker
     }
     // 初始化JTrack
-    var sdkVersion = 140
+    var sdkVersion = 142
     if (window.goTemplateData && window.goTemplateData.version) {
       sdkVersion = window.goTemplateData.version
     }

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
src/web/staticres/common-module/track/j-track.amd.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
src/web/staticres/common-module/track/j-track.es.min.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
src/web/staticres/common-module/track/j-track.min.js


BIN
src/web/staticres/frontRouter/pc/activity/image/202404/header-banner-title@2x.png


+ 29 - 3
src/web/staticres/frontRouter/pc/activity/js/202402.js

@@ -117,6 +117,7 @@ var task = new Vue({
       prompt_msg: '',
       status: 0, // 状态 0-抽奖状态 1-未开始(倒计时) 2-根据prompt_msg展示文案
       now_unix: 0,
+      mold: 0 // 抽奖活动类型 0-购买奖励(支付赠送活动) 1-是剑鱼币抽奖 2-订单抽奖
     },
     shareInfo: {},
     rewardList: [],
@@ -158,7 +159,7 @@ var task = new Vue({
     ballList: [],
     pageDOM: {
       ratio: 1,
-    },
+    }
   },
   computed: {
     now: function () {
@@ -198,6 +199,25 @@ var task = new Vue({
       var conf = this.activityConf
       return new Date(conf.active_end_time * 1000).pattern('yyyy.MM.dd')
     },
+    // 判断显示不显示剑鱼币相关文案(根据活动类型)
+    pointsMold: function () {
+      var conf = this.activityConf
+      return conf.mold === 1
+    },
+    // 订单抽奖活动
+    orderMold: function () {
+      var conf = this.activityConf
+      return conf.mold === 2
+    },
+    // 抽奖次数
+    drawCount: function () {
+      var conf = this.activityConf
+      if (conf.mold === 2) {
+        return conf.cost
+      } else {
+        return 0
+      }
+    }
   },
   created: function () {
     var activityId = getParam('id')
@@ -393,7 +413,7 @@ var task = new Vue({
       this.calcTipInfoText()
       this.calcBallList()
       document.title = conf.name
-      this.conf.header_pic = conf.pic || '/frontRouter/pc/activity/image/202402/header-banner-title@2x.png'
+      this.conf.header_pic = conf.pic || '/frontRouter/pc/activity/image/202404/header-banner-title@2x.png'
       setTimeout(function () {
         _this.resizeCallback()
       }, 100)
@@ -454,9 +474,15 @@ var task = new Vue({
       if (conf.status >= 2) {
         return
       }
-      if (this.coinCount < conf.cost) {
+      // mold=1 剑鱼币抽奖活动 mold=2 订单抽奖活动
+      if (conf.mold === 1 && this.coinCount < conf.cost) {
         return toastFn('剑鱼币余额不足', 2000)
       }
+      if (conf.mold === 2 && conf.cost <= 0) {
+        this.dialog.errTipContentText = '您当前条件不符合参与该抽奖活动!'
+        this.dialog.errTip = true
+        return
+      }
       // 二次确认
       this.dialog.confirm = true
     },

BIN
src/web/staticres/images/index/new/shangwuhezuo-blue.png


BIN
src/web/staticres/images/index/new/shangwuhezuo.png


+ 3 - 3
src/web/staticres/js/biddingSearch.js

@@ -166,9 +166,9 @@ $(function() {
         if (inInjectBI) {
           $(".bi-mark.parent-node").addClass('active')
         } else {
-          $content.children().not($(this)).removeClass("active secondActice");
-          $('.show-nj-cg').children().removeClass("active")
-          $induAll.addClass("active");
+        //   $content.children().not($(this)).removeClass("active secondActice");
+        //   $('.show-nj-cg').children().removeClass("active")
+        //   $induAll.addClass("active");
         }
 			}
 		})

+ 1 - 1
src/web/staticres/js/index/index_2023.12.js

@@ -384,7 +384,7 @@ $(function () {
   $('.pc-index-bottom .bottom-member-ad').on('load', function () {
     fixBottomADHeight(true)
   })
-  if ($.isArray(bottom_img)) {
+  if (window.bottom_img && $.isArray(bottom_img)) {
     if (bottom_img[0]) {
       if (bottom_img[0].s_pic) {
         $('.pc-index-bottom .bottom-member-ad').attr('src', bottom_img[0].s_pic)

+ 28 - 4
src/web/staticres/js/selector/area-city-data.js

@@ -188,6 +188,23 @@ var selectAreachoose = {
       }
       this.getData()
     },
+    processingsubtype(data) { // 信息类型回显
+      // data格式为['招标公告', '招标预告']
+      if (data) {
+        let list
+        if (Array.isArray(data)) {
+          list = data
+        } else {
+          list = data.toString().split(',')
+        }
+        let arr = list
+        this.checkecho(arr, 'value') // 回显选中信息
+      } else {
+        this.reactAll()// 置为初始
+      }
+      this.getData()
+      this.$emit('datachange', this.chooseData)
+    },
     reactAll() {
       this.num = '全部'
       this.leftList.forEach(ele => {
@@ -217,11 +234,18 @@ var selectAreachoose = {
     checkecho(arr, key) {
       arr.forEach(ele => {
         this.leftList.forEach(e => {
-          e.children.forEach(item => {
-            if (ele == item[key]) {
+          if (ele == e.value) {
+            e.selected = true
+            e.children.forEach(item => {
               item.selected = true
-            }
-          })
+            })
+          } else {
+            e.children.forEach(item => {
+              if (ele == item[key]) {
+                item.selected = true
+              }
+            })
+          }
         })
       })
       this.leftList.forEach((ele, index) => {

+ 13 - 1
src/web/staticres/public-pc/css/sub-page.css

@@ -246,13 +246,25 @@ body.in-iframe {
   width: calc(100% - 48px) !important ;
   height: calc(20.3vw - 48px) !important;
   margin: auto;
-  background: url('/common-module/exhibition/img/work_bg.png?v=1') center center no-repeat;
+  // background: url('/common-module/exhibition/img/work_bg.png?v=1') center center no-repeat;
   background-size: cover;
   border-radius: 8px;
 }
 .in-iframe #vm_exhibition .head .content{
   display: none;
 }
+.in-iframe.pc-exhibition-page #vm_exhibition .head{
+  overflow: hidden;
+}
+.in-iframe.pc-exhibition-page #vm_exhibition .head .content .qr{
+  transform: scale(0.6);
+  transform-origin: 0 0;
+  top: 10%;
+  right: 24%;
+}
+.in-iframe.pc-exhibition-page #vm_exhibition .head .content{
+  display: block;
+}
 .in-iframe #vm_exhibition .box{
   padding-top: 24px !important;
   padding-bottom: 37px !important;

+ 35 - 3
src/web/staticres/serviceSystem/js/serviceSystem.js

@@ -21,7 +21,9 @@ var vNode = new Vue({
             type: '',
             showToast: false,
             toastText: '您已开通大会员',
-            urlParams: ''  // tjxm 推荐项目, spxm: 审批项目
+            urlParams: '',  // tjxm 推荐项目, spxm: 审批项目
+            vipRenewActivityPage: '',
+            bigRenewActivityPage: ''
         }
     },
     created: function() {
@@ -57,6 +59,9 @@ var vNode = new Vue({
 
                         }
                         callback(res.data)
+                        if (this_.isbuy_vip || this_.isbuy_big) {
+                          this_.getRenewActivityPage()
+                        }
                     }
                 }
             })
@@ -133,7 +138,9 @@ var vNode = new Vue({
                 //去购买
                 window.location.href = "/swordfish/page_big_pc/free/svip/buy"
             } else {
-                window.location.href="/swordfish/page_big_pc/free/svip/buy?type=renew"
+                // 进入续费活动页 
+                // window.location.href="/swordfish/page_big_pc/free/svip/buy?type=renew"
+                window.location.href = this.vipRenewActivityPage
               }
           } else {//大会员
             if (!this.isbuy_big) {//不是大会员
@@ -145,7 +152,9 @@ var vNode = new Vue({
                   // 专家版
               }
             } else {
-              this.toast('您已开通大会员')
+              // this.toast('您已开通大会员')
+              // 进入续费活动页 
+              window.location.href = this.bigRenewActivityPage
             }
           }
         },
@@ -197,6 +206,29 @@ var vNode = new Vue({
               vm.showSuccess = true
             })
           }
+        },
+        // 获取超级订阅、大会员续费活动页地址
+        getRenewActivityPage: function(){
+          var _this = this
+          var params = {
+            codes:  ['pc-vip-renew-activity', 'pc-big-renew-activity']
+          }
+          $.ajax({
+              type: 'POST',
+              url: '/publicapply/free/getJyAdList',
+              contentType: 'application/json',
+              data: JSON.stringify(params),
+              success: function (res) {
+                if (res.data) {
+                    if (res.data['pc-vip-renew-activity']) {
+                      _this.vipRenewActivityPage = res.data['pc-vip-renew-activity'][0].s_link
+                    }
+                    if (res.data['pc-vip-renew-activity']) {
+                      _this.bigRenewActivityPage = res.data['pc-big-renew-activity'][0].s_link
+                    }
+                }
+              }
+          })
         }
     }
 })

+ 1 - 1
src/web/templates/common/friend-link.html

@@ -3,7 +3,7 @@
     <div class="jy_friendlink_title">友情链接</div>
     <div class="jy_friendlink_content">
       <ul>
-        {{range $i,$v := Ad "jy-pc-index-friendlink" -1 .Host}}
+        {{range $i,$v := Ad "jy-pc-index-friendlink" -1 .Host (cookie "SESSIONID")}}
           <li>
             <a href="{{$v.S_link}}" class="friendlink-href" target="_blank">
               {{$v.S_remark}}

+ 1 - 1
src/web/templates/common/pc-header-nav-second.html

@@ -9,7 +9,7 @@
       <p class="pc-header-nav-second-head-desc">全国招标信息<br>免费看,不遮挡</p>
     </div>
     <div class="pc-header-nav-second-head-right">
-      {{range $menu :=(Ad "jy-top-common-second-menu" -1 .Host) }}
+      {{range $menu :=(Ad "jy-top-common-second-menu" -1 .Host (cookie "SESSIONID")) }}
         <a href="{{$menu.S_link}}" class="pc-header-nav-second-head-right-item">{{$menu.S_remark}}</a>
       {{end}}
     </div>

+ 2 - 2
src/web/templates/common/pc-login-dialog.html

@@ -17,7 +17,7 @@
         <div class="login-wx--title">
           <span>微信扫码登录</span>
         </div>
-        <img class="wx-qrcode" id="layerImg-login" src="/front/share/10" />
+        <img class="wx-qrcode" id="layerImg-login" src="" />
       </div>
       <div class="new_login">
         <div class="login-dig-icon-close" onclick="closeLoginDig()"></div>
@@ -126,7 +126,7 @@
           </div>
         </div>
         <div class="login-dig-wx-qrcode-box login-module-card wx-qr-login" style="display: none">
-          <img class="wx-qrcode" id="layerImg-login" src="/front/share/10" />
+          <img class="wx-qrcode" id="layerImg-login" src="" />
           <div class="footer-action-container">
             <div class="auto-login-container no-selected">
               <div class="auto-login-checkbox"></div>

+ 13 - 4
src/web/templates/common/pcbottom.html

@@ -61,7 +61,7 @@
                 <p>扫码下载</p>
               </div>
               <div>
-                <img data-share-img src="/front/share/10" alt="">
+                <img data-share-img src="" alt="">
                 <p>扫码关注</p>
               </div>
             </div>
@@ -111,7 +111,7 @@
 		<div class="j-wx-code">
 			<img class="code-close" src="{{Msg "seo" "cdn"}}/images/j-wx-code-close.png" alt="" onclick="zbsqClose();"/>
 			<div class="code-title"></div>
-			<div class="code-wxm"><img id="layerImg-zbsq" src="/front/share/10"/></div>
+			<div class="code-wxm"><img id="layerImg-zbsq" src=""/></div>
 			<div class="code-text">
 				<span><img id="wxpng" src="{{Msg "seo" "cdn"}}/images/wx1.png"/>微信扫码关注</span>
 				<br/>
@@ -155,12 +155,21 @@
             </div>
           </div> -->
       </div>
+      <div class="right-side-phone right-side-wx common-right-side-item">
+          <span class="text-customer"><img src='{{Msg "seo" "cdn"}}/images/index/new/shangwuhezuo.png?v={{Msg "seo" "version"}}' alt=""></span>
+          <span class="text-customer text-customer-hover"><img src='{{Msg "seo" "cdn"}}/images/index/new/shangwuhezuo-blue.png?v={{Msg "seo" "version"}}' alt=""></span>
+          <p class="desc_text_b">商务合作</p>
+          <div class="slidePop">
+            <img src="{{Msg " seo" "cdn" }}/common-module/exhibition/img/qr-code-shichang.png?v={{Msg "seo" "version"}}" alt="">
+            <p>微信扫一扫<br>商务合作</p>
+          </div>
+      </div>
       <div class="right-side-phone right-side-wx common-right-side-item">
           <span class=" text-customer"><img src='{{Msg "seo" "cdn"}}/images/index/new/wx.png?v={{Msg "seo" "version"}}' alt=""></span>
           <span class="text-customer text-customer-hover"><img src='{{Msg "seo" "cdn"}}/images/index/new/wx1.png?v={{Msg "seo" "version"}}' alt=""></span>
           <p class="desc_text_b">关注剑鱼</p>
           <div class="slidePop">
-              <img data-share-img src="/front/share/10" alt="">
+              <img data-share-img src="" alt="">
               <p>关注剑鱼标讯<br>免费追踪全国商机</p>
           </div>
       </div>
@@ -188,7 +197,7 @@
 <!--E-侧边栏-->
 
 <script>
-{{$s:=(Ad "jy-pc-sharepolitely-float" -1 .Host)}}
+{{$s:=(Ad "jy-pc-sharepolitely-float" -1 .Host (cookie "SESSIONID"))}}
   var ADList={{$s}}
   var ADHtml="";
 if(ADList.length>0){

+ 1 - 1
src/web/templates/common/pchead.html

@@ -43,5 +43,5 @@
   * @param {Array|String} active_codes_map 广告id标识符--数组集合["jy-wx-course-pay-success"]
   * @param {String} isAppsion 请求环境、app、weixin、pc
   */
-  getActive.getActiveInfo(Activedata,'PC')
+  // getActive.getActiveInfo(Activedata,'PC')
 </script>

+ 1 - 1
src/web/templates/course/pc/course_detail.html

@@ -180,7 +180,7 @@
 				<!--广告-->
 				<div  onclick="adv_statistics(this)" adv_name="PC搜索列表页-底部" class="adv-pcsearch-bottom" id="A1" style="cursor:default;">
 					<script>
-						{{$s:=(Ad "jy-pccourse-detail-right" -1 .Host)}}
+						{{$s:=(Ad "jy-pccourse-detail-right" -1 .Host (cookie "SESSIONID"))}}
 						var ADList={{$s}};
 						if(ADList){
 							var random=Math.floor(Math.random()*ADList.length);

+ 2 - 2
src/web/templates/course/pc/course_list.html

@@ -124,7 +124,7 @@
                     <!-- Add Pagination -->
                     <div class="swiper-pagination"></div>
                 </div>
-                {{$s_top:=(Ad "jy-appcourse-list-top" -1 .Host)}}
+                {{$s_top:=(Ad "jy-appcourse-list-top" -1 .Host (cookie "SESSIONID"))}}
                 <script>
                     var ADTopList={{$s_top}}
                     if (ADTopList!=null){
@@ -143,7 +143,7 @@
                     }
                 </script>
             </div>
-            {{$s_top:=(Ad "jy-pccourse-list-top" -1 .Host)}}
+            {{$s_top:=(Ad "jy-pccourse-list-top" -1 .Host (cookie "SESSIONID"))}}
             <script>
                 var ADTopList={{$s_top}}
                 if (ADTopList!=null){

+ 5 - 5
src/web/templates/course/weixin/course_list.html

@@ -40,7 +40,7 @@
                 <!-- Add Pagination -->
                 <div class="swiper-pagination"></div>
             </div>
-			{{$s_top:=(Ad "jy-wxcourse-list-top" -1 .Host)}}
+			{{$s_top:=(Ad "jy-wxcourse-list-top" -1 .Host (cookie "SESSIONID"))}}
 			<script>
 				var ADTopList={{$s_top}}
 				if (ADTopList!=null){
@@ -86,7 +86,7 @@
             <ul class="tabs-content">
                 <li class="tab-pane" style="display:block;">
                     <div class="course-list">
-                        
+
                     </div>
                 </li>
             </ul>
@@ -105,7 +105,7 @@
 		var wxflag = "";
         $(function () {
             FastClick.attach(document.body);
-	        
+
             // 实现tab切换
             //获取广告高度
             var header_height = document.getElementById("course-header");
@@ -192,7 +192,7 @@
                 left = s.split('.')[0].split('').reverse();
                 right = s.split('.')[1];
             }
-            
+
             t = "";
             for (i = 0; i < left.length; i++) {
                 t += left[i] + ((i + 1) % 3 == 0 && (i + 1) != left.length ? ',' : '');
@@ -341,4 +341,4 @@
 	{{include "/common/baiducc.html"}}
 </body>
 
-</html>
+</html>

+ 1 - 1
src/web/templates/dataMarket/dataInterface/index.html

@@ -91,7 +91,7 @@
       </div>
     </section>
   </section>
-  {{range $k,$v:=Ad "jy-pc-dataInterface-bottom" -1 .Host}}
+  {{range $k,$v:=Ad "jy-pc-dataInterface-bottom" -1 .Host (cookie "SESSIONID")}}
   <div class="data-market-ad-bottom" onClick="isAdJump({{ $v }})">
     <img src="{{Msg "seo" "cdn"}}{{$v.S_pic}}" alt="">
   </div>

+ 5 - 5
src/web/templates/exhibition/pc/index.html

@@ -30,14 +30,14 @@
   </style>
 </head>
 
-<body>
+<body class="pc-exhibition-page">
   {{include "/common/pchead.html"}}
   <div id="vm_exhibition">
     <div class="box">
       <div class="head">
         <div class="content">
           <div class="qr">
-            <img src="{{Msg " seo" "cdn" }}/common-module/exhibition/img/QRcode.png?v={{Msg "seo" "version"}}" alt="">
+            <img src="{{Msg " seo" "cdn" }}/common-module/exhibition/img/qr-code-shichang.png?v={{Msg "seo" "version"}}" alt="">
             <p class="text">扫码咨询 展会合作</p>
           </div>
         </div>
@@ -46,7 +46,7 @@
       <div class="content bannerSwiper">
         <div class="swiper-wrapper">
           <!-- 两端图尺寸不一致因此需要区分 -->
-          {{range $i, $v :=Ad "pc-exhibition-index-top" -1 .Host}}
+          {{range $i, $v :=Ad "pc-exhibition-index-top" -1 .Host (cookie "SESSIONID")}}
           <div class="swiper-slide" onclick="golink({{$v.S_link}})">
             <!-- pc 图 -->
             <img class="m_hide" src="{{$v.S_pic}}" alt="{{$v.S_remark}}">
@@ -270,14 +270,14 @@
           openType: '_blank'
         })
       } else {
-        window.open(openHref) 
+        window.open(openHref)
       }
     }
     function golink(link){
       if(link){
         window.open(link)
       }
-      
+
     }
 
   </script>

+ 3 - 3
src/web/templates/exhibition/weixin/index.html

@@ -38,7 +38,7 @@
         </div>
       </div>
       {{$picNum := false}}
-      {{range $i, $v :=Ad "app-exhibition-index-top" -1 .Host}}
+      {{range $i, $v :=Ad "app-exhibition-index-top" -1 .Host (cookie "SESSIONID")}}
       {{if ge $i 0}}
       {{$picNum = true}}
       {{end}}
@@ -49,7 +49,7 @@
       <div class="content bannerSwiper">
         <div class="swiper-wrapper">
           <!-- 两端图尺寸不一致因此需要区分 -->
-          {{range $i, $v :=Ad "app-exhibition-index-top" -1 .Host}}
+          {{range $i, $v :=Ad "app-exhibition-index-top" -1 .Host (cookie "SESSIONID")}}
           <div class="swiper-slide" onclick="golink({{$v.S_link}})">
             <!-- pc 图 -->
             <img class="m_hide" src="{{$v.S_pic}}" alt="{{$v.S_remark}}">
@@ -269,7 +269,7 @@
       if(link){
         window.location.href = link
       }
-      
+
     }
   </script>
   {{include "/common/baiducc.html"}}

+ 10 - 6
src/web/templates/frontRouter/pc/activity/free/202402.html

@@ -55,7 +55,7 @@
             <div class="header-banner-content w">
                 <div class="header-banner-content-time">${activeStartTime} - ${activeEndTime}</div>
                 <div class="header-banner-machine m-c">
-                    <div class="machine-title">${activityConf.cost}剑鱼币抽会员</div>
+                    <div class="machine-title" v-if="pointsMold">${activityConf.cost}剑鱼币抽会员</div>
                     <div class="machine-ani-content machine-canvas" id="ballBox">
                         <div class="machine-ball-list">
                             <div class="machine-ball-item"
@@ -71,7 +71,7 @@
                         </div>
                     </div>
                     <div class="machine-ani-content machine-mask"></div>
-                    <div class="machine-balance-container">
+                    <div class="machine-balance-container" v-if="pointsMold">
                         <p class="my-coin-count" v-if="hasLogin">我的剑鱼币:${coinCount}</p>
                         <p class="my-coin-count pointer" v-else @click="toLogin">我的剑鱼币:登录查看</p>
                         <div class="add-jianyu-coin" v-if="hasLogin">
@@ -80,10 +80,10 @@
                         </div>
                     </div>
                     <div class="machine-confirm pointer" @click="startChou" v-show="confLoaded" id="start-choujiang">
-                        <div class="machine-button-tip tip-right" v-if="activityConf.status === 0">${activityConf.cost}剑鱼币</div>
+                        <div class="machine-button-tip tip-right" v-if="activityConf.status === 0 && pointsMold">${activityConf.cost}剑鱼币</div>
                         <template v-else>
                             <div class="machine-button-tip tip-left" v-if="tipInfo.countdown">开始倒数计时:${tipInfo.countdownText}</div>
-                            <div class="machine-button-tip tip-left" v-else>${tipInfo.text}</div>
+                            <div class="machine-button-tip tip-left" v-else-if="tipInfo.text">${tipInfo.text}</div>
                         </template>
                         <div class="machine-pointer" v-show="pointerShow"></div>
                     </div>
@@ -163,7 +163,8 @@
         :show-close="false"
         top="25vh"
         width="30%">
-        <span>此次抽奖将消耗${activityConf.cost}剑鱼币</span>
+        <span v-if="pointsMold">此次抽奖将消耗${activityConf.cost}剑鱼币</span>
+        <span v-else>您还有${drawCount}次抽奖机会,本次抽奖将消耗1次抽奖机会。</span>
         <span slot="footer" class="dialog-footer">
             <button class="j-t-button cancel" @click="dialog.confirm=false">取 消</button>
             <button class="j-t-button confirm active" @click="confirmChou">确 定</button>
@@ -177,10 +178,13 @@
         top="25vh"
         width="30%">
         <span>${dialog.errTipContentText}</span>
-        <span slot="footer" class="dialog-footer">
+        <span slot="footer" class="dialog-footer" v-if="pointsMold">
             <button class="j-t-button cancel" @click="dialog.errTip=false">返回</button>
             <button class="j-t-button confirm active" @click="errTipConfirm">联系客服</button>
         </span>
+        <span slot="footer" class="dialog-footer" v-if="orderMold">
+          <button class="j-t-button confirm active" style="margin-left: 0;" @click="dialog.errTip=false">我知道了</button>
+        </span>
     </el-dialog>
 </div>
 <!--S-弹窗-->

+ 2 - 2
src/web/templates/frontRouter/pc/brand/free/index.html

@@ -386,7 +386,7 @@
       <!-- <iframe src="/swordfish/frontPage/brand/free/maps" frameborder="0" style="width:100%;height:100%"  scrolling='no'></iframe> -->
       <img src="{{Msg "seo" "cdn"}}/brand/img/maps.png?v={{Msg "seo" "version"}}" alt="">
     </div>
-    {{$contactList:=(Ad "brand_contact_list" -1 .Host)}}
+    {{$contactList:=(Ad "brand_contact_list" -1 .Host (cookie "SESSIONID"))}}
     {{if $contactList}}
     <div class="qr_box">
       {{range $contact:=$contactList}}
@@ -541,7 +541,7 @@
         }
 
 
-        
+
         if($(window).scrollTop()>=0&&$(window).scrollTop()<=$("#ent_culture").offset().top-140){
           $('.tabs_item').find('p').removeClass('active')
           $('.tabs_item').eq(0).find('p').addClass('active')

+ 1 - 1
src/web/templates/frontRouter/pc/industryInfo/free/index.html

@@ -25,7 +25,7 @@
       <div class="school-banner">
         <div class="swiper-container" id="bannerSwiper">
           <div class="swiper-wrapper">
-            {{range $k,$v:=Ad "index-banner-top" -1 .Host}}
+            {{range $k,$v:=Ad "index-banner-top" -1 .Host (cookie "SESSIONID")}}
               <a class="swiper-slide"
                   {{if $v.S_link }}href="{{$v.S_link}}"{{end}}
                   {{if eq $v.O_extend.Linktype "abroad" }} target="_blank" {{else}} target="_self" {{end}}

+ 29 - 0
src/web/templates/frontRouter/pc/partner/free/index.html

@@ -146,6 +146,29 @@
         font-weight: 700;
         /* text-align: center; */
     }
+
+    .qr-fixed {
+      position: absolute;
+      bottom: 20px;
+      left: 38%;
+      bottom: 13%;
+    }
+    .qr-container {
+      width: 86px;
+      border-radius: 8px;
+      overflow: hidden;
+    }
+    .qr-container img {
+      display: block;
+      width: 100%;
+    }
+    .qr-fixed .text {
+      font-size: 16px;
+      color: #fff;
+      margin-top: 6px;
+      font-weight: bold;
+      text-align: center;
+    }
 </style>
 <body class="indexpage">
 {{include "/common/pchead.html"}}
@@ -157,6 +180,12 @@
         <div class="joinIn">
             <div class="joinbtn">申请加入</div>
         </div>
+        <div class="qr-fixed">
+          <div class="qr-container">
+            <img src="{{Msg " seo" "cdn" }}/common-module/exhibition/img/qr-code-shichang.png?v={{Msg "seo" "version"}}" alt="">
+          </div>
+          <p class="text">扫码咨询</p>
+        </div>
     </div>
     <div class="section-part part-2">
         <img src='{{Msg "seo" "cdn"}}/frontRouter/pc/partner/image/part2.png' style="width: 1200px" alt="">

+ 1 - 1
src/web/templates/frontRouter/pc/school/free/index.html

@@ -25,7 +25,7 @@
       <div class="school-banner">
         <div class="swiper-container" id="bannerSwiper">
           <div class="swiper-wrapper">
-            {{range $k,$v:=Ad "index-banner-top" -1 .Host}}
+            {{range $k,$v:=Ad "index-banner-top" -1 .Host (cookie "SESSIONID")}}
               <a class="swiper-slide"
                   {{if $v.S_link }}href="{{$v.S_link}}"{{end}}
                   {{if eq $v.O_extend.Linktype "abroad" }} target="_blank" {{else}} target="_self" {{end}}

+ 6 - 6
src/web/templates/frontRouter/pc/serviceSystem/free/index.html

@@ -50,7 +50,7 @@
                                  </div>
                              </div>
                             <div class="btn-row clearfix">
-                                <div class="btn-item btn-blue-solid mr-20" @click="goOpen('vip')">立即开通</div>
+                                <div class="btn-item btn-blue-solid mr-20" @click="goOpen('vip')">{ isbuy_vip ? '点击续费' : '立即开通' }</div>
                                 <div class="btn-item btn-blue-line" @click="consultation('0')">立即咨询</div>
                             </div>
                             <p class="tip">支付后可开发票</p>
@@ -64,7 +64,7 @@
                                 <p class="day_price">每天仅需<span class="highlight-red">21.9</span>元</p>
                             </div>
                             <div class="btn-row clearfix">
-                                <div class="btn-item btn-gold-solid mr-20" @click="goOpen('big','商机版')">立即开通</div>
+                                <div class="btn-item btn-gold-solid mr-20" @click="goOpen('big','商机版')">{ isbuy_big ? '续费咨询' : '立即开通' }</div>
                                 <div class="btn-item btn-gold-line" @click="consultation('0')">立即咨询</div>
                             </div>
                             <p class="tip">支付后可开发票</p>
@@ -78,7 +78,7 @@
                                 <p class="day_price">每天仅需<span class="highlight-red">54.8</span>元</p>
                             </div>
                             <div class="btn-row clearfix">
-                                <div class="btn-item btn-gold-solid mr-20" @click="goOpen('big','专家版')">立即开通</div>
+                                <div class="btn-item btn-gold-solid mr-20" @click="goOpen('big','专家版')">{ isbuy_big ? '续费咨询' : '立即开通' }</div>
                                 <div class="btn-item btn-gold-line" @click="consultation('0')">立即咨询</div>
                             </div>
                             <p class="tip">支付后可开发票</p>
@@ -103,7 +103,7 @@
                             </div>
                             <div class="sort_cell_block serve_bg_blue he-118">
                                 <span class="table_serve_head_text">超级订阅</span>
-                                <div class="cell_blue_btn" @click="goOpen('vip')">立即开通</div>
+                                <div class="cell_blue_btn" @click="goOpen('vip')">{ isbuy_vip ? '点击续费' : '立即开通' }</div>
                             </div>
                             <div class="sort_cell_block_nob  serve_bg_yellow he-118">
                                 <span class="table_serve_head_text2">大会员</span>
@@ -131,7 +131,7 @@
                             </div>
                             <div class="sort_cell_block serve_bg_blue he-118">
                                 <span class="table_serve_head_text">超级订阅</span>
-                                <div class="cell_blue_btn" @click="goOpen('vip')">立即开通</div>
+                                <div class="cell_blue_btn" @click="goOpen('vip')">{ isbuy_vip ? '点击续费' : '立即开通' }</div>
                             </div>
                             <div class="sort_cell_block_nob  serve_bg_yellow he-118">
                                 <span class="table_serve_head_text2">大会员</span>
@@ -1010,7 +1010,7 @@
     <script>
         setNavTheme(firstTheme = 'light')
         haslogin({{.T.logid}});
-        {{$ad:=(Ad "service-list-top" -1 .Host)}}
+        {{$ad:=(Ad "service-list-top" -1 .Host (cookie "SESSIONID"))}}
         var headerAd = {{$ad}}
         if(headerAd && headerAd[0] && headerAd[0].s_pic) {
           $('.box-head').css('background-image', 'url(' + headerAd[0].s_pic +')')

+ 4 - 4
src/web/templates/frontRouter/pc/squeeze/sess/test.html

@@ -488,7 +488,7 @@ var adv_margin_top = "110";
 var adv_width = "620";
 var adv_height = "210";
 var adv_background_opacity = 0.6;
-{{$s:=(Ad "jy-pc-index-tap" -1 .Host)}}
+{{$s:=(Ad "jy-pc-index-tap" -1 .Host (cookie "SESSIONID"))}}
 {{if $s}}
 var ADList={{$s}}
 if (ADList.length>0){
@@ -523,7 +523,7 @@ if (ADList.length>0){
 
 // 金刚区start
 var str_projectList = ""
-{{$s:=(Ad "jy-pc-index-jingangqu" -1 .Host)}}
+{{$s:=(Ad "jy-pc-index-jingangqu" -1 .Host (cookie "SESSIONID"))}}
 {{range $t,$v := $s}}
   var data = {{$v}}
   str_projectList += "<li><a href=\"" + data.s_link + "\"><img src=\"" + data.s_pic + "\" alt=\"\" /><p>" + data.s_picalt + "</p></a></li>";
@@ -533,7 +533,7 @@ $(".projectList ul").html(str_projectList)
 
 // 广告轮播
 var str_left_img = "",left_img_index = 0
-{{$s:=(Ad "jy-pc-index-leftad" -1 .Host)}}
+{{$s:=(Ad "jy-pc-index-leftad" -1 .Host (cookie "SESSIONID"))}}
 {{range $t,$v := $s}}
   left_img_index += 1
   var left_img = {{$v}}
@@ -548,7 +548,7 @@ var str_left_img = "",left_img_index = 0
 $(".jy-banner-l .carousel-inner").html(str_left_img)
 
 var str_right_img = "",right_img_index = 0
-{{$s:=(Ad "jy-pc-index-rightad" -1 .Host)}}
+{{$s:=(Ad "jy-pc-index-rightad" -1 .Host (cookie "SESSIONID"))}}
 {{range $t,$v := $s}}
   right_img_index += 1
   var right_img = {{$v}}

+ 4 - 4
src/web/templates/frontRouter/wx/activity/free/202402.html

@@ -42,7 +42,7 @@
                 <div class="header-banner-content">
                     <div class="header-banner-content-time">${activeStartTime} - ${activeEndTime}</div>
                     <div class="header-banner-machine">
-                        <div class="machine-title">${activityConf.cost}剑鱼币抽会员</div>
+                        <div class="machine-title" v-if="pointsMold">${activityConf.cost}剑鱼币抽会员</div>
                         <div class="machine-ani-content machine-canvas" id="ballBox">
                             <div class="machine-ball-list">
                                 <div class="machine-ball-item"
@@ -58,7 +58,7 @@
                             </div>
                         </div>
                         <div class="machine-ani-content machine-mask"></div>
-                        <div class="machine-balance-container">
+                        <div class="machine-balance-container" v-if="pointsMold">
                             <p class="my-coin-count" v-if="hasLogin">我的剑鱼币:${coinCount}</p>
                             <p class="my-coin-count" v-else @click="toLogin" class="pointer">我的剑鱼币:登录查看</p>
                             <div class="add-jianyu-coin" v-if="hasLogin">
@@ -68,10 +68,10 @@
                         </div>
 
                         <div class="machine-confirm pointer" @click="startChou" id="start-choujiang">
-                            <div class="machine-button-tip tip-right" v-if="activityConf.status === 0">${activityConf.cost}剑鱼币</div>
+                            <div class="machine-button-tip tip-right" v-if="activityConf.status === 0 && pointsMold">${activityConf.cost}剑鱼币</div>
                             <template v-else>
                                 <div class="machine-button-tip tip-left" v-if="tipInfo.countdown">开始倒数计时:${tipInfo.countdownText}</div>
-                                <div class="machine-button-tip tip-left" v-else>${tipInfo.text}</div>
+                                <div class="machine-button-tip tip-left" v-else-if="tipInfo.text">${tipInfo.text}</div>
                             </template>
                             <div class="machine-pointer" v-show="pointerShow"></div>
                         </div>

+ 6 - 3
src/web/templates/order/pc/paySuccess.html

@@ -168,7 +168,8 @@
     }
     // 根据支付订单类型 加载广告位
     // 超级订阅、数据流量包、数据导出(线上支付方式)、课程产品
-    if (orderType === 'subvip' || orderType === 'datapackage' || orderType === 'dataexport' || orderType === 'onlineCourse' || orderType === 'course') {
+    // P527新增大会员支付成功广告位
+    if (orderType === 'member' || orderType === 'subvip' || orderType === 'datapackage' || orderType === 'dataexport' || orderType === 'onlineCourse' || orderType === 'course') {
         var Activedatastring = `xxx`
 
         switch (orderType) {
@@ -187,7 +188,9 @@
             case 'course':
             Activedatastring = 'course'
                 break;
-
+            case 'member':
+            Activedatastring = 'member'
+                break;
             default:
                 break;
         }
@@ -201,7 +204,7 @@
      * @param {Array|String} active_codes_map 广告id标识符--数组集合["jy-wx-course-pay-success"]
      * @param {String} isAppsion 请求环境、app、weixin、pc
      */
-        getActive.getActiveInfo(Activedata,'pc')
+        getActive.getActiveInfo(Activedata,'pc', {{.T.orderCode}})
 
     }
 

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است