| | |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.core.io.ClassPathResource; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | if (Objects.isNull(complaintAuditRecord)) { |
| | | throw new ServiceException("上报申请记录不存在"); |
| | | } |
| | | complaintAuditRecord.setAuditorName(systemUser.getName()); |
| | | complaintAuditRecord.setAuditorPhone(systemUser.getPhone()); |
| | | if (complaintReporAuditDTO.getAuditResult().equals(1)) { |
| | | complaintAuditRecord.setAuditStatus(1); |
| | | complaintAuditRecord.setAuditorId(loginUserInfoVO.getUserId()); |
| | |
| | | response.setContentType("application/octet-stream"); |
| | | String fileNameEncode = URLEncoder.encode(fileName, "UTF-8").replaceAll("\\+", "%20"); |
| | | response.setHeader("Content-disposition", "attachment;filename=\"" + fileNameEncode + ".docx" + "\""); |
| | | String fileTemplateName = FileUtil.getPath() + "template/" + fileName + ".docx"; |
| | | XWPFTemplate.compile(fileTemplateName).render(map).writeAndClose(response.getOutputStream()); |
| | | ClassPathResource resource = new ClassPathResource("template/" + fileName + ".docx"); |
| | | XWPFTemplate.compile(resource.getFile()).render(map).writeAndClose(response.getOutputStream()); |
| | | } |
| | | |
| | | |