xuzhiheng 1 year ago
parent
commit
779d83e345

+ 2 - 0
customerdata/src/util.go

@@ -729,6 +729,7 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, a
 			}
 		}
 		tmp["details"] = qu.ObjToString(info["detail"])
+		tmp["bidtype"] = qu.ObjToString(info["bidtype"])
 		tmp["owner"] = qu.ObjToString(info["owner"])
 		tmp["total_investment"] = qu.ObjToString(info["total_investment"])
 		tmp["approvestatus"] = qu.ObjToString(info["approvestatus"])
@@ -785,6 +786,7 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, a
 				}
 			}
 			tmp["details"] = qu.ObjToString(info["detail"])
+			tmp["bidtype"] = qu.ObjToString(info["bidtype"])
 			tmp["owner"] = qu.ObjToString(info["owner"])
 			tmp["total_investment"] = qu.ObjToString(info["total_investment"])
 			tmp["approvestatus"] = qu.ObjToString(info["approvestatus"])

+ 4 - 4
src/config.json

@@ -58,19 +58,19 @@
     "coll_project": "usermail_history_projectid"
   },
   "extract": {
-    "addr": "192.168.3.206:27080",
+    "addr": "192.168.3.71:29099",
     "coll": "result_20200917",
     "db": "qfw",
     "size": 15
   },
   "es": {
-    "addr": "http://192.168.3.241:9205",
+    "addr": "http://127.0.0.1:9802",
     "index": "bidding",
     "itype": "bidding",
     "pool": 15,
     "version": "v7",
-    "userName": "",
-    "password": ""
+    "userName": "qyfw_es_2",
+    "password": "Khfdals33#"
   },
   "mail": [
     {

+ 17 - 14
src/history/util_history.go

@@ -808,14 +808,6 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, h
 	if isDis && tmp["winner_type"] == "集成商" {
 		return
 	}
-	if noticeFilter == 1 && (dataTable == 0 || dataTable == 1) && isOk {
-		ok := checkBidId(appid, id, dataTable)
-		if !ok {
-			isOk = false
-			tmp["chongfu"] = id
-			MgoSave.Save(SaveCollbid, tmp)
-		}
-	}
 	//匹配公告附件
 	info := MgoBidding.FindOne(BiddingColl, map[string]interface{}{"_id": mongodb.StringTOBsonId(id)})
 	if info != nil && len(info) > 0 {
@@ -867,6 +859,7 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, h
 			}
 		}
 		tmp["details"] = qu.ObjToString(info["detail"])
+		tmp["bidtype"] = qu.ObjToString(info["bidtype"])
 		tmp["owner"] = qu.ObjToString(info["owner"])
 		tmp["total_investment"] = qu.ObjToString(info["total_investment"])
 		tmp["approvestatus"] = qu.ObjToString(info["approvestatus"])
@@ -923,6 +916,7 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, h
 				}
 			}
 			tmp["details"] = qu.ObjToString(info["detail"])
+			tmp["bidtype"] = qu.ObjToString(info["bidtype"])
 			tmp["owner"] = qu.ObjToString(info["owner"])
 			tmp["total_investment"] = qu.ObjToString(info["total_investment"])
 			tmp["approvestatus"] = qu.ObjToString(info["approvestatus"])
@@ -1080,6 +1074,15 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, h
 		}
 		tmp["contact"] = contactAllInfo
 	}
+	if noticeFilter == 1 && (dataTable == 0 || dataTable == 1) && isOk {
+		ok := checkBidId(appid, id, dataTable)
+		log.Println("公告去重结果", id, dataTable, ok)
+		if !ok {
+			isOk = false
+			tmp["chongfu"] = id
+			MgoSave.Save(SaveCollbid, tmp)
+		}
+	}
 	if isOk {
 		if dataSave != "" {
 			MgoSave.Save(dataSave, tmp)
@@ -2320,7 +2323,7 @@ func GetXlsxs(mMap []map[string]interface{}, i_contact int, fn, email, id string
 				//生文件
 				//t := strconv.FormatInt(time.Now().Unix(), 10)
 				t := time.Now().Format("20060102")
-				dir := "./web/res/xlsx/" + t + "/"
+				dir := "/nas/jyqyfw/datatag/xlsx/" + t + "/"
 				if b, _ := PathExists(dir); !b {
 					err1 := os.MkdirAll(dir, os.ModePerm)
 					if err1 != nil {
@@ -2373,7 +2376,7 @@ func GetXlsxs(mMap []map[string]interface{}, i_contact int, fn, email, id string
 				//生文件
 				//t := strconv.FormatInt(time.Now().Unix(), 10)
 				t := time.Now().Format("20060102")
-				dir := "./web/res/xlsx/" + t + "/"
+				dir := "/nas/jyqyfw/datatag/xlsx/" + t + "/"
 				if b, _ := PathExists(dir); !b {
 					err1 := os.MkdirAll(dir, os.ModePerm)
 					if err1 != nil {
@@ -2495,15 +2498,15 @@ func InitUsermailProjectId(appid string) {
 func checkBidId(appid, id string, dataTable int) bool {
 	isOk := true
 	if dataTable == 1 {
-		count := MgoCus.Count(SaveUserMail, bson.M{"appid": appid, "id": id})
-		if count > 0 {
+		countData, ok := MgoSave.FindOne(SaveUserMail, map[string]interface{}{"appid": appid, "id": id})
+		if ok && countData != nil && len(*countData) > 0 {
 			log.Println("用户 ", appid, " 在 ", SaveUserMail, " 中找到重复公告id ", id)
 			isOk = false
 		}
 	}
 	if dataTable == 0 {
-		count := Mgo.Count(SaveColl, bson.M{"appid": appid, "id": id})
-		if count > 0 {
+		countData, ok := MgoSave.FindOne(SaveColl, map[string]interface{}{"appid": appid, "id": id})
+		if ok && countData != nil && len(*countData) > 0 {
 			log.Println("用户 ", appid, " 在 ", SaveColl, " 中找到重复公告id ", id)
 			isOk = false
 		}

+ 1 - 1
src/service/second_push.go

@@ -1025,7 +1025,7 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id, appid string) {
 			//生文件
 			//t := strconv.FormatInt(time.Now().Unix(), 10)
 			t := time.Now().Format("20060102")
-			dir := "./web/res/xlsx/" + t + "/"
+			dir := "/nas/jyqyfw/datatag/xlsx/" + t + "/"
 			if b, _ := history.PathExists(dir); !b {
 				err1 := os.MkdirAll(dir, os.ModePerm)
 				if err1 != nil {

+ 27 - 27
src/util/utiltag.go

@@ -140,38 +140,38 @@ func searchDataArr(index, esquery, sdataid, userId string, i_maxnum int64, tags
 	var (
 		err    error
 		counts = int64(0)
-		times  = 0
+		// times  = 0
 		times2 = 0
 	)
-	for {
-		listLen := redis.GetInt("session", "es_status")
-		if listLen == 0 {
-			log.Println("es空闲!")
-			break
-		} else if times > 10 {
-			err = errors.New("系统繁忙,请稍后再试")
-			break
-		} else {
-			log.Println("es繁忙,", listLen)
-		}
-		times += 2
-		time.Sleep(2 * time.Second)
-	}
+	// for {
+	// 	listLen := redis.GetInt("session", "es_status")
+	// 	if listLen == 0 {
+	// 		log.Println("es空闲!")
+	// 		break
+	// 	} else if times > 10 {
+	// 		err = errors.New("系统繁忙,请稍后再试")
+	// 		break
+	// 	} else {
+	// 		log.Println("es繁忙,", listLen)
+	// 	}
+	// 	times += 2
+	// 	time.Sleep(2 * time.Second)
+	// }
 	for {
 		listLens := int(redis.LLEN("datag", "jyqyfw_es_query"))
 		if listLens < 2 {
-			if isExists, _ := redis.Exists("datag", "jyqyfw_es_query_times_"+userId); isExists {
-				qt := redis.GetInt("datag", "jyqyfw_es_query_times_"+userId)
-				if qt > 2 {
-					log.Println("单个账号一分钟内超过3次 ", qt)
-					err = errors.New("系统繁忙,请稍后再试")
-					break
-				} else {
-					redis.Incr("datag", "jyqyfw_es_query_times_"+userId)
-				}
-			} else {
-				redis.Put("datag", "jyqyfw_es_query_times_"+userId, 1, 60)
-			}
+			// if isExists, _ := redis.Exists("datag", "jyqyfw_es_query_times_"+userId); isExists {
+			// 	qt := redis.GetInt("datag", "jyqyfw_es_query_times_"+userId)
+			// 	if qt > 2 {
+			// 		log.Println("单个账号一分钟内超过3次 ", qt)
+			// 		err = errors.New("系统繁忙,请稍后再试")
+			// 		break
+			// 	} else {
+			// 		redis.Incr("datag", "jyqyfw_es_query_times_"+userId)
+			// 	}
+			// } else {
+			// 	redis.Put("datag", "jyqyfw_es_query_times_"+userId, 1, 60)
+			// }
 			log.Println("es空闲,当前进程数 ", listLens)
 			redis.RPUSH("datag", "jyqyfw_es_query", 1)
 			err, counts = searchData(index, esquery, sdataid, i_maxnum, tags, maths)

+ 1 - 1
src/web/templates/private/customer_edit.html

@@ -937,7 +937,7 @@
         $('#cuserRule').DataTable({
             "destroy": true,
             "paging": true,
-            "lengthChange": false,
+            "lengthChange": true,
             "searching": false,
             "ordering": false,
             "info": true,