Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rs-cloud-platform
Project
Project
Details
Activity
Releases
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
周健威
rs-cloud-platform
Commits
e0760405
Commit
e0760405
authored
Sep 13, 2024
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gtdata路径处理
parent
7c5e9f81
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
29 deletions
+24
-29
AdminDataTempcacheController.java
...m/rs/website/controller/AdminDataTempcacheController.java
+24
-29
No files found.
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/controller/AdminDataTempcacheController.java
View file @
e0760405
...
@@ -4,6 +4,7 @@ import cn.hutool.core.convert.Convert;
...
@@ -4,6 +4,7 @@ import cn.hutool.core.convert.Convert;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.http.HttpUtil
;
import
cn.hutool.http.HttpUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
...
@@ -20,6 +21,8 @@ import com.upyuns.platform.rs.website.entity.DataTempcache;
...
@@ -20,6 +21,8 @@ import com.upyuns.platform.rs.website.entity.DataTempcache;
import
com.upyuns.platform.rs.website.entity.FileData
;
import
com.upyuns.platform.rs.website.entity.FileData
;
import
com.upyuns.platform.rs.website.entity.GainData
;
import
com.upyuns.platform.rs.website.entity.GainData
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.extern.log4j.Log4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -34,6 +37,7 @@ import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TR
...
@@ -34,6 +37,7 @@ import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TR
@RestController
@RestController
@RequestMapping
(
"dataTempcache"
)
@RequestMapping
(
"dataTempcache"
)
@Slf4j
public
class
AdminDataTempcacheController
extends
BaseController
<
DataTempcacheBiz
,
DataTempcache
>
{
public
class
AdminDataTempcacheController
extends
BaseController
<
DataTempcacheBiz
,
DataTempcache
>
{
@Autowired
@Autowired
...
@@ -106,38 +110,29 @@ public class AdminDataTempcacheController extends BaseController<DataTempcacheBi
...
@@ -106,38 +110,29 @@ public class AdminDataTempcacheController extends BaseController<DataTempcacheBi
//根据id创建gtdata目录
//根据id创建gtdata目录
String
gtdataPath
=
"/rscloudmart"
+
tempcachePath
+
"/"
+
dataTempcacheDB
.
getId
();
String
gtdataPath
=
"/rscloudmart"
+
tempcachePath
+
"/"
+
dataTempcacheDB
.
getId
();
gtDataRestClient
.
mkdirs
(
gtdataPath
);
gtDataRestClient
.
mkdirs
(
gtdataPath
);
// gainData.setGtdataPath(gtdataPath);
String
finalGtdataPath
=
gtdataPath
;
// updateSelectiveById(new GainData() {{
// setId(gainData.getId());
// setGtdataPath(finalGtdataPath);
// setHasGtdata(HASGTDATA_FIN);
// }});
//上传文件
String
fileGtdataPath
=
gtdataPath
+
"/"
+
dataTempcacheDB
.
getFilename
();
// Map<String, Object> result = gtDataRestClient.open(dataTempcacheDB.getGtdataPath());
String
filepath
=
dataTempcacheDB
.
getFilepath
();
// byte[] content = (byte[]) result.get("file");
// if(StrUtil.isBlank(filepath)) {
// getResponse().setContentLength(content.length);
// //下载文件
//
// String realPath = tempcachePath+"/"+dataTempcache.getId();
// String serverPath = baseUploadPath + realPath;
// //创建目录
// if(!FileUtil.exist(serverPath)) {
// FileUtil.mkdir(serverPath);
// }
// }
//
// FileUtil.writeBytes(content, serverPath + "/" + dataTempcache.getFilename());
if
(!
gtDataRestClient
.
isExist
(
fileGtdataPath
).
get
(
"exist"
).
toString
().
equals
(
"true"
)){
// baseBiz.updateSelectiveById(new DataTempcache(){{
Map
<
String
,
Object
>
responseMap
=
gtDataRestClient
.
createLarge
(
filepath
,
fileGtdataPath
);
// setId(dataTempcacheDB.getId());
if
(
responseMap
==
null
||
200
!=
(
Integer
)
responseMap
.
get
(
"HttpStatusCode"
))
{
// setFilepath(serverPath + "/" + dataTempcache.getFilename());
log
.
error
(
JSONUtil
.
toJsonStr
(
responseMap
),
responseMap
);
// setFileurl(xx_url+ SystemConfig.XXMP_URL + realPath + "/" + dataTempcache.getFilename());
}
// }});
}
// dataTempcacheDB.setFilepath(serverPath + "/" + dataTempcache.getFilename());
// dataTempcacheDB.setFileurl(xx_url+ SystemConfig.XXMP_URL + realPath + "/" + dataTempcache.getFilename());
baseBiz
.
updateSelectiveById
(
new
DataTempcache
()
{{
setId
(
dataTempcache
.
getId
());
setGtdataPath
(
fileGtdataPath
);
setHasGtdata
(
HASGTDATA_FIN
);
}});
dataTempcacheDB
.
setGtdataPath
(
fileGtdataPath
);
}
}
// else if (DataTempcache.UPTYPE_URL == dataTempcacheDB.getUptype()) {
//
// }
}
}
resultPath
=
dataTempcacheDB
.
getGtdataPath
();
resultPath
=
dataTempcacheDB
.
getGtdataPath
();
...
@@ -213,7 +208,7 @@ public class AdminDataTempcacheController extends BaseController<DataTempcacheBi
...
@@ -213,7 +208,7 @@ public class AdminDataTempcacheController extends BaseController<DataTempcacheBi
dataTempcache
.
setFilesize
(
fileSizeString
);
dataTempcache
.
setFilesize
(
fileSizeString
);
dataTempcache
.
setFilepath
(
serverPath
+
"/"
+
dataTempcache
.
getFilename
());
dataTempcache
.
setFilepath
(
serverPath
+
"/"
+
dataTempcache
.
getFilename
());
dataTempcache
.
setFileurl
(
xx_url
+
SystemConfig
.
XXMP_URL
+
realPath
+
"/"
+
dataTempcache
.
getFilename
());
dataTempcache
.
setFileurl
(
xx_url
+
SystemConfig
.
XXMP_URL
+
realPath
+
"/"
+
dataTempcache
.
getFilename
());
}
else
{
}
else
if
(
DataTempcache
.
UPTYPE_UPLOAD
==
dataTempcache
.
getUptype
())
{
dataTempcache
.
setFileurl
(
dataTempcache
.
getUpurl
());
dataTempcache
.
setFileurl
(
dataTempcache
.
getUpurl
());
}
}
}
}
...
...
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