Я хочу получить данные из файла Excel с помощью плагина excel-import: 3.0.2:
import org.grails.plugins.excelimport.AbstractExcelImporter
import org.grails.plugins.excelimport.ExcelImportService
import org.grails.plugins.excelimport.ExpectedPropertyType
import org.springframework.beans.factory.annotation.Autowired
class loadPayment extends AbstractExcelImporter {
@Autowired
ExcelImportService excelImportService
loadPayment(file){
super(file)
excelImportService = ExcelImportService.getService()
}
static Map CONFIG_BOOK_COLUMN_MAP = [sheet: 'Feuil1',
startRow: 1,
columnMap:
[
'A': 'data1',
'B': 'data2',
'C': 'data3',
'D': 'data4',
'E': 'data5'
]
]
static Map propertyConfigurationMap = [
data1: ([expectedType: StringType, defaultValue: null]),
data2: ([expectedType: StringType, defaultValue: null]),
data3: ([expectedType: StringType, defaultValue: null]),
data4: ([expectedType: StringType, defaultValue: null]),
data5: ([expectedType: StringType, defaultValue: null])
]
def getFiles() {
def fileList = excelImportService.columns(workbook, CONFIG_BOOK_COLUMN_MAP)
return fileList
}
}
, но, поскольку я мигрирую с Grails 2.3.9 на Grails 3.3.9, у меня возникла эта проблема:
Причины: groovy.lang.Возможные решения: getScope ()
Grails версия: 3.3.9;плагин excel: org.grails.plugins: excel-import: 3.0.2