Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xzxt-api-report
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
雷紫添
xzxt-api-report
Commits
9e960058
Commit
9e960058
authored
Jan 10, 2022
by
wang_jiaxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新log4j版本,修改为多线程执行模式
parent
a00873e7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
17 deletions
+73
-17
pom.xml
+2
-2
src/main/java/com/founder/file/dao/xjxz/XjxzFlwsMapper.java
+4
-0
src/main/java/com/founder/file/service/impl/XjFlwsServiceImpl.java
+26
-15
src/main/resources/application.yml
+3
-0
src/main/resources/mybatis/xjFlwsMpaaer/XjxzFlwsMapper.xml
+38
-0
No files found.
pom.xml
View file @
9e960058
...
...
@@ -20,7 +20,7 @@
<hutool.version>
5.4.5
</hutool.version>
<guava.version>
29.0-jre
</guava.version>
<spring-boot.version>
2.2.6.RELEASE
</spring-boot.version>
<log4j2.version>
2.1
5
.0
</log4j2.version>
<log4j2.version>
2.1
7
.0
</log4j2.version>
</properties>
<dependencies>
...
...
@@ -228,7 +228,7 @@
<repositories>
<repository>
<id>
founder
</id>
<url>
http://
39.99.224.27
:8081/nexus/content/groups/public/
</url>
<url>
http://
47.92.223.200
:8081/nexus/content/groups/public/
</url>
<releases>
<enabled>
true
</enabled>
</releases>
...
...
src/main/java/com/founder/file/dao/xjxz/XjxzFlwsMapper.java
View file @
9e960058
...
...
@@ -4,6 +4,7 @@ import org.apache.ibatis.annotations.Mapper;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Component
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -13,4 +14,7 @@ public interface XjxzFlwsMapper {
void
update
(
@Param
(
"xxzjbh"
)
String
xxzjbh
,
@Param
(
"bytes"
)
byte
[]
bytes
);
List
<
String
>
getNoFileFlwsXxzjbh
(
@Param
(
"flwsList"
)
List
<
Map
<
String
,
String
>>
flwsList
);
List
<
Map
<
String
,
String
>>
getFlwsWzByDate
(
@Param
(
"date"
)
Date
date
,
@Param
(
"xxzjbh"
)
String
xxzjbh
,
@Param
(
"begin"
)
Integer
page
,
@Param
(
"end"
)
Integer
rows
);
Integer
getFlwsCountWzByDate
(
@Param
(
"date"
)
Date
date
,
@Param
(
"xxzjbh"
)
String
xxzjbh
);
}
src/main/java/com/founder/file/service/impl/XjFlwsServiceImpl.java
View file @
9e960058
package
com
.
founder
.
file
.
service
.
impl
;
import
com.founder.file.dao.jzzjk.JzzjkFlwsMapper
;
import
com.founder.file.dao.xjxz.XjxzFlwsMapper
;
import
com.founder.file.service.XjFlwsService
;
import
com.founder.util.HttpUtil
;
...
...
@@ -8,6 +7,7 @@ import org.apache.commons.io.IOUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.io.FileNotFoundException
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.*
;
...
...
@@ -16,45 +16,54 @@ import java.util.concurrent.FutureTask;
@Service
public
class
XjFlwsServiceImpl
implements
XjFlwsService
{
@Autowired
private
JzzjkFlwsMapper
jzzjkFlwsMapper
;
@Autowired
private
XjxzFlwsMapper
xjxzFlwsMapper
;
@Override
public
String
getJzzjkFlwsnrToXjxz
(
Date
date
,
String
xxzjbh
)
throws
IOException
{
Integer
count
=
jzzjk
FlwsMapper
.
getFlwsCountWzByDate
(
date
,
xxzjbh
);
Integer
count
=
xjxz
FlwsMapper
.
getFlwsCountWzByDate
(
date
,
xxzjbh
);
int
page
=
(
count
/
1000
)
+
1
;
ArrayList
<
FutureTask
<
Map
<
String
,
Integer
>>>
list
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
page
;
i
++)
{
int
limit
=
1000
;
int
begin
=
i
*
limit
;
int
end
=
(
i
+
1
)
*
limit
;
int
end
=
(
i
+
1
)
*
limit
;
int
finalI
=
i
;
FutureTask
<
Map
<
String
,
Integer
>>
xsAjTask
=
new
FutureTask
<>(()
->
{
HashMap
<
String
,
Integer
>
map
=
new
HashMap
<>();
List
<
Map
<
String
,
String
>>
flwsList
=
jzzjkFlwsMapper
.
getFlwsWzByDate
(
date
,
xxzjbh
,
begin
,
end
);
List
<
String
>
xxzjbhList
=
xjxzFlwsMapper
.
getNoFileFlwsXxzjbh
(
flwsList
);
HashSet
<
String
>
set
=
new
HashSet
<>(
xxzjbhList
);
map
.
put
(
"flws"
,
set
.
size
());
List
<
Map
<
String
,
String
>>
flwsList
=
xjxzFlwsMapper
.
getFlwsWzByDate
(
date
,
xxzjbh
,
begin
,
end
);
ArrayList
<
Exception
>
exceptions
=
new
ArrayList
<>();
System
.
out
.
println
(
"+++++++++++++"
+
flwsList
.
size
());
int
j
=
1
;
int
flwsCount
=
0
;
int
wuNrCount
=
0
;
for
(
Map
<
String
,
String
>
flws
:
flwsList
)
{
if
(!
set
.
contains
(
flws
.
get
(
"XXZJBH"
))){
continue
;
}
try
{
String
flwsUrl
=
flws
.
get
(
"FWDZ"
)
+
flws
.
get
(
"TXLJ"
);
System
.
out
.
println
(
flwsUrl
);
InputStream
is
=
HttpUtil
.
getInputStreamByUrl
(
flwsUrl
);
byte
[]
bytes
=
IOUtils
.
toByteArray
(
is
);
xjxzFlwsMapper
.
update
(
flws
.
get
(
"XXZJBH"
),
bytes
);
if
(
is
!=
null
)
{
byte
[]
bytes
=
IOUtils
.
toByteArray
(
is
);
if
(
bytes
!=
null
&&
bytes
.
length
>
0
)
{
xjxzFlwsMapper
.
update
(
flws
.
get
(
"XXZJBH"
),
bytes
);
flwsCount
++;
}
else
{
System
.
out
.
println
(
"文件已损害,无内容"
);
wuNrCount
++;
}
}
}
catch
(
FileNotFoundException
e
)
{
System
.
out
.
println
(
"404,文件找不到"
);
wuNrCount
++;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
exceptions
.
add
(
e
);
}
System
.
out
.
println
(
"线程"
+
finalI
+
"++++++++++++++"
+
(
j
++));
}
map
.
put
(
"exceptions"
,
flwsList
.
size
());
map
.
put
(
"flws"
,
flwsCount
);
map
.
put
(
"wuNrCount"
,
wuNrCount
);
System
.
out
.
println
(
"============="
+
exceptions
.
size
());
return
map
;
});
...
...
@@ -62,17 +71,19 @@ public class XjFlwsServiceImpl implements XjFlwsService {
list
.
add
(
xsAjTask
);
}
int
flsws
=
0
;
int
wuNrCount
=
0
;
int
exc
=
0
;
for
(
FutureTask
<
Map
<
String
,
Integer
>>
task
:
list
)
{
try
{
Map
<
String
,
Integer
>
map
=
task
.
get
();
flsws
+=
map
.
get
(
"flws"
);
wuNrCount
+=
map
.
get
(
"wuNrCount"
);
exc
+=
map
.
get
(
"exceptions"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
exc
+=
1
;
}
}
return
"
共更新了"
+
flsws
+
"个法律文书,其中出错"
+
exc
+
"个法律文书
"
;
return
"
更新了"
+
flsws
+
"个法律文书,出错了"
+
exc
+
"个法律文书,有"
+
wuNrCount
+
"个法律文书404或已损坏
"
;
}
}
src/main/resources/application.yml
View file @
9e960058
...
...
@@ -33,3 +33,6 @@ xxcx:
orc
:
http://39.99.224.27:8866/predict/chinese_ocr_db_crnn_mobile
ce
:
http://39.99.224.27:8866/predict/chinese_ocr_db_crnn_mobile
ce1
:
http://39.99.224.27:8866/predict/ocr_system
ocrURL
:
http://39.99.224.27:8866/predict/chinese_ocr_db_crnn_mobile
lacURL
:
http://39.99.224.27:8866/predict/chinese_ocr_db_crnn_mobile
src/main/resources/mybatis/xjFlwsMpaaer/XjxzFlwsMapper.xml
View file @
9e960058
...
...
@@ -10,4 +10,41 @@
#{flws.XXZJBH}
</foreach>
</select>
<select
id=
"getFlwsWzByDate"
resultType=
"java.util.Map"
>
select *
from (select rownum r, t.*
from (
select dz.FWDZ as fwdz,
dz.TXLJ as txlj,
fl.XXZJBH as xxzjbh
from JZZJK.AJ_DZJZXX dz, JZZJK.AJ_FLWS fl, TB_ST_ASJ_FLWS flws
where dz.flwsbh = fl.flwsbh
and dz.ajbh = fl.ajbh
and dz.txsx = fl.txsx
and dz.txlj = fl.txlj
and fl.xxzjbh = flws.xxzjbh
and flws.flws_dzwjnr is null
and flws.xxrsksj
<![CDATA[>=]]>
#{date}
<if
test=
"xxzjbh != null and xxzjbh != ''"
>
and dz.TZTXBH = #{xxzjbh}
</if>
) t
where rownum
<![CDATA[ <= ]]>
#{end})
where r
<![CDATA[ > ]]>
#{begin}
</select>
<select
id=
"getFlwsCountWzByDate"
resultType=
"java.lang.Integer"
>
select count(1)
from JZZJK.AJ_DZJZXX dz, JZZJK.AJ_FLWS fl, TB_ST_ASJ_FLWS flws
where dz.flwsbh = fl.flwsbh
and dz.ajbh = fl.ajbh
and dz.txsx = fl.txsx
and dz.txlj = fl.txlj
and fl.xxzjbh = flws.xxzjbh
and flws.flws_dzwjnr is null
-- and to_date(DJRQ, 'yyyyMMdd')
<![CDATA[>=]]>
#{date}
and flws.xxrsksj
<![CDATA[>=]]>
#{date}
<if
test=
"xxzjbh != null and xxzjbh != ''"
>
and dz.TZTXBH = #{xxzjbh}
</if>
</select>
</mapper>
\ No newline at end of file
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