| | |
| | | import org.springblade.core.tool.api.IResultCode; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.UrlUtil; |
| | | import org.springblade.mdm.commons.service.OssFileCommonService; |
| | | import org.springblade.mdm.flow.entity.FlowProgramFile; |
| | | import org.springblade.mdm.flow.mapper.FlowProgramFileMapper; |
| | | import org.springblade.mdm.flow.vo.ProgramUploadVO; |
| | |
| | | @Autowired |
| | | private OssTemplate ossTemplate; |
| | | @Autowired |
| | | private RuntimeService runtimeService; |
| | | private OssFileCommonService ossFileCommonService; |
| | | @Autowired |
| | | private FlowCommonService flowCommonService; |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 流程文件下载 |
| | | * @param id 流程文件id |
| | | * @param response http响应 |
| | | * @throws IOException 文件操作异常 |
| | | */ |
| | | public void download(Long id, HttpServletResponse response) throws IOException { |
| | | FlowProgramFile flowFile = this.getById(id); |
| | | ossFileCommonService.download(flowFile.getOssName(),flowFile.getName(),response); |
| | | /* |
| | | response.setHeader("Content-Disposition", "attachment; filename="+ UrlUtil.encode(flowFile.getName())); |
| | | response.setContentType("application/octet-stream"); |
| | | try(InputStream ins = ossTemplate.statFileStream(flowFile.getOssName());){ |
| | | IOUtils.copy(ins,response.getOutputStream()); |
| | | } |
| | | }*/ |
| | | } |
| | | |
| | | /** |