-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from ChinaLym/dev
0.6 released
- Loading branch information
Showing
449 changed files
with
15,766 additions
and
1,543 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ain/resources/archetype-resources/src/test/java/__SpringBootStartAppClassName__Tests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
...ulder-base/shoulder-batch/src/main/java/org/shoulder/batch/endpoint/ExportController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
package org.shoulder.batch.endpoint; | ||
|
||
/** | ||
* 导出 | ||
* | ||
* @param <Entity> 实体 | ||
* @param <PageQuery> 分页查询参数 | ||
* @author lym | ||
* <p> | ||
* 导出Excel | ||
* @param params 参数 | ||
* @param request 请求 | ||
* @param response 响应 | ||
* <p> | ||
* 预览Excel | ||
* @param params 预览参数 | ||
* @return 预览html | ||
* <p> | ||
* 构建导出参数 | ||
* @param params 分页参数 | ||
* @param page 分页 | ||
* @return 导出参数 | ||
*/ | ||
/* | ||
public interface ExportController<Entity, PageQuery> { | ||
*/ | ||
/** | ||
* 导出Excel | ||
* | ||
* @param params 参数 | ||
* @param request 请求 | ||
* @param response 响应 | ||
*//* | ||
@ApiOperation(value = "导出Excel") | ||
@RequestMapping(value = "/export", method = RequestMethod.POST, produces = "application/octet-stream") | ||
@OperationLog(operation = OperationLog.Operations.EXPORT) | ||
default void exportExcel(@RequestBody @Validated PageParams<PageQuery> params, HttpServletRequest request, HttpServletResponse response) { | ||
IPage<Entity> page = params.buildPage(); | ||
ExportParams exportParams = getExportParams(params, page); | ||
Map<String, Object> map = new HashMap<>(7); | ||
map.put(NormalExcelConstants.DATA_LIST, page.getRecords()); | ||
map.put(NormalExcelConstants.CLASS, getEntityClass()); | ||
map.put(NormalExcelConstants.PARAMS, exportParams); | ||
Object fileName = params.getExtra().getOrDefault(NormalExcelConstants.FILE_NAME, "临时文件"); | ||
map.put(NormalExcelConstants.FILE_NAME, fileName); | ||
PoiBaseView.render(map, request, response, NormalExcelConstants.EASYPOI_EXCEL_VIEW); | ||
} | ||
*/ | ||
/** | ||
* 预览Excel | ||
* | ||
* @param params 预览参数 | ||
* @return 预览html | ||
*//* | ||
@ApiOperation(value = "预览Excel") | ||
@OperationLog(operation = OperationLog.Operations.EXPORT) | ||
@RequestMapping(value = "/preview", method = RequestMethod.POST) | ||
default BaseResult<String> preview(@RequestBody @Validated PageParams<PageQuery> params) { | ||
IPage<Entity> page = params.buildPage(); | ||
ExportParams exportParams = getExportParams(params, page); | ||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, getEntityClass(), page.getRecords()); | ||
return BaseResult.success(ExcelXorHtmlUtil.excelToHtml(new ExcelToHtmlParams(workbook))); | ||
} | ||
*/ | ||
/** | ||
* 构建导出参数 | ||
* | ||
* @param params 分页参数 | ||
* @param page 分页 | ||
* @return 导出参数 | ||
*//* | ||
default ExportParams getExportParams(PageParams<PageQuery> params, IPage<Entity> page) { | ||
query(params, page, params.getSize() == -1 ? Convert.toLong(Integer.MAX_VALUE) : params.getSize()); | ||
Object title = params.getExtra().get("title"); | ||
Object type = params.getExtra().getOrDefault("type", ExcelType.XSSF.name()); | ||
Object sheetName = params.getExtra().getOrDefault("sheetName", "SheetName"); | ||
ExcelType excelType = ExcelType.XSSF.name().equals(type) ? ExcelType.XSSF : ExcelType.HSSF; | ||
return new ExportParams(String.valueOf(title), sheetName.toString(), excelType); | ||
} | ||
} | ||
*/ |
Oops, something went wrong.