Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
47d1ed83
Commit
47d1ed83
authored
Oct 18, 2024
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资料上传
parent
1025c13c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
2 deletions
+29
-2
CommonController.java
...mos/boot/module/hygf/biz/controller/CommonController.java
+17
-0
CommonServiceImpl.java
.../boot/module/hygf/biz/service/impl/CommonServiceImpl.java
+12
-2
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/CommonController.java
View file @
47d1ed83
...
...
@@ -58,6 +58,23 @@ public class CommonController {
System
.
out
.
println
(
"zip下载成功"
);
}
/**
* 设备信息下载
*
* @return
*/
@GetMapping
(
value
=
"/test"
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"资料下载"
,
notes
=
"资料下载"
)
public
void
test
(
HttpServletResponse
response
)
throws
IOException
{
// 设置响应头
response
.
setContentType
(
"application/zip"
);
commonService
.
test
(
response
);
System
.
out
.
println
(
"zip下载成功"
);
}
/**
* 设备信息下载
*
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/CommonServiceImpl.java
View file @
47d1ed83
...
...
@@ -554,9 +554,9 @@ public class CommonServiceImpl {
for
(
String
peasantHouseholdId
:
peasantHouseholdIds
)
{
SurveyInfoAllDto
returnDto
=
surveyInformationServiceImpl
.
querySurveyInfo
(
surveyInformationId
,
peasantHouseholdId
,
processInstanceId
,
null
);
fileName
=
returnDto
.
getSurveyInformation
().
getOwnersName
();
int
current
=
0
;
redisUtils
.
set
(
redisKey
,
MapBuilder
.<
String
,
Object
>
create
()
.
put
(
"value"
,
current
).
build
());
.
put
(
"value"
,
current
Bili
).
build
());
String
powerStationInstanceId
=
powerStationMapper
.
getInstanceIdByhouseId
(
peasantHouseholdId
);
String
financingInstanceId
=
financingAuditingMapper
.
getInstanceIdByhouseId
(
peasantHouseholdId
);
List
<
LinkedHashMap
>
powerStationWorkLog
=
new
ArrayList
<>();
...
...
@@ -881,6 +881,16 @@ public class CommonServiceImpl {
cleanup
(
ziLiaoDir
);
}
public
void
test
(
HttpServletResponse
response
)
throws
UnsupportedEncodingException
{
String
fileName
=
"批量资料"
;
Path
currentWorkingDir
=
Paths
.
get
(
""
);
// 获取当前工作目录
Path
rootDir
=
currentWorkingDir
;
Path
ziLiaoDir
=
rootDir
.
resolve
(
"批量资料"
);
String
encodedFilename
=
URLEncoder
.
encode
(
fileName
+
".zip"
,
StandardCharsets
.
UTF_8
.
name
());
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
URLEncoder
.
encode
(
fileName
+
".zip"
,
"UTF-8"
));
createZipFile
(
ziLiaoDir
,
"批量资料"
,
response
);
}
private
void
fillSheet
(
Sheet
sheet
,
Object
data
)
{
if
(
Objects
.
isNull
(
data
)){
...
...
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