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
db24cc45
Commit
db24cc45
authored
Nov 10, 2021
by
kongfm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新通话记录相关内容
parent
21c55b94
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
80 additions
and
12 deletions
+80
-12
RedisKey.java
...java/com/yeejoin/amos/boot/biz/common/utils/RedisKey.java
+3
-0
WechatController.java
...amos/boot/module/tzs/biz/controller/WechatController.java
+0
-5
CtiServiceImpl.java
...amos/boot/module/tzs/biz/service/impl/CtiServiceImpl.java
+1
-0
VoiceRecordFileServiceImpl.java
...dule/tzs/biz/service/impl/VoiceRecordFileServiceImpl.java
+2
-0
VoiceRecordLogServiceImpl.java
...odule/tzs/biz/service/impl/VoiceRecordLogServiceImpl.java
+52
-1
WechatServiceImpl.java
...s/boot/module/tzs/biz/service/impl/WechatServiceImpl.java
+0
-4
application-dev.properties
...-system-tzs/src/main/resources/application-dev.properties
+6
-2
application-qa.properties
...t-system-tzs/src/main/resources/application-qa.properties
+4
-0
tzs-1.0.0.0.xml
...ystem-tzs/src/main/resources/db/changelog/tzs-1.0.0.0.xml
+12
-0
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/RedisKey.java
View file @
db24cc45
...
...
@@ -36,6 +36,9 @@ public class RedisKey {
public
static
final
String
WECHAT_JS_TOKEN
=
"wechat_js_token"
;
/**警情联系人*/
public
static
final
String
CONTACT_USER
=
"contact_user"
;
/**联通CTIuser token */
public
static
final
String
CTI_USER_TOKEN
=
"cti_user_token"
;
/** 驼峰转下划线(简单写法,效率低于 ) */
public
static
String
humpToLine
(
String
str
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/WechatController.java
View file @
db24cc45
...
...
@@ -3,18 +3,14 @@ package com.yeejoin.amos.boot.module.tzs.biz.controller;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
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.RedisUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto
;
import
com.yeejoin.amos.boot.module.common.api.service.ISourceFileService
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.SignatureDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatAccessDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatMessageDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBusinessListDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBussinessDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatRelationDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatTaskLatLonDto
;
...
...
@@ -45,7 +41,6 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.mock.web.MockMultipartFile
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
...
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 @
db24cc45
...
...
@@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.mock.web.MockMultipartFile
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.security.MessageDigest
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/VoiceRecordFileServiceImpl.java
View file @
db24cc45
...
...
@@ -77,6 +77,8 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,V
VoiceRecordLog
log
=
new
VoiceRecordLog
();
log
.
setAlertId
(
model
.
getAlertId
());
log
.
setConnectId
(
model
.
getConnectId
());
log
.
setIsDeal
(
false
);
log
.
setDealTimes
(
0
);
iVoiceRecordLogServiceImpl
.
save
(
log
);
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/VoiceRecordLogServiceImpl.java
View file @
db24cc45
...
...
@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONArray;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
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.RedisUtils
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.VoiceRecordFileDto
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.VoiceRecordLog
;
...
...
@@ -11,6 +13,11 @@ import com.yeejoin.amos.boot.module.tzs.api.mapper.VoiceRecordLogMapper;
import
com.yeejoin.amos.boot.module.tzs.api.service.ICtiService
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IVoiceRecordLogService
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.VoiceRecordLogDto
;
import
com.yeejoin.amos.component.feign.config.TokenOperation
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.IdPasswordAuthModel
;
import
com.yeejoin.amos.feign.privilege.util.DesUtil
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.eclipse.paho.client.mqttv3.MqttException
;
...
...
@@ -18,11 +25,13 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -40,6 +49,8 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi
@Autowired
ICtiService
ctiService
;
@Autowired
RedisUtils
redisUtils
;
@Autowired
AlertCalledServiceImpl
iAlertCalledService
;
...
...
@@ -53,11 +64,32 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi
private
String
ctiMessage
;
@Value
(
"${cti.user.name}"
)
private
String
ctiUserName
;
@Value
(
"${cti.user.pwd}"
)
private
String
ctiUserPwd
;
@Autowired
private
VoiceRecordFileServiceImpl
voiceRecordFileServiceImpl
;
@Scheduled
(
fixedDelay
=
ONE_Minute
)
public
void
fixedDelayJob
(){
// 需要登录后台账号
RequestContext
.
setAppKey
(
"AMOS_STUDIO"
);
RequestContext
.
setProduct
(
"AMOS_STUDIO_WEB"
);
if
(
redisUtils
.
hasKey
(
RedisKey
.
CTI_USER_TOKEN
))
{
// 验证token
boolean
validToken
=
TokenOperation
.
refresh
(
redisUtils
.
get
(
RedisKey
.
CTI_USER_TOKEN
).
toString
());
if
(!
validToken
)
{
// 登陆
loginCtiUser
();
}
}
else
{
// 登陆
loginCtiUser
();
}
String
ctiToken
=
redisUtils
.
get
(
RedisKey
.
CTI_USER_TOKEN
).
toString
();
RequestContext
.
setToken
(
ctiToken
);
// 首先查找未完成 且失败次数少于5 的 记录
List
<
VoiceRecordLog
>
logList
=
this
.
list
(
new
LambdaQueryWrapper
<
VoiceRecordLog
>().
eq
(
VoiceRecordLog:
:
getIsDeal
,
false
).
lt
(
VoiceRecordLog:
:
getDealTimes
,
5
));
if
(
logList
!=
null
&&
logList
.
size
()
>
0
)
{
...
...
@@ -98,7 +130,14 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi
model
.
setFileType
(
"坐席呼出"
);
}
Map
<
String
,
String
>
downloadFile
=
ctiService
.
downLoadRecordFile
(
recordInfo
.
getString
(
"connectionid"
));
Map
<
String
,
String
>
downloadFile
=
null
;
try
{
downloadFile
=
ctiService
.
downLoadRecordFile
(
recordInfo
.
getString
(
"connectionid"
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
this
.
updateById
(
l
);
return
;
}
if
(
downloadFile
.
isEmpty
())
{
this
.
updateById
(
l
);
return
;
...
...
@@ -132,6 +171,18 @@ public class VoiceRecordLogServiceImpl extends BaseService<VoiceRecordLogDto,Voi
}
private
void
loginCtiUser
()
{
String
passwd
=
DesUtil
.
encode
(
ctiUserPwd
,
"qaz"
);
IdPasswordAuthModel
loninData
=
new
IdPasswordAuthModel
();
loninData
.
setLoginId
(
ctiUserName
);
loninData
.
setPassword
(
passwd
);
FeignClientResult
loginResult
=
Privilege
.
authClient
.
idpassword
(
loninData
);
if
(
loginResult
.
getStatus
()
==
200
)
{
HashMap
resultMap
=
(
HashMap
)
loginResult
.
getResult
();
redisUtils
.
set
(
RedisKey
.
CTI_USER_TOKEN
,
resultMap
.
get
(
"token"
).
toString
(),
25920000
l
);
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/WechatServiceImpl.java
View file @
db24cc45
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
...
...
@@ -9,8 +8,6 @@ import com.yeejoin.amos.boot.module.tzs.api.service.IWechatService;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.HttpUtils
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
org.apache.http.Header
;
import
org.apache.http.HeaderElement
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.mock.web.MockMultipartFile
;
...
...
@@ -18,7 +15,6 @@ import org.springframework.stereotype.Service;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.Map
;
...
...
amos-boot-system-tzs/src/main/resources/application-dev.properties
View file @
db24cc45
...
...
@@ -71,4 +71,8 @@ mqtt.topic.alertHeart.push=/tzs/tcb_alertHeart
mqtt.topic.alertMatrix.push
=
/tzs/tcb_alertMatrix
mqtt.topic.cti.push
=
/cti/record
\ No newline at end of file
mqtt.topic.cti.push
=
/cti/record
cti.user.name
=
tzs_cti
cti.user.pwd
=
a1234567
\ No newline at end of file
amos-boot-system-tzs/src/main/resources/application-qa.properties
View file @
db24cc45
...
...
@@ -77,3 +77,7 @@ mqtt.topic.alertHeart.push=/tzs/tcb_alertHeart
mqtt.topic.alertMatrix.push
=
/tzs/tcb_alertMatrix
mqtt.topic.cti.push
=
/cti/record
cti.user.name
=
tzs_cti
cti.user.pwd
=
a1234567
amos-boot-system-tzs/src/main/resources/db/changelog/tzs-1.0.0.0.xml
View file @
db24cc45
...
...
@@ -91,6 +91,18 @@
</sql>
</changeSet>
<changeSet
author=
"kongfm"
id=
"2021-11-10-01"
>
<preConditions
onFail=
"MARK_RAN"
>
<tableExists
tableName=
"tz_voice_record_file"
/>
</preConditions>
<comment>
modify tz_voice_record_file field
</comment>
<sql>
alter table tz_voice_record_file modify rec_user_id bigint(30) NULL COMMENT '更新人id';
alter table tz_voice_record_file modify rec_user_name varchar(100) NULL COMMENT '更新人名称';
alter table tz_voice_record_file modify rec_date datetime NULL COMMENT '更新时间';
</sql>
</changeSet>
</databaseChangeLog>
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