zhangjinkun vor 5 Jahren
Ursprung
Commit
10ef884ade
2 geänderte Dateien mit 32 neuen und 16 gelöschten Zeilen
  1. 1 1
      udpcreateindex/src/main.go
  2. 31 15
      udpcreateindex/src/task.go

+ 1 - 1
udpcreateindex/src/main.go

@@ -98,7 +98,7 @@ func init() {
 }
 
 func main() {
-	go task_projects()
+	go task_index()
 	updport := Sysconfig["udpport"].(string)
 	udpclient = mu.UdpClient{Local: updport, BufSize: 1024}
 	udpclient.Listen(processUdpMsg)

+ 31 - 15
udpcreateindex/src/task.go

@@ -3,26 +3,42 @@ package main
 
 import (
 	"log"
+	qutil "qfw/util"
 	"time"
 
 	"github.com/cron"
 )
 
-func task_projects() {
+func task_index() {
 	c := cron.New()
-	_ = c.AddFunc("20 30 5 * * *", func() {
-		t := time.Now()
-		pici := time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, time.Local).Unix()
-		log.Println(pici)
-		mapInfo := map[string]interface{}{
-			"query": map[string]interface{}{
-				"pici": map[string]interface{}{
-					"$gte": pici - 86400,
-					"$lte": pici,
-				},
-			},
-		}
-		projectTask([]byte{}, project2, mapInfo)
-	})
+	c.AddFunc("20 30 5 * * *", func() { task_projects() })
 	c.Start()
 }
+
+//招标附件、标的物,临时用
+func task_biddingfile() {
+	defer qutil.Catch()
+	q := map[string]interface{}{
+		"extract_state": map[string]interface{}{
+			"$eq": 2,
+		},
+	}
+	log.Println(q)
+	//待续
+}
+
+//project2项目索引
+func task_projects() {
+	t := time.Now()
+	pici := time.Date(t.Year(), t.Month(), t.Day(), 0, 0, 0, 0, time.Local).Unix()
+	log.Println(pici)
+	mapInfo := map[string]interface{}{
+		"query": map[string]interface{}{
+			"pici": map[string]interface{}{
+				"$gte": pici - 86400,
+				"$lte": pici,
+			},
+		},
+	}
+	projectTask([]byte{}, project2, mapInfo)
+}