|
@@ -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")
|