管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-02-11 bd24c3ba340543fd522df9f05ecfb16cac0ec296
src/main/java/com/lf/server/controller/sys/ReportController.java
@@ -5,6 +5,7 @@
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;
@@ -180,4 +181,27 @@
    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);
        }
    }
}