| | |
| | | import org.springblade.core.log.exception.ServiceException; |
| | | import org.springblade.core.tenant.annotation.NonDS; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.mdm.commons.vo.IdsVO; |
| | | import org.springblade.mdm.program.service.NcProgramApprovedService; |
| | | import org.springblade.mdm.program.service.NcProgramExportDNCService; |
| | |
| | | throw new ServiceException("未选择文件导出"); |
| | | } |
| | | try { |
| | | response.setHeader("Content-Disposition", "attachment; filename=dnc-t.zip"); |
| | | String filename = "todncexp-"+ DateUtil.format(DateUtil.now(), "yyyyMMddHHmm")+".zip"; |
| | | response.setHeader("Content-Disposition", "attachment; filename="+filename); |
| | | response.setContentType("application/octet-stream"); |
| | | ncProgramExportDNCService.exportDnc(vo.getIds(),response.getOutputStream()); |
| | | } catch (IOException e) { |
| | | log.error("导出DNC异常", e); |
| | | throw new RuntimeException(e); |
| | | } |
| | | |
| | | } |
| | | |
| | | @PostMapping("/export-approve-table") |
| | | @Operation(summary = "导出审批表", description = "导出审批表excel") |
| | | public void exportApproveTaable(@RequestBody @Parameter(description = "审批表id数组") IdsVO vo, HttpServletResponse response) { |
| | | if(vo.getIds() == null || vo.getIds().length == 0) { |
| | | throw new ServiceException("未选择文件导出"); |
| | | } |
| | | try { |
| | | String filename = "todncexp-"+ DateUtil.format(DateUtil.now(), "yyyyMMddHHmm")+".zip"; |
| | | response.setHeader("Content-Disposition", "attachment; filename="+filename); |
| | | response.setContentType("application/octet-stream"); |
| | | ncProgramExportDNCService.exportDnc(vo.getIds(),response.getOutputStream()); |
| | | } catch (IOException e) { |