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
ac280bd1
Commit
ac280bd1
authored
Jun 15, 2022
by
wuchengwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
声纹信息与考核详情性别修改
parent
2e5f9e3f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
170 additions
and
82 deletions
+170
-82
src/main/java/com/founder/controller/SwCjController.java
+130
-65
src/main/java/com/founder/controller/TbXwRycjController.java
+9
-8
src/main/java/com/founder/khtj/controller/KhtjController.java
+1
-9
src/main/java/com/founder/model/TbStSw.java
+19
-0
src/main/resources/application.properties
+11
-0
No files found.
src/main/java/com/founder/controller/SwCjController.java
View file @
ac280bd1
...
...
@@ -61,7 +61,7 @@ public class SwCjController {
@ResponseBody
private
Map
<
String
,
String
>
saveSwSjXx
(
HttpServletRequest
request
,
TbStSw
tbStSw
,
BufferedReader
br
)
{
System
.
out
.
println
(
"开始接收声纹信息:"
);
Map
<
String
,
String
>
map
=
new
HashMap
<>();
//body部分
String
inputLine
;
...
...
@@ -75,93 +75,157 @@ public class SwCjController {
System
.
out
.
println
(
"IOException: "
+
e
);
}
JSONObject
object
=
JSONObject
.
parseObject
(
str
);
tbStSw
.
setRybh
((
String
)
object
.
get
(
"rybh"
));
tbStSw
.
setXm
((
String
)
object
.
get
(
"xm"
));
tbStSw
.
setGmsfhm
((
String
)
object
.
get
(
"gmsfhm"
));
String
ypsjStr
=
(
String
)
object
.
get
(
"ypsjStr"
);
String
swsjStr
=
(
String
)
object
.
get
(
"swsjStr"
);
tbStSw
.
setZsc
((
String
)
object
.
get
(
"zsc"
));
tbStSw
.
setYxsc
((
String
)
object
.
get
(
"yxsc"
));
tbStSw
.
setXzb
((
String
)
object
.
get
(
"xzb"
));
tbStSw
.
setNlz
((
String
)
object
.
get
(
"nlz"
));
tbStSw
.
setCjcd
((
String
)
object
.
get
(
"cjcd"
));
tbStSw
.
setXxzldf
((
String
)
object
.
get
(
"xxzldf"
));
tbStSw
.
setLyyz
((
String
)
object
.
get
(
"lyyz"
));
tbStSw
.
setLysb
((
String
)
object
.
get
(
"lysb"
));
tbStSw
.
setFyfs
((
String
)
object
.
get
(
"fyfs"
));
tbStSw
.
setXd
((
String
)
object
.
get
(
"xd"
));
tbStSw
.
setHyfy
((
String
)
object
.
get
(
"hyfy"
));
tbStSw
.
setLrrPolicemanid
(
object
.
get
(
"lrrPolicemanid"
).
toString
());
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"
);
String
swsjStr
=
(
String
)
object
.
get
(
"swsjStr"
);
tbStSw
.
setZsc
((
String
)
object
.
get
(
"zsc"
));
tbStSw
.
setYxsc
((
String
)
object
.
get
(
"yxsc"
));
tbStSw
.
setXzb
((
String
)
object
.
get
(
"xzb"
));
tbStSw
.
setNlz
((
String
)
object
.
get
(
"nlz"
));
tbStSw
.
setCjcd
((
String
)
object
.
get
(
"cjcd"
));
tbStSw
.
setXxzldf
((
String
)
object
.
get
(
"xxzldf"
));
tbStSw
.
setLyyz
((
String
)
object
.
get
(
"lyyz"
));
tbStSw
.
setLysb
((
String
)
object
.
get
(
"lysb"
));
tbStSw
.
setFyfs
((
String
)
object
.
get
(
"fyfs"
));
tbStSw
.
setXd
((
String
)
object
.
get
(
"xd"
));
tbStSw
.
setHyfy
((
String
)
object
.
get
(
"hyfy"
));
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"
));
}
catch
(
Exception
e
)
{
}
}
try
{
tbStSw
.
setYpsj
(
URLDecoder
.
decode
(
ypsjStr
).
getBytes
(
"ISO-8859-1"
));
tbStSw
.
setSwsj
(
URLDecoder
.
decode
(
swsjStr
).
getBytes
(
"ISO-8859-1"
));
}
catch
(
Exception
e
)
{
}
//判断必填项是否有值
if
(
tbStSw
==
null
||
StringUtils
.
isEmpty
(
tbStSw
.
getRybh
())
){
//失败
map
.
put
(
"code"
,
"1"
);
map
.
put
(
"msg"
,
"人员编号不能为空!"
);
System
.
out
.
println
(
"人员编号不能为空!"
);
return
map
;
}
if
(
StringUtils
.
isEmpty
(
tbStSw
.
getXm
())
){
//失败
map
.
put
(
"code"
,
"1"
);
map
.
put
(
"msg"
,
"姓名不能为空!"
);
System
.
out
.
println
(
"姓名不能为空!"
);
return
map
;
}
if
(
tbStSw
.
getYpsj
()
==
null
||
tbStSw
.
getYpsj
().
length
==
0
){
//失败
map
.
put
(
"code"
,
"1"
);
map
.
put
(
"msg"
,
"音频数据不能为空!"
);
return
map
;
}
if
(
tbStSw
.
getSwsj
()
==
null
||
tbStSw
.
getSwsj
().
length
==
0
){
/*
if(tbStSw.getSwsjStr() == null || tbStSw.getSwsjStr().length() == 0 ){
//失败
map.put("code","1");
map.put("msg","声纹数据不能为空!");
return
map
;
}
if
(
StringUtils
.
isEmpty
(
tbStSw
.
getZsc
())
){
//失败
map
.
put
(
"code"
,
"1"
);
map
.
put
(
"msg"
,
"音频总时长不能为空!"
);
return
map
;
}
if
(
StringUtils
.
isEmpty
(
tbStSw
.
getCjcd
())
){
//失败
map
.
put
(
"code"
,
"1"
);
map
.
put
(
"msg"
,
"采集场地不能为空!"
);
return
map
;
}
if
(
StringUtils
.
isEmpty
(
tbStSw
.
getXxzldf
())
){
//失败
map
.
put
(
"code"
,
"1"
);
map
.
put
(
"msg"
,
"信息质量不能为空!"
);
return
map
;
}
if
(
StringUtils
.
isEmpty
(
tbStSw
.
getLyyz
())
){
//失败
map
.
put
(
"code"
,
"1"
);
map
.
put
(
"msg"
,
"录音语种不能为空!"
);
return
map
;
System.out.println("声纹数据不能为空!");
//return map;
}else{
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()) {
//GenerateImage(filejia., String imgFilePath)
String zpBase64 = GetImageStrs(tbStSw.getSwsjStr());
try {
tbStSw.setYpsj(URLDecoder.decode(zpBase64).getBytes("ISO-8859-1"));
String rybhstr = tbStSw.getRybh();
int swcnt = swCjService.getSwSjXxCnt(rybhstr);
//List<TbStSw> tbStSws = swCjService.getSwSjXxList(rybhstr);
String savePath = "/personphoto/swfile";
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();
}
String paths = "";
if(swcnt>=0){
paths = filePath + "/"+ rybhstr+ "_" + filejia.getName() + swcnt + ".wav";
}else{
paths = filePath + "/"+ rybhstr+ "_" + filejia.getName() + "0.wav";
}
File filejia1 = new File(paths);
try {
filejia1.createNewFile();
boolean flg = GenerateImage(getBytesByFile(tbStSw.getSwsjStr()),paths);
} catch (IOException e) {
e.printStackTrace();
}
tbStSw.setWjlj(paths);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
}
if
(
StringUtils
.
isEmpty
(
tbStSw
.
getLrrPolicemanid
())
){
//失败
map
.
put
(
"code"
,
"1"
);
map
.
put
(
"msg"
,
"采集人警号不能为空!"
);
return
map
;
*/
//当音频,声纹数据都为空时,不做文件上传操作
if
((
tbStSw
.
getYpsj
()
!=
null
&&
tbStSw
.
getYpsj
().
length
!=
0
)
||
(
tbStSw
.
getSwsj
()
!=
null
&&
tbStSw
.
getSwsj
().
length
!=
0
))
{
//当音频文件为空,声纹数据不为空时,将声纹数据赋予音频文件
if
((
tbStSw
.
getYpsj
()
==
null
||
tbStSw
.
getYpsj
().
length
==
0
)
&&
(
tbStSw
.
getSwsj
()
!=
null
||
tbStSw
.
getSwsj
().
length
!=
0
))
{
//失败
// map.put("code", "1");
// map.put("msg", "音频数据不能为空!");
// System.out.println("音频数据不能为空!");
// return map;
tbStSw
.
setYpsj
(
tbStSw
.
getSwsj
());
}
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
();
}
String
paths
=
""
;
if
(
swcnt
>=
0
)
{
paths
=
filePath
+
"/"
+
rybhstr
+
"_voice"
+
swcnt
+
".wav"
;
}
else
{
paths
=
filePath
+
"/"
+
rybhstr
+
"_voice"
+
"0.wav"
;
}
File
filejia1
=
new
File
(
paths
);
try
{
filejia1
.
createNewFile
();
boolean
flg
=
GenerateImage
(
tbStSw
.
getYpsj
(),
paths
);
tbStSw
.
setWjlj
(
paths
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
User
user
=
(
User
)
request
.
getSession
().
getAttribute
(
"User"
);
//生成信息主键编号
String
uuid
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
tbStSw
.
setXxzjbh
(
uuid
);
//录入人相关信息
tbStSw
.
setLrr
(
dicItemService
.
queryNameByCode
(
tbStSw
.
getLrrPolicemanid
(),
"CODE_JY"
));
Boolean
b
=
swCjService
.
saveSwSjXx
(
tbStSw
,
user
.
getUnitcode
());
tbStSw
.
setSbcs
(
"1"
);
Boolean
b
=
swCjService
.
saveSwSjXx
(
tbStSw
,
tbStSw
.
getLrdwdm
(
));
if
(
b
){
//成功
map
.
put
(
"code"
,
"0"
);
...
...
@@ -174,6 +238,7 @@ public class SwCjController {
}
return
map
;
}
/**
...
...
src/main/java/com/founder/controller/TbXwRycjController.java
View file @
ac280bd1
...
...
@@ -63,6 +63,7 @@ import static jdk.nashorn.internal.runtime.regexp.joni.Config.log;
@Controller
public
class
TbXwRycjController
{
PropertiesUtil
p
=
new
PropertiesUtil
(
"application.properties"
);
private
Logger
log
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
@Autowired
private
AfisQualityService
afisQualityService
;
...
...
@@ -2909,17 +2910,17 @@ public class TbXwRycjController {
long
startTime
=
System
.
currentTimeMillis
();
//获取开始时间
if
(
zwbh
!=
null
&&
zwbh
.
indexOf
(
"4601"
)==
0
){
//imgstrs = hu.getJsonString("http://65.65.66.27:8081/data/getPSNPalmByRybh?rybh="+zwbh);//株洲
imgstrs
=
hu
.
getJsonString
(
"http://10.185.207.31:8082/data/getPSNPalmByRybh
?rybh="
+
zwbh
);
imgstrs
=
hu
.
getJsonString
(
p
.
getValue
(
"pmzwurl4601"
)+
"
?rybh="
+
zwbh
);
}
else
if
(
zwbh
!=
null
&&
zwbh
.
indexOf
(
"4602"
)==
0
){
//imgstrs = hu.getJsonString("http://65.65.66.27:8081/data/getPSNPalmByRybh?rybh="+zwbh);//株洲
imgstrs
=
hu
.
getJsonString
(
"http://74.41.47.102:8082/data/getPSNPalmByRybh
?rybh="
+
zwbh
);
imgstrs
=
hu
.
getJsonString
(
p
.
getValue
(
"pmzwurl4602"
)+
"
?rybh="
+
zwbh
);
}
else
if
(
zwbh
!=
null
&&
zwbh
.
indexOf
(
"469003"
)==
0
){
//imgstrs = hu.getJsonString("http://65.65.66.27:8081/data/getPSNPalmByRybh?rybh="+zwbh);//株洲
imgstrs
=
hu
.
getJsonString
(
"http://74.55.64.132:8082/data/getPSNPalmByRybh
?rybh="
+
zwbh
);
imgstrs
=
hu
.
getJsonString
(
p
.
getValue
(
"pmzwurl469003"
)+
"
?rybh="
+
zwbh
);
}
else
{
//imgstrs = hu.getJsonString("http://65.38.37.118:8081/data/getPSNPalmByRybh?rybh="+zwbh);
//imgstrs = hu.getJsonString("http://10.142.16.171:8082/data/getPSNPalmByRybh?rybh="+zwbh);//湖南省厅
imgstrs
=
hu
.
getJsonString
(
"http://74.10.26.181:8082/data/getPSNPalmByRybh
?rybh="
+
zwbh
);
imgstrs
=
hu
.
getJsonString
(
p
.
getValue
(
"pmzwurl"
)+
"
?rybh="
+
zwbh
);
}
long
endTime
=
System
.
currentTimeMillis
();
//获取结束时间
System
.
out
.
println
(
"接口调用掌纹返回时长: "
+(
endTime
-
startTime
)+
"ms"
);
...
...
@@ -2964,17 +2965,17 @@ public class TbXwRycjController {
long
startTime
=
System
.
currentTimeMillis
();
//获取开始时间
if
(
zwbh
!=
null
&&
zwbh
.
indexOf
(
"4601"
)==
0
){
//imgstrs = hu.getJsonString("http://65.65.66.27:8081/data/getPSNRollByRybh?rybh="+zwbh);//株洲
imgstrs
=
hu
.
getJsonString
(
"http://10.185.207.31:8082/data/getPSNRollByRybh
?rybh="
+
zwbh
);
imgstrs
=
hu
.
getJsonString
(
p
.
getValue
(
"gdzwurl4601"
)+
"
?rybh="
+
zwbh
);
}
else
if
(
zwbh
!=
null
&&
zwbh
.
indexOf
(
"4602"
)==
0
){
//imgstrs = hu.getJsonString("http://65.65.66.27:8081/data/getPSNRollByRybh?rybh="+zwbh);//株洲
imgstrs
=
hu
.
getJsonString
(
"http://74.41.47.102:8082/data/getPSNRollByRybh
?rybh="
+
zwbh
);
imgstrs
=
hu
.
getJsonString
(
p
.
getValue
(
"gdzwurl4602"
)+
"
?rybh="
+
zwbh
);
}
else
if
(
zwbh
!=
null
&&
zwbh
.
indexOf
(
"469003"
)==
0
){
//imgstrs = hu.getJsonString("http://65.65.66.27:8081/data/getPSNRollByRybh?rybh="+zwbh);//株洲
imgstrs
=
hu
.
getJsonString
(
"http://74.55.64.132:8082/data/getPSNRollByRybh
?rybh="
+
zwbh
);
imgstrs
=
hu
.
getJsonString
(
p
.
getValue
(
"gdzwurl469003"
)+
"
?rybh="
+
zwbh
);
}
else
{
//imgstrs = hu.getJsonString("http://65.38.37.118:8081/data/getPSNRollByRybh?rybh="+zwbh);
//imgstrs = hu.getJsonString("http://10.142.16.171:8082/data/getPSNRollByRybh?rybh="+zwbh);//湖南省厅
imgstrs
=
hu
.
getJsonString
(
"http://74.10.26.181:8082/data/getPSNRollByRybh
?rybh="
+
zwbh
);
imgstrs
=
hu
.
getJsonString
(
p
.
getValue
(
"gdzwurl"
)+
"
?rybh="
+
zwbh
);
}
long
endTime
=
System
.
currentTimeMillis
();
//获取结束时间
System
.
out
.
println
(
"接口调用滚动指纹返回时长: "
+(
endTime
-
startTime
)+
"ms"
);
...
...
src/main/java/com/founder/khtj/controller/KhtjController.java
View file @
ac280bd1
...
...
@@ -513,15 +513,7 @@ public class KhtjController {
content
[
i
]
=
new
String
[
title
.
length
];
content
[
i
][
0
]
=
autoTbStRy
.
getRybh
();
content
[
i
][
1
]
=
autoTbStRy
.
getXm
();
if
(
"1"
.
equals
(
autoTbStRy
.
getXbdm
()))
{
content
[
i
][
2
]
=
"男"
;
}
else
if
(
"2"
.
equals
(
autoTbStRy
.
getXbdm
()))
{
content
[
i
][
2
]
=
"女"
;
}
else
if
(
"9"
.
equals
(
autoTbStRy
.
getXbdm
()))
{
content
[
i
][
2
]
=
"未说明性别"
;
}
else
if
(
"0"
.
equals
(
autoTbStRy
.
getXbdm
()))
{
content
[
i
][
2
]
=
"未知性别"
;
}
content
[
i
][
2
]
=
autoTbStRy
.
getXbdm
();
if
(
autoTbStRy
.
getGmsfhm
()
==
null
||
""
.
equals
(
autoTbStRy
.
getGmsfhm
()))
{
content
[
i
][
3
]
=
autoTbStRy
.
getZjhm
();
}
else
{
...
...
src/main/java/com/founder/model/TbStSw.java
View file @
ac280bd1
...
...
@@ -27,6 +27,7 @@ public class TbStSw implements Serializable {
//声纹数据
public
byte
[]
swsj
;
public
String
swsjStr
;
//音频总时长
public
String
zsc
;
...
...
@@ -90,6 +91,24 @@ public class TbStSw implements Serializable {
public
String
wjlj
;
//采集次数
public
int
cjcs
;
//设备厂商
public
String
sbcs
;
public
String
getSwsjStr
()
{
return
swsjStr
;
}
public
void
setSwsjStr
(
String
swsjStr
)
{
this
.
swsjStr
=
swsjStr
;
}
public
String
getSbcs
()
{
return
sbcs
;
}
public
void
setSbcs
(
String
sbcs
)
{
this
.
sbcs
=
sbcs
;
}
public
String
getXxzjbh
()
{
return
xxzjbh
;
...
...
src/main/resources/application.properties
View file @
ac280bd1
...
...
@@ -4,6 +4,17 @@ spring.profiles.active=dev
#server.context-path=/demo
#server.servlet.session.cookie.name=mycookies
pmzwurl4601
=
http://74.10.26.181:8082/data/getPSNPalmByRybh
pmzwurl4602
=
http://74.10.26.181:8082/data/getPSNPalmByRybh
pmzwurl469003
=
http://74.10.26.181:8082/data/getPSNPalmByRybh
pmzwurl
=
http://74.10.26.181:8082/data/getPSNPalmByRybh
gdzwurl4601
=
http://74.10.26.181:8082/data/getPSNRollByRybh
gdzwurl4602
=
http://74.10.26.181:8082/data/getPSNRollByRybh
gdzwurl469003
=
http://74.10.26.181:8082/data/getPSNRollByRybh
gdzwurl
=
http://74.10.26.181:8082/data/getPSNRollByRybh
zwrwurl
=
http://172.18.117.11:8081/szxc/query/person
zwrwurl4601
=
http://172.18.117.11:8081/szxc/query/person
zwrwurl4602
=
http://172.18.117.11:8081/szxc/query/person
...
...
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