lxw
2023-11-22 cba96d4cbd3ddd8af20b2d65d1f430c75f667821
src/main/java/com/whyc/controller/StandardFeatureCurveController.java
@@ -12,6 +12,7 @@
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.io.InputStream;
import java.sql.ResultSet;
import java.util.List;
@@ -41,7 +42,15 @@
        if(!name.substring(name.length()-4).equals(".xls") && !name.substring(name.length()-5).equals(".xlsx")){
            response.set(1,false,"文件类型错误");
        }else{
            service.excelImport(file.getInputStream());
            InputStream is=file.getInputStream();
            service.excelImport(is);
            if(is!=null){
                try {
                    is.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            response.set(1,true,"数据导入完成");
        }
        return response;