zouyuxuan 5 년 전
부모
커밋
ba31f409d5
3개의 변경된 파일8개의 추가작업 그리고 19개의 파일을 삭제
  1. 0 6
      src/config.json
  2. 8 5
      src/service/second_push.go
  3. 0 8
      src/util/config.go

+ 0 - 6
src/config.json

@@ -55,12 +55,6 @@
 		"itype": "bidding",
 		"pool": 15
 	},
-	"second_push": {
-		"addr": "192.168.3.207:27092",
-		"size": 15,
-		"db": "zyx",
-		"coll": "usermail"
-	},
 	"mail": [
         {
             "addr": "smtp.exmail.qq.com",

+ 8 - 5
src/service/second_push.go

@@ -239,7 +239,7 @@ func (s *SecondPush) SecondPushTask() {
 								"$lte": endtime,
 							},
 						}
-						d, _ := MgoSecondPush.Find("usermail_0806_01", q, nil, nil, false, 0, 0)
+						d, _ := MgoCus.Find("usermail", q, nil, nil, false, 0, 0)
 						if len(*d) > 0 && d != nil {
 							for _, l := range *d {
 								xlsxArr = append(xlsxArr, l)
@@ -255,7 +255,7 @@ func (s *SecondPush) SecondPushTask() {
 						},
 					}
 
-					d, _ := MgoSecondPush.Find("usermail", q, nil, nil, false, 0, 0)
+					d, _ := MgoCus.Find("usermail", q, nil, nil, false, 0, 0)
 					for _, l := range *d {
 						xlsxArr = append(xlsxArr, l)
 					}
@@ -394,8 +394,9 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string) {
 			}
 			if dataType == 1 {
 				sh := xf.Sheets[0]
-				for _, v := range mMap {
+				for i, v := range mMap {
 					row := sh.AddRow()
+					row.AddCell().SetInt(i + 1)
 					row.AddCell().SetValue(v["matchkey"])
 					row.AddCell().SetValue(v["area"])
 					row.AddCell().SetValue(v["city"])
@@ -420,8 +421,9 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string) {
 				xf.Sheets = xf.Sheets[0:1]
 			} else if dataType == 2 {
 				sh := xf.Sheets[1]
-				for _, v := range mMap {
+				for i, v := range mMap {
 					row := sh.AddRow()
+					row.AddCell().SetInt(i + 1)
 					row.AddCell().SetValue(v["matchkey"])
 					row.AddCell().SetValue(v["area"])
 					row.AddCell().SetValue(v["city"])
@@ -467,8 +469,9 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string) {
 				xf.Sheets = xf.Sheets[1:2]
 			} else {
 				sh := xf.Sheets[2]
-				for _, v := range mMap {
+				for i, v := range mMap {
 					row := sh.AddRow()
+					row.AddCell().SetInt(i + 1)
 					row.AddCell().SetValue(v["matchkey"])
 					row.AddCell().SetValue(v["area"])
 					row.AddCell().SetValue(v["city"])

+ 0 - 8
src/util/config.go

@@ -22,7 +22,6 @@ var (
 	MgoSave         *mgo.MongodbSim //数据保存库连接
 	MgoBuyer        *mgo.MongodbSim //医院等级信息
 	MgoEnps         *mgo.MongodbSim //企业信息
-	MgoSecondPush   *mongodb.MongodbSim //二次推送
 	SaveColl        string
 	HospColl        string
 	BuyerEntColl    string
@@ -208,13 +207,6 @@ func initdb() {
 		Size:        qu.IntAllDef(buyerinfo["size"], 15),
 	}
 	MgoBuyer.InitPool()
-	second_push := Sysconfig["second_push"].(map[string]interface{})
-	MgoSecondPush = &mongodb.MongodbSim{
-		MongodbAddr: qu.ObjToString(second_push["addr"]),
-		DbName:      qu.ObjToString(second_push["db"]),
-		Size:        qu.IntAllDef(second_push["size"], 15),
-	}
-	MgoSecondPush.InitPool()
 	//mgo enterprise
 	enterprise := Sysconfig["enterprise"].(map[string]interface{})
 	EnpsColl = qu.ObjToString(enterprise["coll"])