wangkaiyue 4 жил өмнө
parent
commit
32a32a347e

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

@@ -368,6 +368,7 @@ func (d *DataExport) SuperSearchExport() error {
 	saveData := reqData.PassBidSearchExport()
 	saveData := reqData.PassBidSearchExport()
 	saveData["s_openid"] = openid
 	saveData["s_openid"] = openid
 	saveData["s_userid"] = userId
 	saveData["s_userid"] = userId
+	saveData["comeinfrom"] = "supersearchPage"
 	//存入数据库
 	//存入数据库
 	_id := mongodb.Save(dataexport.ExportTable, saveData)
 	_id := mongodb.Save(dataexport.ExportTable, saveData)
 	return d.Redirect("/front/dataExport/toCreateOrderPage/" + util.SE.Encode2Hex(_id))
 	return d.Redirect("/front/dataExport/toCreateOrderPage/" + util.SE.Encode2Hex(_id))

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

@@ -391,6 +391,7 @@ func (wd *WsDataExport) SearchExport() error {
 	saveData := reqData.PassBidSearchExport()
 	saveData := reqData.PassBidSearchExport()
 	saveData["s_openid"] = openid
 	saveData["s_openid"] = openid
 	saveData["s_userid"] = userId
 	saveData["s_userid"] = userId
+	saveData["comeinfrom"] = "supersearchPage"
 
 
 	//存入数据库
 	//存入数据库
 	_id := mongodb.Save(dataexport.ExportTable, saveData)
 	_id := mongodb.Save(dataexport.ExportTable, saveData)

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

@@ -358,6 +358,7 @@ func (wd *WsDataExport) SearchExport() error {
 	saveData := reqData.PassBidSearchExport()
 	saveData := reqData.PassBidSearchExport()
 	saveData["s_openid"] = openid
 	saveData["s_openid"] = openid
 	saveData["s_userid"] = userId
 	saveData["s_userid"] = userId
+	saveData["comeinfrom"] = "supersearchPage"
 
 
 	//存入数据库
 	//存入数据库
 	_id := mongodb.Save(dataexport.ExportTable, saveData)
 	_id := mongodb.Save(dataexport.ExportTable, saveData)

+ 11 - 0
src/jfw/modules/publicapply/src/dataexport/init.go

@@ -0,0 +1,11 @@
+package dataexport
+
+import (
+	"dataexport/service"
+
+	"github.com/go-xweb/xweb"
+)
+
+func init() {
+	xweb.AddAction(&service.DataExportStruct{})
+}

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

@@ -0,0 +1,43 @@
+package service
+
+import (
+	. "api"
+	"db"
+	"fmt"
+	"github.com/go-xweb/xweb"
+	"jfw/public"
+	"log"
+	"qfw/util"
+	"qfw/util/dataexport"
+	"strings"
+)
+
+type DataExportStruct struct {
+	*xweb.Action
+	byCollection xweb.Mapper `xweb:"/dataexpoet/bycollection"` //数据导出_收藏导出
+}
+
+func (des *DataExportStruct) ByCollection() {
+	userId, _ := des.GetSession("userId").(string)
+	rData, errMsg := func() (interface{}, error) {
+		reqData := public.BidSearchExport{
+			SelectIds: strings.TrimSpace(des.GetString("selectIds")), //选择信息id
+		}
+		saveData := reqData.PassBidSearchExport()
+		saveData["s_openid"] = util.ObjToString(des.GetSession("s_m_openid"))
+		saveData["s_userid"] = userId
+		saveData["comeinfrom"] = "collectionPage"
+
+		_id := db.Mgo.Save(dataexport.ExportTable, saveData)
+		if _id == "" {
+			return nil, fmt.Errorf("选择导出异常")
+		}
+		return map[string]interface{}{
+			"_id": util.SE.Encode2Hex(_id),
+		}, nil
+	}()
+	if errMsg != nil {
+		log.Printf("%s DataExportStruct ByCollection:%s\n", userId, errMsg.Error())
+	}
+	des.ServeJson(NewResult(rData, errMsg))
+}

+ 1 - 0
src/jfw/modules/publicapply/src/enterpriseSearch/entity/entQuery.go

@@ -110,6 +110,7 @@ func (es *EnterpriseSearch) GetQuerySql() string {
 	musts := make([]string, 0, 0)
 	musts := make([]string, 0, 0)
 	//输入查询
 	//输入查询
 	if es.Match != "" { //或关系 仅需满足一个
 	if es.Match != "" { //或关系 仅需满足一个
+		//可简写 {"bool":{"should":[{"match_phrase":{"ent_ikname":"李智"}},{"multi_match":{"query":"李智","type":"phrase","fields":["stock_name","employee_name","legal_person","bid_purchasing","bid_projectname"]}}],"minimum_should_match":1}}
 		thisQuery := []string{}
 		thisQuery := []string{}
 		if es.MatchType != "" { //查询指定内容
 		if es.MatchType != "" { //查询指定内容
 			for _, t := range strings.Split(es.MatchType, ",") {
 			for _, t := range strings.Split(es.MatchType, ",") {

+ 1 - 0
src/jfw/modules/publicapply/src/main.go

@@ -4,6 +4,7 @@ import (
 	_ "a"
 	_ "a"
 	_ "bidcollection"
 	_ "bidcollection"
 	. "config"
 	. "config"
+	_ "dataexport"
 	_ "db"
 	_ "db"
 	_ "enterpriseSearch"
 	_ "enterpriseSearch"
 	_ "filter"
 	_ "filter"

+ 0 - 1
src/jfw/public/dataexport.go

@@ -174,7 +174,6 @@ func (this *BidSearchExport) PassBidSearchExport() (returnData map[string]interf
 	if this.SelectIds != "" {
 	if this.SelectIds != "" {
 		ids := []string{}
 		ids := []string{}
 		for _, encodeId := range strings.Split(this.SelectIds, ",") {
 		for _, encodeId := range strings.Split(this.SelectIds, ",") {
-			log.Println("xxxxx", util.CommonDecodeArticle("content", encodeId))
 			if tmp := util.CommonDecodeArticle("content", encodeId); len(tmp) > 0 {
 			if tmp := util.CommonDecodeArticle("content", encodeId); len(tmp) > 0 {
 				if id := tmp[0]; id != "" {
 				if id := tmp[0]; id != "" {
 					ids = append(ids, id)
 					ids = append(ids, id)