Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
李希虎
/
ODM
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
aa5624e9
authored
2022-03-14 14:12:16 +0800
by
荆蔚杰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
电子证照ofd转换修改
1 parent
b2a21756
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
17 deletions
pom.xml
src/main/java/com/thinkgem/jeesite/modules/eci/method/OfdConvertRest.java
src/main/webapp/WEB-INF/lib/suwell-agent-wrapper-1.6.210610.jar
pom.xml
View file @
aa5624e
...
...
@@ -885,9 +885,9 @@
<dependency>
<groupId>
com.thinkgem.jeesite
</groupId>
<artifactId>
suwell-agent-wrapper
</artifactId>
<version>
1.6.
1912
10
</version>
<version>
1.6.
2106
10
</version>
<scope>
system
</scope>
<systemPath>
${pom.basedir}/src/main/webapp/WEB-INF/lib/suwell-agent-wrapper-1.6.
1912
10.jar
</systemPath>
<systemPath>
${pom.basedir}/src/main/webapp/WEB-INF/lib/suwell-agent-wrapper-1.6.
2106
10.jar
</systemPath>
</dependency>
<dependency>
...
...
src/main/java/com/thinkgem/jeesite/modules/eci/method/OfdConvertRest.java
View file @
aa5624e
...
...
@@ -2,7 +2,11 @@ package com.thinkgem.jeesite.modules.eci.method;
import
com.suwell.ofd.custom.agent.ConvertException
;
import
com.suwell.ofd.custom.agent.HTTPAgent
;
import
com.suwell.ofd.custom.wrapper.Const
;
import
com.suwell.ofd.custom.wrapper.PackException
;
import
com.suwell.ofd.custom.wrapper.Packet
;
import
com.suwell.ofd.custom.wrapper.model.Common
;
import
com.suwell.ofd.custom.wrapper.model.ImageArgument
;
import
com.thinkgem.jeesite.modules.eci.dao.ElecLicenseInfoDao
;
import
com.thinkgem.jeesite.modules.eci.entity.ElecLicenseInfo
;
import
org.slf4j.Logger
;
...
...
@@ -33,33 +37,34 @@ public class OfdConvertRest {
List
<
ElecLicenseInfo
>
waitForConverts
=
licenseInfoDao
.
getWaitForConvert
();
for
(
ElecLicenseInfo
waitForConvert
:
waitForConverts
)
{
OutputStream
out
=
null
;
//转换后文件输出路径
try
{
String
documentId
=
waitForConvert
.
getDocumentId
();
String
bizId
=
waitForConvert
.
getBizId
();
String
ofdPath
=
waitForConvert
.
getOfdWjdz
();
// TODO: 2022/2/16/0016 ofd文件转换
File
ofdFile
=
new
File
(
ofdPath
);
Packet
packet
=
new
Packet
(
Const
.
PackType
.
IMAGE
,
Const
.
Target
.
IMAGE
);
Common
common
=
new
Common
(
null
,
"ofd"
,
-
1
,
new
FileInputStream
(
waitForConvert
.
getOfdWjdz
()));
common
.
setArgument
(
new
ImageArgument
().
setTargetFormat
(
ImageArgument
.
Type
.
jpg
));
packet
.
file
(
common
);
SimpleDateFormat
simpleDateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dddd"
);
String
dateDir
=
simpleDateFormat
.
format
(
new
Date
());
String
documentId
=
waitForConvert
.
getDocumentId
(
);
File
jpg
=
new
File
(
"E:\\ECI\\TIFF"
+
dateDir
+
"\\"
);
File
tiffDir
=
new
File
(
"E:\\ECI\\TIFF"
+
dateDir
+
"\\"
);
if
(!
tiffDir
.
exists
())
{
tiffDir
.
mkdirs
();
if
(!
jpg
.
exists
())
{
jpg
.
mkdirs
();
}
File
tiffFile
=
new
File
(
tiffDir
+
documentId
+
".tiff
"
);
if
(!
tiff
File
.
exists
())
{
tiff
File
.
createNewFile
();
File
jpgFile
=
new
File
(
jpg
+
documentId
+
".jpg
"
);
if
(!
jpg
File
.
exists
())
{
jpg
File
.
createNewFile
();
}
out
=
new
FileOutputStream
(
tiffFile
);
//输出格式。true输出格式为zip ;false输出格式为tiff
ha
.
OFDToImge
(
ofdFile
,
out
,
-
1
,
false
);
licenseInfoDao
.
updateJpgWjdzAndStatus
(
tiffFile
.
getAbsolutePath
(),
bizId
);
ha
.
convert
(
packet
,
new
FileOutputStream
(
jpgFile
));
licenseInfoDao
.
updateJpgWjdzAndStatus
(
jpgFile
.
getAbsolutePath
(),
bizId
);
}
catch
(
PackException
|
ConvertException
|
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
...
...
src/main/webapp/WEB-INF/lib/suwell-agent-wrapper-1.6.210610.jar
0 → 100644
View file @
aa5624e
No preview for this file type
Please
register
or
sign in
to post a comment