Crunchy
2024-05-10 723705c43f6e87e9f31e4c18eee1c163c14139bb
system-run/src/test/java/com/yuanchu/mom/SystemRunApplicationTest.java
@@ -1,33 +1,14 @@
package com.yuanchu.mom;
import com.yuanchu.mom.service.PerformanceShiftService;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import java.util.Map;
@SpringBootTest
class SystemRunApplicationTest {
    private static String fileName = "D:\\" + System.currentTimeMillis() + ".xlsx";
    @Autowired
    private PerformanceShiftService performanceShiftService;
    @Test
    void  contextLoads() {
        Map<Object, Object> header = performanceShiftService.exportToExcel("2024-05-04 00:00:00", null, null);
    void  contextLoads() throws Exception {
//        EasyExcel.write(fileName)
//                .head(header)
//                // 合并策略:合并相同数据的行。第一个参数表示从哪一行开始进行合并,由于表头占了两行,因此从第2行开始(索引从0开始)
//                // 第二个参数是指定哪些列要进行合并
////                .registerWriteHandler(new MergeSameRowsStrategy(2, new int[]{0, 1, 2, 3, 8, 9}))
//                // 注意:需要先调用registerWriteHandler()再调用sheet()方法才能使合并策略生效!!!
//                .sheet("模板")
//                .doWrite(data());
    }
}