Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-smart
Overview
Overview
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
platform
hg-smart
Commits
3b6b17f7
Commit
3b6b17f7
authored
Oct 23, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-sx' of
http://129.211.46.84:8800/platform/hg-smart
into master-dc
parents
fe1806af
b3650156
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
18 deletions
+11
-18
FileDownloadController.java
.../com/baosight/hggp/controller/FileDownloadController.java
+5
-13
ServiceHGWD001C.java
...java/com/baosight/hggp/hg/wd/service/ServiceHGWD001C.java
+6
-5
No files found.
src/main/java/com/baosight/hggp/controller/FileDownloadController.java
View file @
3b6b17f7
...
@@ -3,6 +3,7 @@ package com.baosight.hggp.controller;
...
@@ -3,6 +3,7 @@ package com.baosight.hggp.controller;
import
com.baosight.hggp.core.constant.S3Constant
;
import
com.baosight.hggp.core.constant.S3Constant
;
import
com.baosight.hggp.core.utils.Iplat4jUtils
;
import
com.baosight.hggp.core.utils.Iplat4jUtils
;
import
com.baosight.hggp.core.utils.S3Utils
;
import
com.baosight.hggp.core.utils.S3Utils
;
import
com.baosight.hggp.util.AssertUtils
;
import
com.baosight.hggp.util.FileUtils
;
import
com.baosight.hggp.util.FileUtils
;
import
com.baosight.hggp.util.LogUtils
;
import
com.baosight.hggp.util.LogUtils
;
import
com.baosight.hggp.util.MapUtils
;
import
com.baosight.hggp.util.MapUtils
;
...
@@ -64,22 +65,13 @@ public class FileDownloadController {
...
@@ -64,22 +65,13 @@ public class FileDownloadController {
@RequestMapping
({
"/{docId}"
})
@RequestMapping
({
"/{docId}"
})
public
void
download
(
@PathVariable
String
docId
,
HttpServletResponse
response
)
throws
IOException
{
public
void
download
(
@PathVariable
String
docId
,
HttpServletResponse
response
)
throws
IOException
{
try
{
try
{
if
(
"s3"
.
equalsIgnoreCase
(
S3Constant
.
FILE_LOCATION
))
{
String
url
=
Iplat4jUtils
.
buildDocUrl
(
docId
);
Teudm05
dbDm05
=
S3Utils
.
buildUrl
(
docId
);
AssertUtils
.
isEmpty
(
url
,
"文件地址为空"
);
// S3地址有公网
response
.
sendRedirect
(
url
);
response
.
sendRedirect
(
dbDm05
.
getUrl
());
// S3地址无公网
// FileUtils.downloadUrlFile(dbDm05.getUrl(), dbDm05.getResCname(), false, response);
}
else
{
Map
dbDm02
=
Iplat4jUtils
.
getDoc02ById
(
docId
);
String
returnUrl
=
MapUtils
.
getString
(
dbDm02
,
"url"
);
String
fileName
=
MapUtils
.
getString
(
dbDm02
,
"docName"
);
FileUtils
.
downloadFile
(
new
File
(
returnUrl
),
fileName
,
false
,
response
);
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
String
msg
=
String
.
format
(
"下载文件【%s】失败!原因:%s"
,
docId
,
LogUtils
.
getMsg
(
e
));
String
msg
=
String
.
format
(
"下载文件【%s】失败!原因:%s"
,
docId
,
LogUtils
.
getMsg
(
e
));
response
.
getWriter
().
write
(
msg
);
response
.
getWriter
().
write
(
msg
);
}
}
}
}
}
}
src/main/java/com/baosight/hggp/hg/wd/service/ServiceHGWD001C.java
View file @
3b6b17f7
...
@@ -96,8 +96,10 @@ public class ServiceHGWD001C extends ServiceBase {
...
@@ -96,8 +96,10 @@ public class ServiceHGWD001C extends ServiceBase {
*/
*/
public
EiInfo
add
(
EiInfo
inInfo
)
{
public
EiInfo
add
(
EiInfo
inInfo
)
{
try
{
try
{
Map
queryMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
,
EiConstant
.
resultBlock
);
String
fileId
=
MapUtils
.
getString
(
queryMap
,
HGWD001
.
FIELD_FILE_ID
);
// 写入下载记录
// 写入下载记录
this
.
saveData
(
inInfo
);
this
.
saveData
(
inInfo
,
fileId
);
inInfo
.
setMsg
(
"操作成功"
);
inInfo
.
setMsg
(
"操作成功"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"操作失败"
);
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"操作失败"
);
...
@@ -114,12 +116,13 @@ public class ServiceHGWD001C extends ServiceBase {
...
@@ -114,12 +116,13 @@ public class ServiceHGWD001C extends ServiceBase {
public
EiInfo
batchDownload
(
EiInfo
inInfo
)
{
public
EiInfo
batchDownload
(
EiInfo
inInfo
)
{
try
{
try
{
Map
queryMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
Map
queryMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
String
fileId
=
MapUtils
.
getString
(
queryMap
,
HGWD001
.
FIELD_FILE_ID
);
String
fileName
=
MapUtils
.
getString
(
queryMap
,
HGWD001
.
FIELD_FILE_NAME
);
String
fileName
=
MapUtils
.
getString
(
queryMap
,
HGWD001
.
FIELD_FILE_NAME
);
String
zipName
=
fileName
+
"_"
+
DateUtils
.
shortDateTime
();
String
zipName
=
fileName
+
"_"
+
DateUtils
.
shortDateTime
();
List
<
String
>
docIds
=
ObjectUtils
.
listKey
(
inInfo
,
HGWD099
.
FIELD_DOC_ID
);
List
<
String
>
docIds
=
ObjectUtils
.
listKey
(
inInfo
,
HGWD099
.
FIELD_DOC_ID
);
inInfo
.
set
(
"downloadUrl"
,
Iplat4jUtils
.
compressFile
(
docIds
,
zipName
));
inInfo
.
set
(
"downloadUrl"
,
Iplat4jUtils
.
compressFile
(
docIds
,
zipName
));
// 写入下载记录
// 写入下载记录
this
.
saveData
(
inInfo
);
this
.
saveData
(
inInfo
,
fileId
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LogUtils
.
setMsg
(
inInfo
,
e
,
"批量下载失败"
);
LogUtils
.
setMsg
(
inInfo
,
e
,
"批量下载失败"
);
}
}
...
@@ -131,9 +134,7 @@ public class ServiceHGWD001C extends ServiceBase {
...
@@ -131,9 +134,7 @@ public class ServiceHGWD001C extends ServiceBase {
*
*
* @param inInfo
* @param inInfo
*/
*/
private
void
saveData
(
EiInfo
inInfo
)
{
private
void
saveData
(
EiInfo
inInfo
,
String
fileId
)
{
Map
queryMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
String
fileId
=
MapUtils
.
getString
(
queryMap
,
HGWD001
.
FIELD_FILE_ID
);
AssertUtils
.
isEmpty
(
fileId
,
"文件ID不能为空"
);
AssertUtils
.
isEmpty
(
fileId
,
"文件ID不能为空"
);
List
<
HGWD001C
>
fWd001Cs
=
MapUtils
.
toDaoEPBases
(
inInfo
,
HGWD001C
.
class
);
List
<
HGWD001C
>
fWd001Cs
=
MapUtils
.
toDaoEPBases
(
inInfo
,
HGWD001C
.
class
);
for
(
HGWD001C
fWd001c
:
fWd001Cs
)
{
for
(
HGWD001C
fWd001c
:
fWd001Cs
)
{
...
...
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