소스 검색

wip:数据导出查询详细数据,已选择具体信息则查询mongodb,若只有选择条件则查询es

wangkaiyue 1 년 전
부모
커밋
b76652d18d

+ 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-20231026082242-8eb41c7bdda6
 	app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545
-	app.yhyue.com/moapp/jypkg v1.0.7
+	app.yhyue.com/moapp/jypkg v1.0.8-0.20231120061054-0036ef2c8301
 	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.15-0.20230925060020-8e4db0f1e13e
 	github.com/ClickHouse/clickhouse-go v1.5.4
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67

+ 2 - 2
src/go.sum

@@ -9,8 +9,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20231026082242-8eb41c7bdda6 h1:uyaBp5Iuc/Il4+O
 app.yhyue.com/moapp/jybase v0.0.0-20231026082242-8eb41c7bdda6/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 v1.0.7 h1:BXwqRJWTYAw+V7mpQnnZn4EDCqSxVbH6YxiQKUH2xfw=
-app.yhyue.com/moapp/jypkg v1.0.7/go.mod h1:LuxdVd+j3uwm7N5j2hivmpPU0LJytEV7iwAIljdoc4Q=
+app.yhyue.com/moapp/jypkg v1.0.8-0.20231120061054-0036ef2c8301 h1:TV1QhUD4m0imwd5lCQcHmsgkGHg6zWlvtQcuGB8ALH4=
+app.yhyue.com/moapp/jypkg v1.0.8-0.20231120061054-0036ef2c8301/go.mod h1:LuxdVd+j3uwm7N5j2hivmpPU0LJytEV7iwAIljdoc4Q=
 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=

+ 6 - 6
src/jfw/front/dataExport.go

@@ -266,11 +266,11 @@ func (d *DataExport) SieveData() {
 		"error_msg":  "",
 	}
 	if _id != "" {
-		msgCount := dataexport.GetDataExportSearchCountByScdId(public.MQFW, public.DbConf.Elasticsearch.Main.Address, _id)
+		msgCount := dataexport.GetDataExportSearchCountByScdId(public.MQFW, public.Mgo_Bidding, public.DbConf.Mongodb.Bidding.DbName, public.DbConf.Elasticsearch.Main.Address, _id)
 		//从500条数据中筛选字段最全五条
 		scd := dataexport.GetSqlObjFromId(public.MQFW, _id)
 		kws := scd.Keyword
-		res, err := dataexport.GetDataExportSearchResult(public.DbConf.Elasticsearch.Main.Address, scd, dataType, -1)
+		res, err := dataexport.GetDataExportSearchResult(public.Mgo_Bidding, public.DbConf.Mongodb.Bidding.DbName, public.DbConf.Elasticsearch.Main.Address, scd, dataType, -1)
 		if res == nil || err != nil {
 			_res["error_msg"] = "无数据"
 			d.ServeJson(_res)
@@ -288,7 +288,7 @@ func (d *DataExport) SieveData() {
 			}
 		}
 
-		list := dataexport.FormatExportData(&res_screen, config.Sysconfig["webdomain"].(string), dataType, true)
+		list := dataexport.FormatExportData(public.Mgo_Ent, &res_screen, config.Sysconfig["webdomain"].(string), dataType, true)
 		/*if msgCount > 20000 {
 			msgCount = 20000
 		}*/
@@ -538,7 +538,7 @@ func (d *DataExport) ToCreateOrderPage(_id string) error {
 	} else {
 		d.DelSession("Structed")
 	}
-	msgCount := dataexport.GetDataExportSearchCountByScdId(public.MQFW, public.DbConf.Elasticsearch.Main.Address, id)
+	msgCount := dataexport.GetDataExportSearchCountByScdId(public.MQFW, public.Mgo_Bidding, public.DbConf.Mongodb.Bidding.DbName, public.DbConf.Elasticsearch.Main.Address, id)
 	if msgCount > public.ExConf.MsgMaxCount || msgCount == -1 {
 		msgCount = public.ExConf.MsgMaxCount
 	}
@@ -626,14 +626,14 @@ func (d *DataExport) PreviewData(source, _id string) error {
 	//从500条数据中筛选字段最全五条
 	scd := dataexport.GetSqlObjFromId(public.MQFW, _id)
 	kws := scd.Keyword
-	res, err := dataexport.GetDataExportSearchResult(public.DbConf.Elasticsearch.Main.Address, scd, dataType, -1)
+	res, err := dataexport.GetDataExportSearchResult(public.Mgo_Bidding, public.DbConf.Mongodb.Bidding.DbName, public.DbConf.Elasticsearch.Main.Address, scd, dataType, -1)
 	if res == nil || err != nil {
 		log.Println("PreviewData查询出错", res)
 		return d.Render("/pc/dataExport_noDataErr.html", &d.T)
 	}
 	//格式化字段
 	res_screen := dataexport.ScreenData(res, dataType, 20, kws)
-	list := dataexport.FormatExportData(&res_screen, config.Sysconfig["webdomain"].(string), dataType, true)
+	list := dataexport.FormatExportData(public.Mgo_Ent, &res_screen, config.Sysconfig["webdomain"].(string), dataType, true)
 
 	d.T["data"] = subUrl(list, dataType)
 	d.T["dataType"] = dataType

+ 4 - 4
src/jfw/front/ws_dataExport.go

@@ -200,14 +200,14 @@ func (w *WsDataExport) GetPreview() error {
 	//从500条数据中筛选字段最全五条
 	scd := dataexport.GetSqlObjFromId(public.MQFW, _id)
 	kws := scd.Keyword
-	res, err := dataexport.GetDataExportSearchResult(public.DbConf.Elasticsearch.Main.Address, scd, dataType, -1)
+	res, err := dataexport.GetDataExportSearchResult(public.Mgo_Bidding, public.DbConf.Mongodb.Bidding.DbName, public.DbConf.Elasticsearch.Main.Address, scd, dataType, -1)
 	if res == nil || err != nil {
 		return w.Render("/pc/dataExport_noDataErr.html", &w.T)
 	}
-	msgCount := dataexport.GetDataExportSearchCountByScdId(public.MQFW, public.DbConf.Elasticsearch.Main.Address, _id)
+	msgCount := dataexport.GetDataExportSearchCountByScdId(public.MQFW, public.Mgo_Bidding, public.DbConf.Mongodb.Bidding.DbName, public.DbConf.Elasticsearch.Main.Address, _id)
 	//格式化字段
 	res_screen := dataexport.ScreenData(res, dataType, 20, kws)
-	list := dataexport.FormatExportData(&res_screen, config.Sysconfig["webdomain"].(string), dataType, true)
+	list := dataexport.FormatExportData(public.Mgo_Ent, &res_screen, config.Sysconfig["webdomain"].(string), dataType, true)
 	//if msgCount > 20000 {
 	//	msgCount = 20000
 	//}
@@ -277,7 +277,7 @@ func (w *WsDataExport) SubmitOrder() error {
 			return errors.New("未登录")
 		}
 	}
-	msgCount := dataexport.GetDataExportSearchCountByScdId(public.MQFW, public.DbConf.Elasticsearch.Main.Address, id)
+	msgCount := dataexport.GetDataExportSearchCountByScdId(public.MQFW, public.Mgo_Bidding, public.DbConf.Mongodb.Bidding.DbName, public.DbConf.Elasticsearch.Main.Address, id)
 	if msgCount > public.ExConf.MsgMaxCount || msgCount == -1 {
 		msgCount = public.ExConf.MsgMaxCount
 	}

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

@@ -280,7 +280,7 @@ func (w *WxDataExport) SaveData() error {
 		saveData["s_userid"] = w.GetSession("userId").(string)
 	}
 	_id := mongodb.Save(dataexport.ExportTable, saveData)
-	msgCount := dataexport.GetDataExportSearchCountByScdId(public.MQFW, public.DbConf.Elasticsearch.Main.Address, _id)
+	msgCount := dataexport.GetDataExportSearchCountByScdId(public.MQFW, public.Mgo_Bidding, public.DbConf.Mongodb.Bidding.DbName, public.DbConf.Elasticsearch.Main.Address, _id)
 	if msgCount > 20000 {
 		msgCount = 20000
 	}

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

@@ -286,7 +286,7 @@ func (w *WxDataExport) SaveData() error {
 	}
 	_id := mongodb.Save(dataexport.ExportTable, saveData)
 	log.Println("数据导出参数:", saveData)
-	msgCount := dataexport.GetDataExportSearchCountByScdId(public.MQFW, public.DbConf.Elasticsearch.Main.Address, _id)
+	msgCount := dataexport.GetDataExportSearchCountByScdId(public.MQFW, public.Mgo_Bidding, public.DbConf.Mongodb.Bidding.DbName, public.DbConf.Elasticsearch.Main.Address, _id)
 	if msgCount > 20000 {
 		msgCount = 20000
 	}

+ 436 - 436
src/jfw/modules/app/src/app/front/ws_dataExport.go

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

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

@@ -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 v1.0.7
+	app.yhyue.com/moapp/jypkg v1.0.8-0.20231120061054-0036ef2c8301
 	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.15-0.20230925060020-8e4db0f1e13e
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
 	github.com/gogf/gf/v2 v2.3.1

+ 2 - 2
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 v1.0.7 h1:BXwqRJWTYAw+V7mpQnnZn4EDCqSxVbH6YxiQKUH2xfw=
-app.yhyue.com/moapp/jypkg v1.0.7/go.mod h1:LuxdVd+j3uwm7N5j2hivmpPU0LJytEV7iwAIljdoc4Q=
+app.yhyue.com/moapp/jypkg v1.0.8-0.20231120061054-0036ef2c8301 h1:TV1QhUD4m0imwd5lCQcHmsgkGHg6zWlvtQcuGB8ALH4=
+app.yhyue.com/moapp/jypkg v1.0.8-0.20231120061054-0036ef2c8301/go.mod h1:LuxdVd+j3uwm7N5j2hivmpPU0LJytEV7iwAIljdoc4Q=
 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=

+ 216 - 216
src/jfw/modules/publicapply/src/dataexport/service/action.go

@@ -1,98 +1,98 @@
 package service
 
 import (
-    "errors"
-    "fmt"
-    "jy/src/jfw/modules/publicapply/src/config"
-    de "jy/src/jfw/modules/publicapply/src/dataexport/dexport"
-    "jy/src/jfw/modules/publicapply/src/dataexport/entity"
-    "jy/src/jfw/modules/publicapply/src/db"
-    u "jy/src/jfw/modules/publicapply/src/util"
-    "log"
-    "strings"
-    "time"
+	"errors"
+	"fmt"
+	"jy/src/jfw/modules/publicapply/src/config"
+	de "jy/src/jfw/modules/publicapply/src/dataexport/dexport"
+	"jy/src/jfw/modules/publicapply/src/dataexport/entity"
+	"jy/src/jfw/modules/publicapply/src/db"
+	u "jy/src/jfw/modules/publicapply/src/util"
+	"log"
+	"strings"
+	"time"
 
-    . "app.yhyue.com/moapp/jybase/api"
-    util "app.yhyue.com/moapp/jybase/common"
-    "app.yhyue.com/moapp/jybase/encrypt"
-    "app.yhyue.com/moapp/jybase/redis"
-    "app.yhyue.com/moapp/jypkg/common/src/qfw/util/dataexport"
-    "app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
+	. "app.yhyue.com/moapp/jybase/api"
+	util "app.yhyue.com/moapp/jybase/common"
+	"app.yhyue.com/moapp/jybase/encrypt"
+	"app.yhyue.com/moapp/jybase/redis"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/dataexport"
+	"app.yhyue.com/moapp/jypkg/common/src/qfw/util/jy"
 
-    "app.yhyue.com/moapp/jybase/go-xweb/xweb"
+	"app.yhyue.com/moapp/jybase/go-xweb/xweb"
 )
 
 type DataExportStruct struct {
-    *xweb.Action
-    //bySelects     xweb.Mapper `xweb:"/dataexpoet/bySelects"`     //数据导出_选择导出
-    byCollection xweb.Mapper `xweb:"/dataexpoet/bycollection"` //数据导出_收藏导出
-    //byPushHistory xweb.Mapper `xweb:"/dataexpoet/byPushHistory"` //数据导出_推送记录
-    payPageParams xweb.Mapper `xweb:"/dataexport/payPageParams"` //数据导出_支付页面参数信息
+	*xweb.Action
+	//bySelects     xweb.Mapper `xweb:"/dataexpoet/bySelects"`     //数据导出_选择导出
+	byCollection xweb.Mapper `xweb:"/dataexpoet/bycollection"` //数据导出_收藏导出
+	//byPushHistory xweb.Mapper `xweb:"/dataexpoet/byPushHistory"` //数据导出_推送记录
+	payPageParams xweb.Mapper `xweb:"/dataexport/payPageParams"` //数据导出_支付页面参数信息
 }
 
 func (des *DataExportStruct) PayPageParams() {
-    userId, _ := des.GetSession("mgoUserId").(string)
-    rData, errMsg := func() (interface{}, error) {
-        defer util.Catch()
-        if userId == "" {
-            return nil, errors.New("未登录")
-        }
-        var res = map[string]interface{}{}
-        id := encrypt.SE.Decode4Hex(des.GetString("id"))
-        //最大导出数据量
-        msgCount := dataexport.GetDataExportSearchCountByScdId(db.Mgo, db.DbConf.Elasticsearch.Main.Address, id)
-        if msgCount > de.DataExport.MsgMaxCount || msgCount == -1 {
-            msgCount = de.DataExport.MsgMaxCount
-        }
-        if msgCount < 1 {
-            msgCount = 0
-        }
-        res["msgCount"] = msgCount
-        //邮箱
+	userId, _ := des.GetSession("mgoUserId").(string)
+	rData, errMsg := func() (interface{}, error) {
+		defer util.Catch()
+		if userId == "" {
+			return nil, errors.New("未登录")
+		}
+		var res = map[string]interface{}{}
+		id := encrypt.SE.Decode4Hex(des.GetString("id"))
+		//最大导出数据量
+		msgCount := dataexport.GetDataExportSearchCountByScdId(db.Mgo, db.Mgo_Bidding, db.DbConf.Mongodb.Bidding.DbName, db.DbConf.Elasticsearch.Main.Address, id)
+		if msgCount > de.DataExport.MsgMaxCount || msgCount == -1 {
+			msgCount = de.DataExport.MsgMaxCount
+		}
+		if msgCount < 1 {
+			msgCount = 0
+		}
+		res["msgCount"] = msgCount
+		//邮箱
 
-        resEmail, _ := des.GetSession("DataExportVerifyEmail_val").(string)
-        resPhone, _ := des.GetSession("DataExportVerifyPhone_val").(string)
-        if resEmail != "" {
-            lastSendDEVerify := util.Int64All(des.GetSession("CreatEVerifyTime"))
-            res["timeSpaceing"] = lastSendDEVerify - time.Now().Unix() + 60*5
-            res["resEmail"] = resEmail
-        }
-        if resPhone != "" {
-            res["resPhone"] = resPhone
-        }
+		resEmail, _ := des.GetSession("DataExportVerifyEmail_val").(string)
+		resPhone, _ := des.GetSession("DataExportVerifyPhone_val").(string)
+		if resEmail != "" {
+			lastSendDEVerify := util.Int64All(des.GetSession("CreatEVerifyTime"))
+			res["timeSpaceing"] = lastSendDEVerify - time.Now().Unix() + 60*5
+			res["resEmail"] = resEmail
+		}
+		if resPhone != "" {
+			res["resPhone"] = resPhone
+		}
 
-        if resEmail == "" || resPhone == "" {
-            lastEmail, lastPhone := "", ""
-            if lastPhone, lastEmail = dataexport.GetLastExportPhoneAndMail(db.Mysql, userId, util.ObjToString(des.GetSession("entUserId"))); lastPhone == "" || lastEmail == "" {
-                userData := config.Compatible.Select(userId, `{"s_myemail":1,"s_phone":1,"s_m_phone":1}`)
-                if userData != nil && len(*userData) > 0 {
-                    if lastEmail == "" {
-                        lastEmail, _ = (*userData)["s_myemail"].(string)
-                    }
-                    if lastPhone == "" {
-                        lastPhone, _ = util.If((*userData)["s_phone"] != nil, (*userData)["s_phone"], (*userData)["s_m_phone"]).(string)
-                    }
-                }
-            }
-            if resEmail == "" && lastEmail != "" {
-                res["resEmail"] = lastEmail
-                des.SetSession("EMVerifySucess", true)
-                des.SetSession("DataExportVerifyEmail_val", lastEmail)
-            }
+		if resEmail == "" || resPhone == "" {
+			lastEmail, lastPhone := "", ""
+			if lastPhone, lastEmail = dataexport.GetLastExportPhoneAndMail(db.Mysql, userId, util.ObjToString(des.GetSession("entUserId"))); lastPhone == "" || lastEmail == "" {
+				userData := config.Compatible.Select(userId, `{"s_myemail":1,"s_phone":1,"s_m_phone":1}`)
+				if userData != nil && len(*userData) > 0 {
+					if lastEmail == "" {
+						lastEmail, _ = (*userData)["s_myemail"].(string)
+					}
+					if lastPhone == "" {
+						lastPhone, _ = util.If((*userData)["s_phone"] != nil, (*userData)["s_phone"], (*userData)["s_m_phone"]).(string)
+					}
+				}
+			}
+			if resEmail == "" && lastEmail != "" {
+				res["resEmail"] = lastEmail
+				des.SetSession("EMVerifySucess", true)
+				des.SetSession("DataExportVerifyEmail_val", lastEmail)
+			}
 
-            if resPhone == "" && lastPhone != "" {
-                des.SetSession("DataExportVerifyPhone_val", lastPhone)
-                res["resPhone"] = lastPhone
-            }
-        }
-        incurKey := fmt.Sprintf("PreviewData_%s_%d", des.GetSession("userId"), time.Now().Day()) //每日限制预览次数
-        res["previewData"] = util.IntAll(redis.Get("other", incurKey))
-        return res, nil
-    }()
-    if errMsg != nil {
-        log.Printf("%s DataExportStruct ByCollection:%s\n", userId, errMsg.Error())
-    }
-    des.ServeJson(NewResult(rData, errMsg))
+			if resPhone == "" && lastPhone != "" {
+				des.SetSession("DataExportVerifyPhone_val", lastPhone)
+				res["resPhone"] = lastPhone
+			}
+		}
+		incurKey := fmt.Sprintf("PreviewData_%s_%d", des.GetSession("userId"), time.Now().Day()) //每日限制预览次数
+		res["previewData"] = util.IntAll(redis.Get("other", incurKey))
+		return res, nil
+	}()
+	if errMsg != nil {
+		log.Printf("%s DataExportStruct ByCollection:%s\n", userId, errMsg.Error())
+	}
+	des.ServeJson(NewResult(rData, errMsg))
 }
 
 //
@@ -134,149 +134,149 @@ func (des *DataExportStruct) PayPageParams() {
 //}
 
 func (des *DataExportStruct) ByCollection() {
-    userId, _ := des.GetSession("userId").(string)
-    rData, errMsg := func() (interface{}, error) {
-        defer util.Catch()
-        ids := []string{}
-        selectIds := strings.TrimSpace(des.GetString("selectIds"))
-        if selectIds != "" { //选中导出
-            for _, encodeId := range strings.Split(selectIds, ",") {
-                if tmp := encrypt.CommonDecodeArticle("content", encodeId); len(tmp) > 0 {
-                    if id := tmp[0]; id != "" {
-                        ids = append(ids, id)
-                    }
-                }
-            }
-        } else {
-            buyerPhone, _ := des.GetInteger("buyerPhone")
-            winnerPhone, _ := des.GetInteger("winnerPhone")
-            sql := u.CollListSql(&u.CollList{
-                Label:       des.GetString("label"),
-                SelectTime:  des.GetString("selectTime"),
-                Buyerclass:  des.GetString("buyerclass"),
-                BuyerPhone:  buyerPhone,
-                WinnerPhone: winnerPhone,
-            }, entity.IsPay(des.Session()), userId)
-            data := db.Mysql.SelectBySql(sql)
-            if data != nil && len(*data) > 0 {
-                for _, v := range *data {
-                    ids = append(ids, util.ObjToString(v["bid"]))
-                }
-            }
-        }
-        if len(ids) == 0 {
-            return nil, fmt.Errorf("参数异常")
-        }
+	userId, _ := des.GetSession("userId").(string)
+	rData, errMsg := func() (interface{}, error) {
+		defer util.Catch()
+		ids := []string{}
+		selectIds := strings.TrimSpace(des.GetString("selectIds"))
+		if selectIds != "" { //选中导出
+			for _, encodeId := range strings.Split(selectIds, ",") {
+				if tmp := encrypt.CommonDecodeArticle("content", encodeId); len(tmp) > 0 {
+					if id := tmp[0]; id != "" {
+						ids = append(ids, id)
+					}
+				}
+			}
+		} else {
+			buyerPhone, _ := des.GetInteger("buyerPhone")
+			winnerPhone, _ := des.GetInteger("winnerPhone")
+			sql := u.CollListSql(&u.CollList{
+				Label:       des.GetString("label"),
+				SelectTime:  des.GetString("selectTime"),
+				Buyerclass:  des.GetString("buyerclass"),
+				BuyerPhone:  buyerPhone,
+				WinnerPhone: winnerPhone,
+			}, entity.IsPay(des.Session()), userId)
+			data := db.Mysql.SelectBySql(sql)
+			if data != nil && len(*data) > 0 {
+				for _, v := range *data {
+					ids = append(ids, util.ObjToString(v["bid"]))
+				}
+			}
+		}
+		if len(ids) == 0 {
+			return nil, fmt.Errorf("参数异常")
+		}
 
-        saveData := map[string]interface{}{
-            "s_userid":   userId,
-            "comeinfrom": "collectionPage",
-            "comeintime": time.Now().Unix(),
-            "selectIds":  ids,
-        }
+		saveData := map[string]interface{}{
+			"s_userid":   userId,
+			"comeinfrom": "collectionPage",
+			"comeintime": time.Now().Unix(),
+			"selectIds":  ids,
+		}
 
-        _id := db.Mgo.Save(dataexport.ExportTable, saveData)
-        if _id == "" {
-            return nil, fmt.Errorf("选择导出异常")
-        }
-        return map[string]interface{}{
-            "_id": encrypt.SE.Encode2Hex(_id),
-        }, nil
-    }()
-    if errMsg != nil {
-        log.Printf("%s DataExportStruct ByCollection:%s\n", userId, errMsg.Error())
-    }
-    des.ServeJson(NewResult(rData, errMsg))
+		_id := db.Mgo.Save(dataexport.ExportTable, saveData)
+		if _id == "" {
+			return nil, fmt.Errorf("选择导出异常")
+		}
+		return map[string]interface{}{
+			"_id": encrypt.SE.Encode2Hex(_id),
+		}, nil
+	}()
+	if errMsg != nil {
+		log.Printf("%s DataExportStruct ByCollection:%s\n", userId, errMsg.Error())
+	}
+	des.ServeJson(NewResult(rData, errMsg))
 }
 
 // ByPushHistory 推送页面筛选导出
 func (des *DataExportStruct) ByPushHistory() {
-    userId, _ := des.GetSession("userId").(string)
-    rData, errMsg := func() (interface{}, error) {
-        defer util.Catch()
-        vipType := des.GetString("vt")
-        if vipType == "" { //默认取已切换的企业
-            vipType = jy.SwitchService.GetEntniche(des.Session(), *config.Middleground)
-        }
-        if vipType == jy.SwitchService.Entniche {
-            userId = fmt.Sprint(util.IntAll(des.GetSession("entUserId")))
-        }
+	userId, _ := des.GetSession("userId").(string)
+	rData, errMsg := func() (interface{}, error) {
+		defer util.Catch()
+		vipType := des.GetString("vt")
+		if vipType == "" { //默认取已切换的企业
+			vipType = jy.SwitchService.GetEntniche(des.Session(), *config.Middleground)
+		}
+		if vipType == jy.SwitchService.Entniche {
+			userId = fmt.Sprint(util.IntAll(des.GetSession("entUserId")))
+		}
 
-        //条件导出
-        exportNum, _ := des.GetInteger("exportNum")
-        spqp := &jy.SubPushQueryParam{
-            Mgo_bidding:   db.Mgo_Bidding,
-            Bidding:       db.DbConf.Mongodb.Bidding.Collection,
-            Bidding_back:  db.DbConf.Mongodb.Bidding.Collection_change,
-            UserId:        userId,
-            PageSize:      exportNum,
-            Export:        true,
-            SelectTime:    des.GetString("selectTime"),
-            Area:          des.GetString("area"),
-            City:          des.GetString("city"),
-            Buyerclass:    des.GetString("buyerclass"),
-            Subtype:       des.GetString("subtype"),
-            Subscopeclass: des.GetString("subscopeclass"),
-            Key:           des.GetString("key"),
-            Price:         des.GetString("price"),
-            FileExists:    des.GetString("fileExists"),
-        }
+		//条件导出
+		exportNum, _ := des.GetInteger("exportNum")
+		spqp := &jy.SubPushQueryParam{
+			Mgo_bidding:   db.Mgo_Bidding,
+			Bidding:       db.DbConf.Mongodb.Bidding.Collection,
+			Bidding_back:  db.DbConf.Mongodb.Bidding.Collection_change,
+			UserId:        userId,
+			PageSize:      exportNum,
+			Export:        true,
+			SelectTime:    des.GetString("selectTime"),
+			Area:          des.GetString("area"),
+			City:          des.GetString("city"),
+			Buyerclass:    des.GetString("buyerclass"),
+			Subtype:       des.GetString("subtype"),
+			Subscopeclass: des.GetString("subscopeclass"),
+			Key:           des.GetString("key"),
+			Price:         des.GetString("price"),
+			FileExists:    des.GetString("fileExists"),
+		}
 
-        //选择导出
-        if selectIds := strings.TrimSpace(des.GetString("selectIds")); selectIds != "" {
-            encodeArr := strings.Split(selectIds, ",")
-            idArr := make([]string, 0, len(encodeArr))
-            for _, encodeId := range encodeArr {
-                if tmp := encrypt.CommonDecodeArticle("content", encodeId); len(tmp) > 0 {
-                    if id := tmp[0]; id != "" {
-                        idArr = append(idArr, id)
-                    }
-                }
-            }
-            spqp.SelectInfoIds = idArr
-        }
+		//选择导出
+		if selectIds := strings.TrimSpace(des.GetString("selectIds")); selectIds != "" {
+			encodeArr := strings.Split(selectIds, ",")
+			idArr := make([]string, 0, len(encodeArr))
+			for _, encodeId := range encodeArr {
+				if tmp := encrypt.CommonDecodeArticle("content", encodeId); len(tmp) > 0 {
+					if id := tmp[0]; id != "" {
+						idArr = append(idArr, id)
+					}
+				}
+			}
+			spqp.SelectInfoIds = idArr
+		}
 
-        if vipType == jy.SwitchService.Member {
-            spqp.PushMysql = db.MysqlMemberPush
-        } else if vipType == jy.SwitchService.Entniche {
-            spqp.PushMysql = db.MysqlEntnichePush
-        } else {
-            spqp.PushMysql = db.MysqlPush
-        }
-        _, _, list := jy.NewSubscribePush(vipType).Datas(spqp)
-        if list == nil || len(list) == 0 {
-            return nil, fmt.Errorf("未匹配到导出数据")
-        }
-        ids := make([]string, 0, len(list))
-        keyWords := make([]string, 0, len(list))
-        for _, pushData := range list {
-            if pushData.Id != "" {
-                if tmp := encrypt.CommonDecodeArticle("content", pushData.Id); len(tmp) > 0 {
-                    if id := tmp[0]; id != "" {
-                        ids = append(ids, id)
-                        keyWords = append(keyWords, strings.Join(pushData.MatchKeys, ","))
-                    }
-                }
-            }
-        }
+		if vipType == jy.SwitchService.Member {
+			spqp.PushMysql = db.MysqlMemberPush
+		} else if vipType == jy.SwitchService.Entniche {
+			spqp.PushMysql = db.MysqlEntnichePush
+		} else {
+			spqp.PushMysql = db.MysqlPush
+		}
+		_, _, list := jy.NewSubscribePush(vipType).Datas(spqp)
+		if list == nil || len(list) == 0 {
+			return nil, fmt.Errorf("未匹配到导出数据")
+		}
+		ids := make([]string, 0, len(list))
+		keyWords := make([]string, 0, len(list))
+		for _, pushData := range list {
+			if pushData.Id != "" {
+				if tmp := encrypt.CommonDecodeArticle("content", pushData.Id); len(tmp) > 0 {
+					if id := tmp[0]; id != "" {
+						ids = append(ids, id)
+						keyWords = append(keyWords, strings.Join(pushData.MatchKeys, ","))
+					}
+				}
+			}
+		}
 
-        saveData := map[string]interface{}{
-            "s_userid":     userId,
-            "comeinfrom":   "pushHistory",
-            "comeintime":   time.Now().Unix(),
-            "selectIds":    ids,
-            "pushKeyWords": keyWords,
-        }
-        _id := db.Mgo.Save(dataexport.ExportTable, saveData)
-        if _id == "" {
-            return nil, fmt.Errorf("创建导出异常")
-        }
-        return map[string]interface{}{
-            "_id": encrypt.SE.Encode2Hex(_id),
-        }, nil
-    }()
-    if errMsg != nil {
-        log.Printf("%s DataExportStruct ByPushHistory:%s\n", userId, errMsg.Error())
-    }
-    des.ServeJson(NewResult(rData, errMsg))
+		saveData := map[string]interface{}{
+			"s_userid":     userId,
+			"comeinfrom":   "pushHistory",
+			"comeintime":   time.Now().Unix(),
+			"selectIds":    ids,
+			"pushKeyWords": keyWords,
+		}
+		_id := db.Mgo.Save(dataexport.ExportTable, saveData)
+		if _id == "" {
+			return nil, fmt.Errorf("创建导出异常")
+		}
+		return map[string]interface{}{
+			"_id": encrypt.SE.Encode2Hex(_id),
+		}, nil
+	}()
+	if errMsg != nil {
+		log.Printf("%s DataExportStruct ByPushHistory:%s\n", userId, errMsg.Error())
+	}
+	des.ServeJson(NewResult(rData, errMsg))
 }

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

@@ -5,7 +5,7 @@ go 1.18
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20231026082242-8eb41c7bdda6
 	app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545
-	app.yhyue.com/moapp/jypkg v1.0.7
+	app.yhyue.com/moapp/jypkg v1.0.8-0.20231120061054-0036ef2c8301
 	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.15
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67
 	github.com/alibabacloud-go/darabonba-openapi/v2 v2.0.4

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

@@ -9,8 +9,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20231026082242-8eb41c7bdda6 h1:uyaBp5Iuc/Il4+O
 app.yhyue.com/moapp/jybase v0.0.0-20231026082242-8eb41c7bdda6/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 v1.0.7 h1:BXwqRJWTYAw+V7mpQnnZn4EDCqSxVbH6YxiQKUH2xfw=
-app.yhyue.com/moapp/jypkg v1.0.7/go.mod h1:LuxdVd+j3uwm7N5j2hivmpPU0LJytEV7iwAIljdoc4Q=
+app.yhyue.com/moapp/jypkg v1.0.8-0.20231120061054-0036ef2c8301 h1:TV1QhUD4m0imwd5lCQcHmsgkGHg6zWlvtQcuGB8ALH4=
+app.yhyue.com/moapp/jypkg v1.0.8-0.20231120061054-0036ef2c8301/go.mod h1:LuxdVd+j3uwm7N5j2hivmpPU0LJytEV7iwAIljdoc4Q=
 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=

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

@@ -376,7 +376,7 @@ func (this *dataExportPackStruct) DoEntPackRepeatCheck(sess *httpsession.Session
 		exportLock.Unlock()
 		entLock.Lock()
 		//开始去重
-		_, newCount, _ := dataexport.GetEntDataExportCount(util.MQFW, config.Config.Elasticsearch,
+		_, newCount, _ := dataexport.GetEntDataExportCount(util.MQFW, util.Mgo_bidding, config.Config.Mongobidding.DbName, config.Config.Elasticsearch,
 			selectId, entIdInt, entUserId, true, middleGround.JyApiConfig.ApiList.EntDedupUrl, config.ExConf.MsgMaxCount)
 		entLock.Unlock()
 		return newCount, err
@@ -391,10 +391,10 @@ 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, config.Config.Elasticsearch, selectId, qutil.If(isSenior, "2", "1").(string), checkCount)
+	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), checkCount)
 	if err == nil && list != nil && len(*list) > 0 {
-		list = dataexport.FormatExportData(list, config.Config.WebDomain, "2")
+		list = dataexport.FormatExportData(util.MQFWENT, list, config.Config.WebDomain, "2")
 		err = util.CreateDataExportExcelFile(list, isSenior, config.ExConf.ExcelPayedPath+url) //创建excel文件
 	}
 	if err == nil {
@@ -444,7 +444,7 @@ func (this *dataExportPackStruct) UseEntPack(sess *httpsession.Session, userId,
 		current := dataexport.GetCurrentCount(util.Mysql, util.Mgo_Qyfw, entIdInt)
 		log.Println("企业总条数", current)
 		//开始去重
-		count, newCount, data = dataexport.GetEntDataExportCount(util.MQFW, config.Config.Elasticsearch,
+		count, newCount, data = dataexport.GetEntDataExportCount(util.MQFW, util.Mgo_bidding, config.Config.Mongobidding.DbName, config.Config.Elasticsearch,
 			selectId, entIdInt, entUserId, false, middleGround.JyApiConfig.ApiList.EntDedupUrl, config.ExConf.MsgMaxCount)
 
 		if newCount > current {

+ 3 - 3
src/jfw/modules/subscribepay/src/entity/order.go

@@ -255,7 +255,7 @@ func dataExportOrder(m map[string]interface{}, userId string) (*OrderInfo, strin
 	} else if data_spec == "senior" {
 		data_spec = "高级字段包"
 	}
-	data_count := dataexport.GetDataExportSearchCountByScdId(util.MQFW, config.Config.Elasticsearch, id)
+	data_count := dataexport.GetDataExportSearchCountByScdId(util.MQFW, util.Mgo_bidding, config.Config.Mongobidding.DbName, config.Config.Elasticsearch, id)
 	if data_count > config.ExConf.MsgMaxCount || data_count == -1 {
 		data_count = config.ExConf.MsgMaxCount
 	}
@@ -314,9 +314,9 @@ func dataExportOrder(m map[string]interface{}, userId string) (*OrderInfo, strin
 	ordercode := pay.GetOrderCode(userId)
 	download_url := util.GetExcelFilePath(ordercode, data_count)
 	go func() {
-		list, err := dataexport.GetDataExportSearchResultByScdId(util.MQFW, config.Config.Elasticsearch, id, qu.If(data_spec == "高级字段包", "2", "1").(string), data_count)
+		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 {
-			list = dataexport.FormatExportData(list, config.Config.WebDomain, qu.If(data_spec == "高级字段包", "2", "1").(string))
+			list = dataexport.FormatExportData(util.MQFWENT, list, config.Config.WebDomain, qu.If(data_spec == "高级字段包", "2", "1").(string))
 			err = util.CreateDataExportExcelFile(list, data_spec == "高级字段包", config.ExConf.ExcelReadyPath+download_url)
 		}
 		if err != nil {

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

@@ -182,7 +182,7 @@ func (d *dataExportSpec) GetSelectPrice() (int, error) {
 		return 0, errors.New("参数异常")
 	}
 	// 2. 获取数量
-	dataCount := dataexport.GetDataExportSearchCountByScdId(util.MQFW, config.Config.Elasticsearch, d.filterId)
+	dataCount := dataexport.GetDataExportSearchCountByScdId(util.MQFW, util.Mgo_bidding, config.Config.Mongobidding.DbName, config.Config.Elasticsearch, d.filterId)
 	if dataCount > config.ExConf.MsgMaxCount || dataCount == -1 {
 		dataCount = config.ExConf.MsgMaxCount
 	}

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

@@ -5,7 +5,7 @@ go 1.19
 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 v1.0.7
+	app.yhyue.com/moapp/jypkg v1.0.8-0.20231120061054-0036ef2c8301
 	bp.jydev.jianyu360.cn/BaseService/pushpkg v0.0.0-20230225061813-384daf716c9d
 	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.15-0.20230925060020-8e4db0f1e13e
 	github.com/SKatiyar/qr v0.0.0-20151201054752-25b6bdf44e67

+ 2 - 2
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 v1.0.7 h1:BXwqRJWTYAw+V7mpQnnZn4EDCqSxVbH6YxiQKUH2xfw=
-app.yhyue.com/moapp/jypkg v1.0.7/go.mod h1:LuxdVd+j3uwm7N5j2hivmpPU0LJytEV7iwAIljdoc4Q=
+app.yhyue.com/moapp/jypkg v1.0.8-0.20231120061054-0036ef2c8301 h1:TV1QhUD4m0imwd5lCQcHmsgkGHg6zWlvtQcuGB8ALH4=
+app.yhyue.com/moapp/jypkg v1.0.8-0.20231120061054-0036ef2c8301/go.mod h1:LuxdVd+j3uwm7N5j2hivmpPU0LJytEV7iwAIljdoc4Q=
 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=

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

@@ -74,7 +74,7 @@ func (p *DataExportPay) CreateOrder() {
 		data_spec = "高级字段包"
 	}
 
-	data_count := dataexport.GetDataExportSearchCountByScdId(util.MQFW, config.Config.Elasticsearch, id)
+	data_count := dataexport.GetDataExportSearchCountByScdId(util.MQFW, util.Mgo_bidding, config.Config.Mongobidding.DbName, config.Config.Elasticsearch, id)
 	if data_count > config.ExConf.MsgMaxCount || data_count == -1 {
 		data_count = config.ExConf.MsgMaxCount
 	}
@@ -166,9 +166,9 @@ func (p *DataExportPay) CreateOrder() {
 		ordercode := pay.GetOrderCode(openId)
 		download_url := util.GetExcelFilePath(ordercode, data_count)
 		go func() {
-			list, err := dataexport.GetDataExportSearchResultByScdId(util.MQFW, config.Config.Elasticsearch, id, qutil.If(data_spec == "高级字段包", "2", "1").(string), data_count)
+			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 {
-				list = dataexport.FormatExportData(list, config.Config.WebDomain, qutil.If(data_spec == "高级字段包", "2", "1").(string))
+				list = dataexport.FormatExportData(util.MQFWENT, list, config.Config.WebDomain, qutil.If(data_spec == "高级字段包", "2", "1").(string))
 				err = util.CreateDataExportExcelFile(list, data_spec == "高级字段包", config.ExConf.ExcelReadyPath+download_url)
 			}
 			if err != nil {

+ 2 - 2
src/jfw/modules/subscribepay/src/service/dataexportPack.go

@@ -352,7 +352,7 @@ func (this *DataExportPack) Statistics() {
 		if filterId == "" {
 			return nil, fmt.Errorf("请求参数异常")
 		}
-		selectCount := dataexport.GetDataExportSearchCountByScdId(util.MQFW, config.Config.Elasticsearch, filterId)
+		selectCount := dataexport.GetDataExportSearchCountByScdId(util.MQFW, util.Mgo_bidding, config.Config.Mongobidding.DbName, config.Config.Elasticsearch, filterId)
 		if selectCount > config.ExConf.MsgMaxCount || selectCount == -1 {
 			selectCount = config.ExConf.MsgMaxCount
 		}
@@ -410,7 +410,7 @@ func (this *DataExportPack) PackPay() {
 		if filterId == "" {
 			return nil, fmt.Errorf("请求参数异常")
 		}
-		selectCount := dataexport.GetDataExportSearchCountByScdId(util.MQFW, config.Config.Elasticsearch, filterId)
+		selectCount := dataexport.GetDataExportSearchCountByScdId(util.MQFW, util.Mgo_bidding, config.Config.Mongobidding.DbName, config.Config.Elasticsearch, filterId)
 		if selectCount > config.ExConf.MsgMaxCount || selectCount == -1 {
 			selectCount = config.ExConf.MsgMaxCount
 		}