Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
map-parent
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
常超
map-parent
Commits
28e7dd90
Commit
28e7dd90
authored
Nov 15, 2023
by
宋珺琪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bz-关键词添加标签定时、小案类别替换、时间处理
parent
2cdd9413
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
467 additions
and
42 deletions
+467
-42
common/common_utils/src/main/java/com/founder/commonutils/model/ypglEntity/TbStAsj.java
+9
-6
common/common_utils/src/main/java/com/founder/commonutils/model/ypglEntity/TbXwAsjbzKeyword.java
+3
-1
service/publicapi/src/main/java/com/founder/publicapi/controller/SkWarningService/WarningController.java
+1
-1
service/publicapi/src/main/java/com/founder/publicapi/controller/ypglController/AsjBqTimController.java
+433
-0
service/publicapi/src/main/java/com/founder/publicapi/controller/ypglController/AsjbzController.java
+14
-27
service/publicapi/src/main/java/com/founder/publicapi/mapper/mysqlMapper/xml/TbXwAsjbzKeywordMapper.xml
+2
-2
service/publicapi/src/main/java/com/founder/publicapi/mapper/mysqlMapper/xml/YpglAsjMapper.xml
+5
-5
No files found.
common/common_utils/src/main/java/com/founder/commonutils/model/ypglEntity/TbStAsj.java
View file @
28e7dd90
...
...
@@ -18,13 +18,16 @@ public class TbStAsj implements Serializable {
private
String
jsasjXxzjbh
;
private
String
xxzjbh
;
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
String
kssj
;
private
String
jssj
;
/* @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date kssj;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
jssj
;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date jssj;
*/
private
Double
kymyqz_wpsl
;
...
...
@@ -217,10 +220,10 @@ public class TbStAsj implements Serializable {
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
asjfssj
_a
sjfskssj
;
private
Date
asjfssj
A
sjfskssj
;
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
asjfssj
_a
sjfsjssj
;
private
Date
asjfssj
A
sjfsjssj
;
private
String
asjfssj_rsddm
;
...
...
common/common_utils/src/main/java/com/founder/commonutils/model/ypglEntity/TbXwAsjbzKeyword.java
View file @
28e7dd90
package
com
.
founder
.
commonutils
.
model
.
ypglEntity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
lombok.Data
;
/**
...
...
@@ -12,7 +13,8 @@ public class TbXwAsjbzKeyword extends PageBean {
private
String
keyword
;
private
String
multiplexing_keyword
;
private
String
keywordName
;
private
String
xxdjry_xm
;
@TableField
(
"XXDJRY_XM"
)
private
String
xxdjryXm
;
private
String
xxdjry_gmsfhm
;
private
String
xxdjdw_gajgmc
;
private
String
xxdjdw_gajgjgdm
;
...
...
service/publicapi/src/main/java/com/founder/publicapi/controller/SkWarningService/WarningController.java
View file @
28e7dd90
...
...
@@ -289,7 +289,7 @@ public class WarningController {
List
<
String
>
xlabmcList
=
new
ArrayList
<>();
for
(
String
s
:
split
)
{
System
.
out
.
println
(
s
.
trim
());
codeMap
.
put
(
"groupid"
,
"CODE_
XALB
"
);
codeMap
.
put
(
"groupid"
,
"CODE_
AJXZ
"
);
codeMap
.
put
(
"code"
,
s
.
trim
());
String
name
=
sysDictitemMapper
.
getNameByCode
(
codeMap
);
xlabmcList
.
add
(
name
);
...
...
service/publicapi/src/main/java/com/founder/publicapi/controller/ypglController/AsjBqTimController.java
0 → 100644
View file @
28e7dd90
package
com
.
founder
.
publicapi
.
controller
.
ypglController
;
import
com.founder.commonutils.model.ypglEntity.Asjbz
;
import
com.founder.commonutils.model.ypglEntity.Phone
;
import
com.founder.commonutils.model.ypglEntity.TbStAsj
;
import
com.founder.commonutils.model.ypglEntity.TbXwAsjbzKeyword
;
import
com.founder.commonutils.util.GJUtil
;
import
com.founder.commonutils.util.StringUtil
;
import
com.founder.publicapi.service.*
;
import
lombok.SneakyThrows
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.CrossOrigin
;
import
tech.powerjob.worker.core.processor.ProcessResult
;
import
tech.powerjob.worker.core.processor.TaskContext
;
import
tech.powerjob.worker.core.processor.sdk.BasicProcessor
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
com.alibaba.fastjson.JSONObject
;
@Controller
@CrossOrigin
public
class
AsjBqTimController
implements
BasicProcessor
{
@Autowired
private
TbXwAsjbzKeywordService
tbXwAsjbzKeywordService
;
@Autowired
YpglAsjService
YpglAsjService
;
@Autowired
private
PhoneService
phoneService
;
@Override
public
ProcessResult
process
(
TaskContext
context
)
throws
Exception
{
System
.
out
.
println
(
"-----------------------日程定时任务启动"
);
System
.
out
.
println
();
JSONObject
resultJSON
=
new
JSONObject
();
ExecutorService
executorService
=
Executors
.
newFixedThreadPool
(
10
);
try
{
int
i1
=
YpglAsjService
.
updateAsjbzAll
();
System
.
out
.
println
(
i1
);
//定时任务这里是跑phones中有的数据
List
<
Phone
>
phones
=
phoneService
.
selectJzxx
();
System
.
out
.
println
(
"基站"
+
phones
.
size
());
// 获取全部同义词和关键词
TbXwAsjbzKeyword
tbXwAsjbzKeyword
=
new
TbXwAsjbzKeyword
();
List
<
TbXwAsjbzKeyword
>
tbXwAsjbzKeywords
=
tbXwAsjbzKeywordService
.
selectTbXwAsjbzKeywordByCondition
(
tbXwAsjbzKeyword
);
System
.
out
.
println
(
"同义词数量==="
+
tbXwAsjbzKeywords
.
size
());
List
<
Asjbz
>
asjbzs
=
tbXwAsjbzKeywordService
.
selectKeyList
();
System
.
out
.
println
(
"案件数量========"
+
asjbzs
.
size
());
// 分批查询全部案件
TbStAsj
tbStAsj
=
new
TbStAsj
();
int
limit
=
1000
;
int
startnum
=
0
;
int
endnum
=
0
;
int
size
=
YpglAsjService
.
findAsjxxCount
()+
2000
;
System
.
out
.
println
(
"总量===="
+
size
);
for
(
int
i
=
0
;
i
<=
size
/
limit
+
1
;
i
++){
startnum
=
i
*
limit
+
1
;
endnum
=
((
i
+
1
)
*
limit
);
if
(
startnum
>
size
)
{
break
;
}
if
(
endnum
>
size
)
{
endnum
=
size
;
}
if
(
startnum
==
endnum
)
{
break
;
}
System
.
out
.
println
(
"开始"
+
startnum
);
System
.
out
.
println
(
"结束"
+
endnum
);
tbStAsj
.
setEndNum
(
endnum
);
tbStAsj
.
setStartNum
(
startnum
);
List
<
TbStAsj
>
asjxxListFy
=
YpglAsjService
.
findAsjxxListFy
(
tbStAsj
);
RunAsjList
runAsjList
=
new
RunAsjList
(
asjxxListFy
,
tbXwAsjbzKeywords
,
phones
,
asjbzs
);
executorService
.
execute
(
runAsjList
);
}
executorService
.
shutdown
();
resultJSON
.
put
(
"status"
,
"success"
);
resultJSON
.
put
(
"message"
,
"成功"
);
return
new
ProcessResult
(
true
,
"标签定时任务完成"
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
executorService
.
shutdown
();
resultJSON
.
put
(
"status"
,
"fail"
);
resultJSON
.
put
(
"message"
,
e
.
getMessage
());
return
new
ProcessResult
(
false
,
"标签定时任务失败"
);
}
}
class
RunAsjList
extends
Thread
{
private
final
List
<
TbStAsj
>
asjxxListFy
;
private
final
List
<
TbXwAsjbzKeyword
>
keyword
;
private
final
List
<
Phone
>
phoneList
;
private
final
List
<
Asjbz
>
asjbzs
;
public
RunAsjList
(
List
<
TbStAsj
>
asjxxListFy
,
List
<
TbXwAsjbzKeyword
>
keyword
,
List
<
Phone
>
phoneList
,
List
<
Asjbz
>
asjbzs
){
this
.
asjxxListFy
=
asjxxListFy
;
this
.
keyword
=
keyword
;
this
.
phoneList
=
phoneList
;
this
.
asjbzs
=
asjbzs
;
}
@SneakyThrows
@Override
public
void
run
()
{
ExecutorService
executorService
=
Executors
.
newFixedThreadPool
(
10
);
Thread
.
sleep
(
1000L
);
for
(
int
i
=
0
;
i
<
asjxxListFy
.
size
();
i
++){
// 案发时间段标签
if
(
asjxxListFy
.
get
(
i
).
getAsjfssjAsjfsjssj
()!=
null
&&
asjxxListFy
.
get
(
i
).
getAsjfssjAsjfskssj
()!=
null
){
Date
asjfssj_asjfskssj
=
asjxxListFy
.
get
(
i
).
getAsjfssjAsjfskssj
();
Date
asjfssj_asjfsjssj
=
asjxxListFy
.
get
(
i
).
getAsjfssjAsjfsjssj
();
int
day
=
(
int
)
((
asjfssj_asjfsjssj
.
getTime
()
-
asjfssj_asjfskssj
.
getTime
())
/
(
1000
*
3600
*
24
));
if
(
day
>
1
){
asjxxListFy
.
get
(
i
).
setZasj
(
"上午,下午,傍晚,夜间"
);
}
else
{
String
[]
kssj
=
new
SimpleDateFormat
(
"HH:mm:ss"
).
format
(
asjfssj_asjfskssj
).
split
(
":"
);
String
[]
jssj
=
new
SimpleDateFormat
(
"HH:mm:ss"
).
format
(
asjfssj_asjfsjssj
).
split
(
":"
);
if
(
kssj
==
null
&&
kssj
.
length
==
0
&&
jssj
==
null
&&
jssj
.
length
==
0
){
if
(
day
>
0
){
asjxxListFy
.
get
(
i
).
setZasj
(
"上午,下午,傍晚,夜间"
);
}
}
else
{
if
(
Integer
.
parseInt
(
kssj
[
0
])>=
6
&&
Integer
.
parseInt
(
kssj
[
0
])<=
13
){
if
(
Integer
.
parseInt
(
jssj
[
0
])>=
6
&&
Integer
.
parseInt
(
jssj
[
0
])<=
13
){
asjxxListFy
.
get
(
i
).
setZasj
(
"上午"
);
}
if
(
Integer
.
parseInt
(
jssj
[
0
])>=
13
&&
Integer
.
parseInt
(
jssj
[
0
])<=
19
){
asjxxListFy
.
get
(
i
).
setZasj
(
"上午,下午"
);
}
if
(
Integer
.
parseInt
(
jssj
[
0
])>=
19
&&
Integer
.
parseInt
(
jssj
[
0
])<=
24
){
asjxxListFy
.
get
(
i
).
setZasj
(
"上午,下午,傍晚"
);
}
if
(
day
>
0
){
if
(
Integer
.
parseInt
(
jssj
[
0
])<=
24
){
asjxxListFy
.
get
(
i
).
setZasj
(
"上午,下午,傍晚,夜间"
);
}
}
}
else
if
(
Integer
.
parseInt
(
kssj
[
0
])>=
13
&&
Integer
.
parseInt
(
kssj
[
0
])<=
19
){
if
(
Integer
.
parseInt
(
jssj
[
0
])>=
13
&&
Integer
.
parseInt
(
jssj
[
0
])<=
19
){
asjxxListFy
.
get
(
i
).
setZasj
(
"下午"
);
}
if
(
Integer
.
parseInt
(
jssj
[
0
])>=
19
&&
Integer
.
parseInt
(
jssj
[
0
])<=
24
){
asjxxListFy
.
get
(
i
).
setZasj
(
"下午,傍晚"
);
}
if
(
day
>
0
){
if
(
Integer
.
parseInt
(
jssj
[
0
])>=
0
&&
Integer
.
parseInt
(
jssj
[
0
])<
6
){
asjxxListFy
.
get
(
i
).
setZasj
(
"下午,傍晚,夜间"
);
}
if
(
Integer
.
parseInt
(
jssj
[
0
])>=
6
&&
Integer
.
parseInt
(
jssj
[
0
])<=
24
){
asjxxListFy
.
get
(
i
).
setZasj
(
"上午,下午,傍晚,夜间"
);
}
}
if
(
day
>
1
){
if
(
Integer
.
parseInt
(
jssj
[
0
])<=
24
){
asjxxListFy
.
get
(
i
).
setZasj
(
"上午,下午,傍晚,夜间"
);
}
}
}
else
if
(
Integer
.
parseInt
(
kssj
[
0
])>=
19
&&
Integer
.
parseInt
(
kssj
[
0
])<=
24
){
if
(
Integer
.
parseInt
(
jssj
[
0
])>=
19
&&
Integer
.
parseInt
(
jssj
[
0
])<=
24
){
asjxxListFy
.
get
(
i
).
setZasj
(
"傍晚"
);
}
if
(
Integer
.
parseInt
(
jssj
[
0
])>=
0
&&
Integer
.
parseInt
(
jssj
[
0
])<=
6
){
asjxxListFy
.
get
(
i
).
setZasj
(
"傍晚,夜间"
);
}
if
(
Integer
.
parseInt
(
jssj
[
0
])>=
6
&&
Integer
.
parseInt
(
jssj
[
0
])<=
13
){
asjxxListFy
.
get
(
i
).
setZasj
(
"上午,傍晚,夜间"
);
}
if
(
day
>
0
){
if
(
Integer
.
parseInt
(
jssj
[
0
])>=
13
&&
Integer
.
parseInt
(
jssj
[
0
])<=
24
){
asjxxListFy
.
get
(
i
).
setZasj
(
"上午,下午,傍晚,夜间"
);
}
}
if
(
day
>
1
){
if
(
Integer
.
parseInt
(
jssj
[
0
])<=
24
){
asjxxListFy
.
get
(
i
).
setZasj
(
"上午,下午,傍晚,夜间"
);
}
}
}
else
if
(
Integer
.
parseInt
(
kssj
[
0
])>=
0
&&
Integer
.
parseInt
(
kssj
[
0
])<=
6
){
if
(
Integer
.
parseInt
(
jssj
[
0
])>=
0
&&
Integer
.
parseInt
(
jssj
[
0
])<=
6
){
asjxxListFy
.
get
(
i
).
setZasj
(
"夜间"
);
}
if
(
Integer
.
parseInt
(
jssj
[
0
])>=
6
&&
Integer
.
parseInt
(
jssj
[
0
])<=
13
){
asjxxListFy
.
get
(
i
).
setZasj
(
"上午,夜间"
);
}
if
(
Integer
.
parseInt
(
jssj
[
0
])>=
3
&&
Integer
.
parseInt
(
jssj
[
0
])<=
19
){
asjxxListFy
.
get
(
i
).
setZasj
(
"上午,下午,夜间"
);
}
if
(
Integer
.
parseInt
(
jssj
[
0
])>=
19
&&
Integer
.
parseInt
(
jssj
[
0
])<=
24
){
asjxxListFy
.
get
(
i
).
setZasj
(
"上午,下午,傍晚,夜间"
);
}
if
(
day
>
0
){
if
(
Integer
.
parseInt
(
jssj
[
0
])<=
24
){
asjxxListFy
.
get
(
i
).
setZasj
(
"上午,下午,傍晚,夜间"
);
}
}
}
}
}
}
// 获取案件周边500米的基站数量
int
count
=
0
;
if
(
asjxxListFy
.
get
(
i
).
getAsjfsdd_dqwd
()!=
null
&&
asjxxListFy
.
get
(
i
).
getAsjfsdd_dqjd
()!=
null
)
{
for
(
Phone
phone
:
phoneList
)
{
double
[]
doubles
=
GJUtil
.
doubleSpecifyLng
(
asjxxListFy
.
get
(
i
).
getAsjfsdd_dqjd
(),
asjxxListFy
.
get
(
i
).
getAsjfsdd_dqwd
(),
500
);
if
(
doubles
!=
null
&&
doubles
.
length
>
0
)
{
if
(
Double
.
valueOf
(
phone
.
getLon
())
>=
doubles
[
1
]
&&
Double
.
valueOf
(
phone
.
getLon
())
<=
doubles
[
0
]
&&
Double
.
valueOf
(
phone
.
getLat
())
>=
doubles
[
3
]
&&
Double
.
valueOf
(
phone
.
getLat
())
<=
doubles
[
2
])
{
count
++;
}
}
}
}
asjxxListFy
.
get
(
i
).
setJzmd
(
count
+
""
);
// 匹配厂区,别墅,小区的案发地
List
<
String
>
afdList
=
new
ArrayList
<>();
String
jyaq
=
asjxxListFy
.
get
(
i
).
getJyaq
();
if
(
jyaq
.
contains
(
"厂区"
)){
afdList
.
add
(
"厂区"
);
}
else
if
(
jyaq
.
contains
(
"别墅"
)){
afdList
.
add
(
"别墅"
);
}
else
if
(
jyaq
.
contains
(
"小区"
)){
afdList
.
add
(
"小区"
);
}
if
(
afdList
!=
null
&&
afdList
.
size
()>
0
){
String
replace
=
afdList
.
toString
().
replace
(
" "
,
""
);
asjxxListFy
.
get
(
i
).
setZadd
(
replace
.
substring
(
1
,
replace
.
length
()-
1
));
}
// 开始分析
RunAsjJYAQ
runMatchJYAQ
=
new
RunAsjJYAQ
(
asjxxListFy
.
get
(
i
),
keyword
,
asjbzs
);
executorService
.
execute
(
runMatchJYAQ
);
}
executorService
.
shutdown
();
}
}
class
RunAsjJYAQ
extends
Thread
{
private
final
TbStAsj
asj
;
private
final
List
<
TbXwAsjbzKeyword
>
keyword
;
private
final
List
<
Asjbz
>
asjbzs
;
public
RunAsjJYAQ
(
TbStAsj
asj
,
List
<
TbXwAsjbzKeyword
>
keyword
,
List
<
Asjbz
>
asjbzs
){
this
.
asj
=
asj
;
this
.
keyword
=
keyword
;
this
.
asjbzs
=
asjbzs
;
}
public
Map
<
String
,
List
<
String
>>
doRunThread
(
TbStAsj
asj
,
TbXwAsjbzKeyword
keyword
,
List
<
Asjbz
>
asjbzs
)
{
List
<
String
>
stringList
=
new
ArrayList
<>();
List
<
String
>
stringArrayList
=
new
ArrayList
<>();
List
<
String
>
sdList
=
new
ArrayList
<>();
List
<
String
>
hjList
=
new
ArrayList
<>();
List
<
String
>
mbList
=
new
ArrayList
<>();
TreeSet
<
String
>
ksList
=
new
TreeSet
<>();
TreeSet
<
String
>
ajList
=
new
TreeSet
<>();
Map
<
String
,
List
<
String
>>
map
=
new
HashMap
<>();
// 获取同义词和关键词
String
keyword1
=
keyword
.
getKeyword
();
String
synonyms
=
keyword
.
getSynonyms
();
String
[]
split1
=
null
;
if
(!
StringUtil
.
isEmpty
(
synonyms
)){
split1
=
synonyms
.
split
(
","
);
}
// 关键词匹配
String
sy_jyqk
=
asj
.
getJyaq
();
if
(!
StringUtil
.
isEmpty
(
sy_jyqk
)){
if
(
sy_jyqk
.
contains
(
keyword1
)){
stringArrayList
.
add
(
keyword1
);
stringList
.
add
(
keyword1
);
if
(!
StringUtil
.
isEmpty
(
keyword
.
getState
())){
if
(
keyword
.
getState
().
equals
(
"手段"
)){
sdList
.
add
(
keyword1
);
}
if
(
keyword
.
getState
().
equals
(
"环境"
)){
hjList
.
add
(
keyword1
);
}
if
(
keyword
.
getState
().
equals
(
"目标"
)){
mbList
.
add
(
keyword1
);
}
}
ksList
.
add
(
keyword1
);
}
}
// 同义词匹配
if
(
split1
!=
null
&&
split1
.
length
>
0
){
for
(
String
str:
split1
){
if
(!
StringUtil
.
isEmpty
(
sy_jyqk
)){
if
(
sy_jyqk
.
contains
(
str
)){
stringArrayList
.
add
(
keyword1
);
stringList
.
add
(
str
);
ksList
.
add
(
str
);
}
}
}
}
HashSet
hashSet
=
new
HashSet
(
stringArrayList
);
stringArrayList
.
clear
();
stringArrayList
.
addAll
(
hashSet
);
map
.
put
(
"key"
,
stringArrayList
);
map
.
put
(
"allkey"
,
stringList
);
map
.
put
(
"sd"
,
sdList
);
map
.
put
(
"hj"
,
hjList
);
map
.
put
(
"mb"
,
mbList
);
ArrayList
<
String
>
objects
=
new
ArrayList
<>();
objects
.
addAll
(
ksList
);
map
.
put
(
"kskey"
,
objects
);
// List<String> stringList1 = new ArrayList<>();
// stringList1.addAll(ajList);
// map.put("aj",stringList1);
return
map
;
}
public
void
doRunBqThread
(
TbStAsj
asj
,
List
<
TbXwAsjbzKeyword
>
keyword
,
List
<
Asjbz
>
asjbzs
)
{
List
<
String
>
stringList
=
new
ArrayList
<>();
List
<
String
>
list
=
new
ArrayList
<>();
List
<
String
>
sdList
=
new
ArrayList
<>();
List
<
String
>
hjList
=
new
ArrayList
<>();
List
<
String
>
mbList
=
new
ArrayList
<>();
List
<
String
>
ksList
=
new
ArrayList
<>();
TreeSet
<
String
>
ajList
=
new
TreeSet
<>();
for
(
TbXwAsjbzKeyword
keyword1:
keyword
){
Map
<
String
,
List
<
String
>>
map
=
doRunThread
(
asj
,
keyword1
,
asjbzs
);
stringList
.
addAll
(
map
.
get
(
"allkey"
));
list
.
addAll
(
map
.
get
(
"key"
));
sdList
.
addAll
(
map
.
get
(
"sd"
));
hjList
.
addAll
(
map
.
get
(
"hj"
));
mbList
.
addAll
(
map
.
get
(
"mb"
));
ksList
.
addAll
(
map
.
get
(
"kskey"
));
// ajList.addAll(map.get("aj"));
}
// System.out.println("案件编号"+asj.getAsjbh()+"标签"+stringList.toString());
// if(stringList != null && stringList.size()>0){
if
(
stringList
!=
null
&&
stringList
.
size
()>
0
){
asj
.
setSdtd
(
list
.
toString
().
replace
(
" "
,
""
));
asj
.
setBqyp
(
stringList
.
toString
().
replace
(
" "
,
""
));
// 案件匹配
if
(
list
!=
null
&&
list
.
size
()>
0
){
if
(
asjbzs
!=
null
&&
asjbzs
.
size
()>
0
){
for
(
Asjbz
asjbz:
asjbzs
){
int
count
=
0
;
if
(!
StringUtil
.
isEmpty
(
asjbz
.
getZj
())&&!
StringUtil
.
isEmpty
(
asjbz
.
getOperators
())){
String
zj
=
asjbz
.
getZj
();
String
operators
=
asjbz
.
getOperators
();
String
[]
split
=
zj
.
split
(
","
);
String
[]
split2
=
operators
.
split
(
","
);
if
(
split
.
length
==(
split2
.
length
+
1
)){
for
(
int
i
=
0
;
i
<
split
.
length
;
i
++){
if
(
i
==
0
){
if
(
split
[
i
].
equals
(
"0"
)){
count
++;
}
else
{
if
(
list
.
contains
(
split
[
i
])){
System
.
out
.
println
(
"============="
);
count
++;
}
}
}
else
{
if
(
split2
[
i
-
1
].
equals
(
"+"
)){
if
(
split
[
i
].
equals
(
"0"
)){
count
++;
}
else
{
if
(
list
.
contains
(
split
[
i
])){
count
++;
}
}
}
else
{
if
(
split
[
i
].
equals
(
"0"
)){
count
++;
}
else
{
if
(!
list
.
contains
(
split
[
i
])){
count
++;
}
}
}
}
}
if
(
count
==
split
.
length
){
ajList
.
add
(
asjbz
.
getCode
());
}
}
}
}
}
}
}
if
(
sdList
!=
null
&&
sdList
.
size
()>
0
){
asj
.
setZasf
(
sdList
.
toString
().
replace
(
" "
,
""
));
}
if
(
hjList
!=
null
&&
hjList
.
size
()>
0
){
asj
.
setZahj
(
hjList
.
toString
().
replace
(
" "
,
""
));
}
if
(
mbList
!=
null
&&
mbList
.
size
()>
0
){
asj
.
setZamb
(
mbList
.
toString
().
replace
(
" "
,
""
));
}
if
(
ksList
!=
null
&&
ksList
.
size
()>
0
){
asj
.
setZj
(
ksList
.
toString
().
replace
(
" "
,
""
));
}
if
(
ajList
!=
null
&&
ajList
.
size
()>
0
){
String
replace
=
ajList
.
toString
().
replace
(
" "
,
""
);
asj
.
setAjxz
(
replace
.
substring
(
1
,
replace
.
length
()-
1
));
}
// asj.setKeyword(list.toString().replace(" ",""));
try
{
YpglAsjService
.
insertAsjbzAll
(
asj
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
// }
}
@Override
public
void
run
()
{
doRunBqThread
(
asj
,
keyword
,
asjbzs
);
}
}
}
service/publicapi/src/main/java/com/founder/publicapi/controller/ypglController/AsjbzController.java
View file @
28e7dd90
...
...
@@ -377,7 +377,7 @@ public class AsjbzController implements BasicProcessor {
TbStAsj
stAsj
=
new
TbStAsj
();
stAsj
.
setAjlbdm
(
tbStAsj
.
getAjlbdm
());
stAsj
.
setKssj
(
tbStAsj
.
getKssj
());
stAsj
.
set
K
ssj
(
tbStAsj
.
getJssj
());
stAsj
.
set
J
ssj
(
tbStAsj
.
getJssj
());
JSONObject
jsonObject
=
toAsjBq
(
stAsj
);
if
(
jsonObject
!=
null
){
map
.
put
(
"code"
,
200
);
...
...
@@ -416,17 +416,6 @@ public class AsjbzController implements BasicProcessor {
int
i1
=
YpglAsjService
.
updateStAsjbz
();
//删除表中所有数据
System
.
out
.
println
(
i1
);
/*
Properties p = new Properties();
String endTime = p.getProperty("endTime");
String startTime = p.getProperty("startTime");
System.out.println("开始时间=="+startTime);
System.out.println("结束时间=="+endTime);
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
tbStAsj.setDjsj(dateFormat.parse(startTime));
tbStAsj.setDjsjEnd(dateFormat.parse(endTime));*/
TbXwAsjbzKeyword
tbXwAsjbzKeyword
=
new
TbXwAsjbzKeyword
();
// 案件类别代码模糊查询
...
...
@@ -441,6 +430,8 @@ public class AsjbzController implements BasicProcessor {
tbStAsj
.
setAjlbdm
(
ajlbdm
);
}
String
kssj
=
tbStAsj
.
getKssj
();
String
jssj
=
tbStAsj
.
getJssj
();
List
<
TbStAsj
>
asjListAll
=
YpglAsjService
.
findAsjxxList
(
tbStAsj
);
List
<
TbXwAsjbzKeyword
>
tbXwAsjbzKeywords
=
tbXwAsjbzKeywordService
.
selectTbXwAsjbzKeywordByCondition
(
tbXwAsjbzKeyword
);
...
...
@@ -473,7 +464,8 @@ public class AsjbzController implements BasicProcessor {
}
return
resultJSON
;
}
//标签研判线程定时任务
//训练定时任务
@Override
public
ProcessResult
process
(
TaskContext
context
)
throws
Exception
{
JSONObject
resultJSON
=
new
JSONObject
();
ExecutorService
executorService
=
Executors
.
newFixedThreadPool
(
1000
);
...
...
@@ -533,14 +525,14 @@ public class AsjbzController implements BasicProcessor {
}
resultJSON
.
put
(
"status"
,
"success"
);
resultJSON
.
put
(
"message"
,
"成功"
);
return
new
ProcessResult
(
true
,
"认定定时任务完成"
);
return
new
ProcessResult
(
true
,
"
训练
认定定时任务完成"
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
executorService
.
shutdown
();
resultJSON
.
put
(
"status"
,
"fail"
);
resultJSON
.
put
(
"message"
,
e
.
getMessage
());
return
new
ProcessResult
(
false
,
"认定定时任务失败"
);
return
new
ProcessResult
(
false
,
"
训练
认定定时任务失败"
);
}
}
...
...
@@ -803,14 +795,9 @@ public class AsjbzController implements BasicProcessor {
}
}*/
/**
* ^
* |
* |
* 定时任务
*/
/* // 全部案件2021至今
@Scheduled(cron = "0 0 2 * * ?")
// 全部案件2021至今
// @Scheduled(cron = "0 0 2 * * ?")
@RequestMapping
(
value
=
"/toRunAsjBq"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@ResponseBody
// @OperLogThread(message = "犯罪特征标签线程")
...
...
@@ -867,7 +854,7 @@ public class AsjbzController implements BasicProcessor {
resultJSON
.
put
(
"message"
,
e
.
getMessage
());
}
return
resultJSON
;
}
*/
}
class
RunAsjList
extends
Thread
{
...
...
@@ -890,9 +877,9 @@ public class AsjbzController implements BasicProcessor {
for
(
int
i
=
0
;
i
<
asjxxListFy
.
size
();
i
++){
// 案发时间段标签
if
(
asjxxListFy
.
get
(
i
).
getAsjfssj
_asjfsjssj
()!=
null
&&
asjxxListFy
.
get
(
i
).
getAsjfssj_a
sjfskssj
()!=
null
){
Date
asjfssj_asjfskssj
=
asjxxListFy
.
get
(
i
).
getAsjfssj
_a
sjfskssj
();
Date
asjfssj_asjfsjssj
=
asjxxListFy
.
get
(
i
).
getAsjfssj
_a
sjfsjssj
();
if
(
asjxxListFy
.
get
(
i
).
getAsjfssj
Asjfsjssj
()!=
null
&&
asjxxListFy
.
get
(
i
).
getAsjfssjA
sjfskssj
()!=
null
){
Date
asjfssj_asjfskssj
=
asjxxListFy
.
get
(
i
).
getAsjfssj
A
sjfskssj
();
Date
asjfssj_asjfsjssj
=
asjxxListFy
.
get
(
i
).
getAsjfssj
A
sjfsjssj
();
int
day
=
(
int
)
((
asjfssj_asjfsjssj
.
getTime
()
-
asjfssj_asjfskssj
.
getTime
())
/
(
1000
*
3600
*
24
));
if
(
day
>
1
){
asjxxListFy
.
get
(
i
).
setZasj
(
"上午,下午,傍晚,夜间"
);
...
...
service/publicapi/src/main/java/com/founder/publicapi/mapper/mysqlMapper/xml/TbXwAsjbzKeywordMapper.xml
View file @
28e7dd90
...
...
@@ -10,8 +10,8 @@
<if
test=
"synonyms != null and synonyms != ''"
>
AND synonyms like "%"#{ synonyms , jdbcType=VARCHAR }"%"
</if>
<if
test=
"xxdjry
_xm != null and xxdjry_x
m != ''"
>
AND xxdjry_xm like "%"#{ xxdjry
_x
m , jdbcType=VARCHAR }"%"
<if
test=
"xxdjry
Xm != null and xxdjryX
m != ''"
>
AND xxdjry_xm like "%"#{ xxdjry
X
m , jdbcType=VARCHAR }"%"
</if>
<if
test=
"djsj != null"
>
and DATE(djsj) = #{djsj , jdbcType=VARCHAR }
...
...
service/publicapi/src/main/java/com/founder/publicapi/mapper/mysqlMapper/xml/YpglAsjMapper.xml
View file @
28e7dd90
...
...
@@ -67,14 +67,14 @@
<if
test=
"asjbh != null and asjbh != ''"
>
and a.asjbh = #{asjbh}
</if>
<if
test=
"asjfssj
_asjfskssj != null and asjfssj_a
sjfskssj != ''"
>
and a.
ASJFSSJ_ASJFSKSSJ
<![CDATA[ >= ]]>
#{asjfssj_a
sjfskssj}
<if
test=
"asjfssj
Asjfskssj != null and asjfssjA
sjfskssj != ''"
>
and a.
asjfssj_asjfskssj
<![CDATA[ >= ]]>
#{asjfssjA
sjfskssj}
</if>
<if
test=
"kssj != null"
>
and
a.asjfssj_asjfskssj
<![CDATA[ >= ]]>
#{kssj}
<if
test=
"kssj != null
and jssj != ''
"
>
and
DATE(a.asjfssj_asjfskssj)
<![CDATA[ >= ]]>
DATE_FORMAT(#{kssj},'%Y-%m-%d %H:%i:%S')
</if>
<if
test=
"jssj != null and jssj != ''"
>
and
a.ASJFSSJ_ASJFSKSSJ
<![CDATA[ <= ]]>
#{asjfssj_asjfsjssj}
and
DATE(a.asjfssj_asjfskssj)
<![CDATA[ <= ]]>
DATE_FORMAT(#{jssj},'%Y-%m-%d %H:%i:%S')
</if>
<if
test=
"ajlbdm != null and ajlbdm != ''"
>
AND a.ajlbdm LIKE CONCAT(#{ajlbdm, jdbcType=VARCHAR}, '%')
...
...
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