Kaynağa Gözat

文件导出数量bug修改

Jianghan 1 yıl önce
ebeveyn
işleme
e6bf3b4578
1 değiştirilmiş dosya ile 3 ekleme ve 3 silme
  1. 3 3
      service/exprot.go

+ 3 - 3
service/exprot.go

@@ -112,7 +112,7 @@ func export(table string, tableColumn []string, key []interface{}, timeStr strin
 			fileCounter++
 			pathArr = append(pathArr, path)
 		}
-		dataHandle(writer, l, a, tableColumn)
+		dataHandle(writer, l, a+1, tableColumn)
 		a++
 		return true
 	}, sqlStr)
@@ -137,7 +137,7 @@ func dataHandle(writer *excelize.StreamWriter, l *[]map[string]interface{}, a in
 
 // 入excel
 func Warehousing(writer *excelize.StreamWriter, file *excelize.File, fileCounter int, key []interface{}, path, timeStr string) (*excelize.StreamWriter, *excelize.File, string) {
-	log.Println(fmt.Sprintf("开始第%d数据", fileCounter))
+	log.Println(fmt.Sprintf("开始第%d个文件数据", fileCounter))
 	writer.Flush()
 	folderPath := fmt.Sprintf("%s/%s", path, timeStr)
 	_, err := os.Stat(folderPath)
@@ -312,7 +312,7 @@ func exportA(sql, path, timeStr string, key []interface{}) []string {
 			fileCounter++
 			pathArr = append(pathArr, fpath)
 		}
-		dataHandle(writer, l, a, common.ObjArrToStringArr(key))
+		dataHandle(writer, l, a+1, common.ObjArrToStringArr(key))
 		a++
 		return true
 	}, sql)