| | |
| | | /*新增7.8报告结果*/ |
| | | ProcessReport processReport = new ProcessReport(); |
| | | processReport.setInspectionOrderId(inspectionOrder.getInsOrderId()); |
| | | processReport.setInsReportCode(inspectionOrder.getEntrustCode());//报告编号=委托编号 |
| | | //页数 |
| | | try { |
| | | com.aspose.words.Document doc = new com.aspose.words.Document(path); |
| | | processReport.setPages(doc.getPageCount()+""); |
| | | } catch (Exception e) { |
| | | } |
| | | processReport.setNumber("1");//发送份数默认1 |
| | | processReport.setInsReportCode(insReport.getCode());//报告编号使用正式报告编号 |
| | | processReport.setSend(inspectionOrder.getCommissionUnit());//发往何处=委托单位 |
| | | processReport.setMethod(inspectionOrder.getSend()==1?"自取":"其他");//发送方式 |
| | | processReport.setSendTime(insReport.getRatifyTime().toLocalDate());//发送日期 |
| | |
| | | processSample.setSampleName(insSample.getSample());//样品名称 |
| | | processSample.setNum(1);//样品数量=1 |
| | | processSample.setSampleSupplier(inspectionOrder.getCommissionUnit());//来样单位 |
| | | LocalDate plusMonths = inspectionOrder.getSampleData().plusMonths(1); |
| | | LocalDate plusMonths = inspectionOrder.getSampleData() == null ? null : inspectionOrder.getSampleData().plusMonths(1); |
| | | processSample.setLeaveDate(plusMonths);//留样日期=收样日期往后延一个月 |
| | | processSample.setSampleState(inspectionOrder.getSampleStatus());//样品状态 |
| | | processSample.setDealTime(plusMonths);//退样日期=留样日期 |
| | |
| | | inspectionOrderDetailService.saveBatch(InspectionOrder.getOrderDetailList()); |
| | | |
| | | //修改7.9报告结果 |
| | | ProcessReport processReport = processReportService.getOne(Wrappers.<ProcessReport>lambdaQuery().eq(ProcessReport::getInspectionOrderId, InspectionOrder.getInspectionOrderId())); |
| | | processReport.setInsReportCode(InspectionOrder.getEntrustCode());//报告编号=委托编号 |
| | | processReportService.updateById(processReport); |
| | | ProcessReport processReport = processReportService.getOne(Wrappers.<ProcessReport>lambdaQuery() |
| | | .eq(ProcessReport::getInspectionOrderId, InspectionOrder.getInsOrderId()) |
| | | .last("limit 1")); |
| | | InsReport insReport = insReportService.getOne(Wrappers.<InsReport>lambdaQuery() |
| | | .eq(InsReport::getInsOrderId, InspectionOrder.getInsOrderId()) |
| | | .orderByDesc(InsReport::getId) |
| | | .last("limit 1")); |
| | | if (processReport != null && insReport != null) { |
| | | processReport.setInsReportCode(insReport.getCode());//报告编号使用正式报告编号 |
| | | processReportService.updateById(processReport); |
| | | } |
| | | |
| | | return true; |
| | | } |
| | |
| | | template.write(os); |
| | | os.flush(); |
| | | os.close(); |
| | | inputStream.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new RuntimeException("导出失败"); |