Browse Source

新增本地文件指定url地址存放

wangliang 2 years ago
parent
commit
f4f89bb1d5

+ 2 - 0
distributed-print/src/main/resources/application-36dev.properties

@@ -82,6 +82,8 @@ sys.config.sessionActive=4h
 sys.config.flowSchoolCodeMap.GdykdxPaperApprove=test-school-2
 sys.config.flowSchoolCodeMap.GdykdxPaperApprove=test-school-2
 sys.config.flowSchoolCodeMap.JxzyyPaperApprove=test-school-1,test-school-3
 sys.config.flowSchoolCodeMap.JxzyyPaperApprove=test-school-1,test-school-3
 spring.resources.static-locations=file:${sys.config.serverUpload},classpath:/META-INF/resources/,classpath:/resources/
 spring.resources.static-locations=file:${sys.config.serverUpload},classpath:/META-INF/resources/,classpath:/resources/
+sys.config.fileTempUrl=/Users/king/Downloads/file-temp
+sys.config.pdfTempUrl=/Users/king/Downloads/pdf-temp
 
 
 org.center.url=https://solar.qmth.com.cn
 org.center.url=https://solar.qmth.com.cn
 org.center.orgQueryApi=/api/open/org/query
 org.center.orgQueryApi=/api/open/org/query

+ 8 - 5
distributed-print/src/main/resources/application-dev.properties

@@ -60,18 +60,19 @@ com.qmth.fss.public.server=https://oss-file.qmth.com.cn/teachcloud-print-dev-pub
 com.qmth.fss.private.config=oss://key:secret@teachcloud-print-dev-private.oss-api.qmth.com.cn
 com.qmth.fss.private.config=oss://key:secret@teachcloud-print-dev-private.oss-api.qmth.com.cn
 com.qmth.fss.private.server=https://oss-file.qmth.com.cn/teachcloud-print-dev-private
 com.qmth.fss.private.server=https://oss-file.qmth.com.cn/teachcloud-print-dev-private
 
 
+#com.qmth.fss.fileTemp.config=oss://key:secret@teachcloud-print-dev-public.oss-api.qmth.com.cn
+#com.qmth.fss.fileTemp.server=https://oss-file.qmth.com.cn/teachcloud-print-dev-public
+#com.qmth.fss.pdfTemp.config=oss://key:secret@teachcloud-print-dev-private.oss-api.qmth.com.cn
+#com.qmth.fss.pdfTemp.server=https://oss-file.qmth.com.cn/teachcloud-print-dev-private
+
 #\u7CFB\u7EDF\u914D\u7F6E
 #\u7CFB\u7EDF\u914D\u7F6E
-sys.config.oss=true
+sys.config.oss=false
 sys.config.attachmentType=.xlsx,.xls,.doc,.docx,.pdf,.jpg,.jpeg,.png,.html,.zip,.mp3,.wav,.dll,.exe,.ftl,.bpmn,.xml
 sys.config.attachmentType=.xlsx,.xls,.doc,.docx,.pdf,.jpg,.jpeg,.png,.html,.zip,.mp3,.wav,.dll,.exe,.ftl,.bpmn,.xml
 sys.config.attachmentLength=100
 sys.config.attachmentLength=100
 sys.config.attachmentSize=200
 sys.config.attachmentSize=200
 sys.config.serverUpload=
 sys.config.serverUpload=
-#sys.config.fileHost=localhost:7001
-#sys.config.serverHost=localhost:7001
 sys.config.fileHost=http://127.0.0.1:7001
 sys.config.fileHost=http://127.0.0.1:7001
 sys.config.serverHost=http://127.0.0.1:7001
 sys.config.serverHost=http://127.0.0.1:7001
-#sys.config.accessKey=0bce69d94a7b4aef8bc0badf150351a9
-#sys.config.accessSecret=LdUwb5X4etmjW7fDn0KAdoXG0Yt7AkDu
 sys.config.accessKey=274f823e5f59410f8b3bb6edcd8e2b6e
 sys.config.accessKey=274f823e5f59410f8b3bb6edcd8e2b6e
 sys.config.accessSecret=y7AO6W0TOdTF8HpWBwGHbp3wfIHsmUKr
 sys.config.accessSecret=y7AO6W0TOdTF8HpWBwGHbp3wfIHsmUKr
 sys.config.adminLogoUrl=http://qmth-test.oss-cn-shenzhen.aliyuncs.com/frontend/wx_logo.png
 sys.config.adminLogoUrl=http://qmth-test.oss-cn-shenzhen.aliyuncs.com/frontend/wx_logo.png
@@ -84,6 +85,8 @@ sys.config.sessionActive=4h
 sys.config.flowSchoolCodeMap.GdykdxPaperApprove=test-school-2
 sys.config.flowSchoolCodeMap.GdykdxPaperApprove=test-school-2
 sys.config.flowSchoolCodeMap.JxzyyPaperApprove=test-school-1,test-school-3
 sys.config.flowSchoolCodeMap.JxzyyPaperApprove=test-school-1,test-school-3
 spring.resources.static-locations=file:${sys.config.serverUpload},classpath:/META-INF/resources/,classpath:/resources/
 spring.resources.static-locations=file:${sys.config.serverUpload},classpath:/META-INF/resources/,classpath:/resources/
+sys.config.fileTempUrl=/Users/king/Downloads/file-temp
+sys.config.pdfTempUrl=/Users/king/Downloads/pdf-temp
 
 
 org.center.url=https://solar.qmth.com.cn
 org.center.url=https://solar.qmth.com.cn
 org.center.orgQueryApi=/api/open/org/query
 org.center.orgQueryApi=/api/open/org/query

+ 2 - 0
distributed-print/src/main/resources/application-offline.properties

@@ -81,6 +81,8 @@ sys.config.sessionActive=4h
 sys.config.flowSchoolCodeMap.GdykdxPaperApprove=test-school-0
 sys.config.flowSchoolCodeMap.GdykdxPaperApprove=test-school-0
 sys.config.flowSchoolCodeMap.JxzyyPaperApprove=test-school-1,test-school-2
 sys.config.flowSchoolCodeMap.JxzyyPaperApprove=test-school-1,test-school-2
 spring.resources.static-locations=file:${sys.config.serverUpload},classpath:/META-INF/resources/,classpath:/resources/
 spring.resources.static-locations=file:${sys.config.serverUpload},classpath:/META-INF/resources/,classpath:/resources/
+sys.config.fileTempUrl=/Users/king/Downloads/file-temp
+sys.config.pdfTempUrl=/Users/king/Downloads/pdf-temp
 
 
 org.center.url=https://solar.qmth.com.cn
 org.center.url=https://solar.qmth.com.cn
 org.center.orgQueryApi=/api/open/org/query
 org.center.orgQueryApi=/api/open/org/query

+ 2 - 0
distributed-print/src/main/resources/application-release.properties

@@ -87,6 +87,8 @@ sys.config.sessionActive=4h
 sys.config.flowSchoolCodeMap.GdykdxPaperApprove=gdpu
 sys.config.flowSchoolCodeMap.GdykdxPaperApprove=gdpu
 sys.config.flowSchoolCodeMap.JxzyyPaperApprove=jxutcm,sisu,test-school-2
 sys.config.flowSchoolCodeMap.JxzyyPaperApprove=jxutcm,sisu,test-school-2
 spring.resources.static-locations=file:${sys.config.serverUpload},classpath:/META-INF/resources/,classpath:/resources/
 spring.resources.static-locations=file:${sys.config.serverUpload},classpath:/META-INF/resources/,classpath:/resources/
+sys.config.fileTempUrl=/Users/king/Downloads/file-temp
+sys.config.pdfTempUrl=/Users/king/Downloads/pdf-temp
 
 
 #com.qmth.solar.access-key=274f823e5f59410f8b3bb6edcd8e2b6e
 #com.qmth.solar.access-key=274f823e5f59410f8b3bb6edcd8e2b6e
 #com.qmth.solar.access-secret=y7AO6W0TOdTF8HpWBwGHbp3wfIHsmUKr
 #com.qmth.solar.access-secret=y7AO6W0TOdTF8HpWBwGHbp3wfIHsmUKr

+ 2 - 0
distributed-print/src/main/resources/application-test.properties

@@ -81,6 +81,8 @@ sys.config.sessionActive=4h
 sys.config.flowSchoolCodeMap.GdykdxPaperApprove=test-school-0
 sys.config.flowSchoolCodeMap.GdykdxPaperApprove=test-school-0
 sys.config.flowSchoolCodeMap.JxzyyPaperApprove=test-school-1,test-school-2
 sys.config.flowSchoolCodeMap.JxzyyPaperApprove=test-school-1,test-school-2
 spring.resources.static-locations=file:${sys.config.serverUpload},classpath:/META-INF/resources/,classpath:/resources/
 spring.resources.static-locations=file:${sys.config.serverUpload},classpath:/META-INF/resources/,classpath:/resources/
+sys.config.fileTempUrl=/Users/king/Downloads/file-temp
+sys.config.pdfTempUrl=/Users/king/Downloads/pdf-temp
 
 
 org.center.url=https://solar.qmth.com.cn
 org.center.url=https://solar.qmth.com.cn
 org.center.orgQueryApi=/api/open/org/query
 org.center.orgQueryApi=/api/open/org/query

+ 20 - 6
teachcloud-common/src/main/java/com/qmth/teachcloud/common/contant/SystemConstant.java

@@ -276,14 +276,28 @@ public class SystemConstant {
      * 初始化附件文件路径
      * 初始化附件文件路径
      */
      */
     public static void initTempFiles() {
     public static void initTempFiles() {
-        StringJoiner localPath = new StringJoiner("").add(System.getProperty(USER_DIR));
-        String mkdir = localPath.toString().substring(0, localPath.toString().lastIndexOf(File.separator));
-        File fileTempDir = new File(new StringBuffer(mkdir).append(File.separator).append(FILE_TEMP).toString());
-        if (!fileTempDir.exists()) {
+        File fileTempDir = null, pdfTempDir = null;
+        DictionaryConfig dictionaryConfig = SpringContextHolder.getBean(DictionaryConfig.class);
+
+        if (Objects.nonNull(dictionaryConfig.sysDomain().getFileTempUrl()) && !Objects.equals("", dictionaryConfig.sysDomain().getFileTempUrl())) {
+            fileTempDir = new File(dictionaryConfig.sysDomain().getFileTempUrl().toString());
+        } else {
+            StringJoiner fileTempLocalPath = new StringJoiner("").add(System.getProperty(USER_DIR));
+            String mkdir = fileTempLocalPath.toString().substring(0, fileTempLocalPath.toString().lastIndexOf(File.separator));
+            fileTempDir = new File(new StringBuffer(mkdir).append(File.separator).append(FILE_TEMP).toString());
+        }
+        if (Objects.nonNull(fileTempDir) && !fileTempDir.exists()) {
             fileTempDir.mkdirs();
             fileTempDir.mkdirs();
         }
         }
-        File pdfTempDir = new File(new StringBuffer(mkdir).append(File.separator).append(PDF_TEMP).toString());
-        if (!pdfTempDir.exists()) {
+
+        if (Objects.nonNull(dictionaryConfig.sysDomain().getPdfTempUrl()) && !Objects.equals("", dictionaryConfig.sysDomain().getPdfTempUrl())) {
+            pdfTempDir = new File(dictionaryConfig.sysDomain().getPdfTempUrl().toString());
+        } else {
+            StringJoiner pdfTempLocalPath = new StringJoiner("").add(System.getProperty(USER_DIR));
+            String mkdir = pdfTempLocalPath.toString().substring(0, pdfTempLocalPath.toString().lastIndexOf(File.separator));
+            pdfTempDir = new File(new StringBuffer(mkdir).append(File.separator).append(PDF_TEMP).toString());
+        }
+        if (Objects.nonNull(pdfTempDir) && !pdfTempDir.exists()) {
             pdfTempDir.mkdirs();
             pdfTempDir.mkdirs();
         }
         }
         TEMP_FILES_DIR = fileTempDir.getPath();
         TEMP_FILES_DIR = fileTempDir.getPath();

+ 20 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/domain/SysDomain.java

@@ -54,6 +54,26 @@ public class SysDomain implements Serializable {
         return flowSchoolCodeMap;
         return flowSchoolCodeMap;
     }
     }
 
 
+    String fileTempUrl;
+
+    String pdfTempUrl;
+
+    public String getFileTempUrl() {
+        return fileTempUrl;
+    }
+
+    public void setFileTempUrl(String fileTempUrl) {
+        this.fileTempUrl = fileTempUrl;
+    }
+
+    public String getPdfTempUrl() {
+        return pdfTempUrl;
+    }
+
+    public void setPdfTempUrl(String pdfTempUrl) {
+        this.pdfTempUrl = pdfTempUrl;
+    }
+
     public void setFlowSchoolCodeMap(Map<String, List<String>> flowSchoolCodeMap) {
     public void setFlowSchoolCodeMap(Map<String, List<String>> flowSchoolCodeMap) {
         this.flowSchoolCodeMap = flowSchoolCodeMap;
         this.flowSchoolCodeMap = flowSchoolCodeMap;
     }
     }

+ 2 - 0
teachcloud-report/src/main/resources/application-36dev.properties

@@ -58,6 +58,8 @@ sys.config.sessionActive=2h
 sys.config.reportUrl=http://localhost:9099/#/student-report/
 sys.config.reportUrl=http://localhost:9099/#/student-report/
 sys.config.loginAuthenUrl=http://192.168.10.86:8057/#/login-authen/
 sys.config.loginAuthenUrl=http://192.168.10.86:8057/#/login-authen/
 spring.resources.static-locations=file:${sys.config.serverUpload},classpath:/META-INF/resources/,classpath:/resources/
 spring.resources.static-locations=file:${sys.config.serverUpload},classpath:/META-INF/resources/,classpath:/resources/
+sys.config.fileTempUrl=/Users/king/Downloads/file-temp
+sys.config.pdfTempUrl=/Users/king/Downloads/pdf-temp
 
 
 org.center.url=https://solar.qmth.com.cn
 org.center.url=https://solar.qmth.com.cn
 org.center.orgQueryApi=/api/open/org/query
 org.center.orgQueryApi=/api/open/org/query

+ 2 - 0
teachcloud-report/src/main/resources/application-dev.properties

@@ -58,6 +58,8 @@ sys.config.sessionActive=2h
 sys.config.reportUrl=http://localhost:9099/#/student-report/
 sys.config.reportUrl=http://localhost:9099/#/student-report/
 sys.config.loginAuthenUrl=http://127.0.0.1:8057/#/login-authen/
 sys.config.loginAuthenUrl=http://127.0.0.1:8057/#/login-authen/
 spring.resources.static-locations=file:${sys.config.serverUpload},classpath:/META-INF/resources/,classpath:/resources/
 spring.resources.static-locations=file:${sys.config.serverUpload},classpath:/META-INF/resources/,classpath:/resources/
+sys.config.fileTempUrl=/Users/king/Downloads/file-temp
+sys.config.pdfTempUrl=/Users/king/Downloads/pdf-temp
 
 
 org.center.url=https://solar.qmth.com.cn
 org.center.url=https://solar.qmth.com.cn
 org.center.orgQueryApi=/api/open/org/query
 org.center.orgQueryApi=/api/open/org/query

+ 2 - 0
teachcloud-report/src/main/resources/application-offline.properties

@@ -58,6 +58,8 @@ sys.config.sessionActive=2h
 sys.config.reportUrl=http://192.168.10.136/#/student-report/
 sys.config.reportUrl=http://192.168.10.136/#/student-report/
 sys.config.loginAuthenUrl=http://192.168.10.136/#/login-authen/
 sys.config.loginAuthenUrl=http://192.168.10.136/#/login-authen/
 spring.resources.static-locations=file:${sys.config.serverUpload},classpath:/META-INF/resources/,classpath:/resources/
 spring.resources.static-locations=file:${sys.config.serverUpload},classpath:/META-INF/resources/,classpath:/resources/
+sys.config.fileTempUrl=/Users/king/Downloads/file-temp
+sys.config.pdfTempUrl=/Users/king/Downloads/pdf-temp
 
 
 org.center.url=https://solar.qmth.com.cn
 org.center.url=https://solar.qmth.com.cn
 org.center.orgQueryApi=/api/open/org/query
 org.center.orgQueryApi=/api/open/org/query

+ 2 - 0
teachcloud-report/src/main/resources/application-release.properties

@@ -59,6 +59,8 @@ sys.config.sessionActive=2h
 sys.config.reportUrl=https://wdfx.qmth.com.cn/#/student-report/
 sys.config.reportUrl=https://wdfx.qmth.com.cn/#/student-report/
 sys.config.loginAuthenUrl=https://wdfx.qmth.com.cn/#/login-authen/
 sys.config.loginAuthenUrl=https://wdfx.qmth.com.cn/#/login-authen/
 spring.resources.static-locations=file:${sys.config.serverUpload},classpath:/META-INF/resources/,classpath:/resources/
 spring.resources.static-locations=file:${sys.config.serverUpload},classpath:/META-INF/resources/,classpath:/resources/
+sys.config.fileTempUrl=/Users/king/Downloads/file-temp
+sys.config.pdfTempUrl=/Users/king/Downloads/pdf-temp
 
 
 org.center.url=https://solar.qmth.com.cn
 org.center.url=https://solar.qmth.com.cn
 org.center.orgQueryApi=/api/open/org/query
 org.center.orgQueryApi=/api/open/org/query

+ 2 - 0
teachcloud-report/src/main/resources/application-test.properties

@@ -58,6 +58,8 @@ sys.config.sessionActive=2h
 sys.config.reportUrl=https://*.teachcloud-report-test.work/#/student-report/
 sys.config.reportUrl=https://*.teachcloud-report-test.work/#/student-report/
 sys.config.loginAuthenUrl=https://*.teachcloud-report-test.work/#/login-authen/
 sys.config.loginAuthenUrl=https://*.teachcloud-report-test.work/#/login-authen/
 spring.resources.static-locations=file:${sys.config.serverUpload},classpath:/META-INF/resources/,classpath:/resources/
 spring.resources.static-locations=file:${sys.config.serverUpload},classpath:/META-INF/resources/,classpath:/resources/
+sys.config.fileTempUrl=/Users/king/Downloads/file-temp
+sys.config.pdfTempUrl=/Users/king/Downloads/pdf-temp
 
 
 org.center.url=https://solar.qmth.com.cn
 org.center.url=https://solar.qmth.com.cn
 org.center.orgQueryApi=/api/open/org/query
 org.center.orgQueryApi=/api/open/org/query