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
7a8caa8b
Commit
7a8caa8b
authored
Dec 30, 2020
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
f038a8e5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
65 additions
and
10 deletions
+65
-10
pom.xml
ace-common/pom.xml
+5
-0
GtDataRestClient.java
.../java/com/upyuns/platform/rs/gtdata/GtDataRestClient.java
+37
-4
ImageDataVO.java
...a/com/upyuns/platform/rs/datacenter/pojo/ImageDataVO.java
+4
-0
GtdataController.java
.../upyuns/platform/rs/datacenter/rest/GtdataController.java
+1
-1
RscpImageDataTotalController.java
...form/rs/datacenter/rest/RscpImageDataTotalController.java
+1
-1
BgGtdataController.java
...form/rs/datacenter/rest/backstage/BgGtdataController.java
+17
-4
No files found.
ace-common/pom.xml
View file @
7a8caa8b
...
...
@@ -28,6 +28,11 @@
<poi.version>
3.15
</poi.version>
</properties>
<dependencies>
<dependency>
<groupId>
commons-io
</groupId>
<artifactId>
commons-io
</artifactId>
<version>
2.5
</version>
</dependency>
<dependency>
<groupId>
com.fasterxml.jackson.module
</groupId>
<artifactId>
jackson-module-jaxb-annotations
</artifactId>
...
...
ace-common/src/main/java/com/upyuns/platform/rs/gtdata/GtDataRestClient.java
View file @
7a8caa8b
...
...
@@ -5,6 +5,8 @@
package
com
.
upyuns
.
platform
.
rs
.
gtdata
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.io.IoUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -674,6 +676,30 @@ public class GtDataRestClient {
}
// /**
// *
// * Description:显示指定路径[文件/文件夹(包括子文件)]的属性
// *
// * @param path
// * @param username
// * @param recursive
// * @param sign
// * @param time
// * @return
// * 成功({key:HttpStatusCode,value:200},{key:files,value:List<GtdataFile
// * >})
// *
// */
// public Map<String, Object> showFileInfo(String path) {
// //路径 和 文件分离
// String[] = StrUtil.
// String fin
// String resourceUrl = MessageFormat.format(
// "{0}{1}?op=LIST&sign={2}&time={3}",
// gtDataUrl, path, defaultSign, defaultTime);
// Map<String, Object> responseMap = restGet(resourceUrl);
// }
/**
*
* Description:(只能在Linux环境使用)根据路径读取文件内容(支持大文件)
...
...
@@ -1097,7 +1123,7 @@ public class GtDataRestClient {
try
{
byte
[]
byteArr
=
file
.
getBytes
();
inputStream
=
new
ByteArrayInputStream
(
byteArr
);
return
createInputStream
(
inputStream
,
path
,
sign
,
time
,
overwrite
);
return
createInputStream
(
byteArr
,
inputStream
,
path
,
sign
,
time
,
overwrite
);
}
catch
(
Exception
e
){
logger
.
error
(
e
.
getMessage
(),
e
);
}
finally
{
...
...
@@ -1129,7 +1155,7 @@ public class GtDataRestClient {
* @return
*
*/
public
Map
<
String
,
Object
>
createInputStream
(
InputStream
file
,
String
path
,
public
Map
<
String
,
Object
>
createInputStream
(
byte
[]
byteArr
,
InputStream
file
,
String
path
,
String
sign
,
String
time
,
boolean
overwrite
)
{
String
md5
=
""
;
...
...
@@ -1155,8 +1181,15 @@ public class GtDataRestClient {
gtDataUrl
,
path
,
md5
,
sign
,
time
,
overwrite
);
try
{
HttpEntity
<
byte
[]>
httpEntity
=
new
HttpEntity
(
IOUtils
.
toByteArray
(
file
));
HttpEntity
<
byte
[]>
httpEntity
=
null
;
if
(
null
!=
byteArr
&&
byteArr
.
length
>
0
)
{
httpEntity
=
new
HttpEntity
(
byteArr
);
}
else
{
httpEntity
=
new
HttpEntity
(
IoUtil
.
readBytes
(
file
));
}
Map
<
String
,
Object
>
responseMap2
=
rest
(
resourceUrl
,
HttpMethod
.
PUT
,
httpEntity
);
return
responseMap2
;
...
...
rs-datacenter/rs-datacenter-api/src/main/java/com/upyuns/platform/rs/datacenter/pojo/ImageDataVO.java
View file @
7a8caa8b
...
...
@@ -9,4 +9,8 @@ import java.math.BigDecimal;
@Data
public
class
ImageDataVO
extends
RscpAreaImageTotal
{
BigDecimal
price
=
BigDecimal
.
ZERO
;
public
void
setPrice
(
BigDecimal
price
)
{
this
.
price
=
price
;
}
}
rs-datacenter/rs-datacenter-server/src/main/java/com/upyuns/platform/rs/datacenter/rest/GtdataController.java
View file @
7a8caa8b
...
...
@@ -31,7 +31,7 @@ public class GtdataController extends CommonBaseController {
@IgnoreUserToken
public
void
queryAreaInfoByAreaId
()
throws
Exception
{
String
url
=
request
.
getRequestURI
();
String
fileName
=
url
.
substring
(
url
.
lastIndexOf
(
"/"
)+
1
);
String
fileName
=
url
.
substring
(
url
.
lastIndexOf
(
"/"
)+
1
)
+
System
.
currentTimeMillis
()
;
String
filePath
=
"https://box.bdimg.com/static/fisp_static/common/img/searchbox/logo_news_276_88_1f9876a.png"
;
// String filePath = "/obt/thumbnail/"+ url.substring(url.lastIndexOf("/app/unauth/image/")+18);
// String filePath = "/obt/thumbnail/data/VDM2/20200613/VDM2_20200525232637_0015_L1_MSS_CMOS5/VDM2_20200525232637_0015_L1_MSS_CMOS5_98_98.jpg";
...
...
rs-datacenter/rs-datacenter-server/src/main/java/com/upyuns/platform/rs/datacenter/rest/RscpImageDataTotalController.java
View file @
7a8caa8b
...
...
@@ -132,7 +132,7 @@ public class RscpImageDataTotalController extends BaseController<RscpImageDataTo
list
.
forEach
(
p
->
{
if
(
t
.
getImageSatelliteType
().
equals
(
p
.
getImageSatelliteType
())
&&
t
.
getImageSensorType
().
equals
(
p
.
getImageSensorType
()))
{
vo
.
setPrice
(
p
.
get
Unit
Price
());
vo
.
setPrice
(
p
.
getPrice
());
}
});
list3
.
add
(
vo
);
...
...
rs-datacenter/rs-datacenter-server/src/main/java/com/upyuns/platform/rs/datacenter/rest/backstage/BgGtdataController.java
View file @
7a8caa8b
package
com
.
upyuns
.
platform
.
rs
.
datacenter
.
rest
.
backstage
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
...
...
@@ -40,12 +41,24 @@ public class BgGtdataController extends CommonBaseController {
@RequestParam
(
value
=
"prefix"
,
defaultValue
=
"admin"
)
String
prefix
)
throws
Exception
{
String
contentType
=
file
.
getContentType
();
//图片文件类型
Map
<
String
,
Object
>
existMap
=
gtDataRestClient
.
isExist
(
uploadP
);
if
(
StrUtil
.
isBlank
(
contentType
))
{
contentType
=
"jpg"
;
}
else
{
String
[]
types
=
file
.
getContentType
().
split
(
"/"
);
if
(
types
.
length
>
1
)
{
contentType
=
file
.
getContentType
().
split
(
"/"
)[
1
];
}
}
String
path
=
uploadP
+
DateUtil
.
date
().
toDateStr
()+
"/"
;
String
fileName
=
path
+
System
.
currentTimeMillis
()+
"."
+
contentType
;
Map
<
String
,
Object
>
existMap
=
gtDataRestClient
.
isExist
(
path
);
if
(
existMap
.
get
(
"HttpStatusCode"
)
==
null
||
!
"200"
.
equals
(
existMap
.
get
(
"HttpStatusCode"
))){
gtDataRestClient
.
mkdirs
(
uploadP
);
gtDataRestClient
.
mkdirs
(
path
);
}
gtDataRestClient
.
createMultipartFile
(
file
,
uploadP
+
file
.
getName
());
return
ObjectRestResponse
.
succ
();
gtDataRestClient
.
createMultipartFile
(
file
,
fileName
);
//获取文件信息
Map
<
String
,
Object
>
map
=
gtDataRestClient
.
open
(
fileName
);
return
ObjectRestResponse
.
succ
(
fileName
);
}
public
void
downloadVideoById
(
String
fileName
,
String
filePath
,
HttpServletResponse
response
)
throws
Exception
{
...
...
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