文档库--导出excel(不带文件)
This commit is contained in:
+2
-19
@@ -377,25 +377,8 @@ public class BussDocumentLibraryEOController extends JeroController<BussDocument
|
||||
@GetMapping(value = "/exportExcel")
|
||||
public void exportExcel(@RequestParam Map<String,Object> map,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) throws Exception {
|
||||
OutputStream os = null;
|
||||
Workbook workbook = null;
|
||||
try {
|
||||
String fileName = "11111";
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment; filename=" + fileName);
|
||||
response.setContentType("application/force-download");
|
||||
// 导出所有数据
|
||||
List<Map<String,Object>> datas = new ArrayList<>();
|
||||
workbook = bussDocumentLibraryEOService.exportDatas(datas);
|
||||
os = response.getOutputStream();
|
||||
workbook.write(os);
|
||||
os.flush();
|
||||
} catch (IOException e) {
|
||||
throw new JeroBootException("下载文件失败,请重试");
|
||||
} finally {
|
||||
IOUtils.closeQuietly(os);
|
||||
}
|
||||
HttpServletRequest request){
|
||||
bussDocumentLibraryEOService.exportExcel(map,response,request);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "带文件导出")
|
||||
|
||||
+21
-5
@@ -2,14 +2,16 @@ package com.jero.modules.document.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.modules.document.entity.BussDocumentLibraryEO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: 文档库信息表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-01-21
|
||||
* @Date: 2022-01-21
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface BussDocumentLibraryEOMapper extends BaseMapper<BussDocumentLibraryEO> {
|
||||
@@ -19,6 +21,7 @@ public interface BussDocumentLibraryEOMapper extends BaseMapper<BussDocumentLibr
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param page
|
||||
* @param field
|
||||
* @param condition
|
||||
@@ -26,18 +29,31 @@ public interface BussDocumentLibraryEOMapper extends BaseMapper<BussDocumentLibr
|
||||
*/
|
||||
IPage getInfoPage(@Param("page") IPage page,
|
||||
@Param("field") String field,
|
||||
@Param("condition") String condition);
|
||||
@Param("condition") String condition);
|
||||
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @param
|
||||
* @param field
|
||||
* @param condition
|
||||
* @return
|
||||
*/
|
||||
List<Map<String, Object>> getInfoList(@Param("field") String field,
|
||||
@Param("condition") String condition);
|
||||
|
||||
/**
|
||||
* 代替标准分页
|
||||
*
|
||||
* @param page
|
||||
* @param field
|
||||
* @param condition
|
||||
* @return
|
||||
*/
|
||||
IPage replacePageInfo(@Param("page") IPage page,
|
||||
@Param("field") String field,
|
||||
@Param("condition") String condition);
|
||||
@Param("field") String field,
|
||||
@Param("condition") String condition);
|
||||
|
||||
|
||||
}
|
||||
|
||||
+6
-1
@@ -32,7 +32,6 @@
|
||||
<result column="exposure_draft" property="exposureDraft" />
|
||||
<result column="datum" property="datum" />
|
||||
<result column="warn_flag" property="warnFlag" />
|
||||
<result column="read_flag" property="readFlag" />
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertInfo">
|
||||
@@ -40,10 +39,16 @@
|
||||
values (${insertValue})
|
||||
</insert>
|
||||
|
||||
<!--分页-->
|
||||
<select id="getInfoPage" resultType="java.util.LinkedHashMap">
|
||||
select ${field} from buss_document_library
|
||||
${condition}
|
||||
</select>
|
||||
<!--列表-->
|
||||
<select id="getInfoList" resultType="java.util.LinkedHashMap">
|
||||
select ${field} from buss_document_library
|
||||
${condition}
|
||||
</select>
|
||||
<!--代替标准分页-->
|
||||
<select id="replacePageInfo" resultType="java.util.LinkedHashMap">
|
||||
select ${field} from buss_document_library
|
||||
|
||||
+10
-1
@@ -134,7 +134,16 @@ public interface IBussDocumentLibraryEOService extends IService<BussDocumentLibr
|
||||
*/
|
||||
void cancelSubscribe(String id);
|
||||
|
||||
Workbook exportDatas(List<Map<String,Object>> datas);
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
* @param map
|
||||
* @param response
|
||||
* @param request
|
||||
*/
|
||||
void exportExcel(Map<String,Object> map,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request);
|
||||
|
||||
void exportZip(Map<String,Object> map,
|
||||
HttpServletResponse response,
|
||||
|
||||
+465
-312
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user