| | |
| | | */ |
| | | public void exportDnc(Long[] approvedIdArray, OutputStream os) throws IOException { |
| | | //FileOutputStream fos = new FileOutputStream("d:/exportDnc.zip"); |
| | | try (ZipOutputStream zipOut = new ZipOutputStream(os);) {//os |
| | | try (ZipOutputStream zipOut = new ZipOutputStream(os);os) {//os |
| | | |
| | | for (Long approvedId : approvedIdArray) { |
| | | NcProgramApproved approved = approvedService.getById(approvedId); |
| | | addProgramPackageToZip(zipOut,approved); |
| | | |
| | | approved.setStatus(NcProgramApproved.STATUS_EXPORTED); |
| | | approvedService.updateById(approved); |
| | | } |
| | | |
| | | //状态修改为已导出 |
| | | /* |
| | | approvedService.lambdaUpdate().in(NcProgramApproved::getId, Arrays.asList(approvedIdArray)) |
| | | .set(NcProgramApproved::getStatus,NcProgramApproved.STATUS_EXPORTED).update(); |
| | | .set(NcProgramApproved::getStatus,NcProgramApproved.STATUS_EXPORTED).update();*/ |
| | | }catch(Exception e){ |
| | | Throwable [] err = e.getSuppressed(); |
| | | throw new ServiceException("导出工控网错误"+e.getMessage()); |
| | | } |
| | | |
| | | os.close(); |
| | | |
| | | } |
| | | |