|
|
|
@ -329,4 +329,26 @@ public class ExcelExportImportServiceImpl extends Service implements ExcelExport
|
|
|
|
|
boolean insertSign = CommonUtil.insertBatch(toImportScheduleInfos, "uf_pbjg");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Map<String, Object> previewImportSchedule(ImportParam param) {
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(param.getImageId())) {
|
|
|
|
|
throw new AttendanceRunTimeException("导入文件id为空!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
InputStream fileInputStream = null;
|
|
|
|
|
try {
|
|
|
|
|
fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(param.getImageId()));
|
|
|
|
|
Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX);
|
|
|
|
|
map.put("headers", ExcelSupport.getSheetHeader(sheet, 1));
|
|
|
|
|
map.put("list", ExcelParseHelper.parse2List(sheet, 2, 1));
|
|
|
|
|
return map;
|
|
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
IOUtils.closeQuietly(fileInputStream);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|