LIVE_YE преди 1 година
родител
ревизия
af3d37ec51

+ 6 - 0
ruoyi-common/pom.xml

@@ -182,6 +182,12 @@
             <groupId>com.squareup.okhttp3</groupId>
             <artifactId>okhttp</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-compress</artifactId>
+            <version>1.19</version>
+        </dependency>
+
     </dependencies>
 
 </project>

+ 14 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/poi/WordUtil.java

@@ -52,6 +52,11 @@ public class WordUtil {
             dir.mkdirs();
         }
 
+        //判断系统
+        /*String osName = System.getProperty("os.name").toLowerCase();
+        if (osName.contains("win")) {
+            fileDir = fileDir.replaceAll("/","\\\\");
+        }*/
         String filePath = fileDir + fileName;
         // 读取模板templatePath并将paramMap的内容填充进模板,即编辑模板+渲染数据
         XWPFTemplate template = XWPFTemplate.compile(templatePath).render(paramMap);
@@ -68,6 +73,15 @@ public class WordUtil {
     }
 
     public static void main(String[] args) {
+
+        String s = "D:/ruoyi/uploadPath/mb/temporarily/RZDB202405171421120925517/";
+
+        //判断系统
+        String osName = System.getProperty("os.name").toLowerCase();
+        if (osName.contains("win")) {
+            s = s.replaceAll("/","\\\\");
+        }
+
         Map<String, Object> params = new HashMap<>();
         // 渲染文本
         //params.put("title", "XXX工程");

+ 0 - 32
ruoyi-framework/src/main/java/com/ruoyi/framework/config/CrossFilter.java

@@ -1,32 +0,0 @@
-package com.ruoyi.framework.config;
-
-import org.springframework.stereotype.Component;
-import javax.servlet.*;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-/**
- * 拦截器,解决前端跨域问题
- * 为了 pageoffice 使用的
- */
-@Component
-public class CrossFilter implements Filter {
-
-
-    @Override
-    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
-        HttpServletResponse response = (HttpServletResponse) servletResponse;
-
-        response.setHeader("Access-Control-Allow-Origin","*");
-        response.setHeader("Access-Control-Allow-Credentials", "true");
-        response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE");
-        response.setHeader("Access-Control-Max-Age", "3600");
-        response.setHeader("Access-Control-Allow-Headers", "x-requested-with");
-
-        filterChain.doFilter(servletRequest, servletResponse);
-    }
-
-    @Override
-    public void destroy() {
-
-    }
-}

+ 12 - 13
ruoyi-system/src/main/java/com/ruoyi/system/service/loan/impl/LoanApplicationServiceImpl.java

@@ -713,8 +713,7 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
     public AjaxResult exportMb(LoanApplication loanApplication) {
         Map<String, Object> map = new HashMap<>();
         String type = loanApplication.getType();
-        String loanApplicationNumber = loanApplication.getLoanApplicationNumber();
-        if (loanApplication.getLoanApplicationId() != null || loanApplication.getLoanApplicationId() != 0L) {
+        if (loanApplication.getLoanApplicationId() != null && loanApplication.getLoanApplicationId() != 0L) {
             loanApplication = loanApplicationMapper.selectLoanApplicationByLoanApplicationId(loanApplication.getLoanApplicationId());
             loanApplication.setType(type);
             //判断附件存不存在
@@ -734,7 +733,7 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
                 }
             }
         }
-
+        String loanApplicationNumber = loanApplication.getLoanApplicationNumber();
         Map<String, Object> params = new HashMap<>();
         String path = "/profile/mb/temporarily";
         //查询公司信息
@@ -751,7 +750,7 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
                 //params.put("enterpriseName", loanApplication.getEnterpriseName());
                 //path = path + "/委托担保申请书.doc";
                 templatePath = RuoYiConfig.getProfile() + "/mb/委托担保申请书.docx";
-                fileDir = RuoYiConfig.getProfile() + "/mb/temporarily" + loanApplicationNumber;
+                fileDir = RuoYiConfig.getProfile() + "/mb/temporarily/" + loanApplicationNumber;
                 //fileName = FileUploadUtils.extractFilenameLoanApplicationNumberNoHzm("委托担保申请书");
                 fileName = loanApplication.getEnterpriseName() + "-委托担保申请书";
                 fileNameHz = fileName + ".docx";
@@ -763,7 +762,7 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
                 params.put("corporationPhone", loanApplication.getCorporationPhone());
                 //path = path + "/委托担保申请书.doc";
                 templatePath = RuoYiConfig.getProfile() + "/mb/委托保证合同.docx";
-                fileDir = RuoYiConfig.getProfile() + "/mb/temporarily" + loanApplicationNumber;
+                fileDir = RuoYiConfig.getProfile() + "/mb/temporarily/" + loanApplicationNumber;
                 //fileName = FileUploadUtils.extractFilenameLoanApplicationNumberNoHzm("委托担保申请书");
                 fileName = loanApplication.getEnterpriseName() + "-委托担保申请书";
                 fileNameHz = fileName + ".docx";
@@ -774,7 +773,7 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
                 //params.put("enterpriseName", loanApplication.getEnterpriseName());
                 //path = path + "/委托担保申请书.doc";
                 templatePath = templatePath + "/mb/担保意向函.docx";
-                fileDir = fileDir + "/mb/temporarily" + loanApplicationNumber;
+                fileDir = fileDir + "/mb/temporarily/" + loanApplicationNumber;
                 //fileName = FileUploadUtils.extractFilenameLoanApplicationNumberNoHzm("担保意向函");
                 fileName = loanApplication.getEnterpriseName() + "-担保意向函";
                 fileNameHz = fileName + ".docx";
@@ -796,7 +795,7 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
                 //params.put("enterpriseName", loanApplication.getEnterpriseName());
                 //path = path + "/委托担保申请书.doc";
                 templatePath = RuoYiConfig.getProfile() + "/mb/保证反担保合同(适用于法人).docx";
-                fileDir = RuoYiConfig.getProfile() + "/mb/temporarily" + loanApplicationNumber;
+                fileDir = RuoYiConfig.getProfile() + "/mb/temporarily/" + loanApplicationNumber;
                 //fileName = FileUploadUtils.extractFilenameLoanApplicationNumberNoHzm("保证反担保合同(适用于法人)");
                 fileName = loanApplication.getEnterpriseName() + "-保证反担保合同(适用于法人)";
                 fileNameHz = fileName + ".docx";
@@ -807,7 +806,7 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
                 //params.put("enterpriseName", loanApplication.getEnterpriseName());
                 //path = path + "/委托担保申请书.doc";
                 templatePath = RuoYiConfig.getProfile() + "/mb/保证反担保合同(适用于自然人).docx";
-                fileDir = RuoYiConfig.getProfile() + "/mb/temporarily" + loanApplicationNumber;
+                fileDir = RuoYiConfig.getProfile() + "/mb/temporarily/" + loanApplicationNumber;
                 //fileName = FileUploadUtils.extractFilenameLoanApplicationNumberNoHzm("保证反担保合同(适用于自然人)");
                 fileName = loanApplication.getEnterpriseName() + "-保证反担保合同(适用于自然人)";
                 fileNameHz = fileName + ".docx";
@@ -818,7 +817,7 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
                 //params.put("enterpriseName", loanApplication.getEnterpriseName());
                 //path = path + "/委托担保申请书.doc";
                 templatePath = RuoYiConfig.getProfile() + "/mb/抵押反担保合同(适用于法人).docx";
-                fileDir = RuoYiConfig.getProfile() + "/mb/temporarily" + loanApplicationNumber;
+                fileDir = RuoYiConfig.getProfile() + "/mb/temporarily/" + loanApplicationNumber;
                 //fileName = FileUploadUtils.extractFilenameLoanApplicationNumberNoHzm("抵押反担保合同(适用于法人)");
                 fileName = loanApplication.getEnterpriseName() + "-抵押反担保合同(适用于法人)";
                 fileNameHz = fileName + ".docx";
@@ -829,7 +828,7 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
                 //params.put("enterpriseName", loanApplication.getEnterpriseName());
                 //path = path + "/委托担保申请书.doc";
                 templatePath = RuoYiConfig.getProfile() + "/mb/抵押反担保合同(适用于自然人).docx";
-                fileDir = RuoYiConfig.getProfile() + "/mb/temporarily" + loanApplicationNumber;
+                fileDir = RuoYiConfig.getProfile() + "/mb/temporarily/" + loanApplicationNumber;
                 //fileName = FileUploadUtils.extractFilenameLoanApplicationNumberNoHzm("抵押反担保合同(适用于自然人)");
                 fileName = loanApplication.getEnterpriseName() + "-抵押反担保合同(适用于自然人)";
                 fileNameHz = fileName + ".docx";
@@ -840,7 +839,7 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
                 //params.put("enterpriseName", loanApplication.getEnterpriseName());
                 //path = path + "/委托担保申请书.doc";
                 templatePath = RuoYiConfig.getProfile() + "/mb/权利质权反担保合同(适用于法人).docx";
-                fileDir = RuoYiConfig.getProfile() + "/mb/temporarily" + loanApplicationNumber;
+                fileDir = RuoYiConfig.getProfile() + "/mb/temporarily/" + loanApplicationNumber;
                 //fileName = FileUploadUtils.extractFilenameLoanApplicationNumberNoHzm("权利质权反担保合同(适用于法人)");
                 fileName = loanApplication.getEnterpriseName() + "-权利质权反担保合同(适用于法人)";
                 fileNameHz = fileName + ".docx";
@@ -851,7 +850,7 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
                 //params.put("enterpriseName", loanApplication.getEnterpriseName());
                 //path = path + "/委托担保申请书.doc";
                 templatePath = RuoYiConfig.getProfile() + "/mb/权利质权反担保合同(适用于自然人).docx";
-                fileDir = RuoYiConfig.getProfile() + "/mb/temporarily" + loanApplicationNumber;
+                fileDir = RuoYiConfig.getProfile() + "/mb/temporarily/" + loanApplicationNumber;
                 //fileName = FileUploadUtils.extractFilenameLoanApplicationNumberNoHzm("权利质权反担保合同(适用于自然人)");
                 fileName = loanApplication.getEnterpriseName() + "-权利质权反担保合同(适用于自然人)";
                 fileNameHz = fileName + ".docx";
@@ -862,7 +861,7 @@ public class LoanApplicationServiceImpl implements ILoanApplicationService {
                 //params.put("enterpriseName", loanApplication.getEnterpriseName());
                 //path = path + "/委托担保申请书.doc";
                 templatePath = RuoYiConfig.getProfile() + "/mb/股东会决议.docx";
-                fileDir = RuoYiConfig.getProfile() + "/mb/temporarily" + loanApplicationNumber;
+                fileDir = RuoYiConfig.getProfile() + "/mb/temporarily/" + loanApplicationNumber;
                 //fileName = FileUploadUtils.extractFilenameLoanApplicationNumberNoHzm("股东会决议");
                 fileName = loanApplication.getEnterpriseName() + "-股东会决议";
                 fileNameHz = fileName + ".docx";