Commit fc04d20f authored by sherlock's avatar sherlock

template import selected sheet

parent e0f1eb62
......@@ -212,7 +212,7 @@ public class TemplateGroupServiceImpl extends AbstractService {
templateGroupMapper.insertSelective(templateGroup);
for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
String sheetName = workbook.getSheetName(i);
if(!templateGroupDto.getSheetNameList().contains(sheetName)){
if(!sheetNameList.contains(sheetName)){
continue;
}
String newName = sheetName + CommonUtils.getUUID() + POIUtil.getFileSuffix(fileName).get();
......@@ -347,6 +347,9 @@ public class TemplateGroupServiceImpl extends AbstractService {
int length = templateMapper.selectByExample(t).size();
for (int i = 0; i < workbook.getNumberOfSheets(); i++) {
String sheetName = workbook.getSheetName(i);
if(!sheetNameList.contains(sheetName)){
continue;
}
String newName = sheetName + CommonUtils.getUUID() + POIUtil.getFileSuffix(fileName).get();
Sheet sheet = workbook.getSheetAt(i);
Optional<Workbook> optional = POIUtil.cloneNewSheet(sheet, fileName);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment