Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
1061fcd4
Commit
1061fcd4
authored
May 16, 2024
by
韩桐桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):zip解压异常问题
parent
b1f4454d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
7 deletions
+8
-7
JgUseRegistrationController.java
...module/jg/biz/controller/JgUseRegistrationController.java
+1
-1
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+0
-2
JgUseRegistrationServiceImpl.java
...ule/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
+7
-4
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgUseRegistrationController.java
View file @
1061fcd4
...
@@ -175,7 +175,7 @@ public class JgUseRegistrationController extends BaseController {
...
@@ -175,7 +175,7 @@ public class JgUseRegistrationController extends BaseController {
jgUseRegistrationServiceImpl
.
exportUseRegistrationCertificate
(
sequenceNbr
,
response
,
printType
);
jgUseRegistrationServiceImpl
.
exportUseRegistrationCertificate
(
sequenceNbr
,
response
,
printType
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/summaryBasicInfo/export"
)
@GetMapping
(
value
=
"/summaryBasicInfo/export"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"导出基本信息汇总表(工业管道/气瓶)"
,
notes
=
"导出基本信息汇总表(工业管道/气瓶)"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"导出基本信息汇总表(工业管道/气瓶)"
,
notes
=
"导出基本信息汇总表(工业管道/气瓶)"
)
public
void
exportSummaryBasicInfo
(
HttpServletResponse
response
,
public
void
exportSummaryBasicInfo
(
HttpServletResponse
response
,
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/CommonServiceImpl.java
View file @
1061fcd4
...
@@ -905,8 +905,6 @@ public class CommonServiceImpl implements ICommonService {
...
@@ -905,8 +905,6 @@ public class CommonServiceImpl implements ICommonService {
if
(
CollectionUtils
.
isEmpty
(
map
))
{
if
(
CollectionUtils
.
isEmpty
(
map
))
{
throw
new
IllegalArgumentException
(
"参数不能为空"
);
throw
new
IllegalArgumentException
(
"参数不能为空"
);
}
}
// 默认普打
map
.
put
(
"printingType"
,
PrintingTypeEnum
.
REGULAR
.
getCode
());
// word转pdf
// word转pdf
File
pdfFile
;
File
pdfFile
;
try
{
try
{
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgUseRegistrationServiceImpl.java
View file @
1061fcd4
...
@@ -73,14 +73,14 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
...
@@ -73,14 +73,14 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.ByteArrayOutputStream
;
import
java.io.*
;
import
java.io.IOException
;
import
java.net.URLEncoder
;
import
java.net.URLEncoder
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.time.ZoneId
;
import
java.time.ZoneId
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -186,13 +186,15 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -186,13 +186,15 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
try
{
try
{
zip
.
putNextEntry
(
new
ZipEntry
(
filePrefix
+
"第"
+
(
i
+
1
)
+
"页"
+
".pdf"
));
zip
.
putNextEntry
(
new
ZipEntry
(
filePrefix
+
"第"
+
(
i
+
1
)
+
"页"
+
".pdf"
));
IOUtils
.
write
(
futures
.
get
(
i
).
join
(),
zip
);
IOUtils
.
write
(
futures
.
get
(
i
).
join
(),
zip
);
zip
.
closeEntry
();
// 每个条目结束后关闭
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
log
.
error
(
"打包zip失败:"
+
e
.
getMessage
());
log
.
error
(
"打包zip失败:"
+
e
.
getMessage
());
throw
new
BadRequest
(
"打包zip失败"
);
throw
new
BadRequest
(
"打包zip失败"
);
}
finally
{
zip
.
closeEntry
();
}
}
}
}
// 所有条目写入完成后关闭 ZipOutputStream
zip
.
finish
();
// 设置响应头并将压缩文件写入 HttpServletResponse
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setHeader
(
"content-Type"
,
"application/zip"
);
response
.
setHeader
(
"content-Type"
,
"application/zip"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
URLEncoder
.
encode
(
customFileName
,
"UTF-8"
));
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
URLEncoder
.
encode
(
customFileName
,
"UTF-8"
));
...
@@ -203,6 +205,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
...
@@ -203,6 +205,7 @@ public class JgUseRegistrationServiceImpl extends BaseService<JgUseRegistrationD
}
}
}
}
public
Page
<
Map
<
String
,
Object
>>
getList
(
JgUseRegistrationDto
dto
,
String
sort
,
Page
<
Map
<
String
,
Object
>>
page
,
List
<
String
>
roleIds
)
{
public
Page
<
Map
<
String
,
Object
>>
getList
(
JgUseRegistrationDto
dto
,
String
sort
,
Page
<
Map
<
String
,
Object
>>
page
,
List
<
String
>
roleIds
)
{
SortVo
sortMap
=
commonServiceImpl
.
sortFieldConversion
(
sort
);
SortVo
sortMap
=
commonServiceImpl
.
sortFieldConversion
(
sort
);
return
this
.
baseMapper
.
getListPage
(
page
,
sortMap
,
dto
,
roleIds
);
return
this
.
baseMapper
.
getListPage
(
page
,
sortMap
,
dto
,
roleIds
);
...
...
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