Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dcs-doc-expand
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
INET-TWO
server
dcs-doc-expand
Commits
dc6b2d5b
Commit
dc6b2d5b
authored
Sep 10, 2024
by
wangqiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
将固定地址修改为动态地址
parent
1771276d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
14 deletions
+33
-14
Constants.java
...src/main/java/com/yonde/dcs/core/constants/Constants.java
+8
-5
ResourceHelper.java
...src/main/java/com/yonde/dcs/core/util/ResourceHelper.java
+25
-9
No files found.
dcs-doc-expand-core/src/main/java/com/yonde/dcs/core/constants/Constants.java
View file @
dc6b2d5b
package
com
.
yonde
.
dcs
.
core
.
constants
;
import
com.yonde.dcs.core.util.ResourceHelper
;
/**
* @author xfchai
* @ClassName Constants.java
...
...
@@ -87,11 +89,12 @@ public class Constants {
/**
* 合并后生成的 word-绝对路径
*/
public
static
final
String
MERGER_FILE_ABSOLUTE_PATH
=
"D:\\InetService\\resource\\template\\words\\"
;
public
static
final
String
MERGER_FILE_ABSOLUTE_PATH
=
ResourceHelper
.
getTempFileDir
()
;
/**
* 模板的路径
*/
public
static
final
String
MTEMPLATE_ABSOLUTE_PATH
=
"D:\\InetService\\resource\\template\\"
;
public
static
final
String
MTEMPLATE_ABSOLUTE_PATH
=
ResourceHelper
.
getTempFileDir
();
/**
* 生成多个合并前的模板路径
*/
...
...
@@ -99,7 +102,7 @@ public class Constants {
/**
* 生成多个合并前的模板路径
*/
public
static
final
String
JD_BEFORE_MERGER_PATH
=
"D:/InetService/resource/template/words/"
;
public
static
final
String
JD_BEFORE_MERGER_PATH
=
ResourceHelper
.
getTempFileDir
()
;
/**
* 模板路径
*/
...
...
@@ -288,11 +291,11 @@ public class Constants {
/**
* 批量下载文件路径
*/
public
static
final
String
DOWLOAD_FILE_PATH
=
"D:\\bathDocFile"
;
public
static
final
String
DOWLOAD_FILE_PATH
=
ResourceHelper
.
getTempFileDir
()
;
/**
* 将bathDocFile目录下的所有文件目录打包到d:/bathDocFile.zip
*/
public
static
final
String
BATH_FILE_PATH
=
"D:/bathDocFile"
;
public
static
final
String
BATH_FILE_PATH
=
ResourceHelper
.
getTempFileDir
()
;
/**
* 未开启
*/
...
...
dcs-doc-expand-core/src/main/java/com/yonde/dcs/core/util/ResourceHelper.java
View file @
dc6b2d5b
package
com
.
yonde
.
dcs
.
core
.
util
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.io.FileUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.boot.system.ApplicationHome
;
...
...
@@ -9,6 +11,7 @@ import java.io.FileInputStream;
import
java.io.FileNotFoundException
;
import
java.io.IOException
;
import
java.util.Properties
;
import
java.util.UUID
;
/**
* @program: service
...
...
@@ -20,17 +23,19 @@ import java.util.Properties;
public
class
ResourceHelper
{
public
static
String
baseHomeDir
;
/**
* 获取外部资源配置
*
* @return
*/
public
static
Properties
getResource
(){
public
static
Properties
getResource
()
{
Properties
prop
=
new
Properties
();
try
{
try
{
prop
.
load
(
new
FileInputStream
(
"resource/esignConfig.properties"
));
}
catch
(
FileNotFoundException
e
)
{
}
catch
(
FileNotFoundException
e
)
{
log
.
error
(
"找不到配置资源文件:"
+
e
.
getMessage
());
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
error
(
"读取外部配置资源文件报错:"
+
e
.
getMessage
());
}
return
prop
;
...
...
@@ -39,16 +44,17 @@ public class ResourceHelper {
/**
* 项目经费 模板文件目录
*
* @return
*/
public
static
String
get
Funds
Dir
()
{
public
static
String
get
TempFile
Dir
()
{
return
getBaseHomeDir
()
+
File
.
separator
+
"config"
+
File
.
separator
+
"funds"
;
"config"
;
}
/**
* 项目经费 模板文件目录
*
* @return
*/
public
static
String
getIndexDir
()
{
...
...
@@ -75,7 +81,7 @@ public class ResourceHelper {
*/
public
static
String
getSKImage
()
{
return
getBaseHomeDir
()
+
File
.
separator
+
"config"
+
File
.
separator
+
"doc"
+
File
.
separator
+
"config"
+
File
.
separator
+
"doc"
+
File
.
separator
+
"skImage.png"
;
}
...
...
@@ -87,7 +93,7 @@ public class ResourceHelper {
*/
public
static
String
getZFImage
()
{
return
getBaseHomeDir
()
+
File
.
separator
+
"config"
+
File
.
separator
+
"doc"
+
File
.
separator
+
"config"
+
File
.
separator
+
"doc"
+
File
.
separator
+
"zfImage.png"
;
}
...
...
@@ -161,4 +167,14 @@ public class ResourceHelper {
}
return
baseHomeDir
;
}
public
static
File
createTemDir
()
{
String
uuid
=
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
);
String
temDir
=
getBaseHomeDir
()
+
File
.
separator
+
"tem"
+
File
.
separator
+
uuid
;
return
FileUtil
.
mkdir
(
temDir
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment