mitao
2025-03-18 9235b50cad6cdbdde1e0be3766ca165af03bb0c0
bug修改
3 文件已重命名
1个文件已修改
13 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintServiceImpl.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/template/community_question.docx 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/template/notice.docx 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/template/question_handle.docx 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/java/com/panzhihua/sangeshenbian/service/impl/ComplaintServiceImpl.java
@@ -39,6 +39,7 @@
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.*;
@@ -1187,10 +1188,10 @@
        String fileName = "";
        switch (type) {
            case 1:
                fileName = "社区问题单";
                fileName = "community_question.docx";
                break;
            case 2:
                fileName = "问题处理单";
                fileName = "question_handle.docx";
                if (Objects.nonNull(partyMember)) {
                    community = community + "-" + partyMember.getServiceTarget();
                }
@@ -1206,7 +1207,7 @@
                if (Objects.nonNull(record)) {
                    reportType = record.getReportType();
                }
                fileName = "协调通知单";
                fileName = "notice.docx";
                break;
        }
        Map<String, Object> map = new HashMap<>();
@@ -1241,8 +1242,8 @@
        response.setContentType("application/octet-stream");
        String fileNameEncode = URLEncoder.encode(fileName, "UTF-8").replaceAll("\\+", "%20");
        response.setHeader("Content-disposition", "attachment;filename=\"" + fileNameEncode + ".docx" + "\"");
        ClassPathResource resource = new ClassPathResource("template/" + fileName + ".docx");
        XWPFTemplate.compile(resource.getFile()).render(map).writeAndClose(response.getOutputStream());
        InputStream resourceAsStream = this.getClass().getResourceAsStream("/template/" + fileName);
        XWPFTemplate.compile(resourceAsStream).render(map).writeAndClose(response.getOutputStream());
    }
@@ -1263,7 +1264,7 @@
            String content = "第一行内容\n第二行内容\n第三行内容";
            map.put("complaintProgress", content);
            map.put("status", "处理中");
            XWPFTemplate.compile("F:\\DeskTop\\zhihuishequ\\springcloud_k8s_panzhihuazhihuishequ\\service_sangeshenbian\\src\\main\\resources\\template\\社区问题单.docx").render(map).writeToFile("F:\\DeskTop\\社区.docx");
            XWPFTemplate.compile("F:\\DeskTop\\zhihuishequ\\springcloud_k8s_panzhihuazhihuishequ\\service_sangeshenbian\\src\\main\\resources\\template\\community_question.docx").render(map).writeToFile("F:\\DeskTop\\社区.docx");
        } catch (IOException e) {
            e.printStackTrace();
        }
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/template/community_question.docx
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/template/notice.docx
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/service_sangeshenbian/src/main/resources/template/question_handle.docx
Binary files differ