Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hnxtbaboot
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
杨亮
hnxtbaboot
Commits
c35c0e15
Commit
c35c0e15
authored
Aug 19, 2021
by
yangliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改足迹接口调用方式
parent
6fc591b0
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
44 deletions
+43
-44
src/main/java/com/founder/controller/SwCjController.java
+42
-43
src/main/java/com/founder/controller/ZjCjController.java
+0
-0
src/main/java/com/founder/utils/FileUtils.java
+1
-1
No files found.
src/main/java/com/founder/controller/SwCjController.java
View file @
c35c0e15
...
...
@@ -60,7 +60,7 @@ public class SwCjController {
@RequestMapping
(
"/saveSwSjXx"
)
@ResponseBody
private
Map
<
String
,
String
>
saveSwSjXx
(
HttpServletRequest
request
,
TbStSw
tbStSw
,
BufferedReader
br
)
{
System
.
out
.
println
(
"
接收声纹信息:"
+
tbStSw
.
getRybh
()
);
System
.
out
.
println
(
"
开始接收声纹信息:"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
//body部分
String
inputLine
;
...
...
@@ -76,6 +76,7 @@ public class SwCjController {
JSONObject
object
=
JSONObject
.
parseObject
(
str
);
if
(
object
!=
null
&&!
""
.
equals
(
object
)){
tbStSw
.
setRybh
((
String
)
object
.
get
(
"rybh"
));
System
.
out
.
println
(
"声纹信息人员编号:"
+
tbStSw
.
getRybh
());
tbStSw
.
setXm
((
String
)
object
.
get
(
"xm"
));
tbStSw
.
setGmsfhm
((
String
)
object
.
get
(
"gmsfhm"
));
String
ypsjStr
=
(
String
)
object
.
get
(
"ypsjStr"
);
...
...
@@ -92,13 +93,14 @@ public class SwCjController {
tbStSw
.
setFyfs
((
String
)
object
.
get
(
"fyfs"
));
tbStSw
.
setXd
((
String
)
object
.
get
(
"xd"
));
tbStSw
.
setHyfy
((
String
)
object
.
get
(
"hyfy"
));
tbStSw
.
setLrrPolicemanid
(
object
.
get
(
"lrrPolicemanid"
).
toString
(
));
tbStSw
.
setLrrPolicemanid
(
(
String
)
object
.
get
(
"lrrPolicemanid"
));
try
{
tbStSw
.
setYpsj
(
URLDecoder
.
decode
(
ypsjStr
).
getBytes
(
"ISO-8859-1"
));
tbStSw
.
setSwsj
(
URLDecoder
.
decode
(
swsjStr
).
getBytes
(
"ISO-8859-1"
));
}
catch
(
Exception
e
)
{
}
}
else
{
System
.
out
.
println
(
"接收声纹信息为空!"
);
try
{
tbStSw
.
setYpsj
(
URLDecoder
.
decode
(
tbStSw
.
getYpsjStr
()).
getBytes
(
"ISO-8859-1"
));
tbStSw
.
setSwsj
(
URLDecoder
.
decode
(
tbStSw
.
getSwsjStr
()).
getBytes
(
"ISO-8859-1"
));
...
...
@@ -113,15 +115,16 @@ public class SwCjController {
map
.
put
(
"code"
,
"1"
);
map
.
put
(
"msg"
,
"人员编号不能为空!"
);
System
.
out
.
println
(
"人员编号不能为空!"
);
//
return map;
return
map
;
}
if
(
StringUtils
.
isEmpty
(
tbStSw
.
getXm
())
){
//失败
map
.
put
(
"code"
,
"1"
);
map
.
put
(
"msg"
,
"姓名不能为空!"
);
System
.
out
.
println
(
"姓名不能为空!"
);
//
return map;
return
map
;
}
/*
if(tbStSw.getSwsjStr() == null || tbStSw.getSwsjStr().length() == 0 ){
//失败
map.put("code","1");
...
...
@@ -129,7 +132,12 @@ public class SwCjController {
System.out.println("声纹数据不能为空!");
//return map;
}else{
System
.
out
.
println
(
"声纹数据路径"
+
tbStSw
.
getSwsjStr
());
String rybhstr = tbStSw.getRybh();
String savePath = "/personphoto/" + rybhstr.substring(rybhstr.length() - 10, rybhstr.length() - 4) + "/" + rybhstr.substring(rybhstr.length() - 3, rybhstr.length());
Param param = paramService.getParamById("0100");
String zplj = param.getParamvalue();
String filePath = zplj;
filePath = filePath + savePath;
tbStSw.setWjlj(tbStSw.getSwsjStr());
File filejia = new File(tbStSw.getSwsjStr());
if (filejia.exists()) {
...
...
@@ -169,51 +177,42 @@ public class SwCjController {
}
}
}
/*
if(
StringUtils.isEmpty(tbStSw.getZsc())
){
*/
if
(
tbStSw
.
getYpsj
()
==
null
||
tbStSw
.
getYpsj
().
length
==
0
){
//失败
map
.
put
(
"code"
,
"1"
);
map.put("msg","音频总时长不能为空!");
System.out.println("音频总时长不能为空!");
//return map;
map
.
put
(
"msg"
,
"音频数据不能为空!"
);
System
.
out
.
println
(
"音频数据不能为空!"
);
return
map
;
}
else
{
String
rybhstr
=
tbStSw
.
getRybh
();
int
swcnt
=
swCjService
.
getSwSjXxCnt
(
rybhstr
);
//List<TbStSw> tbStSws = swCjService.getSwSjXxList(rybhstr);
String
savePath
=
"/personphoto/"
+
rybhstr
.
substring
(
rybhstr
.
length
()
-
10
,
rybhstr
.
length
()
-
4
)
+
"/"
+
rybhstr
.
substring
(
rybhstr
.
length
()
-
3
,
rybhstr
.
length
());
Param
param
=
paramService
.
getParamById
(
"0100"
);
String
zplj
=
param
.
getParamvalue
();
String
filePath
=
zplj
;
filePath
=
filePath
+
savePath
;
File
filejia0
=
new
File
(
filePath
);
if
(!
filejia0
.
exists
())
{
filejia0
.
mkdir
();
}
*/
if
(
StringUtils
.
isEmpty
(
tbStSw
.
getCjcd
())
){
//失败
map
.
put
(
"code"
,
"1"
);
map
.
put
(
"msg"
,
"采集场地不能为空!"
);
System
.
out
.
println
(
"采集场地不能为空!"
);
//return map;
String
paths
=
""
;
if
(
swcnt
>=
0
){
paths
=
filePath
+
"/"
+
rybhstr
+
"_voice"
+
swcnt
+
".wav"
;
}
else
{
paths
=
filePath
+
"/"
+
rybhstr
+
"_voice"
+
"0.wav"
;
}
if
(
StringUtils
.
isEmpty
(
tbStSw
.
getXxzldf
())
){
//失败
map
.
put
(
"code"
,
"1"
);
map
.
put
(
"msg"
,
"信息质量不能为空!"
);
System
.
out
.
println
(
"信息质量不能为空!"
);
//return map;
File
filejia1
=
new
File
(
paths
);
try
{
filejia1
.
createNewFile
();
boolean
flg
=
GenerateImage
(
tbStSw
.
getYpsj
(),
paths
);
tbStSw
.
setWjlj
(
paths
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
if
(
StringUtils
.
isEmpty
(
tbStSw
.
getLyyz
())
){
//失败
map
.
put
(
"code"
,
"1"
);
map
.
put
(
"msg"
,
"录音语种不能为空!"
);
System
.
out
.
println
(
"录音语种不能为空!"
);
//return map;
}
if
(
StringUtils
.
isEmpty
(
tbStSw
.
getLrrPolicemanid
())
){
//失败
map
.
put
(
"code"
,
"1"
);
map
.
put
(
"msg"
,
"采集人警号不能为空!"
);
System
.
out
.
println
(
"采集人警号不能为空!"
);
//return map;
tbStSw
.
setLrdwdm
(
"460000000000"
);
tbStSw
.
setLrr
(
"admin"
);
}
else
{
User
user
=
(
User
)
request
.
getSession
().
getAttribute
(
"User"
);
//录入人相关信息
tbStSw
.
setLrr
(
dicItemService
.
queryNameByCode
(
tbStSw
.
getLrrPolicemanid
(),
"CODE_JY"
));
tbStSw
.
setLrdwdm
(
"460000000000"
);
}
//生成信息主键编号
String
uuid
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
tbStSw
.
setXxzjbh
(
uuid
);
...
...
src/main/java/com/founder/controller/ZjCjController.java
View file @
c35c0e15
This diff is collapsed.
Click to expand it.
src/main/java/com/founder/utils/FileUtils.java
View file @
c35c0e15
...
...
@@ -391,7 +391,7 @@ public class FileUtils {
HttpPost
httpPost
=
new
HttpPost
(
url
);
// 设置请求和传输超时时间
RequestConfig
requestConfig
=
RequestConfig
.
custom
()
.
setSocketTimeout
(
4000
).
setConnectTimeout
(
4
000
).
build
();
.
setSocketTimeout
(
20000
).
setConnectTimeout
(
20
000
).
build
();
httpPost
.
setConfig
(
requestConfig
);
try
{
if
(
null
!=
jsonParam
)
{
...
...
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