maxiaoshan 4 years ago
parent
commit
0ddfc95702
3 changed files with 31 additions and 25 deletions
  1. 18 0
      src/config.json
  2. 6 19
      src/main.go
  3. 7 6
      src/util/config.go

+ 18 - 0
src/config.json

@@ -5,6 +5,8 @@
     "size": 10,
     "fromtable": "marked",
     "totablel": "errdata",
+    "redis": "extcheck=192.168.3.207:1679",
+    "redistimeout": 10,
     "bidding":{
     	"addr":"192.168.3.207:27092",
 		"db": "mxs",
@@ -65,10 +67,18 @@
                 "key": "budget",
                 "descript": "预算"
             },
+            {
+                "key": "biddiscount",
+                "descript": "投标折扣系数"
+            },
             {
                 "key": "bidamount",
                 "descript": "中标金额"
             },
+            {
+                "key": "",
+                "descript": ""
+            },
             {
                 "key": "buyer",
                 "descript": "采购单位"
@@ -134,6 +144,10 @@
                 "key": "winnerzipcode",
                 "descript": "中标邮编"
             },
+            {
+                "key": "purchasing",
+                "descript": "标的物"
+            },
             {
                 "key": "attach_discern",
                 "descript": "附件识别"
@@ -141,6 +155,10 @@
             {
                 "key": "attach_ext",
                 "descript": "附件抽取"
+            },
+            {
+                "key": "isrepeat",
+                "descript": "数据重复"
             }
         ],
         "timeplace":[

+ 6 - 19
src/main.go

@@ -4,8 +4,11 @@ package main
 import (
 	"crypto/md5"
 	"encoding/hex"
+	_ "filter"
 	"front"
 	"log"
+	"qfw/util/redis"
+	"time"
 
 	qu "qfw/util"
 	"strings"
@@ -24,9 +27,8 @@ func init() {
 	//os.Exit(0)
 	qu.ReadConfig(&util.Config)
 	util.InitConfig()
-	//util.InitInfluxdb(util.Config.InfluxdbUrl)
 	//redis
-	//redis.InitRedis(util.Config.Redis)
+	redis.InitRedis(util.Config.Redis)
 	//oss
 	util.InitOss()
 	//xweb框架配置
@@ -36,29 +38,14 @@ func init() {
 	xweb.RootApp().AppConfig.StaticDir = "web/staticres"
 	xweb.RootApp().AppConfig.StaticFileVersion = false
 	xweb.RootApp().AppConfig.CheckXsrf = false
-	xweb.RootApp().AppConfig.ReloadTemplates = false
+	xweb.RootApp().AppConfig.ReloadTemplates = true
 	xweb.RootApp().AppConfig.EnableHttpCache = false
 	xweb.RootApp().AppConfig.Mode = xweb.Product
 	xweb.RootApp().AppConfig.CacheTemplates = false
+	xweb.RootApp().AppConfig.SessionTimeout = 3 * time.Hour
 	xweb.AddAction(&front.Front{})
 	//_id初始化内存
 	log.Println("_id初始化内存...")
-	//front.IdList = list.New()
-
-	//加载所有数据,存入IdList
-	//ls, _ := util.MgoM.Find(util.Config.Fromtable, `{"check":{"$exists":0}}`, nil, `{"_id":1}`, false, -1, -1)
-	//ls, _ := util.MgoM.Find(util.Coll, nil, nil, `{"_id":1}`, false, -1, -1)
-	//for _, v := range *ls {
-	//	front.IdList.PushBack(mgo.BsonIdToSId(v["_id"]))
-	//}
-	//qu.Debug("_id初始化内存完成", front.IdList.Len())
-	// front.IdPackList = list.New()
-	// //加载所有未标注数据且含有分包信息的数据
-	// lspack, _ := util.MgoM.Find(util.Config.Fromtable, `{"check":{"$exists":0},"package":{"$exists":1}}`, nil, `{"_id":1}`, false, -1, -1)
-	// for _, v := range *lspack {
-	// 	front.IdPackList.PushBack(mgo.BsonIdToSId(v["_id"]))
-	// }
-	// log.Println("_id初始化内存完成_分包", front.IdPackList.Len())
 }
 
 func main() {

+ 7 - 6
src/util/config.go

@@ -6,7 +6,7 @@ package util
 import (
 	mgo "mongodb"
 	qu "qfw/util"
-	elastic "qfw/util/elastic"
+	"qfw/util/elastic"
 	"sort"
 )
 
@@ -21,6 +21,7 @@ type config struct {
 	Biaozhu       map[string]interface{} `json:"biaozhu"`
 	InfluxdbUrl   string                 `json:"influxdbUrl"`
 	Redis         string                 `json:"redis"`
+	RedisTimeout  int                    `json:"redistimeout"`
 	Bidding       map[string]interface{} `json:"bidding"`
 	Extract       map[string]interface{} `json:"extract"`
 	Elas          map[string]interface{} `json:"es"`
@@ -28,6 +29,7 @@ type config struct {
 	CustomerField map[string]string      `json:"customerfield"`
 }
 
+const JYHREFPRE = "https://www.jianyu360.com/article/content/"
 const SPECIALTYPE = "二级不存在"
 const BIDDINGSTARTID = "5a862f0640d2d9bbe88e3cec"
 
@@ -43,13 +45,13 @@ var (
 	Es       *elastic.Elastic //es
 	Index    string
 	Itype    string
-	Coll     string
 	//
 	AllFieldArr         []map[string]string
 	PurchasinglistField []map[string]string
 	PackageField        []map[string]string
 	WinnerorderField    []map[string]string
 	TopSubStypeArr      []string
+	TopSubStypeArr2     []string
 )
 
 func InitConfig() {
@@ -69,8 +71,8 @@ func InitConfig() {
 		MongodbAddr: qu.ObjToString(bid["addr"]),
 		DbName:      qu.ObjToString(bid["db"]),
 		Size:        qu.IntAll(bid["size"]),
-		UserName:    qu.ObjToString(bid["username"]),
-		Password:    qu.ObjToString(bid["password"]),
+		//UserName:    qu.ObjToString(bid["username"]),
+		//Password:    qu.ObjToString(bid["password"]),
 	}
 	MgoB.InitPool()
 
@@ -170,7 +172,6 @@ func InitConfig() {
 			TopSubStypeArr = append(TopSubStypeArr, top+"-"+qu.ObjToString(sub))
 		}
 	}
+	TopSubStypeArr2 = TopSubStypeArr
 	TopSubStypeArr = append(TopSubStypeArr, SPECIALTYPE)
-	//coll
-	Coll = Config.Fromtable
 }