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
6fe14bff
Commit
6fe14bff
authored
Nov 26, 2021
by
xinglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*)修改后端
parent
f5df4d7d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
22 deletions
+43
-22
VoiceRecordFile.java
...join/amos/boot/module/jcs/api/entity/VoiceRecordFile.java
+6
-0
VoiceRecordFileMapper.xml
...s-api/src/main/resources/mapper/VoiceRecordFileMapper.xml
+0
-1
VoiceRecordFileController.java
.../module/jcs/biz/controller/VoiceRecordFileController.java
+0
-4
FusionServiceImpl.java
...s/boot/module/jcs/biz/service/impl/FusionServiceImpl.java
+12
-4
VoiceRecordFileServiceImpl.java
...dule/jcs/biz/service/impl/VoiceRecordFileServiceImpl.java
+25
-13
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/java/com/yeejoin/amos/boot/module/jcs/api/entity/VoiceRecordFile.java
View file @
6fe14bff
...
...
@@ -30,6 +30,12 @@ public class VoiceRecordFile extends BaseEntity {
private
String
filePath
;
/**
* CID
*/
@TableField
(
"connect_id"
)
private
String
connectId
;
/**
* 通话类型
*/
@TableField
(
"file_type"
)
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-jcs-api/src/main/resources/mapper/VoiceRecordFileMapper.xml
View file @
6fe14bff
...
...
@@ -4,7 +4,6 @@
<sql
id=
"componentField"
>
r.sequence_nbr AS sequenceNbr,
r.file_path AS filePath,
r.file_type AS fileType,
r.caller AS caller,
r.called AS called,
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/VoiceRecordFileController.java
View file @
6fe14bff
...
...
@@ -40,7 +40,6 @@ public class VoiceRecordFileController extends BaseController {
@Autowired
AlertCalledServiceImpl
iAlertCalledService
;
/**
* 根据警情id 查找通话记录信息
*
...
...
@@ -78,7 +77,6 @@ public class VoiceRecordFileController extends BaseController {
return
ResponseHelper
.
buildResponse
(
record
);
}
/**
* 新增-通话记录
*
...
...
@@ -96,8 +94,6 @@ public class VoiceRecordFileController extends BaseController {
return
ResponseHelper
.
buildResponse
(
true
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"查询通话记录"
,
notes
=
"查询通话记录"
)
@GetMapping
(
"/selectRecord"
)
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/FusionServiceImpl.java
View file @
6fe14bff
...
...
@@ -81,7 +81,7 @@ public class FusionServiceImpl implements IFusionService {
@Override
public
Map
<
String
,
String
>
getCallRecordByCID
(
String
cid
)
{
MultiValueMap
<
String
,
String
>
requestEntity
=
new
LinkedMultiValueMap
<
String
,
String
>();
requestEntity
.
add
(
"
cid
"
,
cid
);
requestEntity
.
add
(
"
CID
"
,
cid
);
JSONObject
jsonObject
=
null
;
try
{
jsonObject
=
RestTemplateUtil
.
getRestInstance
().
postForObject
(
String
.
format
(
"%s/GetCallRecordByCID"
,
voiceURL
),
requestEntity
,
JSONObject
.
class
);
...
...
@@ -94,9 +94,17 @@ public class FusionServiceImpl implements IFusionService {
public
Map
<
String
,
String
>
getResult
(
JSONObject
jsonObject
)
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
JSONArray
data
=
jsonObject
.
getJSONArray
(
"data"
);
if
(!
ValidationUtil
.
isEmpty
(
data
))
{
map
=
(
Map
)
data
.
get
(
0
);
if
(
ValidationUtil
.
isEmpty
(
jsonObject
))
{
throw
new
BadRequest
(
"访问融合终端失败"
);
}
if
(
jsonObject
.
get
(
"data"
)
instanceof
Map
)
{
JSONObject
data
=
jsonObject
.
getJSONObject
(
"data"
);
map
=
(
Map
)
data
;
}
else
{
JSONArray
data
=
jsonObject
.
getJSONArray
(
"data"
);
if
(!
ValidationUtil
.
isEmpty
(
data
))
{
map
=
(
Map
)
data
.
get
(
0
);
}
}
return
map
;
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/VoiceRecordFileServiceImpl.java
View file @
6fe14bff
...
...
@@ -20,6 +20,7 @@ import org.apache.logging.log4j.Logger;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.Assert
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
...
...
@@ -84,11 +85,19 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,
VoiceRecordFile
voiceRecordFile
=
new
VoiceRecordFile
();
BeanUtils
.
copyProperties
(
model
,
voiceRecordFile
);
log
.
setAlertId
(
model
.
getAlertId
());
log
.
setConnectId
(
dMap
.
get
(
"cid"
));
String
cid
=
dMap
.
get
(
"cid"
);
Assert
.
notNull
(
cid
,
"CID不能为空"
);
Map
<
String
,
String
>
callRecord
=
fusionService
.
getCallRecordByCID
(
cid
);
log
.
setConnectId
(
cid
);
log
.
setIsDeal
(
false
);
log
.
setDealTimes
(
0
);
if
(!
ValidationUtil
.
isEmpty
(
callRecord
)){
voiceRecordFile
.
setFilePath
(
String
.
format
(
"/%s/%s"
,
callRecord
.
get
(
"subPath"
),
callRecord
.
get
(
"recordName"
).
replace
(
"wav"
,
"mp3"
)));
logger
.
info
(
String
.
format
(
"音频地址:【%s】"
,
String
.
format
(
"/%s/%s"
,
callRecord
.
get
(
"subPath"
),
callRecord
.
get
(
"recordName"
))));
}
else
{
// 无录音地址记录日志
iVoiceRecordLogServiceImpl
.
save
(
log
);
}
save
(
voiceRecordFile
);
iVoiceRecordLogServiceImpl
.
save
(
log
);
}
@Override
...
...
@@ -108,6 +117,8 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,
@Override
public
VoiceRecordFileDto
getRecordById
(
Long
sequenceNbr
)
{
VoiceRecordFileDto
record
=
baseMapper
.
getRecordById
(
sequenceNbr
);
Map
<
String
,
String
>
callRecord
=
fusionService
.
getCallRecordByCID
(
record
.
getConnectId
());
record
.
setFilePath
(
callRecord
.
get
(
"cid"
));
return
record
;
}
...
...
@@ -125,8 +136,7 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,
public
List
<
FusionDto
>
getCarList
(
Boolean
hasFusion
)
{
List
<
FusionDto
>
fusionDtos
=
new
ArrayList
<>();
List
carList
=
equipFeignClient
.
getCarFusionList
().
getResult
();
List
<
String
>
employeeIDs
=
getAllOnlineUser
();
List
<
String
>
employeeIDs
=
getAllOnlineUser
(
hasFusion
);
if
(!
ValidationUtil
.
isEmpty
(
carList
))
{
carList
.
forEach
(
x
->
{
FusionDto
fusionDto
=
new
FusionDto
();
...
...
@@ -145,7 +155,7 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,
public
List
<
FusionDto
>
getSinglePawnList
(
Boolean
hasFusion
)
{
List
<
DictionarieValueModel
>
result
=
Systemctl
.
dictionarieClient
.
dictValues
(
SINGLE_PAWN
).
getResult
();
List
<
FusionDto
>
fusionDtos
=
new
ArrayList
<>();
List
<
String
>
employeeIDs
=
getAllOnlineUser
();
List
<
String
>
employeeIDs
=
getAllOnlineUser
(
hasFusion
);
result
.
forEach
(
model
->
{
FusionDto
fusionDto
=
new
FusionDto
();
...
...
@@ -163,15 +173,17 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,
*
* @return
*/
private
List
<
String
>
getAllOnlineUser
()
{
JSONObject
jsonObject
=
fusionService
.
getAllOnlineUser
();
private
List
<
String
>
getAllOnlineUser
(
Boolean
hasFusion
)
{
List
<
String
>
employeeIDs
=
new
ArrayList
<>();
if
(!
ValidationUtil
.
isEmpty
(
jsonObject
))
{
JSONArray
onlines
=
jsonObject
.
getJSONArray
(
"Onlines"
);
onlines
.
forEach
(
x
->
{
Map
<
String
,
String
>
obj
=
(
Map
)
x
;
employeeIDs
.
add
(
obj
.
get
(
"employeeID"
));
});
if
(
hasFusion
){
JSONObject
jsonObject
=
fusionService
.
getAllOnlineUser
();
if
(!
ValidationUtil
.
isEmpty
(
jsonObject
))
{
JSONArray
onlines
=
jsonObject
.
getJSONArray
(
"Onlines"
);
onlines
.
forEach
(
x
->
{
Map
<
String
,
String
>
obj
=
(
Map
)
x
;
employeeIDs
.
add
(
obj
.
get
(
"employeeID"
));
});
}
}
return
employeeIDs
;
}
...
...
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