Crunchy
2024-05-13 af499687591afe7c54b680914a5f9ea36970db53
2024-5-10 绩效管理-班次-月度文件导出
已修改2个文件
8 ■■■■ 文件已修改
performance-server/src/main/java/com/yuanchu/mom/utils/StyleMonthUtils.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
system-run/src/test/java/com/yuanchu/mom/SystemRunApplicationTest.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/utils/StyleMonthUtils.java
@@ -13,7 +13,7 @@
        // 头的策略
        WriteCellStyle headWriteCellStyle = new WriteCellStyle();
        // 背景颜色
        headWriteCellStyle.setFillForegroundColor(IndexedColors.WHITE1.getIndex());
        headWriteCellStyle.setFillForegroundColor(IndexedColors.WHITE.getIndex());
        headWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND);
        // 字体
system-run/src/test/java/com/yuanchu/mom/SystemRunApplicationTest.java
@@ -3,7 +3,7 @@
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
import com.yuanchu.mom.service.PerformanceShiftService;
import com.yuanchu.mom.utils.StyleMonthUtils;
import com.yuanchu.mom.utils.StyleYearUtils;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@@ -23,9 +23,9 @@
    @Test
    void  contextLoads() throws Exception {
        Map<Object, Object> data = performanceShiftService.exportToMonthExcel("2024-05-01 00:00:00", null, null);
        Map<Object, Object> data = performanceShiftService.exportToYearExcel("2024-05-01 00:00:00", null, null);
        // 设置单元格样式
        HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(StyleMonthUtils.getHeadStyle(), StyleMonthUtils.getContentStyle());
        HorizontalCellStyleStrategy horizontalCellStyleStrategy = new HorizontalCellStyleStrategy(StyleYearUtils.getHeadStyle(), StyleYearUtils.getContentStyle());
        EasyExcel.write(fileName)
                .head((List<List<String>>) data.get("header"))
                .registerWriteHandler(horizontalCellStyleStrategy)