//package com.example.ghjgpython;
//
//import lombok.Data;
//import org.apache.poi.ss.usermodel.Workbook;
//import org.jeecgframework.poi.excel.ExcelExportUtil;
//import org.jeecgframework.poi.excel.entity.TemplateExportParams;
//import org.junit.jupiter.api.Test;
//import org.springframework.boot.test.context.SpringBootTest;
//
//import java.io.File;
//import java.io.FileOutputStream;
//import java.io.IOException;
//import java.util.ArrayList;
//import java.util.Date;
//import java.util.HashMap;
//
//@SpringBootTest
//class GhjgPythonApplicationTests {
//
//    //文件导出测试
//    @Data
//    class People{
//        private Integer id;
//        private String name;
//        private String age;
//        private String sex;
//
//        public People(Integer id,String name, String age, String sex) {
//            this.id = id;
//            this.name = name;
//            this.age = age;
//            this.sex = sex;
//        }
//    }
//
//    @Data
//    class OutPut{
//        private String code;
//        private String cname;
//
//        public OutPut(String code,String cname){
//            this.code = code;
//            this.cname = cname;
//        }
//    }
//    @Test
//    void contextLoads() throws IOException {
//        TemplateExportParams templateExportParams = new TemplateExportParams("E:/test/test_template.xlsx");
//        HashMap<String, Object> stringObjectHashMap = new HashMap<>();
//        stringObjectHashMap.put("date",new Date());
//        stringObjectHashMap.put("title","测试");
//        ArrayList<People> objects = new ArrayList<>();
//        objects.add(new People(1,"张三", "20", "男"));
//        objects.add(new People(2,"李四", "21", "女"));
//        stringObjectHashMap.put("list",objects);
//        stringObjectHashMap.put("sum","1234567890");
//        Workbook sheets = ExcelExportUtil.exportExcel(templateExportParams, stringObjectHashMap);
//        File file = new File("E:\\test");
//        if (!file.exists()){
//            file.mkdirs();
//        }
//        FileOutputStream fileOutputStream = new FileOutputStream("E:\\test\\test.xlsx");
//        sheets.write(fileOutputStream);
//        fileOutputStream.close();
//    }
//
//    @Test
//    public void test() throws IOException {
//        TemplateExportParams templateExportParams = new TemplateExportParams("E:/test/模板.xlsx");
//        HashMap<String, Object> map = new HashMap<>();
//        ArrayList<OutPut> outPuts = new ArrayList<>();
//        outPuts.add(new OutPut("1","zoro"));
//        outPuts.add(new OutPut("2","luffy"));
//        map.put("list",outPuts);
//        Workbook sheets = ExcelExportUtil.exportExcel(templateExportParams, map);
//        FileOutputStream fileOutputStream = new FileOutputStream("E:/test/test1.xlsx");
//        sheets.write(fileOutputStream);
//        fileOutputStream.close();
//    }
//
////    @Test
////    void excelToHtml() throws IOException {
////        Workbook workbook = new Workbook();
////        workbook.loadFromFile("E:\\test\\岸电模版.xlsx");
////        Worksheet worksheet = workbook.getWorksheets().get(0);
////
////        worksheet.saveToHtml("E:\\test\\岸电模版.html");
////        FileReader fileReader = new FileReader("E:\\test\\岸电模版.html");
////        BufferedReader bufferedReader = new BufferedReader(fileReader);
////        BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter("E:\\test\\岸电模版2.html"));
////        String s;
////        while ((s = bufferedReader.readLine()) != null){
////            System.out.println(s);
////            if (!s.contains("Java")){
////                bufferedWriter.write(s);
////                bufferedWriter.flush();
////            }
//////            if (bufferedReader.readLine().contains("Java")){
//////                System.out.println("包含Java");
//////            }
////        }
////        bufferedWriter.close();
////        bufferedReader.close();
////        fileReader.close();
////        File file = new File("E:\\test\\岸电模版.html");file.deleteOnExit();
////    }
//}
