Jelajahi Sumber

Merge branch 'dev/v4.8.70_rjj' of qmx/jy into feature/v4.8.70

renjiaojiao 1 tahun lalu
induk
melakukan
ca2a0ba225
2 mengubah file dengan 61 tambahan dan 22 penghapusan
  1. 6 5
      src/jfw/front/dataExport.go
  2. 55 17
      src/jfw/modules/app/src/app/front/dataExport.go

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

@@ -847,7 +847,7 @@ func (d *DataExport) ValuationList(order_code string) error {
 
 func (d *DataExport) SetDontPromptAgain() {
 	status := d.GetString("status") //0 提示  1 不再提示
-	userId := d.GetSession("userId").(string)
+	userId := d.GetSession("mgoUserId").(string)
 	boo := public.MQFW.UpdateById("user", userId, map[string]interface{}{
 		"$set": map[string]interface{}{
 			"i_export_promptAgain": status,
@@ -863,10 +863,11 @@ func (d *DataExport) SetDontPromptAgain() {
 
 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 {
+	userId := d.GetSession("mgoUserId").(string)
+	fmt.Println("userId", userId)
+	user, ok := public.MQFW.FindById("user", userId, `{"i_export_promptAgain":1}`)
+	if ok && user != nil && len(*user) > 0 {
+		if util.IntAll((*user)["i_export_promptAgain"]) == 1 {
 			isPrompt = false
 		}
 	}

+ 55 - 17
src/jfw/modules/app/src/app/front/dataExport.go

@@ -3,6 +3,7 @@ package front
 import (
 	"encoding/json"
 	"errors"
+	"fmt"
 	"log"
 	"strings"
 	"time"
@@ -18,23 +19,26 @@ import (
 
 type WxDataExport struct {
 	*xweb.Action
-	toSieve       xweb.Mapper `xweb:"/jyapp/front/dataExport/toSieve"`       //微信数据导出
-	saveData      xweb.Mapper `xweb:"/jyapp/front/dataExport/saveData"`      //保存筛选数据
-	area          xweb.Mapper `xweb:"/jyapp/front/dataExport/area"`          //区域
-	industry      xweb.Mapper `xweb:"/jyapp/front/dataExport/industry"`      //行业
-	buyerclass    xweb.Mapper `xweb:"/jyapp/front/dataExport/buyerclass"`    //采购单位类型
-	keyWord       xweb.Mapper `xweb:"/jyapp/front/dataExport/keyWord"`       //关键词
-	keyWordInput  xweb.Mapper `xweb:"/jyapp/front/dataExport/keyWordInput"`  //关键词输入
-	appended      xweb.Mapper `xweb:"/jyapp/front/dataExport/appended"`      //附加词
-	appendedInput xweb.Mapper `xweb:"/jyapp/front/dataExport/appendedInput"` //附加词输入
-	exclude       xweb.Mapper `xweb:"/jyapp/front/dataExport/exclude"`       //排除词
-	excludeInput  xweb.Mapper `xweb:"/jyapp/front/dataExport/excludeInput"`  //排除词输入
-	price         xweb.Mapper `xweb:"/jyapp/front/dataExport/price"`         //金额
-	subType       xweb.Mapper `xweb:"/jyapp/front/dataExport/subType"`       //信息类型
-	buyerEdit     xweb.Mapper `xweb:"/jyapp/front/dataExport/buyerEdit"`     //采购单位编辑
-	buyerInput    xweb.Mapper `xweb:"/jyapp/front/dataExport/buyerInput"`    //采购单位输入
-	winnerEdit    xweb.Mapper `xweb:"/jyapp/front/dataExport/winnerEdit"`    //中标单位编辑
-	winnerInput   xweb.Mapper `xweb:"/jyapp/front/dataExport/winnerInput"`   //中标单位输入
+	toSieve            xweb.Mapper `xweb:"/jyapp/front/dataExport/toSieve"`            //微信数据导出
+	saveData           xweb.Mapper `xweb:"/jyapp/front/dataExport/saveData"`           //保存筛选数据
+	area               xweb.Mapper `xweb:"/jyapp/front/dataExport/area"`               //区域
+	industry           xweb.Mapper `xweb:"/jyapp/front/dataExport/industry"`           //行业
+	buyerclass         xweb.Mapper `xweb:"/jyapp/front/dataExport/buyerclass"`         //采购单位类型
+	keyWord            xweb.Mapper `xweb:"/jyapp/front/dataExport/keyWord"`            //关键词
+	keyWordInput       xweb.Mapper `xweb:"/jyapp/front/dataExport/keyWordInput"`       //关键词输入
+	appended           xweb.Mapper `xweb:"/jyapp/front/dataExport/appended"`           //附加词
+	appendedInput      xweb.Mapper `xweb:"/jyapp/front/dataExport/appendedInput"`      //附加词输入
+	exclude            xweb.Mapper `xweb:"/jyapp/front/dataExport/exclude"`            //排除词
+	excludeInput       xweb.Mapper `xweb:"/jyapp/front/dataExport/excludeInput"`       //排除词输入
+	price              xweb.Mapper `xweb:"/jyapp/front/dataExport/price"`              //金额
+	subType            xweb.Mapper `xweb:"/jyapp/front/dataExport/subType"`            //信息类型
+	buyerEdit          xweb.Mapper `xweb:"/jyapp/front/dataExport/buyerEdit"`          //采购单位编辑
+	buyerInput         xweb.Mapper `xweb:"/jyapp/front/dataExport/buyerInput"`         //采购单位输入
+	winnerEdit         xweb.Mapper `xweb:"/jyapp/front/dataExport/winnerEdit"`         //中标单位编辑
+	winnerInput        xweb.Mapper `xweb:"/jyapp/front/dataExport/winnerInput"`        //中标单位输入
+	setDontPromptAgain xweb.Mapper `xweb:"/jyapp/front/dataExport/setDontPromptAgain"` //数据导出-超出2w条,不再提示
+	getDontPromptAgain xweb.Mapper `xweb:"/jyapp/front/dataExport/getDontPromptAgain"` //数据导出-超出2w条,不再提示
+
 }
 
 func init() {
@@ -243,6 +247,40 @@ func (w *WxDataExport) SaveData() error {
 	return nil
 }
 
+func (w *WxDataExport) SetDontPromptAgain() {
+	status := w.GetString("status") //0 提示  1 不再提示
+	userId := w.GetSession("mgoUserId").(string)
+	boo := public.MQFW.UpdateById("user", userId, map[string]interface{}{
+		"$set": map[string]interface{}{
+			"i_export_promptAgain": status,
+		},
+	})
+	w.ServeJson(map[string]interface{}{
+		"error_code": 0,
+		"error_msg":  "",
+		"success":    boo,
+	})
+	return
+}
+
+func (w *WxDataExport) GetDontPromptAgain() {
+	isPrompt := true
+	userId := w.GetSession("mgoUserId").(string)
+	fmt.Println("userId", userId)
+	user, ok := public.MQFW.FindById("user", userId, `{"i_export_promptAgain":1}`)
+	if ok && user != nil && len(*user) > 0 {
+		if util.IntAll((*user)["i_export_promptAgain"]) == 1 {
+			isPrompt = false
+		}
+	}
+	w.ServeJson(map[string]interface{}{
+		"error_code": 0,
+		"error_msg":  "",
+		"isPrompt":   isPrompt,
+	})
+	return
+}
+
 // Area 区域
 func (w *WxDataExport) Area() error {
 	w.Render("/dataExport/dataExport_area.html")