1,首先创建工具类继承XxlsAbstract类
public class ImportXxlsForBase extends XxlsAbstract {
private Integer pid;
private List<Base> list = new ArrayList<Base>();
private StringBuffer sb = new StringBuffer();
public void optRows(int sheetIndex,int curRow, List<String> rowlist) throws SQLException {
if(curRow==0){
}else{
String expressCode = rowlist.get(0);
String expressNumber = rowlist.get(1);
String business = rowlist.get(2);
Base base = new Base();
base.set("各种属性")
list.add(waybill);
}
}
public List<Base> getList() {
return list;
}
public void setList(List<Base> list) {
this.list = list;
}
}
2,service层调用,mysql 最大sql语句有限制 所以一千跳插入一次
public GeneralResult importOrder(String path,int userId) {
GeneralResult result = new GeneralResult();
try{
Import