Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
9a9ab940
Commit
9a9ab940
authored
Dec 13, 2021
by
tangwei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://172.16.10.76/moa/amos-boot-biz
into developer
parents
c94a4397
5d6ff773
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
60 additions
and
17 deletions
+60
-17
KeySiteDateDto.java
...ejoin/amos/boot/module/common/api/dto/KeySiteDateDto.java
+22
-1
KeySiteMapper.xml
...le-common-api/src/main/resources/mapper/KeySiteMapper.xml
+6
-4
KeySiteController.java
.../boot/module/common/biz/controller/KeySiteController.java
+1
-1
AudioKeywordType.java
...mos/boot/module/jcs/biz/audioToText/AudioKeywordType.java
+4
-4
RealTimeSpeechTranscriberListener.java
...cs/biz/audioToText/RealTimeSpeechTranscriberListener.java
+15
-4
application-dev.properties
...-system-jcs/src/main/resources/application-dev.properties
+0
-1
AppNslClient.java
...h/src/main/java/com/yeejoin/amos/speech/AppNslClient.java
+11
-2
AppSpeechTranscriber.java
...in/java/com/yeejoin/amos/speech/AppSpeechTranscriber.java
+1
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/dto/KeySiteDateDto.java
View file @
9a9ab940
...
...
@@ -24,8 +24,29 @@ public class KeySiteDateDto {
private
String
floorLongitude
;
@ApiModelProperty
(
value
=
"緯度"
)
private
String
floorLatitude
;
private
String
belongName
;
private
Long
belongId
;
public
String
getKey
()
{
public
String
getBelongName
()
{
return
belongName
;
}
public
void
setBelongName
(
String
belongName
)
{
this
.
belongName
=
belongName
;
}
public
Long
getBelongId
()
{
return
belongId
;
}
public
void
setBelongId
(
Long
belongId
)
{
this
.
belongId
=
belongId
;
}
public
String
getKey
()
{
return
key
;
}
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/KeySiteMapper.xml
View file @
9a9ab940
...
...
@@ -146,10 +146,12 @@
c.`name` as label,
c.address_desc as fireLocation,
c.longitude as floorLongitude,
c.latitude AS floorLatitude
FROM cb_key_site c
where c.is_delete=FALSE
<if
test=
"belongId != null and belongId!='-1' and belongId != -1"
>
c.latitude AS floorLatitude,
cou.biz_org_name as belongName,
c.belong_id as belongId
FROM cb_key_site c LEFT JOIN cb_org_usr cou on cou.sequence_nbr = c.belong_id
where c.is_delete=FALSE
<if
test=
"id != null and id != -1"
>
AND c.`belong_id`= #{id}
</if>
</select>
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/KeySiteController.java
View file @
9a9ab940
...
...
@@ -223,7 +223,7 @@ public class KeySiteController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"部位"
,
notes
=
"部位"
)
@GetMapping
(
value
=
"/getKeySiteDate"
)
public
ResponseModel
<
List
<
KeySiteDateDto
>>
getKeySiteDate
(
@RequestParam
Long
id
)
{
public
ResponseModel
<
List
<
KeySiteDateDto
>>
getKeySiteDate
(
@RequestParam
(
required
=
false
)
Long
id
)
{
return
ResponseHelper
.
buildResponse
(
keySiteService
.
getKeySiteDate
(
id
));
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/audioToText/AudioKeywordType.java
View file @
9a9ab940
...
...
@@ -4,11 +4,11 @@ package com.yeejoin.amos.boot.module.jcs.biz.audioToText;
* 语音转文字关键字查找表
*/
enum
AudioKeywordType
{
LOCATION
(
"location"
,
new
String
[]{
"地址"
,
"位置"
,
"地点"
,
}),
CONTACT
(
"contact"
,
new
String
[]{
"联系人"
,
"联系"
,
"在"
,
}),
CONTACT_NUMBER
(
"contactNumber"
,
new
String
[]{
"号码
是"
,
"号码"
,
"手机是"
,
"手机"
,
"手机号"
,
"手机号是
"
}),
LOCATION
(
"location"
,
new
String
[]{
"地址"
,
"位置"
,
"地点"
}),
CONTACT
(
"contact"
,
new
String
[]{
"联系人"
,
"联系"
,}),
CONTACT_NUMBER
(
"contactNumber"
,
new
String
[]{
"号码
"
,
"手机"
,
"手机号"
,
"手机号码
"
}),
UNIT
(
"unit"
,
new
String
[]{
"事发单位"
,
"单位"
,
"部门"
}),
PART
(
"part"
,
new
String
[]{
"重点部位"
,
"部位"
,
});
PART
(
"part"
,
new
String
[]{
"重点部位"
,
"部位"
});
private
String
type
;
private
String
[]
keyword
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/audioToText/RealTimeSpeechTranscriberListener.java
View file @
9a9ab940
...
...
@@ -182,6 +182,7 @@ public class RealTimeSpeechTranscriberListener extends SpeechTranscriberListener
audioRecords
.
forEach
(
audioRecord
->
{
stringBuilder
.
append
(
","
).
append
(
audioRecord
.
getMessage
());
});
stringBuilder
.
append
(
","
);
String
result
=
stringBuilder
.
toString
();
//寻找电话号码
Pattern
pattern
=
Pattern
.
compile
(
"\\d{5,}"
);
...
...
@@ -194,13 +195,23 @@ public class RealTimeSpeechTranscriberListener extends SpeechTranscriberListener
if
(
messageKeyword
==
AudioKeywordType
.
CONTACT_NUMBER
)
continue
;
for
(
String
keyword
:
messageKeyword
.
getKeyword
())
{
int
keywordIndex
=
result
.
indexOf
(
keyword
);
//问答式:截取关键字,从关键字的下一个[,/。]号开始截取到下下一个[,/。]号结束
// 第一种(获取keyword紧跟的内容到下一个[,/。]号的内容作为关键字)
if
(
keywordIndex
!=
-
1
)
{
int
keyWordValueEndIndex
=
getKeyWordValueIndex
(
result
,
keywordIndex
);
if
(
keyWordValueEndIndex
==
-
1
)
continue
;
String
keywordValue
=
result
.
substring
(
keywordIndex
+
keyword
.
length
(),
keyWordValueEndIndex
);
if
(!
StringUtils
.
isEmpty
(
keywordValue
)
&&
keywordValue
.
length
()
>=
4
)
{
audioKeyWords
.
getValues
().
get
(
messageKeyword
.
getType
()).
add
(
keywordValue
);
continue
;
}
}
// 第二种(获取keyword的下一个[,/。]号和下下一个[,/。]号的内容作为关键字)
if
(
keywordIndex
!=
-
1
)
{
int
keyWordValueStartIndex
=
getKeyWordValueIndex
(
result
,
keywordIndex
);
if
(
keyWordValueStartIndex
==
-
1
)
continue
;
int
keyWordValueEndIndex
=
getKeyWordValueIndex
(
result
,
keyWordValueStartIndex
);
if
(
keyWordValueEndIndex
==
-
1
)
continue
;
String
keywordValue
=
result
.
substring
(
keyWordValueStartIndex
,
keyWordValueEndIndex
);
String
keywordValue
=
result
.
substring
(
keyWordValueStartIndex
+
1
<
result
.
length
()
?
keyWordValueStartIndex
+
1
:
keyWordValueStartIndex
,
keyWordValueEndIndex
);
if
(
StringUtils
.
isEmpty
(
keywordValue
))
continue
;
audioKeyWords
.
getValues
().
get
(
messageKeyword
.
getType
()).
add
(
keywordValue
);
}
...
...
@@ -217,8 +228,8 @@ public class RealTimeSpeechTranscriberListener extends SpeechTranscriberListener
private
int
getKeyWordValueIndex
(
String
text
,
int
keywordIndex
)
{
int
keywordIndexNextFlag
=
-
1
;
int
keywordIndexNextFlag1
=
text
.
indexOf
(
","
,
keywordIndex
);
int
keywordIndexNextFlag2
=
text
.
indexOf
(
"。"
,
keywordIndex
);
int
keywordIndexNextFlag1
=
text
.
indexOf
(
","
,
keywordIndex
+
1
);
int
keywordIndexNextFlag2
=
text
.
indexOf
(
"。"
,
keywordIndex
+
1
);
if
(
keywordIndexNextFlag1
!=
-
1
)
{
if
(
keywordIndexNextFlag2
!=
-
1
)
{
keywordIndexNextFlag
=
Math
.
min
(
keywordIndexNextFlag1
,
keywordIndexNextFlag2
);
...
...
amos-boot-system-jcs/src/main/resources/application-dev.properties
View file @
9a9ab940
...
...
@@ -40,7 +40,6 @@ file.url=http://39.98.45.134:9000/
video.url
=
https://11.11.16.4:443/
ifc.url
=
http://11.11.16.17/IFCInterface
ifc.call-back.localIp
=
11.11.16.1
amos-boot-utils/amos-boot-utils-speech/src/main/java/com/yeejoin/amos/speech/AppNslClient.java
View file @
9a9ab940
...
...
@@ -58,13 +58,23 @@ class AppNslClientToken {
}
}
//token过期自更新
if
(
getTokenTime
+
accessToken
.
getExpireTime
()
<=
System
.
currentTimeMillis
())
{
//显示18天过期,实测两天就失效了
/*if (getTokenTime + accessToken.getExpireTime() <= System.currentTimeMillis()) {
logger.warn("token已过期,开始重新获取...");
accessToken = getAccessToken();
getTokenTime = System.currentTimeMillis();
} else {
long time = getTokenTime + accessToken.getExpireTime() - System.currentTimeMillis();
logger.warn("token过期还剩:" + "(" + time / (1000 * 60 * 60 * 24) + "天)");
}*/
//一天更新一次
if
(
System
.
currentTimeMillis
()
-
getTokenTime
>
(
1000
*
60
*
60
))
{
logger
.
warn
(
"token已过期,开始重新获取..."
);
accessToken
=
getAccessToken
();
getTokenTime
=
System
.
currentTimeMillis
();
}
else
{
long
time
=
System
.
currentTimeMillis
()
-
getTokenTime
;
logger
.
warn
(
"token过期还剩:"
+
"("
+
time
/
(
1000
*
60
*
60
*
24
)
+
"天)"
);
}
return
accessToken
;
}
...
...
@@ -72,7 +82,6 @@ class AppNslClientToken {
/**
* 获取访问Token,包含token和过期时间(2021-11-30测试Token过期时间为18天)
* 避免多次获取可能导致已进行的任务token失效
*
* @return token 访问token
*/
private
static
AccessToken
getAccessToken
()
{
...
...
amos-boot-utils/amos-boot-utils-speech/src/main/java/com/yeejoin/amos/speech/AppSpeechTranscriber.java
View file @
9a9ab940
...
...
@@ -74,6 +74,7 @@ public class AppSpeechTranscriber {
idleTime
=
0
;
logger
.
warn
(
"收到数据包:"
+
b
.
length
);
//去掉前12个字节的rtp包头,后面的332字节为语音数据
//4秒未再次调用此方法,阿里云会抛出超时异常
transcriber
.
send
(
Arrays
.
copyOfRange
(
b
,
12
,
b
.
length
));
}
}
catch
(
Exception
e
)
{
...
...
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