|
|
@ -7,6 +7,7 @@ import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Set; |
|
|
|
import java.util.Set; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.excel.annotation.write.style.ColumnWidth; |
|
|
|
import com.alibaba.excel.annotation.write.style.ContentLoopMerge; |
|
|
|
import com.alibaba.excel.annotation.write.style.ContentLoopMerge; |
|
|
|
import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
|
|
|
import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
|
|
|
import com.alibaba.excel.annotation.write.style.HeadFontStyle; |
|
|
|
import com.alibaba.excel.annotation.write.style.HeadFontStyle; |
|
|
@ -17,6 +18,7 @@ import com.alibaba.excel.enums.HeadKindEnum; |
|
|
|
import com.alibaba.excel.metadata.CellRange; |
|
|
|
import com.alibaba.excel.metadata.CellRange; |
|
|
|
import com.alibaba.excel.metadata.Head; |
|
|
|
import com.alibaba.excel.metadata.Head; |
|
|
|
import com.alibaba.excel.metadata.Holder; |
|
|
|
import com.alibaba.excel.metadata.Holder; |
|
|
|
|
|
|
|
import com.alibaba.excel.metadata.property.ColumnWidthProperty; |
|
|
|
import com.alibaba.excel.metadata.property.ExcelHeadProperty; |
|
|
|
import com.alibaba.excel.metadata.property.ExcelHeadProperty; |
|
|
|
import com.alibaba.excel.metadata.property.FontProperty; |
|
|
|
import com.alibaba.excel.metadata.property.FontProperty; |
|
|
|
import com.alibaba.excel.metadata.property.LoopMergeProperty; |
|
|
|
import com.alibaba.excel.metadata.property.LoopMergeProperty; |
|
|
@ -50,9 +52,11 @@ public class ExcelWriteHeadProperty extends ExcelHeadProperty { |
|
|
|
this.onceAbsoluteMergeProperty = |
|
|
|
this.onceAbsoluteMergeProperty = |
|
|
|
OnceAbsoluteMergeProperty.build(headClazz.getAnnotation(OnceAbsoluteMerge.class)); |
|
|
|
OnceAbsoluteMergeProperty.build(headClazz.getAnnotation(OnceAbsoluteMerge.class)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ColumnWidth parentColumnWidth = headClazz.getAnnotation(ColumnWidth.class); |
|
|
|
HeadStyle parentHeadStyle = headClazz.getAnnotation(HeadStyle.class); |
|
|
|
HeadStyle parentHeadStyle = headClazz.getAnnotation(HeadStyle.class); |
|
|
|
HeadFontStyle parentHeadFontStyle = headClazz.getAnnotation(HeadFontStyle.class); |
|
|
|
HeadFontStyle parentHeadFontStyle = headClazz.getAnnotation(HeadFontStyle.class); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (Map.Entry<Integer, Head> entry : getHeadMap().entrySet()) { |
|
|
|
for (Map.Entry<Integer, Head> entry : getHeadMap().entrySet()) { |
|
|
|
Head headData = entry.getValue(); |
|
|
|
Head headData = entry.getValue(); |
|
|
|
if (headData == null) { |
|
|
|
if (headData == null) { |
|
|
@ -61,6 +65,13 @@ public class ExcelWriteHeadProperty extends ExcelHeadProperty { |
|
|
|
} |
|
|
|
} |
|
|
|
Field field = headData.getField(); |
|
|
|
Field field = headData.getField(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ColumnWidth columnWidth = field.getAnnotation(ColumnWidth.class); |
|
|
|
|
|
|
|
if (columnWidth == null) { |
|
|
|
|
|
|
|
columnWidth = parentColumnWidth; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
headData.setColumnWidthProperty(ColumnWidthProperty.build(columnWidth)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HeadStyle headStyle = field.getAnnotation(HeadStyle.class); |
|
|
|
HeadStyle headStyle = field.getAnnotation(HeadStyle.class); |
|
|
|
if (headStyle == null) { |
|
|
|
if (headStyle == null) { |
|
|
|
headStyle = parentHeadStyle; |
|
|
|
headStyle = parentHeadStyle; |
|
|
|