|
|
@ -199,7 +199,8 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
Object value = dataMap.get(variable); |
|
|
|
Object value = dataMap.get(variable); |
|
|
|
WriteCellData<?> cellData = converterAndSet(writeSheetHolder, FieldUtils.getFieldClass(dataMap, variable), |
|
|
|
WriteCellData<?> cellData = converterAndSet(writeSheetHolder, |
|
|
|
|
|
|
|
FieldUtils.getFieldClass(dataMap, variable), |
|
|
|
null, cell, value, fieldNameContentPropertyMap.get(variable), null, relativeRowIndex); |
|
|
|
null, cell, value, fieldNameContentPropertyMap.get(variable), null, relativeRowIndex); |
|
|
|
WriteHandlerUtils.afterCellDispose(writeContext, cellData, cell, null, relativeRowIndex, Boolean.FALSE); |
|
|
|
WriteHandlerUtils.afterCellDispose(writeContext, cellData, cell, null, relativeRowIndex, Boolean.FALSE); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -416,7 +417,6 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { |
|
|
|
int startIndex = 0; |
|
|
|
int startIndex = 0; |
|
|
|
int length = value.length(); |
|
|
|
int length = value.length(); |
|
|
|
int lastPrepareDataIndex = 0; |
|
|
|
int lastPrepareDataIndex = 0; |
|
|
|
int variableCount = 0; |
|
|
|
|
|
|
|
out: |
|
|
|
out: |
|
|
|
while (startIndex < length) { |
|
|
|
while (startIndex < length) { |
|
|
|
int prefixIndex = value.indexOf(FILL_PREFIX, startIndex); |
|
|
|
int prefixIndex = value.indexOf(FILL_PREFIX, startIndex); |
|
|
@ -448,10 +448,7 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { |
|
|
|
String variable = value.substring(prefixIndex + 1, suffixIndex); |
|
|
|
String variable = value.substring(prefixIndex + 1, suffixIndex); |
|
|
|
if (StringUtils.isEmpty(variable)) { |
|
|
|
if (StringUtils.isEmpty(variable)) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} else { |
|
|
|
|
|
|
|
++variableCount; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int collectPrefixIndex = variable.indexOf(COLLECTION_PREFIX); |
|
|
|
int collectPrefixIndex = variable.indexOf(COLLECTION_PREFIX); |
|
|
|
if (collectPrefixIndex > -1) { |
|
|
|
if (collectPrefixIndex > -1) { |
|
|
|
if (collectPrefixIndex != 0) { |
|
|
|
if (collectPrefixIndex != 0) { |
|
|
@ -466,18 +463,19 @@ public class ExcelWriteFillExecutor extends AbstractExcelWriteExecutor { |
|
|
|
analysisCell.getVariableList().add(variable); |
|
|
|
analysisCell.getVariableList().add(variable); |
|
|
|
if (lastPrepareDataIndex == prefixIndex) { |
|
|
|
if (lastPrepareDataIndex == prefixIndex) { |
|
|
|
analysisCell.getPrepareDataList().add(StringUtils.EMPTY); |
|
|
|
analysisCell.getPrepareDataList().add(StringUtils.EMPTY); |
|
|
|
|
|
|
|
// fix https://github.com/alibaba/easyexcel/issues/2035
|
|
|
|
|
|
|
|
if (lastPrepareDataIndex != 0) { |
|
|
|
|
|
|
|
analysisCell.setOnlyOneVariable(Boolean.FALSE); |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
String data = convertPrepareData(value.substring(lastPrepareDataIndex, prefixIndex)); |
|
|
|
String data = convertPrepareData(value.substring(lastPrepareDataIndex, prefixIndex)); |
|
|
|
preparedData.append(data); |
|
|
|
preparedData.append(data); |
|
|
|
analysisCell.getPrepareDataList().add(data); |
|
|
|
analysisCell.getPrepareDataList().add(data); |
|
|
|
|
|
|
|
analysisCell.setOnlyOneVariable(Boolean.FALSE); |
|
|
|
} |
|
|
|
} |
|
|
|
lastPrepareDataIndex = suffixIndex + 1; |
|
|
|
lastPrepareDataIndex = suffixIndex + 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (variableCount > 1) { |
|
|
|
|
|
|
|
analysisCell.setOnlyOneVariable(Boolean.FALSE); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return dealAnalysisCell(analysisCell, value, rowIndex, lastPrepareDataIndex, length, firstRowCache, |
|
|
|
return dealAnalysisCell(analysisCell, value, rowIndex, lastPrepareDataIndex, length, firstRowCache, |
|
|
|
preparedData); |
|
|
|
preparedData); |
|
|
|
} |
|
|
|
} |
|
|
|