package common; import com.BWebApplication; import com.alibaba.excel.EasyExcel; import com.alibaba.fastjson.JSON; import com.hfkj.entity.SecRegion; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; import java.io.FileOutputStream; import java.io.OutputStreamWriter; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * @Auther: 胡锐 * @Description: * @Date: 2021/3/20 20:26 */ @RunWith(SpringJUnit4ClassRunner.class) @SpringBootTest(classes = BWebApplication.class) @WebAppConfiguration public class ExcelTest { @Test public void test(){ try { List list = new ArrayList<>(); EasyExcel.read("F:\\卡券列表记录.xlsx", ExcelModel.class, new DemoDataListener()).sheet().doRead(); }catch (Exception e){ e.printStackTrace(); } } }