You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.1 KiB
45 lines
1.1 KiB
2 years ago
|
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<ExcelModel> list = new ArrayList<>();
|
||
|
EasyExcel.read("F:\\卡券列表记录.xlsx", ExcelModel.class, new DemoDataListener()).sheet().doRead();
|
||
|
|
||
|
|
||
|
}catch (Exception e){
|
||
|
e.printStackTrace();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|