28 lines
1.2 KiB
Go
28 lines
1.2 KiB
Go
package excel
|
|
|
|
import (
|
|
"electricity_bill_calc/model"
|
|
"io"
|
|
)
|
|
|
|
var tenementRecognizers = []*ColumnRecognizer{
|
|
{Pattern: [][]string{{"商户全称"}}, Tag: "fullName", MatchIndex: -1},
|
|
{Pattern: [][]string{{"联系地址"}}, Tag: "address", MatchIndex: -1},
|
|
{Pattern: [][]string{{"入驻时间"}}, Tag: "movedInAt", MatchIndex: -1},
|
|
{Pattern: [][]string{{"商铺名称"}}, Tag: "shortName", MatchIndex: -1},
|
|
{Pattern: [][]string{{"联系人"}}, Tag: "contactName", MatchIndex: -1},
|
|
{Pattern: [][]string{{"电话"}}, Tag: "contactPhone", MatchIndex: -1},
|
|
{Pattern: [][]string{{"USCI"}}, Tag: "usci", MatchIndex: -1},
|
|
{Pattern: [][]string{{"开票地址"}}, Tag: "invoiceAddress", MatchIndex: -1},
|
|
{Pattern: [][]string{{"账号"}}, Tag: "account", MatchIndex: -1},
|
|
{Pattern: [][]string{{"开户行"}}, Tag: "bank", MatchIndex: -1},
|
|
}
|
|
|
|
func NewTenementExcelAnalyzer(file io.Reader) (*ExcelAnalyzer[model.TenementImportRow], error) {
|
|
return NewExcelAnalyzer[model.TenementImportRow](file, tenementRecognizers)
|
|
}
|
|
|
|
//func NewMeterArchiveExcelAnalyzer(file io.Reader) (*ExcelAnalyzer[model.MeterImportRow], error) {
|
|
// return NewExcelAnalyzer[model.MeterImportRow](file, meterArchiveRecognizers)
|
|
//}
|