Package com.bytedesk.kbase.taboo
Class TabooExcelListener
java.lang.Object
com.bytedesk.kbase.taboo.TabooExcelListener
- All Implemented Interfaces:
com.alibaba.excel.event.Listener,com.alibaba.excel.read.listener.ReadListener<TabooExcel>
public class TabooExcelListener
extends Object
implements com.alibaba.excel.read.listener.ReadListener<TabooExcel>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int每隔5条存储数据库,实际使用中可以100条,然后清理list ,方便内存回收private List<TabooEntity>缓存的数据private final Stringprivate final Stringprivate final TabooRestService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddoAfterAllAnalysed(com.alibaba.excel.context.AnalysisContext context) 所有数据解析完成了 都会来调用voidinvoke(TabooExcel data, com.alibaba.excel.context.AnalysisContext context) 这个每一条数据解析都会来调用private voidsaveData()加上存储数据库Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.alibaba.excel.read.listener.ReadListener
extra, hasNext, invokeHead, onException
-
Field Details
-
tabooService
-
kbUid
-
orgUid
-
BATCH_COUNT
private static final int BATCH_COUNT每隔5条存储数据库,实际使用中可以100条,然后清理list ,方便内存回收- See Also:
-
cachedDataList
缓存的数据
-
-
Constructor Details
-
TabooExcelListener
public TabooExcelListener()
-
-
Method Details
-
invoke
这个每一条数据解析都会来调用- Specified by:
invokein interfacecom.alibaba.excel.read.listener.ReadListener<TabooExcel>
-
doAfterAllAnalysed
public void doAfterAllAnalysed(com.alibaba.excel.context.AnalysisContext context) 所有数据解析完成了 都会来调用- Specified by:
doAfterAllAnalysedin interfacecom.alibaba.excel.read.listener.ReadListener<TabooExcel>
-
saveData
private void saveData()加上存储数据库
-