| | |
| | | template.write(os); |
| | | os.flush(); |
| | | os.close(); |
| | | inputStream.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new RuntimeException("导出失败"); |
| | |
| | | template.write(os); |
| | | os.flush(); |
| | | os.close(); |
| | | inputStream.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new RuntimeException("导出失败"); |
| | |
| | | template.write(os); |
| | | os.flush(); |
| | | os.close(); |
| | | inputStream.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | throw new RuntimeException("导出失败"); |
| | |
| | | if (qualityMonitorDetailsId == null) { |
| | | throw new ErrorException("缺少监控详情id"); |
| | | } |
| | | QualityMonitorDetails qualityMonitorDetails = qualityMonitorDetailsService.getOne(Wrappers.<QualityMonitorDetails>lambdaUpdate() |
| | | .eq(QualityMonitorDetails::getQualityMonitorDetailsId, qualityMonitorDetailsId)); |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | Integer userId =SecurityUtils.getUserId().intValue(); |
| | | |
| | | String contentType = file.getContentType(); |
| | | String urlString; |
| | | String pathName; |
| | | try { |
| | |
| | | urlString = realpath + "/" + pathName; |
| | | file.transferTo(new File(urlString)); |
| | | |
| | | wordInsertUrl(new HashMap<String, Object>() {{ |
| | | put("writeUrl", UserUtils.getFinalUserSignatureUrl(userId)); |
| | | put("writeDateUrl", Pictures.ofStream(DateImageUtil.createDateImage(now)).create()); |
| | | }}, wordUrl + "/" + pathName.replace("/word", wordUrl)); |
| | | // 判断是否是pdf |
| | | if (!contentType.contains("pdf")) { |
| | | wordInsertUrl(new HashMap<String, Object>() {{ |
| | | put("writeUrl", UserUtils.getFinalUserSignatureUrl(userId)); |
| | | put("writeDateUrl", Pictures.ofStream(DateImageUtil.createDateImage(now)).create()); |
| | | }}, wordUrl + "/" + pathName.replace("/word", wordUrl)); |
| | | } |
| | | |
| | | qualityMonitorDetailsService.update(Wrappers.<QualityMonitorDetails>lambdaUpdate() |
| | | .eq(QualityMonitorDetails::getQualityMonitorDetailsId, qualityMonitorDetailsId) |
| | |
| | | |
| | | // 添加批准人 |
| | | QualityMonitorDetails details = qualityMonitorDetailsMapper.selectById(qualityMonitorDetails.getQualityMonitorDetailsId()); |
| | | if (StringUtils.isNotBlank(details.getFinishReportUrl())) { |
| | | if (StringUtils.isNotBlank(details.getFinishReportUrl()) && !details.getFinishReportUrl().contains(".pdf")) { |
| | | wordInsertUrl(new HashMap<String, Object>() {{ |
| | | put("ratifyUrl", UserUtils.getFinalUserSignatureUrl(userId)); |
| | | put("ratifyDateUrl", Pictures.ofStream(DateImageUtil.createDateImage(now)).create()); |