- CreatePromotionByExcel
This commit is contained in:
@@ -3,6 +3,7 @@ package excel
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"reflect"
|
||||
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
@@ -66,6 +67,17 @@ func Obj2Excel(sheetList []*Obj2ExcelSheetConfig) []byte {
|
||||
return buf.Bytes()
|
||||
}
|
||||
|
||||
func Excel2Slice(reader io.Reader) (contents map[string][][]string) {
|
||||
globals.SugarLogger.Debug("Excel2Slice")
|
||||
if excelFile, err := excelize.OpenReader(reader); err == nil {
|
||||
contents = make(map[string][][]string)
|
||||
for _, v := range excelFile.GetSheetMap() {
|
||||
contents[v] = excelFile.GetRows(v)
|
||||
}
|
||||
}
|
||||
return contents
|
||||
}
|
||||
|
||||
func genAxis(row, col int) string {
|
||||
return fmt.Sprintf("%c%d", col+65, row+1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user