|
|
@ -44,6 +44,7 @@ import com.google.common.cache.CacheBuilder; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.poi.ss.usermodel.IndexedColors; |
|
|
|
import org.apache.poi.ss.usermodel.VerticalAlignment; |
|
|
|
import org.jetbrains.annotations.Nullable; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@ -126,7 +127,9 @@ public class IcResiUserExportServiceImpl implements IcResiUserExportService { |
|
|
|
WriteCellStyle headWriteCellStyle = new WriteCellStyle(); |
|
|
|
// 背景设置为红色
|
|
|
|
headWriteCellStyle.setFillForegroundColor(IndexedColors.PALE_BLUE.getIndex()); |
|
|
|
HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle,new WriteCellStyle()); |
|
|
|
WriteCellStyle contentWriteCellStyle = new WriteCellStyle(); |
|
|
|
contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); |
|
|
|
HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle); |
|
|
|
FreezeAndFilter writeHandler = new FreezeAndFilter(); |
|
|
|
excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel("居民基本信息.xlsx", response)) |
|
|
|
.registerWriteHandler(new ExcelFillCellMergeStrategy(mergeRowIndex, mergeColumnIndex)) |
|
|
|