Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c85adc3a
authored
Feb 23, 2021
by
淡漠
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix
1 parent
e742b585
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletions
linkwe-common/src/main/java/com/tencent/wework/FinanceUtils.java
linkwe-common/src/main/java/com/tencent/wework/FinanceUtils.java
View file @
c85adc3
...
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
...
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.linkwechat.common.config.RuoYiConfig
;
import
com.linkwechat.common.config.RuoYiConfig
;
import
com.linkwechat.common.constant.Constants
;
import
com.linkwechat.common.constant.WeConstans
;
import
com.linkwechat.common.constant.WeConstans
;
import
com.linkwechat.common.core.redis.RedisCache
;
import
com.linkwechat.common.core.redis.RedisCache
;
import
com.linkwechat.common.utils.DateUtils
;
import
com.linkwechat.common.utils.DateUtils
;
...
@@ -244,6 +245,7 @@ public class FinanceUtils {
...
@@ -244,6 +245,7 @@ public class FinanceUtils {
getPath
(
realJsonData
,
msgType
,
fileName
);
getPath
(
realJsonData
,
msgType
,
fileName
);
}
}
//本地存储
private
static
void
getPath
(
JSONObject
realJsonData
,
String
msgType
,
String
fileName
)
{
private
static
void
getPath
(
JSONObject
realJsonData
,
String
msgType
,
String
fileName
)
{
String
filePath
=
getFilePath
(
msgType
);
String
filePath
=
getFilePath
(
msgType
);
JSONObject
data
=
Optional
.
ofNullable
(
realJsonData
.
getJSONObject
(
msgType
))
JSONObject
data
=
Optional
.
ofNullable
(
realJsonData
.
getJSONObject
(
msgType
))
...
@@ -254,7 +256,14 @@ public class FinanceUtils {
...
@@ -254,7 +256,14 @@ public class FinanceUtils {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
data
.
put
(
"attachment"
,
filePath
+
"/"
+
fileName
);
String
currentDir
=
StringUtils
.
substring
(
filePath
,
downloadWeWorkPath
.
length
()+
1
);
String
pathFileName
;
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isBlank
(
currentDir
)){
pathFileName
=
Constants
.
RESOURCE_PREFIX
+
"/"
+
fileName
;
}
else
{
pathFileName
=
Constants
.
RESOURCE_PREFIX
+
"/"
+
currentDir
+
"/"
+
fileName
;
}
data
.
put
(
"attachment"
,
pathFileName
);
if
(
realJsonData
.
containsKey
(
"content"
))
{
if
(
realJsonData
.
containsKey
(
"content"
))
{
realJsonData
.
put
(
"content"
,
data
);
realJsonData
.
put
(
"content"
,
data
);
}
else
{
}
else
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment