瀏覽代碼

放撞单修改

WH01243 1 年之前
父節點
當前提交
1d3283f30e
共有 6 個文件被更改,包括 1240 次插入67 次删除
  1. 10 8
      clueSync/config.go
  2. 1 20
      clueSync/config.json
  3. 132 0
      clueSync/db.json
  4. 2 3
      clueSync/go.mod
  5. 1071 7
      clueSync/go.sum
  6. 24 29
      clueSync/main.go

+ 10 - 8
clueSync/config.go

@@ -28,14 +28,16 @@ type (
 		AllocationRatio    float64 `json:"allocationRatio"`
 	}
 	DB struct {
-		CornExp1 string `json:"cornexp1"`
-		CornExp2 string `json:"cornexp2"`
-		CornExp3 string `json:"cornexp3"`
-		CornExp4 string `json:"cornexp4"`
-		CornExp5 string `json:"cornexp5"`
-		CornExp6 string `json:"cornexp6"`
-		CornExp7 string `json:"cornexp7"`
-		TiDb     struct {
+		CornExp1      int64  `json:"cornexp1"`
+		CornExp2      int64  `json:"cornexp2"`
+		CornExp2Start string `json:"cornexp2Strat"`
+		CornExp2End   string `json:"cornexp2End"`
+		CornExp3      string `json:"cornexp3"`
+		CornExp4      string `json:"cornexp4"`
+		CornExp5      int64  `json:"cornexp5"`
+		CornExp6      int64  `json:"cornexp6"`
+		CornExp7      string `json:"cornexp7"`
+		TiDb          struct {
 			Host        string `json:"host"`
 			Port        int    `json:"port"`
 			Database    string `json:"database"`

+ 1 - 20
clueSync/config.json

@@ -1,20 +1 @@
-{
-  "lastOrderId": 258784,
-  "lastOrderClueId": "2024-05-25 02:23:21",
-  "lastUserId": "2024-05-20 15:40:02",
-  "lastId": "668c9fdbd1f99a10cd641691",
-  "lastOrderTime": "2023-04-25 00:00:00",
-  "lastUserTime": "2024-07-09 11:54:02",
-  "lastSubscribeId": "645470af172d9e8dcc5c507a",
-  "lastMessageTime": "2024-06-20 17:54:18",
-  "lastkcTime": "",
-  "lastEverythingTime": "",
-  "lastEventRegTime": "",
-  "lastReadClueTime": "",
-  "bigSaleTime": 1718241923,
-  "bigOrderTime": "2024-06-12 17:01:39",
-  "marketSaleTime": 1708160200,
-  "allocationTime": "2024-07-01 14:59:37",
-  "allocationRatio": 2,
-  "lastXcxUserId": "2024-07-09 14:59:37"
-}
+{"lastOrderId":258784,"lastOrderClueId":"2024-05-25 02:23:21","lastUserId":"2024-07-11 13:38:02","lastXcxUserId":"2024-07-10 16:30:03","lastId":"668e2be1d1f99a10cd6416a9","lastOrderTime":"2024-07-10 18:10:33","lastUserTime":"2024-07-10 17:55:03","lastSubscribeId":"668e3ec29a9f357bd3e3da06","lastMessageTime":"2024-07-09 17:24:47","lastkcTime":"","lastEverythingTime":"","lastEventRegTime":"","lastReadClueTime":"","bigSaleTime":1718241923,"bigOrderTime":"2024-06-12 17:01:39","marketSaleTime":1708160200,"allocationTime":"2024-07-01 14:59:37","allocationRatio":2}

+ 132 - 0
clueSync/db.json

@@ -0,0 +1,132 @@
+{
+  "cornexp1": "0 */30 * * * ?",
+  "cornexp2": "0 */5 9,10,11,12,13,14,15,16,17 * * ?",
+  "cornexp3": "0 30 8 * * ?",
+  "cornexp4": "0 0 0 */1 * ? ",
+  "cornexp5": "0 */5 * * * ?",
+  "cornexp6": "0 */10 * * * ?",
+  "cornexp7": "0 */10 * * * ?",
+  "redisServer": "bidx=192.168.3.206:1712,newother=192.168.3.149:1712",
+  "tiDb": {
+    "host": "192.168.3.149",
+    "port": 4000,
+    "database": "jianyu_subjectdb_test",
+    "user": "datagroup",
+    "password": "Dgrpdb#2024@36",
+    "poolsize": 20,
+    "maxidle": 40,
+    "maxleft": 40
+  },
+  "tiDbData": {
+    "host": "192.168.3.149",
+    "port": 4000,
+    "database": "Call_Accounting",
+    "user": "datagroup",
+    "password": "Dgrpdb#2024@36",
+    "poolsize": 20,
+    "maxidle": 40,
+    "maxleft": 40
+  },
+  "tiDbPower": {
+    "host": "192.168.3.149",
+    "port": 4000,
+    "database": "jianyu_subjectdb_test",
+    "user": "datagroup",
+    "password": "Dgrpdb#2024@36",
+    "poolsize": 20,
+    "maxidle": 40,
+    "maxleft": 40
+  },
+  "workOrder": {
+    "host": "192.168.3.14",
+    "port": 4000,
+    "database": "work_order",
+    "user": "root",
+    "password": "=PDT49#80Z!RVv52_z",
+    "poolsize": 20,
+    "maxidle": 40,
+    "maxleft": 40
+  },
+  "baseService": {
+    "host": "192.168.3.14",
+    "port": 4000,
+    "database": "base_service",
+    "user": "root",
+    "password": "=PDT49#80Z!RVv52_z",
+    "poolsize": 20,
+    "maxidle": 40,
+    "maxleft": 40
+  },
+  "thirdParty": {
+    "host": "192.168.3.14",
+    "port": 4000,
+    "database": "thirdparty",
+    "user": "root",
+    "password": "=PDT49#80Z!RVv52_z",
+    "poolsize": 20,
+    "maxidle": 40,
+    "maxleft": 40
+  },
+  "mysql": {
+    "host": "192.168.3.14",
+    "port": 4000,
+    "database": "jianyu",
+    "user": "root",
+    "password": "=PDT49#80Z!RVv52_z",
+    "poolsize": 20,
+    "maxidle": 40,
+    "maxleft": 40
+  },
+  "mgo": {
+    "address": "192.168.3.149:27180",
+    "dbName": "qfw",
+    "dbSize": 20
+  },
+  "mgoLog": {
+    "address": "192.168.3.149:27190",
+    "dbName": "qfw",
+    "dbSize": 20,
+    "user": "admin",
+    "password": "123456"
+  },
+  "mgoQyxy": {
+    "address": "192.168.3.149:27102",
+    "dbName": "mixdata",
+    "dbSize": 20,
+    "user": "jyDevGroup",
+    "password": "jy@DevGroup"
+  },
+  "es": {
+    "address": "http://192.168.3.149:9200",
+    "dbSize": 20,
+    "version": "v7",
+    "UserName": "",
+    "password": ""
+  },
+  "productArr": [
+    "数据流量包",
+    "结构化数据",
+    "API接口",
+    "广告服务",
+    "物业专版",
+    "市场分析报告"
+  ],
+  "marketSaleMail": "wanghao@jianyu360.com",
+  "allocationCap": 500,
+  "warningValue": 350,
+  "corn_mail": "",
+  "regTimes": 7,
+  "jyactivities": {
+    "host": "",
+    "port": 0,
+    "database": "",
+    "user": "",
+    "password": "",
+    "poolsize": 0,
+    "maxidle": 0,
+    "maxleft": 0
+  },
+  "nameToMail": null,
+  "thawDay": 3,
+  "loopType": 1
+}

+ 2 - 3
clueSync/go.mod

@@ -3,7 +3,8 @@ module clueSync
 go 1.14
 
 require (
-	app.yhyue.com/moapp/jybase v0.0.0-20240514063605-a33a48d6be14
+	app.yhyue.com/moapp/jybase v0.0.0-20240523083821-42a82b37ae20
+	bp.jydev.jianyu360.cn/BaseService/pushpkg v0.0.0-20240627084125-22b4217112c7
 	github.com/go-xweb/httpsession v0.0.0-20141220075701-356d3b4d38d6 // indirect
 	github.com/go-xweb/log v0.0.0-20140701090824-270d183ad77e // indirect
 	github.com/go-xweb/uuid v0.0.0-20140604020037-d7dce341f851 // indirect
@@ -11,8 +12,6 @@ require (
 	github.com/gogf/gf v1.16.9
 	github.com/gogf/gf/v2 v2.7.0
 	github.com/lunny/csession v0.0.0-20130910075847-fe53c5de3dfd // indirect
-	github.com/mattn/go-runewidth v0.0.13 // indirect
-	github.com/mattn/go-sqlite3 v1.9.0 // indirect
 	github.com/robfig/cron v1.2.0
 	github.com/tealeg/xlsx v1.0.5
 )

文件差異過大導致無法顯示
+ 1071 - 7
clueSync/go.sum


+ 24 - 29
clueSync/main.go

@@ -1,15 +1,17 @@
 package main
 
 import (
-	"flag"
-	"fmt"
-	"github.com/robfig/cron"
-	"log"
-
 	"app.yhyue.com/moapp/jybase/common"
 	elastic "app.yhyue.com/moapp/jybase/es"
 	"app.yhyue.com/moapp/jybase/mongodb"
 	"app.yhyue.com/moapp/jybase/mysql"
+	"bp.jydev.jianyu360.cn/BaseService/pushpkg/p"
+	"flag"
+	"fmt"
+	"github.com/gogf/gf/v2/util/gconv"
+	"github.com/robfig/cron"
+	"log"
+	"time"
 
 	"app.yhyue.com/moapp/jybase/redis"
 )
@@ -119,23 +121,20 @@ func main() {
 	InitProduct(db.ProductArr)
 	if *mode == 1 {
 		//30分钟一次
-		a := cron.New()
-		a.AddFunc(db.CornExp1, func() {
+		for {
 			orders()      //未支付订单
 			messageSync() //聊天记录进线索
 			userbase()    //新绑定手机号进线索
-		})
-		a.Start()
+			time.Sleep(gconv.Duration(db.CornExp1) * time.Minute)
+		}
 		//5分钟一次
-		b := cron.New()
-		b.AddFunc(db.CornExp2, func() {
+		p.VarTimeTask.RunInTimeSection("5分钟定时任务", db.CornExp2Start, db.CornExp2End, db.CornExp2, func(dayFirst bool) {
 			users()          //新注册用户进线索
 			saleLeads()      //留资进线索
 			eventReg()       //渠道
 			bigCustomer()    //大客户线索
 			marketCustomer() //市场部线索
 		})
-		b.Start()
 		//每天8点30
 		c := cron.New()
 		c.AddFunc(db.CornExp3, func() {
@@ -152,24 +151,22 @@ func main() {
 		d.Start()
 		// 5分钟一次
 		go ordersClue() //后台订单进线索
-		e := cron.New()
-		e.AddFunc(db.CornExp5, func() {
-			go everythingSync() //渠道
-			go ordersClue()     //后台订单进线索
-			go kcSync()         //移交客成
-			go kcAuto()         //客成自动加入任务车
-			go tagAddSync()     //用户标签增量
-			go autoExitSea()    //自动退海
-			go Thaw()           //自动解冻处理
-		})
-		e.Start()
+		for {
+			everythingSync() //渠道
+			ordersClue()     //后台订单进线索
+			kcSync()         //移交客成
+			kcAuto()         //客成自动加入任务车
+			tagAddSync()     //用户标签增量
+			autoExitSea()    //自动退海
+			Thaw()           //自动解冻处理
+			time.Sleep(gconv.Duration(db.CornExp5) * time.Minute)
+		}
 		//5分钟一次
-		f := cron.New()
-		f.AddFunc(db.CornExp6, func() {
+		for {
 			subscribeAddSync() //订阅增量
 			rderAcceptance()   //工单生成
-		})
-		f.Start()
+			time.Sleep(gconv.Duration(db.CornExp6) * time.Minute)
+		}
 		//自动进入任务车 1天一次
 		g := cron.New()
 		g.AddFunc(db.CornExp7, func() {
@@ -177,10 +174,8 @@ func main() {
 			refundAuto() //客成移交销售
 			autoTask()   //超时未跟进加入任务车
 			autoTasks()  //按照下次跟进时间提前一天加入任务车
-
 		})
 		g.Start()
-
 		log.Println("个人邮件告警查询开始")
 		WarningPerl() // 个人
 		log.Println("部门邮件告警查询开始")

部分文件因文件數量過多而無法顯示