Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-standard-interfaces
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
1
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit e2ae12d4
authored
Nov 09, 2022
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化图片压缩接口
1 parent
825e1cd0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
src/main/java/cn/com/glsx/stdinterface/modules/service/WorkOrderDocsService.java
src/main/java/cn/com/glsx/stdinterface/modules/service/WorkOrderDocsService.java
View file @
e2ae12d
...
...
@@ -98,8 +98,8 @@ public class WorkOrderDocsService {
//车架号目录
StopWatch
sw
=
new
StopWatch
();
sw
.
start
(
"下载并压缩图片文件"
);
log
.
info
(
"开始下载并压缩图片文件==="
);
sw
.
start
(
"下载并压缩图片文件"
+
workOrderId
);
log
.
info
(
"开始下载并压缩图片文件==="
+
workOrderId
);
String
vinPath
=
vin
+
File
.
separator
;
try
(
ByteArrayOutputStream
baos
=
new
ByteArrayOutputStream
();
final
ZipOutputStream
zout
=
new
ZipOutputStream
(
baos
))
{
...
...
@@ -166,15 +166,15 @@ public class WorkOrderDocsService {
@Async
public
void
syncUploadDocsAndZipByCmd
(
Long
workOrderId
,
String
vin
,
List
<
WorkOrderDocs
>
docsList
)
throws
IOException
{
public
void
syncUploadDocsAndZipByCmd
(
Long
workOrderId
,
String
vin
,
List
<
WorkOrderDocs
>
docsList
)
throws
IOException
{
if
(
CollectionUtils
.
isEmpty
(
docsList
))
{
log
.
info
(
"workOrderId:{},vin:{},docsList is null"
,
workOrderId
,
vin
);
return
;
}
StopWatch
sw
=
new
StopWatch
();
sw
.
start
(
"下载并压缩图片文件"
);
log
.
info
(
"下载并压缩图片文件==="
);
sw
.
start
(
"下载并压缩图片文件"
+
workOrderId
);
log
.
info
(
"下载并压缩图片文件==="
+
workOrderId
);
byte
[]
bytes
;
for
(
WorkOrderDocs
doc
:
docsList
)
{
if
(
StringUtils
.
isEmpty
(
doc
.
getCompressUrl
()))
{
...
...
@@ -230,7 +230,7 @@ public class WorkOrderDocsService {
*
* @param workOrderId 工单ID
*/
public
void
compressImages
(
Long
workOrderId
)
throws
Exception
{
public
void
compressImages
(
Long
workOrderId
)
throws
Exception
{
if
(
workOrderId
==
null
)
{
List
<
Long
>
workOrderIdList
=
workOrderDocsMapper
.
selectAllWorkOrderId
();
log
.
info
(
"workOrderIdList==="
+
workOrderIdList
.
size
());
...
...
@@ -247,7 +247,7 @@ public class WorkOrderDocsService {
*
* @param workOrderId 工单ID
*/
private
void
getDocsByWorkOrderId
(
Long
workOrderId
)
throws
Exception
{
private
void
getDocsByWorkOrderId
(
Long
workOrderId
)
throws
Exception
{
List
<
WorkOrderDocs
>
docsList
=
workOrderDocsMapper
.
selectByOrderId
(
workOrderId
);
WorkOrderVehicle
workOrderVehicle
=
workOrderVehicleMapper
.
selectOneByOrderId
(
workOrderId
);
syncUploadDocsAndZipByCmd
(
workOrderId
,
workOrderVehicle
.
getVin
(),
docsList
);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment