| | |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.sys.ReportEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.service.all.UploadAttachService; |
| | | import com.lf.server.service.sys.ReportService; |
| | | import com.lf.server.service.sys.TokenService; |
| | |
| | | public void download(String guid, HttpServletResponse res) { |
| | | uploadAttachService.download(guid, res); |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "下载报告") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "guid", value = "附件Guid", dataType = "String", paramType = "body") |
| | | }) |
| | | @GetMapping(value = "/downloadReport") |
| | | public void downloadReport(Integer id, HttpServletResponse res) { |
| | | try { |
| | | if (null == id || id < 1) { |
| | | return; |
| | | } |
| | | |
| | | ReportEntity re = reportService.selectById(id); |
| | | if (null == re || StringHelper.isEmpty(re.getGuid()) || StringHelper.isEmpty(re.getType()) || StringHelper.isEmpty(re.getCode())) { |
| | | return; |
| | | } |
| | | |
| | | reportService.createReport(re, res); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | } |