fei
1 天以前 e899d2709f21b322232fb64778fef296233be3f0
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/ExcelUtil.java
@@ -24,6 +24,8 @@
import java.util.UUID;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.RegExUtils;
import org.apache.commons.lang3.reflect.FieldUtils;
@@ -205,6 +207,25 @@
    {
        this.clazz = clazz;
    }
    public void byteOutputStreamExcel(ByteOutputStream byteOutputStream, List<T> list, String sheetName, String title) {
        this.init(list, sheetName, title,Type.EXPORT);
        try {
            writeSheet();
            wb.write(byteOutputStream);
        } catch (Exception e) {
            log.error("导出Excel异常{}", e.getMessage());
        } finally {
            IOUtils.closeQuietly(wb);
        }
    }
    /**
     * 仅在Excel中显示列属性