导出包公表格
This commit is contained in:
@@ -69,11 +69,26 @@ public class OaProjectReportController extends BaseController {
|
||||
@SaCheckPermission("oa:projectReport:export")
|
||||
@Log(title = "项目报工", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(OaProjectReportBo bo, HttpServletResponse response) {
|
||||
public void export(@RequestBody OaProjectReportBo bo, HttpServletResponse response) {
|
||||
List<OaProjectReportVo> list = iOaProjectReportService.queryList(bo);
|
||||
// 处理content去标签
|
||||
for (OaProjectReportVo reportVo : list) {
|
||||
reportVo.setContent(stripHtml(reportVo.getContent()));
|
||||
reportVo.setTrip(reportVo.getIsTrip() == 1 ? "是" : "否");
|
||||
if (reportVo.getIsTrip() == null) {
|
||||
reportVo.setIsTrip(0L); // 防止ExcelDictConvert NPE
|
||||
}
|
||||
}
|
||||
//打印结果我看看
|
||||
System.out.println(list);
|
||||
ExcelUtil.exportExcel(list, "项目报工", OaProjectReportVo.class, response);
|
||||
}
|
||||
|
||||
// 工具方法
|
||||
private static String stripHtml(String html) {
|
||||
return html == null ? null : html.replaceAll("<[^>]+>", "");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取项目报工详细信息
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user