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
50e16a59
Commit
50e16a59
authored
Dec 23, 2021
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
06e03c4a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
UploadController.java
...ns/platform/rs/universal/controller/UploadController.java
+3
-3
UploadService.java
...m/upyuns/platform/rs/universal/service/UploadService.java
+8
-2
No files found.
rs-universal/rs-universal-server/src/main/java/com/upyuns/platform/rs/universal/controller/UploadController.java
View file @
50e16a59
...
@@ -131,11 +131,11 @@ public class UploadController{
...
@@ -131,11 +131,11 @@ public class UploadController{
}
}
@RequestMapping
(
value
=
"/app/unauth/shp/upload"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/app/unauth/shp/upload"
,
method
=
RequestMethod
.
POST
)
public
JSONObject
shpUploads
(
public
ObjectRestResponse
shpUploads
(
@RequestParam
(
"file"
)
MultipartFile
file
,
@RequestParam
(
"file"
)
MultipartFile
file
,
@RequestParam
(
value
=
"prefix"
,
defaultValue
=
"shp"
)
String
prefix
@RequestParam
(
value
=
"prefix"
,
defaultValue
=
"shp"
)
String
prefix
)
throws
Exception
{
)
throws
Exception
{
return
JsonResultUtil
.
createSuccessResultWithObj
(
uploadService
.
uploadShpFile
(
file
,
prefix
));
return
ObjectRestResponse
.
succ
(
uploadService
.
uploadShpFile
(
file
,
prefix
));
}
}
@IgnoreUserToken
@IgnoreUserToken
...
...
rs-universal/rs-universal-server/src/main/java/com/upyuns/platform/rs/universal/service/UploadService.java
View file @
50e16a59
package
com
.
upyuns
.
platform
.
rs
.
universal
.
service
;
package
com
.
upyuns
.
platform
.
rs
.
universal
.
service
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.img.ImgUtil
;
import
cn.hutool.core.img.ImgUtil
;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.io.FileUtil
;
import
com.github.wxiaoqi.security.common.util.UUIDUtils
;
import
com.github.wxiaoqi.security.common.util.UUIDUtils
;
...
@@ -27,6 +28,7 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -27,6 +28,7 @@ import org.springframework.web.multipart.MultipartFile;
import
java.awt.*
;
import
java.awt.*
;
import
java.awt.image.BufferedImage
;
import
java.awt.image.BufferedImage
;
import
java.io.File
;
import
java.io.File
;
import
java.util.Map
;
import
java.util.UUID
;
import
java.util.UUID
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
...
@@ -49,7 +51,7 @@ public class UploadService {
...
@@ -49,7 +51,7 @@ public class UploadService {
* @param file
* @param file
* @return
* @return
*/
*/
public
String
uploadShpFile
(
MultipartFile
file
,
String
prefix
)
throws
Exception
{
public
Map
<
String
,
String
>
uploadShpFile
(
MultipartFile
file
,
String
prefix
)
throws
Exception
{
//创建本日存放目录
//创建本日存放目录
DateTime
now
=
DateTime
.
now
();
DateTime
now
=
DateTime
.
now
();
String
dirPathToday
=
"/"
+
prefix
+
"/"
+
now
.
toString
(
DEFAULT_DATE_TIME_FORMATTER
);
String
dirPathToday
=
"/"
+
prefix
+
"/"
+
now
.
toString
(
DEFAULT_DATE_TIME_FORMATTER
);
...
@@ -68,7 +70,11 @@ public class UploadService {
...
@@ -68,7 +70,11 @@ public class UploadService {
String
geomJson
=
ShpToGeojson
.
shp2geojson
(
filePath
);
String
geomJson
=
ShpToGeojson
.
shp2geojson
(
filePath
);
redisTemplate
.
opsForValue
().
set
(
key
,
geomJson
);
redisTemplate
.
opsForValue
().
set
(
key
,
geomJson
);
// realFileRelPath=xx_url+SystemConfig.XXMP_URL+realFileRelPath;
// realFileRelPath=xx_url+SystemConfig.XXMP_URL+realFileRelPath;
return
key
;
Map
map
=
CollUtil
.
newHashMap
();
map
.
put
(
"shpKey"
,
key
);
map
.
put
(
"geom"
,
geomJson
);
return
map
;
}
}
/**
/**
...
...
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