浏览代码

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

wenmenghao321 1 年之前
父节点
当前提交
46f0447014

+ 2 - 1
src/config.json

@@ -447,5 +447,6 @@
   "wxBrowserContent": ["content","bdcontent","advancedProject"],
   "hotSubjectMatter": "A4纸,安全标志,安全挡板,安全隔离网,安全网,办公耗材,办公家具,办公设备,办公椅,办公用房,办公用品,办公桌,保护装置,保密柜,笔记本,笔记本电脑,变压器,仓库,插线板,充电桩,触控一体机,传感器,打印机,打印机耗材,打印设备,档案袋,档案盒,道路工程,地铁,电池,电缆,电流互感器,电梯,电线,订书机,订书针,对讲机,多功能一体机,多媒体设备,发电机,防冻液,防护栏杆,防护门,防护棚,防雷设施,防水工程,服务器,服装,复印机,复印纸,钢板,钢结构,钢筋,工作服,工作站,公路,公用工程,固体胶,光伏,光盘,航标灯,回形针,机房空调,机柜,机油,鸡蛋,计算机,记号笔,记事本,继电器,家具,监测仪,监视器,检测报告,检测仪器,剪刀,建筑工程,交换机,交通设施,胶带,胶水,脚手架,井架,警示灯,救护车,救生设施,刻录机,空调,空气调节器,垃圾袋,垃圾桶,冷却塔,冷水机组,楼层呼唤器,路灯,绿化工程,毛巾,美工刀,门禁,密集架,灭火器,抹布,墨盒,逆变器,牛皮纸,配电箱,喷壶,起重机,汽油,桥梁,热泵机组,热水器,弱电系统,扫描仪,摄像头,生活用房,食堂,市政工程,双面胶,水电站,水桶,宿舍,碎纸机,台式机,太阳能,碳粉,天然气,投影仪,图书,土石方,拖把,挖掘机,网线,文件袋,文件柜,无人机,无线电,硒鼓,洗洁精,洗手液,洗衣粉,显示屏,橡皮,消防立管,消防器材,消防水泵,消防箱,新能源,蓄电池,液晶显示器,医疗器械,医疗设备,移动工作站,移动硬盘,预埋钢板,园林工程,纸杯,中性笔,桩基,装修工程",
   "biddingRelatesLevel": 0,
-  "ipInitAuthentication": "qwertyuiopzxcvbnm1234567890asdfghjkl"
+  "ipInitAuthentication": "qwertyuiopzxcvbnm1234567890asdfghjkl",
+  "node": 1
 }

+ 4 - 2
src/go.mod

@@ -6,8 +6,9 @@ require (
 	app.yhyue.com/moapp/jyMarketing v0.0.2-0.20230308011651-df591d32df88
 	app.yhyue.com/moapp/jybase v0.0.0-20230901064756-2fc66b18db40
 	app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545
-	app.yhyue.com/moapp/jypkg v0.0.0-20231024062045-5c364be1561d
+	app.yhyue.com/moapp/jypkg v1.0.3-0.20231031031244-d8df2b391b72
 	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.14
+	github.com/ClickHouse/clickhouse-go v1.5.4
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
 	github.com/bwmarrin/snowflake v0.3.0
 	github.com/fsnotify/fsnotify v1.6.0
@@ -31,6 +32,7 @@ require (
 	github.com/cenkalti/backoff/v4 v4.2.1 // indirect
 	github.com/cespare/xxhash/v2 v2.2.0 // indirect
 	github.com/clbanning/mxj/v2 v2.5.5 // indirect
+	github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58 // indirect
 	github.com/coreos/go-semver v0.3.1 // indirect
 	github.com/coreos/go-systemd/v22 v22.5.0 // indirect
 	github.com/davecgh/go-spew v1.1.1 // indirect
@@ -141,7 +143,7 @@ require (
 	gopkg.in/yaml.v3 v3.0.1 // indirect
 	gorm.io/driver/mysql v1.0.5 // indirect
 	gorm.io/gorm v1.21.3 // indirect
-	jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20230710093759-d9d6c68de8b1 // indirect
+	jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20231017031425-45003ca9f35a // indirect
 	k8s.io/api v0.26.3 // indirect
 	k8s.io/apimachinery v0.27.0-alpha.3 // indirect
 	k8s.io/client-go v0.26.3 // indirect

+ 8 - 4
src/go.sum

@@ -9,8 +9,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20230901064756-2fc66b18db40 h1:/FcBvpf/KW8g6GB
 app.yhyue.com/moapp/jybase v0.0.0-20230901064756-2fc66b18db40/go.mod h1:Hv9U/7oHRucqH315Tr1+d03NCvS9mOKPfk8pwwlOIwQ=
 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 v0.0.0-20231024062045-5c364be1561d h1:h8SnO8ONZlmtx8ZSYtpw36TdBhYPy8WgLeWHyMGZj0Q=
-app.yhyue.com/moapp/jypkg v0.0.0-20231024062045-5c364be1561d/go.mod h1:76Kz6+MuxcRJRyFad9W8R4AByiQlVGzuGFzklY+2m38=
+app.yhyue.com/moapp/jypkg v1.0.3-0.20231031031244-d8df2b391b72 h1:irUuaH36GK/6tz4UWDjxSseKX8GJnfy5J6F+e9fFAZY=
+app.yhyue.com/moapp/jypkg v1.0.3-0.20231031031244-d8df2b391b72/go.mod h1:76Kz6+MuxcRJRyFad9W8R4AByiQlVGzuGFzklY+2m38=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae h1:6rDDaz6yxvE8viTSzEBwKYOFWq14TMfuBivSazUZMz4=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae/go.mod h1:b0zZHev3gmJao1Fo+2Z2KPVjsuLOJVvVxf+kCnu9WkA=
 bp.jydev.jianyu360.cn/BaseService/entManageApplication v0.0.0-20230214091519-89a98c01ab0e h1:h+VEI3o1qC0jeCzkFGTrLI4f27cfa/W/y+0sXokWMgE=
@@ -74,6 +74,7 @@ github.com/BurntSushi/toml v1.1.0 h1:ksErzDEI1khOiGPgpwuI7x2ebx/uXQNw7xJpn9Eq1+I
 github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
 github.com/ClickHouse/clickhouse-go v1.4.3/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI=
+github.com/ClickHouse/clickhouse-go v1.5.4 h1:cKjXeYLNWVJIx2J1K6H2CqyRmfwVJVY1OV1coaaFcI0=
 github.com/ClickHouse/clickhouse-go v1.5.4/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI=
 github.com/ClickHouse/clickhouse-go/v2 v2.2.0/go.mod h1:8f2XZUi7XoeU+uPIytSi1cvx8fmJxi7vIgqpvYTF1+o=
 github.com/DATA-DOG/go-sqlmock v1.4.1/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
@@ -119,6 +120,7 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r
 github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
 github.com/bits-and-blooms/bitset v1.2.0 h1:Kn4yilvwNtMACtf1eYDlG8H77R07mZSPbMjLyS07ChA=
 github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA=
+github.com/bkaradzic/go-lz4 v1.0.0 h1:RXc4wYsyz985CkXXeX04y4VnZFGG8Rd43pRaHsOXAKk=
 github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4=
 github.com/boj/redistore v0.0.0-20180917114910-cd5dcc76aeff/go.mod h1:+RTT1BOk5P97fT2CiHkbFQwkK3mjsFAP6zCYV2aXtjw=
 github.com/bos-hieu/mongostore v0.0.2/go.mod h1:8AbbVmDEb0yqJsBrWxZIAZOxIfv/tsP8CDtdHduZHGg=
@@ -140,6 +142,7 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn
 github.com/clbanning/mxj/v2 v2.5.5 h1:oT81vUeEiQQ/DcHbzSytRngP6Ky9O+L+0Bw0zSJag9E=
 github.com/clbanning/mxj/v2 v2.5.5/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
 github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58 h1:F1EaeKL/ta07PY/k9Os/UFtwERei2/XzGemhpGnBKNg=
 github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80=
 github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
 github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
@@ -669,6 +672,7 @@ github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNc
 github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
 github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
 github.com/pierrec/lz4 v2.5.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
+github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM=
 github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
 github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
 github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -1432,8 +1436,8 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
 honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
 honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
-jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20230710093759-d9d6c68de8b1 h1:BItxi1gkQUs3sjxaBk6tc34fZWSO4hUSXcTM3PcnY4I=
-jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20230710093759-d9d6c68de8b1/go.mod h1:p/595fgbj4r6GhSJhHDpx3Ru1NkD5UASFL8OuIQw09E=
+jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20231017031425-45003ca9f35a h1:kwjO4pqB3gnNGrQ9aXyz6f8s9qXAUenPUDWip8gYR/Q=
+jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20231017031425-45003ca9f35a/go.mod h1:p/595fgbj4r6GhSJhHDpx3Ru1NkD5UASFL8OuIQw09E=
 k8s.io/api v0.22.9/go.mod h1:rcjO/FPOuvc3x7nQWx29UcDrFJMx82RxDob71ntNH4A=
 k8s.io/api v0.26.3 h1:emf74GIQMTik01Aum9dPP0gAypL8JTLl/lHa4V9RFSU=
 k8s.io/api v0.26.3/go.mod h1:PXsqwPMXBSBcL1lJ9CYDKy7kIReUydukS5JiRlxC3qE=

+ 15 - 0
src/jfw/config/config.go

@@ -6,7 +6,9 @@ import (
 	"app.yhyue.com/moapp/jybase/mail"
 	"app.yhyue.com/moapp/jypkg/middleground"
 	"app.yhyue.com/moapp/jypkg/public"
+	"database/sql"
 	"fmt"
+	_ "github.com/ClickHouse/clickhouse-go"
 	"github.com/gogf/gf/v2/frame/g"
 	"github.com/gogf/gf/v2/os/gcfg"
 	"github.com/gogf/gf/v2/os/gctx"
@@ -30,6 +32,7 @@ var (
 	HotBuyerConfig       HotConfig
 	IpList               *ipmatch.WhiteIp
 	IpInitLock           sync.RWMutex //锁
+	ClickhouseDb         *sql.DB
 )
 
 type HotConfig struct {
@@ -47,6 +50,7 @@ func init() {
 	g.Cfg().GetAdapter().(*gcfg.AdapterFile).SetFileName("config.yaml")
 	util.ReadConfig(&Sysconfig)
 	IpInit()
+	//ClickhouseInit()
 	//log.Println("sysconfig:", Sysconfig)
 	WeixinConfig, _ = Sysconfig["wxJianyu"].(map[string]interface{})
 	Wxoauth = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=` + util.ObjToString(WeixinConfig["appid"]) + `&redirect_uri=%s&response_type=code&scope=snsapi_base&state=%s#wechat_redirect`
@@ -198,3 +202,14 @@ func convertToPinyin(word string) string {
 	}
 	return pinyinStr
 }
+
+func ClickhouseInit() *sql.DB {
+
+	// 创建ClickHouse连接
+	connect, err := sql.Open("clickhouse", util.InterfaceToStr(Seoconfig["clickhouseUrl"]))
+	if err != nil {
+		fmt.Println("连接失败:", err)
+		return nil
+	}
+	return connect
+}

+ 26 - 5
src/jfw/filter/anonymousUser.go

@@ -15,6 +15,7 @@ import (
 	"fmt"
 	"github.com/bwmarrin/snowflake"
 	"io/ioutil"
+	"jy/src/jfw/config"
 	"log"
 	"net/http"
 	"strings"
@@ -30,7 +31,7 @@ type AnonymousAuth struct {
 }
 
 var (
-	node, _ = snowflake.NewNode(1)
+	Node *snowflake.Node
 )
 
 func initPrivatePublicKey() {
@@ -105,12 +106,14 @@ func (sk *AnonymousAuth) Do() {
 			if sk.R.Method != "GET" || !strings.Contains(accept, "text/html") { //避免多请求
 				return
 			}
-			guestUID := node.Generate()
+			guestUID := Node.Generate()
 			cookie := &http.Cookie{
 				Name:     "JYGuestUID",
 				Value:    util.InterfaceToStr(guestUID),
 				Path:     "/",
 				HttpOnly: true,
+				Domain:   util.ObjToString(config.Sysconfig["cookiedomain"]),
+				Expires:  time.Now().AddDate(10, 0, 0),
 			}
 			http.SetCookie(sk.W, cookie)
 			//未登录用户增加匿名身份信息
@@ -130,6 +133,15 @@ func (sk *AnonymousAuth) Do() {
 				"creation_time": time.Now().Unix(),
 			}
 			public.BaseMysql.Insert("anonymous_identity", data)
+			//stmt, err := config.ClickhouseDb.Prepare("INSERT INTO anonymous_identity (ip, client, os, browse, url, guestUID, mdescribe, refer, method, creation_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")
+			//if err != nil {
+			//	return
+			//}
+			//defer stmt.Close()
+			//_, err = stmt.Exec(util.GetIp(sk.R), agent, util.GetOS(agent), util.GetBrowse(agent), sk.R.RequestURI, util.InterfaceToStr(guestUID), str, sk.R.Referer(), sk.R.Method, time.Now().Unix())
+			//if err != nil {
+			//	return
+			//}
 			return
 		}
 
@@ -140,17 +152,14 @@ func (sk *AnonymousAuth) Do() {
 		}
 		eid, err := sk.R.Cookie("eid")
 		if err != nil {
-			//log.Println("匿名用户获取eid失败", err.Error())
 			return
 		}
 		if fid.Value != "" && eid.Value != "" {
 			eData, err1 := Decryption(eid.Value)
 			if err1 != nil {
-				//log.Printf("匿名用户eid:%s,fid:%s 解密失败err:%s", eid.Value, fid.Value, err1.Error())
 				return
 			}
 			if fid.Value != eData {
-				//log.Printf("匿名用户身份验证不通过,eid:%s,fid:%s,eData:%s", eid.Value, fid.Value, eData)
 				return
 			}
 			trustedId := encrypt.SE.EncodeString(fid.Value + "***" + jyGuestUID.Value)
@@ -159,10 +168,22 @@ func (sk *AnonymousAuth) Do() {
 				Value:    trustedId,
 				Path:     "/",
 				HttpOnly: true,
+				Domain:   util.ObjToString(config.Sysconfig["cookiedomain"]),
+				Expires:  time.Now().AddDate(10, 0, 0),
 			}
 			http.SetCookie(sk.W, cookie)
 			public.BaseMysql.Update("anonymous_identity", map[string]interface{}{"guestUID": jyGuestUID.Value},
 				map[string]interface{}{"fid": fid.Value, "trustedId": trustedId})
+			//stmt, err := config.ClickhouseDb.Prepare("UPDATE anonymous_identity SET fid = ? and trustedId = ? WHERE guestUID = ?")
+			//if err != nil {
+			//	fmt.Println("Failed to prepare statement:", err)
+			//	return
+			//}
+			//defer stmt.Close()
+			//_, err = stmt.Exec(fid.Value, trustedId, jyGuestUID.Value)
+			//if err != nil {
+			//	return
+			//}
 		} else {
 			log.Println("无身份验证信息")
 		}

+ 2 - 1
src/jfw/filter/filter.go

@@ -2,6 +2,7 @@ package filter
 
 import (
 	"crypto/rsa"
+	"github.com/bwmarrin/snowflake"
 	. "jy/src/jfw/config"
 	"jy/src/jfw/jyutil"
 	"net/http"
@@ -27,7 +28,7 @@ var (
 func init() {
 	xweb.AddFilter(&Filter{})
 	go initPrivatePublicKey()
-
+	Node, _ = snowflake.NewNode(util.Int64All(Seoconfig["node"]))
 	//日志过滤 路由集合
 	go fs.FSNotifyFUNC("sword->%s", "./route.json", true, func() {
 		util.ReadConfig("./route.json", &RouteConf)

+ 43 - 8
src/jfw/front/dataExport.go

@@ -32,14 +32,16 @@ type DataExport struct {
 	toOrderDetail xweb.Mapper `xweb:"/front/dataExport/toOrderDetail/(.*)"`  //订单详情
 	getOrderCode  xweb.Mapper `xweb:"/front/dataExport/getOrderCode/(\\w+)"` //申请发票获取订单编号
 
-	superSearchExport xweb.Mapper `xweb:"/front/dataExport/superSearchExport"`      //数据导出-超级搜索
-	toCreateOrderPage xweb.Mapper `xweb:"/front/dataExport/toCreateOrderPage/(.*)"` //数据导出-订单页面
-	previewData       xweb.Mapper `xweb:"/front/(.*)/previewData/(.*)"`             //数据导出-数据预览
-	sendMailVerify    xweb.Mapper `xweb:"/front/dataExport/sendMailVerify"`         //发送邮箱验证码
-	checkMailVerify   xweb.Mapper `xweb:"/front/dataExport/checkMailVerify"`        //验证邮箱验证码
-	paysuccess        xweb.Mapper `xweb:"/front/dataExport/paysuccess"`             //支付成功页面
-	checkPhoneVerify  xweb.Mapper `xweb:"/front/dataExport/checkPhoneVerify"`       //验证手机号
-	fontSet           xweb.Mapper `xweb:"/front/dataExport/fontSet/(.*)"`
+	superSearchExport  xweb.Mapper `xweb:"/front/dataExport/superSearchExport"`      //数据导出-超级搜索
+	toCreateOrderPage  xweb.Mapper `xweb:"/front/dataExport/toCreateOrderPage/(.*)"` //数据导出-订单页面
+	previewData        xweb.Mapper `xweb:"/front/(.*)/previewData/(.*)"`             //数据导出-数据预览
+	sendMailVerify     xweb.Mapper `xweb:"/front/dataExport/sendMailVerify"`         //发送邮箱验证码
+	checkMailVerify    xweb.Mapper `xweb:"/front/dataExport/checkMailVerify"`        //验证邮箱验证码
+	paysuccess         xweb.Mapper `xweb:"/front/dataExport/paysuccess"`             //支付成功页面
+	checkPhoneVerify   xweb.Mapper `xweb:"/front/dataExport/checkPhoneVerify"`       //验证手机号
+	fontSet            xweb.Mapper `xweb:"/front/dataExport/fontSet/(.*)"`
+	setDontPromptAgain xweb.Mapper `xweb:"/front/dataExport/setDontPromptAgain"` //数据导出-超出2w条,不再提示
+	getDontPromptAgain xweb.Mapper `xweb:"/front/dataExport/getDontPromptAgain"` //数据导出-超出2w条,不再提示
 
 	cancelOrder          xweb.Mapper `xweb:"/front/dataExport/cancelOrder"`              //取消订单
 	vipOrderDetail       xweb.Mapper `xweb:"/front/vipOrder/vipOrderDetail"`             //vip订单详情
@@ -833,6 +835,39 @@ func (d *DataExport) ValuationList(order_code string) error {
 	return d.Render("/_error.html")
 }
 
+func (d *DataExport) SetDontPromptAgain() {
+	status := d.GetString("status") //0 提示  1 不再提示
+	userId := d.GetSession("userId").(string)
+	boo := public.MQFW.UpdateById("user", userId, map[string]interface{}{
+		"$set": map[string]interface{}{
+			"i_export_promptAgain": status,
+		},
+	})
+	d.ServeJson(map[string]interface{}{
+		"error_code": 0,
+		"error_msg":  "",
+		"success":    boo,
+	})
+	return
+}
+
+func (d *DataExport) GetDontPromptAgain() {
+	isPrompt := true
+	userId := d.GetSession("userId").(string)
+	user, ok := public.MQFW.FindById("user", userId, `"i_export_promptAgain":1`)
+	if ok && user != nil {
+		if (*user)["_id"] == nil || util.IntAll((*user)["i_export_promptAgain"]) == 1 {
+			isPrompt = false
+		}
+	}
+	d.ServeJson(map[string]interface{}{
+		"error_code": 0,
+		"error_msg":  "",
+		"isPrompt":   isPrompt,
+	})
+	return
+}
+
 //
 //func (d *DataExport) EntDataExport(_id string) error {
 //	id := util.se.Decode4Hex(_id)

+ 18 - 0
src/jfw/front/login.go

@@ -400,6 +400,24 @@ func anonymousLogin(session *httpsession.Session, trustedId string) {
 
 	//匿名用户登录后创建关联信息
 	public.BaseMysql.Insert("anonymous_association", queryData)
+
+	//var count int
+	//err := config.ClickhouseDb.QueryRow(fmt.Sprintf(`SELECT count(*) FROM anonymous_association where positionId = %v and mgoUserId = "%v" and trustedId = "%v"`, positionId, mgoUserId, trustedId)).Scan(&count)
+	//if err != nil {
+	//	return
+	//}
+	////queryData := map[string]interface{}{"positionId": positionId, "mgoUserId": mgoUserId, "trustedId": trustedId, "creation_time": time.Now().Unix()}
+	//if count > 0 {
+	//	stmt, err := config.ClickhouseDb.Prepare("INSERT INTO anonymous_identity (positionId, mgoUserId, trustedId, creation_time) VALUES (?, ?, ?, ?)")
+	//	if err != nil {
+	//		return
+	//	}
+	//	defer stmt.Close()
+	//	_, err = stmt.Exec(positionId, mgoUserId, trustedId, time.Now().Unix())
+	//	if err != nil {
+	//		return
+	//	}
+	//}
 }
 
 func afterLogin(phone string, session *httpsession.Session, fool bool) (bool, *map[string]interface{}, map[string]interface{}) {

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

@@ -91,10 +91,20 @@ func (m *PcIndex) NewSordfish(flag string) error {
 	m.T["shareid"] = se.EncodeString(shareid)
 	m.T["activestart"] = config.ActiveConfig.DoubleEleven.Active_Start
 	m.T["activeend"] = config.ActiveConfig.DoubleEleven.Active_End
+	m.T["userCard"] = "f"
 	regex, _ := regexp.Compile("(Android|Mobile)")
 	var isLogin bool
 	if util.ObjToString(m.GetSession("userId")) != "" {
 		isLogin = true
+		userPower := jy.GetBigVipUserBaseMsg(m.Session(), *config.Middleground)
+		switch {
+		case userPower.Status > 0:
+			m.T["userCard"] = "m"
+		case userPower.VipStatus > 0:
+			m.T["userCard"] = "v"
+		case userPower.EntnicheStatus > 0:
+			m.T["userCard"] = "e"
+		}
 	}
 	if ispc == 0 && len(regex.FindAllString(m.Header("User-Agent"), -1)) > 0 {
 		m.T["s_m_openid"] = util.ObjToString(m.GetSession("s_m_openid"))

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

@@ -5,7 +5,7 @@ go 1.18
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20230901064756-2fc66b18db40
 	app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545
-	app.yhyue.com/moapp/jypkg v0.0.0-20230925120741-9e02619bfe25
+	app.yhyue.com/moapp/jypkg v1.0.3-0.20231031031244-d8df2b391b72
 	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.14
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
 	github.com/gogf/gf/v2 v2.3.1
@@ -139,7 +139,7 @@ require (
 	gopkg.in/yaml.v3 v3.0.1 // indirect
 	gorm.io/driver/mysql v1.0.5 // indirect
 	gorm.io/gorm v1.21.3 // indirect
-	jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20230710093759-d9d6c68de8b1 // indirect
+	jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20231017031425-45003ca9f35a // indirect
 	k8s.io/api v0.26.3 // indirect
 	k8s.io/apimachinery v0.27.0-alpha.3 // indirect
 	k8s.io/client-go v0.26.3 // indirect

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

@@ -9,8 +9,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20230901064756-2fc66b18db40 h1:/FcBvpf/KW8g6GB
 app.yhyue.com/moapp/jybase v0.0.0-20230901064756-2fc66b18db40/go.mod h1:Hv9U/7oHRucqH315Tr1+d03NCvS9mOKPfk8pwwlOIwQ=
 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 v0.0.0-20230925120741-9e02619bfe25 h1:2q7b1auPihIJD3Ewsd7Zi8ESeLkxuP57avWL8UoBr9U=
-app.yhyue.com/moapp/jypkg v0.0.0-20230925120741-9e02619bfe25/go.mod h1:gPCOY8bVXdY5bD7nry7th+YNkKC/viG8Dc9+z4fUaRo=
+app.yhyue.com/moapp/jypkg v1.0.3-0.20231031031244-d8df2b391b72 h1:irUuaH36GK/6tz4UWDjxSseKX8GJnfy5J6F+e9fFAZY=
+app.yhyue.com/moapp/jypkg v1.0.3-0.20231031031244-d8df2b391b72/go.mod h1:76Kz6+MuxcRJRyFad9W8R4AByiQlVGzuGFzklY+2m38=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae h1:6rDDaz6yxvE8viTSzEBwKYOFWq14TMfuBivSazUZMz4=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae/go.mod h1:b0zZHev3gmJao1Fo+2Z2KPVjsuLOJVvVxf+kCnu9WkA=
 bp.jydev.jianyu360.cn/BaseService/entManageApplication v0.0.0-20230214091519-89a98c01ab0e h1:h+VEI3o1qC0jeCzkFGTrLI4f27cfa/W/y+0sXokWMgE=
@@ -1429,8 +1429,8 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
 honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
 honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
-jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20230710093759-d9d6c68de8b1 h1:BItxi1gkQUs3sjxaBk6tc34fZWSO4hUSXcTM3PcnY4I=
-jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20230710093759-d9d6c68de8b1/go.mod h1:p/595fgbj4r6GhSJhHDpx3Ru1NkD5UASFL8OuIQw09E=
+jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20231017031425-45003ca9f35a h1:kwjO4pqB3gnNGrQ9aXyz6f8s9qXAUenPUDWip8gYR/Q=
+jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20231017031425-45003ca9f35a/go.mod h1:p/595fgbj4r6GhSJhHDpx3Ru1NkD5UASFL8OuIQw09E=
 k8s.io/api v0.22.9/go.mod h1:rcjO/FPOuvc3x7nQWx29UcDrFJMx82RxDob71ntNH4A=
 k8s.io/api v0.26.3 h1:emf74GIQMTik01Aum9dPP0gAypL8JTLl/lHa4V9RFSU=
 k8s.io/api v0.26.3/go.mod h1:PXsqwPMXBSBcL1lJ9CYDKy7kIReUydukS5JiRlxC3qE=

文件差异内容过多而无法显示
+ 48 - 46
src/jfw/modules/subscribepay/src/dataexport.json


+ 1 - 1
src/jfw/modules/subscribepay/src/entity/dataExportPackStruct.go

@@ -392,7 +392,7 @@ func (this *dataExportPackStruct) DoPerPackRepeatCheck(userId string, isSenior b
 // GetExcelFile 数据包生成excel文件
 func GetExcelFile(selectId string, checkCount int, isSenior bool, success func(excelPath string, exportIds []string), fail func(error)) {
 	list, err := dataexport.GetDataExportSearchResultByScdId(util.MQFW, util.Mgo_bidding, config.Config.Mongobidding.DbName, config.Config.Elasticsearch, selectId, qutil.If(isSenior, "2", "1").(string), checkCount)
-	url := util.GetExcelFilePath(pay.GetOrderCode(selectId))
+	url := util.GetExcelFilePath(pay.GetOrderCode(selectId), checkCount)
 	if err == nil && list != nil && len(*list) > 0 {
 		list = dataexport.FormatExportData(util.MQFWENT, list, config.Config.WebDomain, "2")
 		err = util.CreateDataExportExcelFile(list, isSenior, config.ExConf.ExcelPayedPath+url) //创建excel文件

+ 5 - 2
src/jfw/modules/subscribepay/src/entity/dataexport.go

@@ -6,6 +6,7 @@ import (
 	"fmt"
 	"io/ioutil"
 	"jy/src/jfw/modules/subscribepay/src/config"
+	"jy/src/jfw/modules/subscribepay/src/pay"
 	"jy/src/jfw/modules/subscribepay/src/util"
 	"log"
 	"os"
@@ -83,9 +84,11 @@ func (d *dataExportStruct) PayCallBack(param *CallBackParam) bool {
 				"out_trade_no": param.OutTradeno,
 			}
 			orderCode := qutil.ObjToString((*orderdata)["order_code"])
+			dataCount := qutil.IntAll((*orderdata)["data_count"])
+
 			download_url := qutil.ObjToString((*orderdata)["download_url"])
 			if download_url == "" { //若未生成execl
-				download_url = util.GetExcelFilePath(orderCode)
+				download_url = util.GetExcelFilePath(orderCode, dataCount)
 				updateMap["download_url"] = download_url
 			}
 
@@ -95,7 +98,7 @@ func (d *dataExportStruct) PayCallBack(param *CallBackParam) bool {
 			if update {
 				//先发个通知
 				go SendMailToBJFinance(orderdata, pay_time, param.TransactionId, 1, config.GmailAuth)
-
+				go pay.CheckSave(userId, qutil.InterfaceToStr((*orderdata)["filter_id"])) //数据导出成功保存筛选条件
 				//发送邮件移至定时任务
 				//go SendMailToPayUser(orderdata, float64(param.CashFee)/100, pay_time, download_url, config.GmailAuth)
 

+ 32 - 27
src/jfw/modules/subscribepay/src/entity/order.go

@@ -25,7 +25,7 @@ import (
 	"github.com/shopspring/decimal"
 )
 
-//资源包
+// 资源包
 type commonOrderStruct struct {
 }
 
@@ -88,15 +88,18 @@ func (this *commonOrderStruct) RequestCheck(product string, m map[string]interfa
 }
 
 /*
-	param
-		product:产品类型
-		m:订单需要的参数
-		lotteryId, discountId:优惠券相关
-		sess:session
-		activityType 活动类型 0满减、1折扣券、2满赠、3促销、4限时折扣、5限时减免  0、1才有券 2以后没券(虚假的券)
-	return
-		insertMap:创建订单的参数
-		msg:错误信息
+param
+
+	product:产品类型
+	m:订单需要的参数
+	lotteryId, discountId:优惠券相关
+	sess:session
+	activityType 活动类型 0满减、1折扣券、2满赠、3促销、4限时折扣、5限时减免  0、1才有券 2以后没券(虚假的券)
+
+return
+
+	insertMap:创建订单的参数
+	msg:错误信息
 */
 func (this *commonOrderStruct) InserMap(product, productId, userid, lotteryId, discountId string, m map[string]interface{}, session *httpsession.Session, activityType int) (orderinfo *OrderInfo, msg string) {
 	switch product {
@@ -240,7 +243,7 @@ func dataExportCheck(m map[string]interface{}, sess *httpsession.Session) string
 	return ""
 }
 
-//历史数据
+// 历史数据
 func dataExportOrder(m map[string]interface{}, userId string) (*OrderInfo, string) {
 	id := encrypt.SE.Decode4Hex(qu.ObjToString(m["id"]))
 	if id == "" {
@@ -309,7 +312,7 @@ func dataExportOrder(m map[string]interface{}, userId string) (*OrderInfo, strin
 	}
 
 	ordercode := pay.GetOrderCode(userId)
-	download_url := util.GetExcelFilePath(ordercode)
+	download_url := util.GetExcelFilePath(ordercode, data_count)
 	go func() {
 		list, err := dataexport.GetDataExportSearchResultByScdId(util.MQFW, util.Mgo_bidding, config.Config.Mongobidding.DbName, config.Config.Elasticsearch, id, qu.If(data_spec == "高级字段包", "2", "1").(string), data_count)
 		if err == nil && list != nil && len(*list) > 0 {
@@ -359,7 +362,7 @@ func (this *commonOrderStruct) DataExportPhoneAndMailCheck(sess *httpsession.Ses
 	return
 }
 
-//商机管理
+// 商机管理
 func entnicheOrder(m map[string]interface{}, userId string) (*OrderInfo, string) {
 	if phone, _ := util.GetMyPhoneAndName(userId); phone == "" {
 		return nil, "未绑定手机号"
@@ -446,7 +449,7 @@ var EntnichePirce entnichePrice
 
 type entnichePrice struct{}
 
-//商机管理计算价格
+// 商机管理计算价格
 func (this *entnichePrice) GetOrderMoney(userId string, personnum, cycle int) int {
 	if personnum < 5 || cycle < 1 {
 		log.Println(userId, "商机管理订单personnum、cycle参数不合法", personnum, cycle)
@@ -478,7 +481,7 @@ func (this *entnichePrice) GetOrderMoney(userId string, personnum, cycle int) in
 	return order_money
 }
 
-//获取解密后的企业id
+// 获取解密后的企业id
 func DecodeEntId(encodeId string) int {
 	encodeId = strings.TrimSpace(encodeId)
 	if encodeId == "" {
@@ -495,7 +498,7 @@ func DecodeEntId(encodeId string) int {
 	return id
 }
 
-//超级订阅
+// 超级订阅
 func vipOrder(m map[string]interface{}, userId string, session *httpsession.Session) (*OrderInfo, string) {
 	types := qu.ObjToString(m["type"])
 	switch types {
@@ -509,7 +512,7 @@ func vipOrder(m map[string]interface{}, userId string, session *httpsession.Sess
 	return nil, "未知类型"
 }
 
-//超级订阅首次购买
+// 超级订阅首次购买
 func vipFirstBuy(m map[string]interface{}, userId string, session *httpsession.Session) (*OrderInfo, string) {
 	//area := qu.ObjToMap(m["area"])          //地区  p195不再选择地区 只选择数量
 	areaCount := qu.IntAll(m["areaCount"]) //地区
@@ -629,7 +632,7 @@ func vipFirstBuy(m map[string]interface{}, userId string, session *httpsession.S
 	}, ""
 }
 
-//超级订阅续费
+// 超级订阅续费
 func vipRenew(m map[string]interface{}, userId string, session *httpsession.Session) (*OrderInfo, string) {
 	disWord := qu.ObjToString(m["disWord"])
 	// req_price := qu.IntAll(m["price"])
@@ -725,7 +728,7 @@ func vipRenew(m map[string]interface{}, userId string, session *httpsession.Sess
 	}, ""
 }
 
-//超级订阅升级
+// 超级订阅升级
 func vipUpgrade(m map[string]interface{}, userId string, session *httpsession.Session) (*OrderInfo, string) {
 	areaCount := qu.IntAll(m["areaCount"]) //地区
 	//area := qu.ObjToMap(m["area"])                  //地区  p195不再选择地区 只选数量
@@ -879,7 +882,7 @@ func vipUpgrade(m map[string]interface{}, userId string, session *httpsession.Se
 	return orderinfo, ""
 }
 
-//大会员
+// 大会员
 func memberOrder(m map[string]interface{}, userId string, session *httpsession.Session) (*OrderInfo, string) {
 	//校验是否有转账待审核订单
 	num := util.Mysql.Count("dataexport_order", map[string]interface{}{
@@ -930,7 +933,7 @@ func memberOrder(m map[string]interface{}, userId string, session *httpsession.S
 	}, ""
 }
 
-//剑鱼币
+// 剑鱼币
 func integralOrder(m map[string]interface{}, userId string) (*OrderInfo, string) {
 	//参数验证 price:价格(已折扣);score:购买积分
 	price := qu.IntAll(m["price"])
@@ -968,7 +971,7 @@ func integralOrder(m map[string]interface{}, userId string) (*OrderInfo, string)
 	}, ""
 }
 
-//数据流量包
+// 数据流量包
 func dataexportPackOrder(m map[string]interface{}, userId string) (*OrderInfo, string) {
 	packId := qu.ObjToString(m["packId"])
 	// 获取用户分销口令
@@ -1015,7 +1018,7 @@ func dataexportPackOrder(m map[string]interface{}, userId string) (*OrderInfo, s
 	}, ""
 }
 
-//省份订阅包
+// 省份订阅包
 func areaPackOrder(m map[string]interface{}, userId string, session *httpsession.Session) (*OrderInfo, string) {
 	orderType := qu.IntAll(m["orderType"])
 	area := qu.ObjToMap(m["area"])
@@ -1108,7 +1111,7 @@ func areaPackOrder(m map[string]interface{}, userId string, session *httpsession
 	return orderinfo, ""
 }
 
-//附件下载包
+// 附件下载包
 func filePackOrder(m map[string]interface{}, userId string, session *httpsession.Session) (*OrderInfo, string) {
 	data := jy.GetBigVipUserBaseMsg(session, *config.Middleground)
 	if data.VipStatus <= 0 {
@@ -1156,7 +1159,9 @@ func filePackOrder(m map[string]interface{}, userId string, session *httpsession
 	useProduct :产品类型
 	useProductType:商品类型 0普通的 1线上课程
 	discountId:活动赠品对应标识
+
 return:
+
 	timeNum:赠送数量
 	查看赠品
 */
@@ -1182,7 +1187,7 @@ func GiveInfo(userid string, useProduct, useProductType, discountId int) []map[s
 	return nil
 }
 
-//采购单位画像包 -超级订阅升级版用户可以购买使用
+// 采购单位画像包 -超级订阅升级版用户可以购买使用
 func buyerPortraitPackOrder(m map[string]interface{}, userId string, session *httpsession.Session) (*OrderInfo, string) {
 	uData := jy.GetBigVipUserBaseMsg(session, *config.Middleground)
 	if uData.VipStatus <= 0 || uData.Vip_BuySet.Upgrade <= 0 {
@@ -1224,7 +1229,7 @@ func buyerPortraitPackOrder(m map[string]interface{}, userId string, session *ht
 	}, ""
 }
 
-//数据报告
+// 数据报告
 func newDataReportOrder(m map[string]interface{}, userId string) (*OrderInfo, string) {
 	reportId := qu.IntAll(m["reportId"]) //报告id
 	email := qu.ObjToString(m["email"])
@@ -1285,7 +1290,7 @@ func newDataReportOrder(m map[string]interface{}, userId string) (*OrderInfo, st
 	}, ""
 }
 
-//中标必听课
+// 中标必听课
 func courseOnlineOrder(m map[string]interface{}, userId string) (*OrderInfo, string) {
 	pay_way := "wx_app"
 	_id := qu.ObjToString(m["courseId"])

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

@@ -5,7 +5,7 @@ go 1.18
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20230718012114-37013054344b
 	app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545
-	app.yhyue.com/moapp/jypkg v0.0.0-20230925120741-9e02619bfe25
+	app.yhyue.com/moapp/jypkg v1.0.3-0.20231031031244-d8df2b391b72
 	bp.jydev.jianyu360.cn/BaseService/pushpkg v0.0.0-20230225061813-384daf716c9d
 	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.14
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
@@ -14,6 +14,7 @@ require (
 	github.com/tealeg/xlsx v1.0.5
 	go.mongodb.org/mongo-driver v1.11.6
 	gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
+	k8s.io/apimachinery v0.27.0-alpha.3
 )
 
 require (
@@ -137,9 +138,8 @@ require (
 	gopkg.in/yaml.v3 v3.0.1 // indirect
 	gorm.io/driver/mysql v1.0.5 // indirect
 	gorm.io/gorm v1.21.3 // indirect
-	jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20230710093759-d9d6c68de8b1 // indirect
+	jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20231017031425-45003ca9f35a // indirect
 	k8s.io/api v0.26.3 // indirect
-	k8s.io/apimachinery v0.27.0-alpha.3 // indirect
 	k8s.io/client-go v0.26.3 // indirect
 	k8s.io/klog/v2 v2.90.1 // indirect
 	k8s.io/kube-openapi v0.0.0-20230307230338-69ee2d25a840 // indirect

+ 4 - 4
src/jfw/modules/subscribepay/src/go.sum

@@ -9,8 +9,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20230718012114-37013054344b h1:Wtytm2QqQWtBV+s
 app.yhyue.com/moapp/jybase v0.0.0-20230718012114-37013054344b/go.mod h1:D40Ae0rQilH8Hc5o2Vtt04Tjh/DNEFpcS3/WkJMPJb8=
 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 v0.0.0-20230925120741-9e02619bfe25 h1:2q7b1auPihIJD3Ewsd7Zi8ESeLkxuP57avWL8UoBr9U=
-app.yhyue.com/moapp/jypkg v0.0.0-20230925120741-9e02619bfe25/go.mod h1:gPCOY8bVXdY5bD7nry7th+YNkKC/viG8Dc9+z4fUaRo=
+app.yhyue.com/moapp/jypkg v1.0.3-0.20231031031244-d8df2b391b72 h1:irUuaH36GK/6tz4UWDjxSseKX8GJnfy5J6F+e9fFAZY=
+app.yhyue.com/moapp/jypkg v1.0.3-0.20231031031244-d8df2b391b72/go.mod h1:76Kz6+MuxcRJRyFad9W8R4AByiQlVGzuGFzklY+2m38=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae h1:6rDDaz6yxvE8viTSzEBwKYOFWq14TMfuBivSazUZMz4=
 app.yhyue.com/moapp/message v0.0.0-20221223100203-6402e389d9ae/go.mod h1:b0zZHev3gmJao1Fo+2Z2KPVjsuLOJVvVxf+kCnu9WkA=
 bp.jydev.jianyu360.cn/BaseService/entManageApplication v0.0.0-20230214091519-89a98c01ab0e h1:h+VEI3o1qC0jeCzkFGTrLI4f27cfa/W/y+0sXokWMgE=
@@ -1423,8 +1423,8 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
 honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
 honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
-jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20230710093759-d9d6c68de8b1 h1:BItxi1gkQUs3sjxaBk6tc34fZWSO4hUSXcTM3PcnY4I=
-jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20230710093759-d9d6c68de8b1/go.mod h1:p/595fgbj4r6GhSJhHDpx3Ru1NkD5UASFL8OuIQw09E=
+jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20231017031425-45003ca9f35a h1:kwjO4pqB3gnNGrQ9aXyz6f8s9qXAUenPUDWip8gYR/Q=
+jygit.jydev.jianyu360.cn/ApplicationCenter/publicService v0.0.0-20231017031425-45003ca9f35a/go.mod h1:p/595fgbj4r6GhSJhHDpx3Ru1NkD5UASFL8OuIQw09E=
 k8s.io/api v0.22.9/go.mod h1:rcjO/FPOuvc3x7nQWx29UcDrFJMx82RxDob71ntNH4A=
 k8s.io/api v0.26.3 h1:emf74GIQMTik01Aum9dPP0gAypL8JTLl/lHa4V9RFSU=
 k8s.io/api v0.26.3/go.mod h1:PXsqwPMXBSBcL1lJ9CYDKy7kIReUydukS5JiRlxC3qE=

+ 117 - 0
src/jfw/modules/subscribepay/src/pay/derivedCondition.go

@@ -0,0 +1,117 @@
+package pay
+
+import (
+	util "app.yhyue.com/moapp/jybase/common"
+	"go.mongodb.org/mongo-driver/bson/primitive"
+	qutil "jy/src/jfw/modules/subscribepay/src/util"
+	"k8s.io/apimachinery/pkg/util/json"
+	"sort"
+	"strings"
+	"time"
+)
+
+func CheckSave(userid, filterId string) {
+	if filterId == "" || userid == "" {
+		return
+	}
+	id, _ := primitive.ObjectIDFromHex(filterId)
+	dataMap, ok := qutil.MQFW.FindOne("export_search", map[string]interface{}{
+		"s_userid":   userid,
+		"_id":        id,
+		"comeinfrom": "exportPage",
+	})
+	if !ok || dataMap == nil || len(*dataMap) == 0 {
+		return
+	}
+	data := make(map[string]interface{})
+	query := map[string]interface{}{
+		"user_id": userid,
+	}
+	area, _ := (*dataMap)["area"].([]interface{})
+	data["area"] = ArrSort(area)
+	city, _ := (*dataMap)["city"].([]interface{})
+	data["city"] = ArrSort(city)
+	region, _ := (*dataMap)["region"].([]interface{})
+	data["region"] = ArrSort(region)
+	industry, _ := (*dataMap)["industry"].([]interface{})
+	data["industry"] = ArrSort(industry)
+	buyerclass, _ := (*dataMap)["buyerclass"].([]interface{})
+	data["buyerclass"] = ArrSort(buyerclass)
+	buyer, _ := (*dataMap)["buyer"].([]interface{})
+	data["buyer"] = ArrSort(buyer)
+	winner, _ := (*dataMap)["winner"].([]interface{})
+	data["winner"] = ArrSort(winner)
+	keyword, _ := (*dataMap)["keyword"].([]interface{})
+	data["keyword"] = keywordSort(util.ObjArrToMapArr(keyword))
+
+	data["publishtime"] = util.InterfaceToStr((*dataMap)["publishtime"])
+	data["selectType"] = ValueSort(util.InterfaceToStr((*dataMap)["selectType"]))
+	data["minprice"] = util.InterfaceToStr((*dataMap)["minprice"])
+	data["maxprice"] = util.InterfaceToStr((*dataMap)["maxprice"])
+	data["subtype"] = ValueSort(util.InterfaceToStr((*dataMap)["subtype"]))
+
+	inKey := GetKeysByParam(data)
+	query["in_key"] = inKey
+	tm := time.Now()
+	if qutil.MQFW.Count("export_condition", query) > 0 {
+		qutil.MQFW.Update("export_condition", query, map[string]interface{}{
+			"$set": map[string]interface{}{
+				"update_time": tm.Unix(),
+			}}, false, false)
+	} else {
+		data["create_time"] = tm.Unix()
+		data["update_time"] = tm.Unix()
+		data["in_key"] = inKey
+		data["filter_id"] = filterId
+		data["user_id"] = userid
+		qutil.MQFW.Save("export_condition", data)
+	}
+}
+
+func keywordSort(data []map[string]interface{}) string {
+	var (
+		dataArr []map[string]string
+	)
+	if data == nil || len(data) == 0 {
+		return ""
+	}
+	for _, v := range data {
+		dm := make(map[string]string)
+		for k, v1 := range v {
+			var v2 string
+			if k == "keyword" {
+				v2 = ValueSort(util.InterfaceToStr(v1))
+			} else if (k == "appended" && v1 != "" && v1 != nil) || (k == "exclude" && v1 != "" && v1 != nil) {
+				vs, _ := v1.([]interface{})
+				v2 = ArrSort(vs)
+			}
+			dm[k] = v2
+		}
+		dataArr = append(dataArr, dm)
+	}
+	SortData(&dataArr, "keyword", false)
+	b, _ := json.Marshal(dataArr)
+	return string(b)
+}
+
+func ValueSort(v string) string {
+	if v == "" {
+		return ""
+	}
+	vs := strings.Split(v, ",")
+	sort.Slice(vs, func(i, j int) bool {
+		return vs[i] < vs[j]
+	})
+	return strings.Join(vs, ",")
+}
+
+func ArrSort(value []interface{}) string {
+	if value == nil || len(value) == 0 {
+		return ""
+	}
+	vs := util.ObjArrToStringArr(value)
+	sort.Slice(vs, func(i, j int) bool {
+		return vs[i] < vs[j]
+	})
+	return strings.Join(vs, ",")
+}

+ 160 - 7
src/jfw/modules/subscribepay/src/pay/util.go

@@ -1,12 +1,15 @@
 package pay
 
 import (
+	"bytes"
 	"crypto"
+	"crypto/md5"
 	"crypto/rand"
 	"crypto/rsa"
 	"crypto/sha256"
 	"crypto/x509"
 	"encoding/base64"
+	"encoding/json"
 	"encoding/pem"
 	"errors"
 	"fmt"
@@ -14,6 +17,9 @@ import (
 	"jy/src/jfw/modules/subscribepay/src/config"
 	"jy/src/jfw/modules/subscribepay/src/util"
 	"log"
+	"net/url"
+	"reflect"
+	"sort"
 	"strings"
 	"sync"
 	"time"
@@ -297,7 +303,7 @@ func GetCacheOrderCode(tradeNo string) (orderCode string) {
 	return redis.GetStr("other", fmt.Sprintf(CacheOrderTradeNo, tradeNo))
 }
 
-//关闭订单
+// 关闭订单
 func CloseOrderByOrderCode(ordercode string) error {
 	res := util.Mysql.FindOne("dataexport_order", map[string]interface{}{"order_code": ordercode}, "out_trade_no,pay_way", "")
 	if res == nil || len(*res) == 0 {
@@ -330,13 +336,13 @@ func CloseOrder(tradeno, payWay string) bool {
 	return false
 }
 
-//创建订单号
+// 创建订单号
 func GetOrderCode(id ...string) string {
 	//2020-08-01之前的规则 fmt.Sprintf("%s%s", time.Now().Format("150405"), qutil.GetRandom(6))
 	return <-varOrderCode.pool
 }
 
-//关闭订单
+// 关闭订单
 func CloseDataExportOrder(payWay, tradeno, prepayTime string) (status bool) {
 	//如果订单超时 则不用关闭订单
 	t, err := time.ParseInLocation(Date_Full_Layout, prepayTime, time.Local)
@@ -361,7 +367,7 @@ func CloseDataExportOrder(payWay, tradeno, prepayTime string) (status bool) {
 	return status
 }
 
-//加载秘钥
+// 加载秘钥
 func parsePrivateKey(key string) (*rsa.PrivateKey, error) {
 	block, _ := pem.Decode([]byte(key))
 	if block == nil {
@@ -377,7 +383,7 @@ func parsePrivateKey(key string) (*rsa.PrivateKey, error) {
 	return rsaPrivateKey.(*rsa.PrivateKey), nil
 }
 
-//加载支付宝后台公钥
+// 加载支付宝后台公钥
 func parseAliPayPublicKey(key string) (*rsa.PublicKey, error) {
 	publicKeyDecoded, err := base64.StdEncoding.DecodeString(key)
 	if err != nil {
@@ -393,7 +399,7 @@ func parseAliPayPublicKey(key string) (*rsa.PublicKey, error) {
 	return nil, errors.New("rsa.PublicKey 断言出错")
 }
 
-//生成加密token
+// 生成加密token
 func (a *aliPayStruct) getSign(data []byte) (signature string, err error) {
 	var h hash.Hash
 	var hType crypto.Hash
@@ -411,7 +417,7 @@ func (a *aliPayStruct) getSign(data []byte) (signature string, err error) {
 	return
 }
 
-//处理商户订单号
+// 处理商户订单号
 func processTradeno(tradeno string) string {
 	if devTradenoSign, _ := config.PayConf["devTradenoSign"].(string); devTradenoSign != "" {
 		tradeno = devTradenoSign + tradeno
@@ -419,3 +425,150 @@ func processTradeno(tradeno string) string {
 	}
 	return tradeno
 }
+
+type paramSorter struct {
+	Keys   []string
+	Values []string
+}
+
+var SP = strings.Replace
+
+func (ps *paramSorter) String() string {
+	str := ""
+	for n, k := range ps.Keys {
+		str += k + "=" + ps.Values[n]
+		if n < len(ps.Keys)-1 {
+			str += "&"
+		}
+	}
+	return str
+}
+
+func (ps *paramSorter) Sort() {
+	sort.Sort(ps)
+}
+func (ps *paramSorter) Len() int {
+	return len(ps.Values)
+}
+
+func (ps *paramSorter) Less(i, j int) bool {
+	return bytes.Compare([]byte(ps.Keys[i]), []byte(ps.Keys[j])) < 0
+}
+
+func (ps *paramSorter) Swap(i, j int) {
+	ps.Values[i], ps.Values[j] = ps.Values[j], ps.Values[i]
+	ps.Keys[i], ps.Keys[j] = ps.Keys[j], ps.Keys[i]
+}
+
+func percentEncode(str string) string {
+	str = url.QueryEscape(str)
+	str = SP(SP(SP(str, "+", "%20", -1), "*", "%2A", -1), "%7E", "~", -1)
+	return str
+}
+
+// 排序 排序键必须为数字类型
+type SortBy struct {
+	Data    []map[string]interface{}
+	Sortkey string
+}
+
+func (a SortBy) Len() int { return len(a.Data) }
+
+func (a SortBy) Swap(i, j int) {
+	a.Data[i], a.Data[j] = a.Data[j], a.Data[i]
+}
+
+func (a SortBy) Less(i, j int) bool {
+	//return Float64(a.Data[i][a.Sortkey]) < Float64(a.Data[j][a.Sortkey])
+	m := a.Data[i][a.Sortkey]
+	n := a.Data[j][a.Sortkey]
+	w := reflect.ValueOf(m)
+	v := reflect.ValueOf(n)
+	switch v.Kind() {
+	case reflect.String:
+		return w.String() < v.String()
+	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+		return w.Int() < v.Int()
+	case reflect.Float64, reflect.Float32:
+		return w.Float() < v.Float()
+	default:
+		return fmt.Sprintf("%v", w) < fmt.Sprintf("%v", v)
+	}
+}
+
+// 根据指定字符排序
+//
+//	m := []map[string]int{
+//	   {"k": 2},
+//	   {"k": 1},
+//	   {"k": 3},
+//	}
+//
+// customer.SortData(&m, "k", true)
+// ture  倒序3, 2, 1
+// fmt.Println(m)
+func SortData(data interface{}, sortkey string, reverse bool) {
+	//func SortData(data interface{}, sortkey string, reverse bool) {
+	var db []map[string]interface{}
+	err := Bind(data, &db)
+	if err != nil {
+		fmt.Println(err)
+		return
+	}
+	stb := SortBy{db, sortkey}
+	if !reverse {
+		sort.Sort(stb)
+	} else {
+		sort.Sort(sort.Reverse(stb))
+	}
+	err = Bind(stb.Data, data)
+	if err != nil {
+		fmt.Println(err)
+	}
+
+}
+
+func Bind(data interface{}, ret interface{}) error {
+	v := reflect.ValueOf(ret)
+	if v.Kind() != reflect.Ptr {
+		return fmt.Errorf("ptr input ret needed as type as input type %s", v.Kind())
+	}
+	havdata := false
+	var bk interface{}
+	if v.Elem().Kind() == reflect.Slice {
+		t := reflect.Zero(reflect.TypeOf(v.Elem().Interface()))
+		bk = v.Elem().Interface()
+		v.Elem().Set(t)
+		havdata = true
+	}
+	_data, _ := json.MarshalIndent(data, "", "    ")
+	err := json.Unmarshal(_data, ret)
+	if err != nil {
+		fmt.Println(err)
+		if havdata {
+			v.Elem().Set(reflect.ValueOf(bk))
+		}
+		return err
+	}
+	return nil
+}
+
+func GetKeysByParam(param map[string]interface{}) string {
+	ps := &paramSorter{[]string{}, []string{}}
+	for k, v := range param {
+		ps.Keys = append(ps.Keys, k)
+		ps.Values = append(ps.Values, qutil.InterfaceToStr(v))
+	}
+	ps.Sort()
+	reqStr := ps.String()
+	str := percentEncode(reqStr)
+	str = SP(str, "%3A", "%253A", -1)
+	return MD5(str)
+}
+
+func MD5(str string) string {
+	data := []byte(str)
+	has := md5.Sum(data)
+	md5str := fmt.Sprintf("%x", has)
+	return md5str
+}

+ 1 - 1
src/jfw/modules/subscribepay/src/service/dataExportPay.go

@@ -164,7 +164,7 @@ func (p *DataExportPay) CreateOrder() {
 			}
 		}
 		ordercode := pay.GetOrderCode(openId)
-		download_url := util.GetExcelFilePath(ordercode)
+		download_url := util.GetExcelFilePath(ordercode, data_count)
 		go func() {
 			list, err := dataexport.GetDataExportSearchResultByScdId(util.MQFW, util.Mgo_bidding, config.Config.Mongobidding.DbName, config.Config.Elasticsearch, id, qutil.If(data_spec == "高级字段包", "2", "1").(string), data_count)
 			if err == nil && list != nil && len(*list) > 0 {

+ 66 - 1
src/jfw/modules/subscribepay/src/service/dataexportPack.go

@@ -2,7 +2,9 @@ package service
 
 import (
 	"encoding/json"
+	"errors"
 	"fmt"
+	"go.mongodb.org/mongo-driver/bson/primitive"
 	"io/ioutil"
 	"jy/src/jfw/modules/subscribepay/src/config"
 	"jy/src/jfw/modules/subscribepay/src/entity"
@@ -37,6 +39,66 @@ type DataExportPack struct {
 	rechargeList   xweb.Mapper `xweb:"/dataExportPack/rechargeList"` //数据导出-流量包充值记录
 	recordList     xweb.Mapper `xweb:"/dataExportPack/recordList"`   //数据导出记录
 	sendExportMail xweb.Mapper `xweb:"/dataExportPack/sendMail"`     //移动端导出记录发送附件邮件
+
+	screenList   xweb.Mapper `xweb:"/dataExportPack/screenList"`   //数据导出_筛选列表
+	screenDelete xweb.Mapper `xweb:"/dataExportPack/screenDelete"` //数据导出_删除筛选
+
+}
+
+func (des *DataExportPack) ScreenList() {
+	data, err := func() (*[]map[string]interface{}, error) {
+		qMap := map[string]interface{}{
+			"user_id": des.GetSession("userId"),
+			"update_time": map[string]interface{}{
+				"$gte": time.Now().AddDate(-1, 0, 0).Unix(),
+			},
+		}
+		data, ok := util.MQFW.Find("export_condition", qMap, `{"update_time":-1}`, "", false, -1, -1)
+		if !ok {
+			log.Printf("获取筛选条件失败;qMap:%v", qMap)
+			return nil, errors.New("获取筛选条件失败")
+		}
+		if data != nil && len(*data) > 0 {
+			for _, v := range *data {
+				v["_id"] = encrypt.SE.EncodeString(qutil.InterfaceToStr(v["_id"]))
+			}
+		}
+		return data, nil
+	}()
+
+	des.ServeJson(NewResult(data, err))
+}
+
+func (des *DataExportPack) ScreenDelete() {
+	err := func() error {
+		userid := des.GetSession("userId")
+		if len(des.Body()) == 0 {
+			return errors.New("body数据异常")
+		}
+		data := make(map[string]interface{})
+		err := json.Unmarshal(des.Body(), &data)
+		if err != nil {
+			return errors.New("获取ids失败")
+		}
+		ids := qutil.InterfaceToStr(data["ids"])
+		var idArr []primitive.ObjectID
+		for _, v := range strings.Split(ids, ",") {
+			if id := encrypt.SE.DecodeString(v); id != "" {
+				mgoId, _ := primitive.ObjectIDFromHex(id)
+				idArr = append(idArr, mgoId)
+			}
+		}
+		//log.Println("userid", userid, idArr)
+		util.MQFW.Delete("export_condition", map[string]interface{}{
+			"user_id": userid,
+			"_id": map[string]interface{}{
+				"$in": idArr,
+			},
+		})
+		return nil
+	}()
+
+	des.ServeJson(NewResult("", err))
 }
 
 // PackGoodsList 数据包规格及价格列表
@@ -303,11 +365,11 @@ func (this *DataExportPack) Statistics() {
 // return	serialNumber 流水号(暂定为记录id)
 func (this *DataExportPack) PackPay() {
 	userId, _ := this.GetSession("userId").(string)
+	filterId := encrypt.SE.Decode4Hex(this.GetString("filterId"))
 	rData, errMsg := func() (interface{}, error) {
 		//企业数据包、个人数据包流量包支付
 		//数据总量,扣除量
 		total_req, _ := this.GetInteger("total") //导出总量
-		filterId := encrypt.SE.Decode4Hex(this.GetString("filterId"))
 		if filterId == "" {
 			return nil, fmt.Errorf("请求参数异常")
 		}
@@ -380,6 +442,9 @@ func (this *DataExportPack) PackPay() {
 	}()
 	if errMsg != nil {
 		log.Printf("%s DataExportPack PackPay 异常:%s\n", userId, errMsg.Error())
+	} else {
+		//条件保存
+		go pay.CheckSave(userId, filterId)
 	}
 	this.ServeJson(NewResult(rData, errMsg))
 }

+ 124 - 44
src/jfw/modules/subscribepay/src/util/dataExportExcel.go

@@ -5,6 +5,7 @@ import (
 	qutil "app.yhyue.com/moapp/jybase/common"
 	"errors"
 	"fmt"
+	"github.com/gogf/gf/v2/util/gconv"
 	"io"
 	"jy/src/jfw/modules/subscribepay/src/config"
 	"os"
@@ -16,26 +17,33 @@ import (
 
 var (
 	defaultExcelBorder = xlsx.Border{ //边框样式
-		Left:        "thin",
-		LeftColor:   "00A6A6A6",
-		Right:       "thin",
-		RightColor:  "00A6A6A6",
-		Top:         "thin",
-		TopColor:    "00A6A6A6",
-		Bottom:      "thin",
-		BottomColor: "00A6A6A6",
+		Left:        "dotted",
+		LeftColor:   "00000000",
+		Right:       "dotted",
+		RightColor:  "00000000",
+		Top:         "dotted",
+		TopColor:    "00000000",
+		Bottom:      "dotted",
+		BottomColor: "00000000",
 	}
+
 	defaultExcelAlignment = xlsx.Alignment{ //对其方式
-		Horizontal: "center",
+		Horizontal: "left",
 		Vertical:   "center",
 		WrapText:   true,
 	}
+	defaultFont = xlsx.NewFont(12, "等线")
+	blueFont    = xlsx.Font{
+		Size:  12,
+		Name:  "等线",
+		Color: "00376092",
+	}
 )
 
 // 获取
-func GetExcelFilePath(orderCode string) string {
+func GetExcelFilePath(orderCode string, num int) string {
 	now := time.Now()
-	filename := fmt.Sprintf("%s.xlsx", fmt.Sprintf("%s_%s_%s", now.Format("20060102150405"), orderCode, qutil.GetLetterRandom(5)))
+	filename := fmt.Sprintf("%s.xlsx", fmt.Sprintf("%s_%d_%s_%s", now.Format("20060102"), num, orderCode, qutil.GetLetterRandom(5)))
 	return fmt.Sprintf("/dataexport/%s/%s/%s", now.Format("2006"), now.Format("01"), filename)
 }
 
@@ -57,9 +65,9 @@ func GetDataExportFileDataLen(path string) (int, error) {
 
 // 生成数据导出excel
 func CreateDataExportExcelFile(list *[]map[string]interface{}, isSenior bool, filePath string) error {
-	if list == nil || len(*list) == 0 {
-		return errors.New("未查询到数据")
-	}
+	//if list == nil || len(*list) == 0 {
+	//	return errors.New("未查询到数据")
+	//}
 	//创建excel文件
 	file := xlsx.NewFile()
 	sheet, err := file.AddSheet("Sheet1")
@@ -77,18 +85,20 @@ func CreateDataExportExcelFile(list *[]map[string]interface{}, isSenior bool, fi
 		for index, excel := range excelHead {
 			cell = row.AddCell()
 			cell.SetString(excel.Name)
-			cell.SetStyle(&xlsx.Style{
+			style := &xlsx.Style{
 				Fill:      *xlsx.NewFill("solid", excel.Color, excel.Color),
-				Border:    defaultExcelBorder,
 				Alignment: defaultExcelAlignment,
-			})
+				Font:      *defaultFont,
+				Border:    defaultExcelBorder,
+			}
+			cell.SetStyle(style)
 			sheet.Col(index).Width = excel.Width
 		}
 	} else {
 		excelHead = config.ExConf.Senior_Fields
 		//铺设第一层title
 		row = sheet.AddRow()
-		row.SetHeight(12)
+		row.SetHeight(20)
 		lastF := false //合并行时标识
 		for _, excel := range excelHead {
 			if excel.VMerge != 1 && excel.HMerge == 0 {
@@ -107,15 +117,17 @@ func CreateDataExportExcelFile(list *[]map[string]interface{}, isSenior bool, fi
 			if excel.HMerge != 0 {
 				lastF = true
 			}
-			cell.SetStyle(&xlsx.Style{
+			style := &xlsx.Style{
 				Fill:      *xlsx.NewFill("solid", excel.Color, excel.Color),
-				Border:    defaultExcelBorder,
 				Alignment: defaultExcelAlignment,
-			})
+				Font:      *defaultFont,
+				Border:    defaultExcelBorder,
+			}
+			cell.SetStyle(style)
 		}
 		//铺设第二层title并设置宽度
 		row = sheet.AddRow()
-		row.SetHeight(12)
+		row.SetHeight(20)
 		cNum := 0
 		for _, excel := range excelHead {
 			if excel.HMerge != 0 {
@@ -131,35 +143,103 @@ func CreateDataExportExcelFile(list *[]map[string]interface{}, isSenior bool, fi
 				Fill:      *xlsx.NewFill("solid", excel.Color, excel.Color),
 				Border:    defaultExcelBorder,
 				Alignment: defaultExcelAlignment,
+				Font:      *defaultFont,
 			})
 		}
 	}
-	//填充数据
-	for k, data := range *list {
-		row = sheet.AddRow()
-		row.SetHeight(50)
-		data["index"] = k + 1
-		for _, v := range excelHead {
-			if v.Filed == "" {
-				continue
-			}
-			cell = row.AddCell()
+	if list != nil && len(*list) > 0 {
+		//填充数据
+		for k, data := range *list {
+			winnerMaps := gconv.Maps(data["winnerMaps"])
+			winnerTotal := len(winnerMaps)
+			data["index"] = k + 1
+			if winnerTotal > 0 {
+				for index, winnerDatas := range winnerMaps {
+					row = sheet.AddRow()
+					row.SetHeight(20)
 
-			if v.Filed == "title" || v.Filed == "url" {
-				cell.SetFormula(fmt.Sprintf("=HYPERLINK(\"%s\",\"%s\")", data["url_jump"], data[v.Filed]))
-			} else if v.Filed == "href" {
-				cell.SetFormula(fmt.Sprintf("=HYPERLINK(\"%s\",\"%s\")", data["href"], data[v.Filed]))
+					for _, v := range excelHead {
+						if v.Filed == "" {
+							continue
+						}
+						cell = row.AddCell()
+						style := &xlsx.Style{
+							Border:    defaultExcelBorder,
+							Alignment: defaultExcelAlignment,
+						}
+
+						if v.Filed != "legal_person" && v.Filed != "company_phone" && v.Filed != "company_email" && v.Filed != "company_name" {
+							if index == 0 {
+								cell.VMerge = winnerTotal - 1
+
+								if v.Filed == "title" || v.Filed == "url" {
+									cell.SetFormula(fmt.Sprintf("=HYPERLINK(\"%s\",\"%s\")", data["url_jump"], data[v.Filed]))
+								} else if v.Filed == "href" {
+									cell.SetFormula(fmt.Sprintf("=HYPERLINK(\"%s\",\"%s\")", data["href"], data[v.Filed]))
+								} else {
+									cell.SetValue(data[v.Filed])
+								}
+							}
+						} else {
+							cell.SetValue(winnerDatas[v.Filed])
+						}
+						if v.Filed == "title" {
+							style.Font = blueFont
+						}
+						cell.SetStyle(style)
+					}
+				}
 			} else {
-				cell.SetValue(data[v.Filed])
+				row = sheet.AddRow()
+				row.SetHeight(20)
+
+				for _, v := range excelHead {
+					if v.Filed == "" {
+						continue
+					}
+					cell = row.AddCell()
+					style := &xlsx.Style{
+						Border:    defaultExcelBorder,
+						Alignment: defaultExcelAlignment,
+					}
+					if v.Filed == "title" || v.Filed == "url" {
+						cell.SetFormula(fmt.Sprintf("=HYPERLINK(\"%s\",\"%s\")", data["url_jump"], data[v.Filed]))
+					} else if v.Filed == "href" {
+						cell.SetFormula(fmt.Sprintf("=HYPERLINK(\"%s\",\"%s\")", data["href"], data[v.Filed]))
+					} else {
+						cell.SetValue(data[v.Filed])
+					}
+					if v.Filed == "title" {
+						style.Font = blueFont
+					}
+					cell.SetStyle(style)
+				}
 			}
-			cell.SetStyle(&xlsx.Style{
-				Border:    defaultExcelBorder,
-				Alignment: defaultExcelAlignment,
-			})
+			//row = sheet.AddRow()
+			//row.SetHeight(50)
+			//data["index"] = k + 1
+			//for _, v := range excelHead {
+			//	if v.Filed == "" {
+			//		continue
+			//	}
+			//	cell = row.AddCell()
+			//
+			//	if v.Filed == "title" || v.Filed == "url" {
+			//		cell.SetFormula(fmt.Sprintf("=HYPERLINK(\"%s\",\"%s\")", data["url_jump"], data[v.Filed]))
+			//	} else if v.Filed == "href" {
+			//		cell.SetFormula(fmt.Sprintf("=HYPERLINK(\"%s\",\"%s\")", data["href"], data[v.Filed]))
+			//	} else {
+			//		cell.SetValue(data[v.Filed])
+			//	}
+			//	cell.SetStyle(&xlsx.Style{
+			//		Border:    defaultExcelBorder,
+			//		Alignment: defaultExcelAlignment,
+			//	})
+			//}
+		}
+		if err := FolderCheck(filePath); err != nil {
+			return err
 		}
-	}
-	if err := FolderCheck(filePath); err != nil {
-		return err
 	}
 	return file.Save(filePath)
 }

+ 6 - 0
src/web/staticres/css/pc/index.css

@@ -1834,6 +1834,9 @@ text-align: center;
   margin-top: 10px;
   height: 22px;
 }
+.jy-index .jy-index-strategy .strategy-content .strate_content .strate_c_list a {
+  font-size: 14px;
+}
 .jy-index-strategy .strategy-content .strate_content .strate_c_list a{
   color: #686868;
   text-decoration: none;
@@ -1841,6 +1844,9 @@ text-align: center;
 .jy-index-strategy .strategy-content .strate_content .strate_c_list a:hover{
   color: #2CB7CA;
 }
+.jy-index .jy-index-strategy .strategy-content .strate_content .strate_l_r_c_date {
+  font-size: 12px;
+}
 .jy-index-strategy .strategy-content .strate_content .strate_l_r_c_date{
   color: #999999;
   min-width: 50px;

+ 20 - 18
src/web/templates/pc/index.html

@@ -596,10 +596,12 @@
           <div class="app-btn" id="app-btn">立即预约演示</div>
         </div>
       </div>
+      {{ if ne .T.userCard "m"}}
       <!-- 底部广告位 -->
       <div class="pc-index-bottom">
         <img class="bottom-member-ad" adv_name="PC首页广告位-底部" src="" alt="底部广告位">
       </div>
+      {{ end }}
       {{include "/common/friend-link.html"}}
       {{include "/common/pcbottom.html"}}
 		</section>
@@ -1035,24 +1037,24 @@
   {{end}}
 
   // 首页活动弹窗迁移至工作桌面首页,此处活动弹窗不再展示
-  // var showDay = localStorage.tc;
-  // if(adv_img!=""){
-  //   if(localStorage.tc === undefined){
-  //     $("#index_tc").css("display","block");
-  //     $("#close2x").css("display","block");
-  //     $(".tans").css("display","block");
-  //   }else{
-  //     if(showDay != day){
-  //       $("#index_tc").css("display","block");
-  //       $("#close2x").css("display","block");
-  //       $(".tans").css("display","block");
-  //     }else{
-  //       $("#index_tc").css("display","none");
-  //       $("#close2x").css("display","none");
-  //       $(".tans").css("display","none");
-  //     }
-  //   }
-  // }
+  var showDay = localStorage.tc;
+  if(adv_img!=""){
+    if(localStorage.tc === undefined){
+      $("#index_tc").css("display","block");
+      $("#close2x").css("display","block");
+      $(".tans").css("display","block");
+    }else{
+      if(showDay != day){
+        $("#index_tc").css("display","block");
+        $("#close2x").css("display","block");
+        $(".tans").css("display","block");
+      }else{
+        $("#index_tc").css("display","none");
+        $("#close2x").css("display","none");
+        $(".tans").css("display","none");
+      }
+    }
+  }
 
   // 首页底部广告位
   {{$bottom:=(Ad "jy_pc_index_bottom" -1 .Host)}}

部分文件因为文件数量过多而无法显示