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
11fd085f
Commit
11fd085f
authored
Aug 31, 2021
by
kongfm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新CTI相关代码
parent
29834cb2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
55 deletions
+36
-55
AlertCalledController.java
...boot/module/tzs/biz/controller/AlertCalledController.java
+3
-3
CtiController.java
...in/amos/boot/module/tzs/biz/controller/CtiController.java
+6
-3
VoiceRecordFileController.java
.../module/tzs/biz/controller/VoiceRecordFileController.java
+12
-7
CtiServiceImpl.java
...amos/boot/module/tzs/biz/service/impl/CtiServiceImpl.java
+9
-40
application-dev.properties
...-system-tzs/src/main/resources/application-dev.properties
+6
-2
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/AlertCalledController.java
View file @
11fd085f
...
@@ -282,15 +282,15 @@ public class AlertCalledController extends BaseController {
...
@@ -282,15 +282,15 @@ public class AlertCalledController extends BaseController {
queryWrapper
.
isNull
(
"father_alert"
);
queryWrapper
.
isNull
(
"father_alert"
);
}
}
if
(
ValidationUtil
.
isEmpty
(
alertCalled
.
getType
()))
{
if
(
!
ValidationUtil
.
isEmpty
(
alertCalled
.
getType
()))
{
queryWrapper
.
eq
(
"type"
,
alertCalled
.
getType
());
queryWrapper
.
eq
(
"type"
,
alertCalled
.
getType
());
}
}
if
(
ValidationUtil
.
isEmpty
(
alertCalled
.
getAlarmType
()))
{
if
(
!
ValidationUtil
.
isEmpty
(
alertCalled
.
getAlarmType
()))
{
queryWrapper
.
eq
(
"alarm_type"
,
alertCalled
.
getAlarmType
());
queryWrapper
.
eq
(
"alarm_type"
,
alertCalled
.
getAlarmType
());
}
}
if
(
ValidationUtil
.
isEmpty
(
alertCalled
.
getAlertSource
()))
{
if
(
!
ValidationUtil
.
isEmpty
(
alertCalled
.
getAlertSource
()))
{
queryWrapper
.
eq
(
"alert_source"
,
alertCalled
.
getAlertSource
());
queryWrapper
.
eq
(
"alert_source"
,
alertCalled
.
getAlertSource
());
}
}
return
queryWrapper
;
return
queryWrapper
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/CtiController.java
View file @
11fd085f
...
@@ -81,10 +81,13 @@ public class CtiController extends BaseController {
...
@@ -81,10 +81,13 @@ public class CtiController extends BaseController {
* @return
* @return
*/
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/info/{
connectI
d}"
)
@GetMapping
(
value
=
"/info/{
serviceconnectioni
d}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取通话话单详情"
,
notes
=
"获取通话话单详情"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取通话话单详情"
,
notes
=
"获取通话话单详情"
)
public
ResponseModel
<
JSONObject
>
getCallInfo
(
@PathVariable
String
connectId
)
{
public
ResponseModel
<
JSONObject
>
getCallInfo
(
@PathVariable
String
serviceconnectionid
)
{
JSONArray
recordInfos
=
ctiService
.
getCallInfo
(
connectId
);
JSONArray
recordInfos
=
ctiService
.
getCallInfo
(
serviceconnectionid
);
if
(
recordInfos
.
size
()
==
0
)
{
throw
new
BadRequest
(
"未找到相关通话信息"
);
}
JSONObject
recordInfo
=
recordInfos
.
getJSONObject
(
0
);
JSONObject
recordInfo
=
recordInfos
.
getJSONObject
(
0
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd'T'HH:mm:ss.SSSZ"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd'T'HH:mm:ss.SSSZ"
);
return
ResponseHelper
.
buildResponse
(
recordInfo
);
return
ResponseHelper
.
buildResponse
(
recordInfo
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/VoiceRecordFileController.java
View file @
11fd085f
...
@@ -116,7 +116,7 @@ public class VoiceRecordFileController extends BaseController {
...
@@ -116,7 +116,7 @@ public class VoiceRecordFileController extends BaseController {
/**
/**
* 新增通话记录
* 新增
-
通话记录
*
*
* @return
* @return
*/
*/
...
@@ -135,13 +135,13 @@ public class VoiceRecordFileController extends BaseController {
...
@@ -135,13 +135,13 @@ public class VoiceRecordFileController extends BaseController {
}
}
JSONObject
recordInfo
=
recordInfos
.
getJSONObject
(
0
);
JSONObject
recordInfo
=
recordInfos
.
getJSONObject
(
0
);
model
.
setTel
(
recordInfo
.
getString
(
"telephone"
));
model
.
setTel
(
recordInfo
.
getString
(
"telephone"
));
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd'T'HH:mm:ss.SSSZ"
);
Date
telStartTime
=
null
;
Date
telStartTime
=
null
;
Date
telEndTime
=
null
;
Date
telEndTime
=
null
;
try
{
try
{
telStartTime
=
sdf
.
pars
e
(
recordInfo
.
getString
(
"connectTime"
));
telStartTime
=
DateUtils
.
longStr2Dat
e
(
recordInfo
.
getString
(
"connectTime"
));
telEndTime
=
sdf
.
pars
e
(
recordInfo
.
getString
(
"hangupTime"
));
telEndTime
=
DateUtils
.
longStr2Dat
e
(
recordInfo
.
getString
(
"hangupTime"
));
}
catch
(
Parse
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
BadRequest
(
"日期转换错误"
);
throw
new
BadRequest
(
"日期转换错误"
);
}
}
model
.
setTelStartTime
(
telStartTime
);
model
.
setTelStartTime
(
telStartTime
);
...
@@ -152,8 +152,13 @@ public class VoiceRecordFileController extends BaseController {
...
@@ -152,8 +152,13 @@ public class VoiceRecordFileController extends BaseController {
model
.
setFileType
(
"坐席呼出"
);
model
.
setFileType
(
"坐席呼出"
);
}
}
// 获取附件
// 获取附件 需要延时5S
Map
<
String
,
String
>
downloadFile
=
ctiService
.
downLoadRecordFile
(
model
.
getConnectId
());
try
{
Thread
.
sleep
(
5000
);
}
catch
(
InterruptedException
e
)
{
e
.
printStackTrace
();
}
Map
<
String
,
String
>
downloadFile
=
ctiService
.
downLoadRecordFile
(
recordInfo
.
getString
(
"connectionid"
));
if
(
downloadFile
.
isEmpty
())
{
if
(
downloadFile
.
isEmpty
())
{
throw
new
BadRequest
(
"未找到附件文件"
);
throw
new
BadRequest
(
"未找到附件文件"
);
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/CtiServiceImpl.java
View file @
11fd085f
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
service
.
impl
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.google.common.collect.Maps
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.FormValue
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.Elevator
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums
;
import
com.yeejoin.amos.boot.module.tzs.api.enums.DispatchPaperEnums
;
import
com.yeejoin.amos.boot.module.tzs.api.mapper.AlertCalledMapper
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IAlertCalledService
;
import
com.yeejoin.amos.boot.module.tzs.api.service.ICtiService
;
import
com.yeejoin.amos.boot.module.tzs.api.service.ICtiService
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.HttpUtils
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.HttpUtils
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.FileInfoModel
;
import
org.apache.commons.fileupload.FileItem
;
import
org.apache.commons.fileupload.FileItemFactory
;
import
org.apache.commons.fileupload.disk.DiskFileItemFactory
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.MediaType
;
import
org.springframework.mock.web.MockMultipartFile
;
import
org.springframework.mock.web.MockMultipartFile
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.commons.CommonsMultipartFile
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.security.MessageDigest
;
import
java.security.MessageDigest
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
...
@@ -70,11 +36,14 @@ public class CtiServiceImpl implements ICtiService {
...
@@ -70,11 +36,14 @@ public class CtiServiceImpl implements ICtiService {
*/
*/
private
long
time
=
6000
l
;
private
long
time
=
6000
l
;
private
final
String
APP_KEY
=
"4e805006-3fef-ae43-3915-a153731007c4"
;
@Value
(
"${tzs.cti.appkey}"
)
private
String
APP_KEY
;
private
final
String
SECRET_KEY
=
"7bd29115-99ee-4f7d-1fb1-7c4719d5f43a"
;
@Value
(
"${tzs.cti.secretkey}"
)
private
String
SECRET_KEY
;
private
String
ctiUrl
=
"http://36.46.151.113:8000"
;
@Value
(
"${tzs.cti.url}"
)
private
String
ctiUrl
;
@Override
@Override
public
String
getAccessToken
()
{
public
String
getAccessToken
()
{
...
@@ -144,11 +113,11 @@ public class CtiServiceImpl implements ICtiService {
...
@@ -144,11 +113,11 @@ public class CtiServiceImpl implements ICtiService {
}
}
@Override
@Override
public
JSONArray
getCallInfo
(
String
connectionid
)
{
public
JSONArray
getCallInfo
(
String
service
connectionid
)
{
String
token
=
this
.
getAccessToken
();
String
token
=
this
.
getAccessToken
();
String
url
=
ctiUrl
+
"/onOpenAuth/cti/openApi/query
call
list1"
;
String
url
=
ctiUrl
+
"/onOpenAuth/cti/openApi/query
service
list1"
;
JSONObject
params
=
new
JSONObject
();
JSONObject
params
=
new
JSONObject
();
params
.
put
(
"
connectionid"
,
connectionid
);
params
.
put
(
"
serviceconnectionid"
,
service
connectionid
);
Map
<
String
,
String
>
header
=
new
HashMap
<>();
Map
<
String
,
String
>
header
=
new
HashMap
<>();
header
.
put
(
"accessToken"
,
token
);
header
.
put
(
"accessToken"
,
token
);
String
responseStr
=
HttpUtils
.
doPostWithHeader
(
url
,
params
.
toJSONString
(),
header
);
String
responseStr
=
HttpUtils
.
doPostWithHeader
(
url
,
params
.
toJSONString
(),
header
);
...
...
amos-boot-system-tzs/src/main/resources/application-dev.properties
View file @
11fd085f
...
@@ -40,4 +40,8 @@ emqx.password=a123456
...
@@ -40,4 +40,8 @@ emqx.password=a123456
## redisʱʱ
## redisʱʱ
redis.cache.failure.time
=
10800
redis.cache.failure.time
=
10800
failure.work.flow.processDefinitionKey
=
malfunction_repair
failure.work.flow.processDefinitionKey
=
malfunction_repair
\ No newline at end of file
tzs.cti.appkey
=
4e805006-3fef-ae43-3915-a153731007c4
tzs.cti.secretkey
=
7bd29115-99ee-4f7d-1fb1-7c4719d5f43a
tzs.cti.url
=
http://36.46.151.113:8000
\ No newline at end of file
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