|
@@ -231,6 +231,7 @@ func (s *SecondPush) SecondPushTask() {
|
|
|
if len(c)!=0&&c != nil{
|
|
|
if c["dep_rules"] !=nil&&len(c["dep_rules"].([]interface{}))!=0{
|
|
|
for _,m := range c["dep_rules"].([]interface{}){
|
|
|
+ log.Println("ruleid",mongoutil.BsonIdToSId(m.(map[string]interface{})["_id"]))
|
|
|
q := bson.M{
|
|
|
"ruleid":mongoutil.BsonIdToSId(m.(map[string]interface{})["_id"]),
|
|
|
"createtime":bson.M{
|
|
@@ -238,7 +239,7 @@ func (s *SecondPush) SecondPushTask() {
|
|
|
"$lte":endtime,
|
|
|
},
|
|
|
}
|
|
|
- d,_:=MgoSecondPush.Find("usermail",q,nil,nil,false,0,0)
|
|
|
+ d,_:=MgoSecondPush.Find("usermail_0806_01",q,nil,nil,false,0,0)
|
|
|
if len(*d)>0&&d !=nil{
|
|
|
for _,l := range *d{
|
|
|
xlsxArr=append(xlsxArr, l)
|
|
@@ -264,6 +265,9 @@ func (s *SecondPush) SecondPushTask() {
|
|
|
log.Println(len(xlsxArr))
|
|
|
GetXlsxs(xlsxArr, customer_name, email, s_pushid)
|
|
|
go UpdateHistoryState(2, s_pushid, len(xlsxArr))
|
|
|
+ s.ServeJson(map[string]interface{}{
|
|
|
+ "status":true,
|
|
|
+ })
|
|
|
xlsxArr =[]map[string]interface{}{}
|
|
|
}
|
|
|
}
|
|
@@ -388,9 +392,8 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string) {
|
|
|
}
|
|
|
if dataType == 1 {
|
|
|
sh := xf.Sheets[0]
|
|
|
- for i, v := range mMap {
|
|
|
+ for _, 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"])
|
|
@@ -415,9 +418,8 @@ 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 i, v := range mMap {
|
|
|
+ for _, 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"])
|
|
@@ -463,9 +465,8 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string) {
|
|
|
xf.Sheets = xf.Sheets[1:2]
|
|
|
} else {
|
|
|
sh := xf.Sheets[2]
|
|
|
- for i, v := range mMap {
|
|
|
+ for _, 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"])
|