Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
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
徐少华
midjourney-proxy
Commits
c3870ff6
Commit
c3870ff6
authored
Mar 06, 2020
by
阮思源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1002528 微信语音发送
parent
e89514ee
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
215 additions
and
13 deletions
+215
-13
WechatGroupConsr.java
...om/pcloud/book/consumer/wechatgroup/WechatGroupConsr.java
+10
-0
ReplyTypeEnum.java
...in/java/com/pcloud/book/keywords/enums/ReplyTypeEnum.java
+5
-1
PcloudRobotBizImpl.java
...cloud/book/pcloudkeyword/biz/impl/PcloudRobotBizImpl.java
+15
-0
WelcomeReplyTypeEnum.java
...pcloud/book/pcloudkeyword/enums/WelcomeReplyTypeEnum.java
+5
-1
PcloudRobotSet.java
...ava/com/pcloud/book/pcloudkeyword/set/PcloudRobotSet.java
+2
-2
PersonalStageBizImpl.java
...oud/book/personalstage/biz/impl/PersonalStageBizImpl.java
+23
-2
PersonalStageJumpBizImpl.java
...book/personalstage/biz/impl/PersonalStageJumpBizImpl.java
+82
-0
PersonalStageCheck.java
...m/pcloud/book/personalstage/check/PersonalStageCheck.java
+28
-0
PersonalStageJumpLinkup.java
...ud/book/personalstage/entity/PersonalStageJumpLinkup.java
+33
-1
PersonalStageReplyItem.java
...oud/book/personalstage/entity/PersonalStageReplyItem.java
+1
-1
BaseStageJumpRequestVO.java
...book/personalstage/vo/request/BaseStageJumpRequestVO.java
+1
-0
PersonalStageJumpLinkup.xml
...esources/mapper/personalstage/PersonalStageJumpLinkup.xml
+10
-5
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/consumer/wechatgroup/WechatGroupConsr.java
View file @
c3870ff6
...
@@ -669,4 +669,14 @@ public class WechatGroupConsr {
...
@@ -669,4 +669,14 @@ public class WechatGroupConsr {
}
}
return
serviceState
;
return
serviceState
;
}
}
@ParamLog
(
value
=
"获取机器人信息"
)
public
GroupRobotDTO
getGroupRobotByRobotId
(
String
robotId
)
throws
BizException
{
try
{
return
ResponseHandleUtil
.
parseResponse
(
selfRobotService
.
getGroupRobotByRobotId
(
robotId
),
GroupRobotDTO
.
class
);
}
catch
(
Exception
e
)
{
log
.
error
(
"获取机器人信息失败.[getGroupRobotByRobotId]:"
+
e
.
getMessage
(),
e
);
}
return
null
;
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/keywords/enums/ReplyTypeEnum.java
View file @
c3870ff6
...
@@ -26,7 +26,11 @@ public enum ReplyTypeEnum {
...
@@ -26,7 +26,11 @@ public enum ReplyTypeEnum {
/**
/**
* 资源
* 资源
*/
*/
RESOURCE
(
5
);
RESOURCE
(
5
),
/**
* 语音
*/
AUDIO
(
6
);
/**
/**
* 值
* 值
*/
*/
...
...
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/biz/impl/PcloudRobotBizImpl.java
View file @
c3870ff6
...
@@ -58,6 +58,7 @@ import com.pcloud.common.utils.string.StringUtil;
...
@@ -58,6 +58,7 @@ import com.pcloud.common.utils.string.StringUtil;
import
com.pcloud.contentcenter.resource.dto.ResourceDTO
;
import
com.pcloud.contentcenter.resource.dto.ResourceDTO
;
import
com.pcloud.facade.wechat.service.QrcodeService
;
import
com.pcloud.facade.wechat.service.QrcodeService
;
import
com.pcloud.resourcecenter.product.dto.ProductDto
;
import
com.pcloud.resourcecenter.product.dto.ProductDto
;
import
com.pcloud.wechatgroup.group.dto.GroupRobotDTO
;
import
com.pcloud.wechatgroup.message.dto.SendTextDTO
;
import
com.pcloud.wechatgroup.message.dto.SendTextDTO
;
import
com.pcloud.wechatgroup.selfrobot.dto.RobotBaseInfoDTO
;
import
com.pcloud.wechatgroup.selfrobot.dto.RobotBaseInfoDTO
;
import
com.sdk.wxgroup.SendFileVO
;
import
com.sdk.wxgroup.SendFileVO
;
...
@@ -65,6 +66,8 @@ import com.sdk.wxgroup.SendMessageTypeEnum;
...
@@ -65,6 +66,8 @@ import com.sdk.wxgroup.SendMessageTypeEnum;
import
com.sdk.wxgroup.SendPicMessageVO
;
import
com.sdk.wxgroup.SendPicMessageVO
;
import
com.sdk.wxgroup.SendTextMessageVO
;
import
com.sdk.wxgroup.SendTextMessageVO
;
import
com.sdk.wxgroup.WxGroupSDK
;
import
com.sdk.wxgroup.WxGroupSDK
;
import
com.sdk.wxgroup.im.mimc.BusinessConstant
;
import
com.sdk.wxgroup.im.mimc.dto.SendMomentsDTO
;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.commons.collections.MapUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -341,6 +344,18 @@ public class PcloudRobotBizImpl implements PcloudRobotBiz {
...
@@ -341,6 +344,18 @@ public class PcloudRobotBizImpl implements PcloudRobotBiz {
sendFileVO
.
setWxId
(
userWxId
);
sendFileVO
.
setWxId
(
userWxId
);
sendFileVO
.
setCode
(
SendMessageTypeEnum
.
SELF
.
getCode
());
sendFileVO
.
setCode
(
SendMessageTypeEnum
.
SELF
.
getCode
());
WxGroupSDK
.
sendFile
(
sendFileVO
);
WxGroupSDK
.
sendFile
(
sendFileVO
);
}
else
if
(
WelcomeReplyTypeEnum
.
AUDIO
.
value
.
equals
(
replyType
)){
SendMomentsDTO
sendMomentsDTO
=
new
SendMomentsDTO
();
GroupRobotDTO
info
=
wechatGroupConsr
.
getGroupRobotByRobotId
(
robotWxId
);
if
(
info
!=
null
){
sendMomentsDTO
.
setIsMasterWx
(
info
.
getMasterWx
());
sendMomentsDTO
.
setReceiveAccount
(
info
.
getMac
());
}
sendMomentsDTO
.
setMomentType
(
BusinessConstant
.
MomentTypeEnum
.
SEND_WX_RECORD
);
sendMomentsDTO
.
setContent
(
userWxId
);
sendMomentsDTO
.
setLink
(
robotWelcome
.
getResourceUrl
());
sendMomentsDTO
.
setIp
(
ip
);
WxGroupSDK
.
sendMessageToPhone
(
sendMomentsDTO
);
}
}
}
}
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/enums/WelcomeReplyTypeEnum.java
View file @
c3870ff6
...
@@ -14,7 +14,11 @@ public enum WelcomeReplyTypeEnum {
...
@@ -14,7 +14,11 @@ public enum WelcomeReplyTypeEnum {
/**
/**
* 资源
* 资源
*/
*/
RESOURCE
(
5
);
RESOURCE
(
5
),
/**
* 语音
*/
AUDIO
(
6
);
/**
/**
* 值
* 值
*/
*/
...
...
pcloud-service-book/src/main/java/com/pcloud/book/pcloudkeyword/set/PcloudRobotSet.java
View file @
c3870ff6
...
@@ -47,7 +47,7 @@ public class PcloudRobotSet {
...
@@ -47,7 +47,7 @@ public class PcloudRobotSet {
List
<
Long
>
resourceIds
=
new
ArrayList
<>();
List
<
Long
>
resourceIds
=
new
ArrayList
<>();
for
(
PcloudRobotWelcome
robotWelcome
:
robotWelcomeList
){
for
(
PcloudRobotWelcome
robotWelcome
:
robotWelcomeList
){
Integer
type
=
robotWelcome
.
getReplyType
();
Integer
type
=
robotWelcome
.
getReplyType
();
if
(
WelcomeReplyTypeEnum
.
RESOURCE
.
value
.
equals
(
type
)){
if
(
WelcomeReplyTypeEnum
.
RESOURCE
.
value
.
equals
(
type
)
||
WelcomeReplyTypeEnum
.
AUDIO
.
value
.
equals
(
type
)
){
resourceIds
.
add
(
robotWelcome
.
getResourceId
());
resourceIds
.
add
(
robotWelcome
.
getResourceId
());
}
}
}
}
...
@@ -57,7 +57,7 @@ public class PcloudRobotSet {
...
@@ -57,7 +57,7 @@ public class PcloudRobotSet {
}
}
for
(
PcloudRobotWelcome
robotWelcome
:
robotWelcomeList
){
for
(
PcloudRobotWelcome
robotWelcome
:
robotWelcomeList
){
Integer
type
=
robotWelcome
.
getReplyType
();
Integer
type
=
robotWelcome
.
getReplyType
();
if
(
WelcomeReplyTypeEnum
.
RESOURCE
.
value
.
equals
(
type
)){
if
(
WelcomeReplyTypeEnum
.
RESOURCE
.
value
.
equals
(
type
)
||
WelcomeReplyTypeEnum
.
AUDIO
.
value
.
equals
(
type
)
){
ResourceDTO
resourceDTO
=
resourceDTOMap
.
get
(
robotWelcome
.
getResourceId
());
ResourceDTO
resourceDTO
=
resourceDTOMap
.
get
(
robotWelcome
.
getResourceId
());
if
(
resourceDTO
!=
null
){
if
(
resourceDTO
!=
null
){
robotWelcome
.
setResourceName
(
resourceDTO
.
getResourceName
());
robotWelcome
.
setResourceName
(
resourceDTO
.
getResourceName
());
...
...
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/biz/impl/PersonalStageBizImpl.java
View file @
c3870ff6
...
@@ -41,12 +41,15 @@ import com.pcloud.common.utils.cache.redis.JedisClusterUtils;
...
@@ -41,12 +41,15 @@ import com.pcloud.common.utils.cache.redis.JedisClusterUtils;
import
com.pcloud.common.utils.httpclient.UrlUtils
;
import
com.pcloud.common.utils.httpclient.UrlUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.contentcenter.resource.dto.ResourceDTO
;
import
com.pcloud.contentcenter.resource.dto.ResourceDTO
;
import
com.pcloud.wechatgroup.group.dto.GroupRobotDTO
;
import
com.pcloud.wechatgroup.group.dto.GroupUserDTO
;
import
com.pcloud.wechatgroup.group.dto.GroupUserDTO
;
import
com.sdk.wxgroup.SendFileVO
;
import
com.sdk.wxgroup.SendFileVO
;
import
com.sdk.wxgroup.SendMessageTypeEnum
;
import
com.sdk.wxgroup.SendMessageTypeEnum
;
import
com.sdk.wxgroup.SendPicMessageVO
;
import
com.sdk.wxgroup.SendPicMessageVO
;
import
com.sdk.wxgroup.SendTextMessageVO
;
import
com.sdk.wxgroup.SendTextMessageVO
;
import
com.sdk.wxgroup.WxGroupSDK
;
import
com.sdk.wxgroup.WxGroupSDK
;
import
com.sdk.wxgroup.im.mimc.BusinessConstant
;
import
com.sdk.wxgroup.im.mimc.dto.SendMomentsDTO
;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.commons.collections.MapUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -198,14 +201,15 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
...
@@ -198,14 +201,15 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
if
(
ListUtils
.
isEmpty
(
replyItems
)){
if
(
ListUtils
.
isEmpty
(
replyItems
)){
return
;
return
;
}
}
List
<
Long
>
resourceIds
=
replyItems
.
stream
().
filter
(
s
->
ReplyTypeEnum
.
RESOURCE
.
value
.
equals
(
s
.
getReplyType
())&&
s
.
getResourceId
()!=
null
).
map
(
PersonalStageReplyItem:
:
getResourceId
).
collect
(
Collectors
.
toList
());
List
<
Long
>
resourceIds
=
replyItems
.
stream
().
filter
(
s
->(
ReplyTypeEnum
.
RESOURCE
.
value
.
equals
(
s
.
getReplyType
())
||
ReplyTypeEnum
.
AUDIO
.
value
.
equals
(
s
.
getReplyType
()))&&
s
.
getResourceId
()!=
null
).
map
(
PersonalStageReplyItem:
:
getResourceId
).
collect
(
Collectors
.
toList
());
if
(
ListUtils
.
isEmpty
(
resourceIds
)){
if
(
ListUtils
.
isEmpty
(
resourceIds
)){
return
;
return
;
}
}
Map
<
Long
,
ResourceDTO
>
resourceDTOMap
=
resourceConsr
.
mapByIds
(
resourceIds
);
Map
<
Long
,
ResourceDTO
>
resourceDTOMap
=
resourceConsr
.
mapByIds
(
resourceIds
);
for
(
PersonalStageReplyItem
item:
replyItems
){
for
(
PersonalStageReplyItem
item:
replyItems
){
Integer
type
=
item
.
getReplyType
();
Integer
type
=
item
.
getReplyType
();
if
(
ReplyTypeEnum
.
RESOURCE
.
value
.
equals
(
type
)){
if
(
ReplyTypeEnum
.
RESOURCE
.
value
.
equals
(
type
)
||
ReplyTypeEnum
.
AUDIO
.
value
.
equals
(
type
)
){
ResourceDTO
resourceDTO
=
resourceDTOMap
.
get
(
item
.
getResourceId
());
ResourceDTO
resourceDTO
=
resourceDTOMap
.
get
(
item
.
getResourceId
());
if
(
resourceDTO
!=
null
){
if
(
resourceDTO
!=
null
){
item
.
setResourceName
(
resourceDTO
.
getResourceName
());
item
.
setResourceName
(
resourceDTO
.
getResourceName
());
...
@@ -846,6 +850,23 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
...
@@ -846,6 +850,23 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
sendFileVO
.
setWxId
(
userWxId
);
sendFileVO
.
setWxId
(
userWxId
);
WxGroupSDK
.
sendFile
(
sendFileVO
);
WxGroupSDK
.
sendFile
(
sendFileVO
);
}
}
if
(
ReplyTypeEnum
.
AUDIO
.
value
.
equals
(
type
))
{
SendMomentsDTO
sendMomentsDTO
=
new
SendMomentsDTO
();
Map
<
Long
,
ResourceDTO
>
map
=
resourceConsr
.
mapByIds
(
Arrays
.
asList
(
item
.
getResourceId
()));
ResourceDTO
resourceDTO
=
map
.
get
(
item
.
getResourceId
());
if
(
resourceDTO
!=
null
)
{
GroupRobotDTO
info
=
wechatGroupConsr
.
getGroupRobotByRobotId
(
robotId
);
if
(
info
!=
null
){
sendMomentsDTO
.
setIsMasterWx
(
info
.
getMasterWx
());
sendMomentsDTO
.
setReceiveAccount
(
info
.
getMac
());
}
sendMomentsDTO
.
setMomentType
(
BusinessConstant
.
MomentTypeEnum
.
SEND_WX_RECORD
);
sendMomentsDTO
.
setContent
(
userWxId
);
sendMomentsDTO
.
setLink
(
resourceDTO
.
getFileUrl
());
sendMomentsDTO
.
setIp
(
ip
);
WxGroupSDK
.
sendMessageToPhone
(
sendMomentsDTO
);
}
}
}
}
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/biz/impl/PersonalStageJumpBizImpl.java
View file @
c3870ff6
...
@@ -4,6 +4,7 @@ import com.pcloud.book.base.exception.BookBizException;
...
@@ -4,6 +4,7 @@ import com.pcloud.book.base.exception.BookBizException;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.pcloud.book.book.entity.Book
;
import
com.pcloud.book.book.entity.Book
;
import
com.pcloud.book.consumer.content.ResourceConsr
;
import
com.pcloud.book.consumer.feedback.FeedbackConsr
;
import
com.pcloud.book.consumer.feedback.FeedbackConsr
;
import
com.pcloud.book.consumer.wechatgroup.WechatGroupConsr
;
import
com.pcloud.book.consumer.wechatgroup.WechatGroupConsr
;
import
com.pcloud.book.group.biz.WeixinQrcodeBiz
;
import
com.pcloud.book.group.biz.WeixinQrcodeBiz
;
...
@@ -16,6 +17,7 @@ import com.pcloud.book.pcloudkeyword.entity.PcloudRobot;
...
@@ -16,6 +17,7 @@ import com.pcloud.book.pcloudkeyword.entity.PcloudRobot;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobotClassify
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobotClassify
;
import
com.pcloud.book.personalstage.biz.PersonalStageBiz
;
import
com.pcloud.book.personalstage.biz.PersonalStageBiz
;
import
com.pcloud.book.personalstage.biz.PersonalStageJumpBiz
;
import
com.pcloud.book.personalstage.biz.PersonalStageJumpBiz
;
import
com.pcloud.book.personalstage.check.PersonalStageCheck
;
import
com.pcloud.book.personalstage.constant.PersonalStageConstant
;
import
com.pcloud.book.personalstage.constant.PersonalStageConstant
;
import
com.pcloud.book.personalstage.dao.*
;
import
com.pcloud.book.personalstage.dao.*
;
import
com.pcloud.book.personalstage.dto.*
;
import
com.pcloud.book.personalstage.dto.*
;
...
@@ -39,6 +41,7 @@ import com.pcloud.common.utils.NumberUtil;
...
@@ -39,6 +41,7 @@ import com.pcloud.common.utils.NumberUtil;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.common.utils.httpclient.UrlUtils
;
import
com.pcloud.common.utils.httpclient.UrlUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.contentcenter.resource.dto.ResourceDTO
;
import
com.pcloud.feedback.paper.dto.PaperAndQuestionDto
;
import
com.pcloud.feedback.paper.dto.PaperAndQuestionDto
;
import
com.pcloud.wechatgroup.group.dto.GroupRobotDTO
;
import
com.pcloud.wechatgroup.group.dto.GroupRobotDTO
;
import
com.pcloud.wechatgroup.group.dto.GroupUserDTO
;
import
com.pcloud.wechatgroup.group.dto.GroupUserDTO
;
...
@@ -46,6 +49,8 @@ import com.sdk.wxgroup.SendMessageTypeEnum;
...
@@ -46,6 +49,8 @@ import com.sdk.wxgroup.SendMessageTypeEnum;
import
com.sdk.wxgroup.SendPicMessageVO
;
import
com.sdk.wxgroup.SendPicMessageVO
;
import
com.sdk.wxgroup.SendTextMessageVO
;
import
com.sdk.wxgroup.SendTextMessageVO
;
import
com.sdk.wxgroup.WxGroupSDK
;
import
com.sdk.wxgroup.WxGroupSDK
;
import
com.sdk.wxgroup.im.mimc.BusinessConstant
;
import
com.sdk.wxgroup.im.mimc.dto.SendMomentsDTO
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -98,6 +103,10 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -98,6 +103,10 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
private
PersonalStageProgressMessageDao
personalStageProgressMessageDao
;
private
PersonalStageProgressMessageDao
personalStageProgressMessageDao
;
@Autowired
@Autowired
private
FeedbackConsr
feedbackConsr
;
private
FeedbackConsr
feedbackConsr
;
@Autowired
private
PersonalStageCheck
personalStageCheck
;
@Autowired
private
ResourceConsr
resourceConsr
;
@Value
(
"${system.env}"
)
@Value
(
"${system.env}"
)
private
String
envStr
;
private
String
envStr
;
...
@@ -128,6 +137,7 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -128,6 +137,7 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
if
(
vo
.
getOpenEmail
()){
if
(
vo
.
getOpenEmail
()){
this
.
checkEmail
(
vo
.
getEmails
());
this
.
checkEmail
(
vo
.
getEmails
());
}
}
checkAudioReply
(
vo
.
getLinkups
());
PersonalStageJump
personalStageJump
=
CreateStageJumpRequestVO
.
valueToJumpEntity
(
vo
);
PersonalStageJump
personalStageJump
=
CreateStageJumpRequestVO
.
valueToJumpEntity
(
vo
);
personalStageJumpDao
.
insert
(
personalStageJump
);
personalStageJumpDao
.
insert
(
personalStageJump
);
List
<
PersonalStageJumpKeyword
>
jumpKeywords
=
BaseStageJumpRequestVO
.
valueToJumpKeywords
(
vo
,
personalStageJump
.
getId
());
List
<
PersonalStageJumpKeyword
>
jumpKeywords
=
BaseStageJumpRequestVO
.
valueToJumpKeywords
(
vo
,
personalStageJump
.
getId
());
...
@@ -145,6 +155,15 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -145,6 +155,15 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
}
}
}
}
@ParamLog
(
"校验语音"
)
private
void
checkAudioReply
(
List
<
PersonalStageJumpLinkup
>
linkups
)
{
if
(
ListUtils
.
isEmpty
(
linkups
)){
return
;
}
List
<
Long
>
audioIds
=
linkups
.
stream
().
filter
(
s
->
ReplyTypeEnum
.
AUDIO
.
value
.
equals
(
s
.
getReplyType
())&&
s
.
getResourceId
()!=
null
).
map
(
PersonalStageJumpLinkup:
:
getResourceId
).
collect
(
Collectors
.
toList
());
personalStageCheck
.
checkAudioLimit60S
(
audioIds
);
}
@ParamLog
(
"人工客服结束阶段跳转配置唯一性"
)
@ParamLog
(
"人工客服结束阶段跳转配置唯一性"
)
private
void
checkOnlyOneEndServiceJump
(
Long
personalStageId
,
Long
personalStageJumpId
)
{
private
void
checkOnlyOneEndServiceJump
(
Long
personalStageId
,
Long
personalStageJumpId
)
{
List
<
PersonalStageJump
>
stageJumps
=
personalStageJumpDao
.
getByJumpType
(
personalStageId
,
JumpTypeEnum
.
END_SERVICE
.
key
);
List
<
PersonalStageJump
>
stageJumps
=
personalStageJumpDao
.
getByJumpType
(
personalStageId
,
JumpTypeEnum
.
END_SERVICE
.
key
);
...
@@ -204,12 +223,42 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -204,12 +223,42 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
if
(
ListUtils
.
isEmpty
(
linkups
)){
if
(
ListUtils
.
isEmpty
(
linkups
)){
return
;
return
;
}
}
fillLinkupResource
(
linkups
);
Map
<
Long
,
List
<
PersonalStageJumpLinkup
>>
mapJumpLinkups
=
linkups
.
stream
().
collect
(
Collectors
.
groupingBy
(
x
->
x
.
getPersonalStageJumpId
()));
Map
<
Long
,
List
<
PersonalStageJumpLinkup
>>
mapJumpLinkups
=
linkups
.
stream
().
collect
(
Collectors
.
groupingBy
(
x
->
x
.
getPersonalStageJumpId
()));
for
(
PersonalStageJumpDto
jumpDto
:
recordList
){
for
(
PersonalStageJumpDto
jumpDto
:
recordList
){
jumpDto
.
setJumpLinkups
(
mapJumpLinkups
.
getOrDefault
(
jumpDto
.
getId
(),
Lists
.
newArrayList
()));
jumpDto
.
setJumpLinkups
(
mapJumpLinkups
.
getOrDefault
(
jumpDto
.
getId
(),
Lists
.
newArrayList
()));
}
}
}
}
@ParamLog
(
"填充资源信息"
)
private
void
fillLinkupResource
(
List
<
PersonalStageJumpLinkup
>
linkups
)
{
if
(
ListUtils
.
isEmpty
(
linkups
)){
return
;
}
List
<
Long
>
resourceIds
=
linkups
.
stream
().
filter
(
s
->(
ReplyTypeEnum
.
RESOURCE
.
value
.
equals
(
s
.
getReplyType
())
||
ReplyTypeEnum
.
AUDIO
.
value
.
equals
(
s
.
getReplyType
()))&&
s
.
getResourceId
()!=
null
).
map
(
PersonalStageJumpLinkup:
:
getResourceId
).
collect
(
Collectors
.
toList
());
if
(
ListUtils
.
isEmpty
(
resourceIds
)){
return
;
}
Map
<
Long
,
ResourceDTO
>
resourceDTOMap
=
resourceConsr
.
mapByIds
(
resourceIds
);
for
(
PersonalStageJumpLinkup
item:
linkups
){
Integer
type
=
item
.
getReplyType
();
if
(
ReplyTypeEnum
.
RESOURCE
.
value
.
equals
(
type
)||
ReplyTypeEnum
.
AUDIO
.
value
.
equals
(
type
)){
ResourceDTO
resourceDTO
=
resourceDTOMap
.
get
(
item
.
getResourceId
());
if
(
resourceDTO
!=
null
){
item
.
setResourceName
(
resourceDTO
.
getResourceName
());
item
.
setResourceUrl
(
resourceDTO
.
getFileUrl
());
item
.
setResourceTypeCode
(
resourceDTO
.
getTypeCode
());
item
.
setResourceTypeName
(
resourceDTO
.
getTypeName
());
item
.
setFileType
(
resourceDTO
.
getFileType
());
item
.
setResourcePdfItems
(
resourceDTO
.
getResourcePdfItems
());
item
.
setResourceOfficeItemDTOs
(
resourceDTO
.
getResourceOfficeItemDTOs
());
item
.
setFileSize
(
resourceDTO
.
getFileSize
());
}
}
}
}
@ParamLog
(
"填充跳转关键字列表"
)
@ParamLog
(
"填充跳转关键字列表"
)
private
void
fillJumpKeywords
(
List
<
PersonalStageJumpDto
>
recordList
)
{
private
void
fillJumpKeywords
(
List
<
PersonalStageJumpDto
>
recordList
)
{
List
<
Long
>
jumpIds
=
recordList
.
stream
().
map
(
x
->
x
.
getId
()).
collect
(
Collectors
.
toList
());
List
<
Long
>
jumpIds
=
recordList
.
stream
().
map
(
x
->
x
.
getId
()).
collect
(
Collectors
.
toList
());
...
@@ -242,6 +291,7 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -242,6 +291,7 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
if
(
vo
.
getOpenEmail
()){
if
(
vo
.
getOpenEmail
()){
this
.
checkEmail
(
vo
.
getEmails
());
this
.
checkEmail
(
vo
.
getEmails
());
}
}
checkAudioReply
(
vo
.
getLinkups
());
PersonalStageJump
personalStageJump
=
UpdateStageJumpRequestVO
.
valueToJumpEntity
(
vo
);
PersonalStageJump
personalStageJump
=
UpdateStageJumpRequestVO
.
valueToJumpEntity
(
vo
);
personalStageJumpDao
.
update
(
personalStageJump
);
personalStageJumpDao
.
update
(
personalStageJump
);
//删除原有的关键词
//删除原有的关键词
...
@@ -433,6 +483,22 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -433,6 +483,22 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
sendPicMessageVO
.
setIp
(
linkupDelayDTO
.
getIp
());
sendPicMessageVO
.
setIp
(
linkupDelayDTO
.
getIp
());
sendPicMessageVO
.
setCode
(
SendMessageTypeEnum
.
SELF
.
getCode
());
sendPicMessageVO
.
setCode
(
SendMessageTypeEnum
.
SELF
.
getCode
());
WxGroupSDK
.
sendPicMessage
(
sendPicMessageVO
);
WxGroupSDK
.
sendPicMessage
(
sendPicMessageVO
);
}
else
if
(
ReplyTypeEnum
.
AUDIO
.
value
.
equals
(
jumpLinkup
.
getReplyType
())){
SendMomentsDTO
sendMomentsDTO
=
new
SendMomentsDTO
();
Map
<
Long
,
ResourceDTO
>
map
=
resourceConsr
.
mapByIds
(
Arrays
.
asList
(
jumpLinkup
.
getResourceId
()));
ResourceDTO
resourceDTO
=
map
.
get
(
jumpLinkup
.
getResourceId
());
if
(
resourceDTO
!=
null
)
{
GroupRobotDTO
info
=
wechatGroupConsr
.
getGroupRobotByRobotId
(
linkupDelayDTO
.
getRobotId
());
if
(
info
!=
null
){
sendMomentsDTO
.
setIsMasterWx
(
info
.
getMasterWx
());
sendMomentsDTO
.
setReceiveAccount
(
info
.
getMac
());
}
sendMomentsDTO
.
setMomentType
(
BusinessConstant
.
MomentTypeEnum
.
SEND_WX_RECORD
);
sendMomentsDTO
.
setContent
(
dto
.
getKey
());
sendMomentsDTO
.
setLink
(
resourceDTO
.
getFileUrl
());
sendMomentsDTO
.
setIp
(
linkupDelayDTO
.
getIp
());
WxGroupSDK
.
sendMessageToPhone
(
sendMomentsDTO
);
}
}
}
}
}
...
@@ -697,6 +763,22 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -697,6 +763,22 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
sendPicMessageVO
.
setIp
(
ip
);
sendPicMessageVO
.
setIp
(
ip
);
sendPicMessageVO
.
setCode
(
SendMessageTypeEnum
.
SELF
.
getCode
());
sendPicMessageVO
.
setCode
(
SendMessageTypeEnum
.
SELF
.
getCode
());
WxGroupSDK
.
sendPicMessage
(
sendPicMessageVO
);
WxGroupSDK
.
sendPicMessage
(
sendPicMessageVO
);
}
else
if
(
ReplyTypeEnum
.
AUDIO
.
value
.
equals
(
jumpLinkup
.
getReplyType
())){
SendMomentsDTO
sendMomentsDTO
=
new
SendMomentsDTO
();
Map
<
Long
,
ResourceDTO
>
map
=
resourceConsr
.
mapByIds
(
Arrays
.
asList
(
jumpLinkup
.
getResourceId
()));
ResourceDTO
resourceDTO
=
map
.
get
(
jumpLinkup
.
getResourceId
());
if
(
resourceDTO
!=
null
)
{
GroupRobotDTO
info
=
wechatGroupConsr
.
getGroupRobotByRobotId
(
robotWxId
);
if
(
info
!=
null
){
sendMomentsDTO
.
setIsMasterWx
(
info
.
getMasterWx
());
sendMomentsDTO
.
setReceiveAccount
(
info
.
getMac
());
}
sendMomentsDTO
.
setMomentType
(
BusinessConstant
.
MomentTypeEnum
.
SEND_WX_RECORD
);
sendMomentsDTO
.
setContent
(
userWxId
);
sendMomentsDTO
.
setLink
(
resourceDTO
.
getFileUrl
());
sendMomentsDTO
.
setIp
(
ip
);
WxGroupSDK
.
sendMessageToPhone
(
sendMomentsDTO
);
}
}
}
}
}
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/check/PersonalStageCheck.java
View file @
c3870ff6
package
com
.
pcloud
.
book
.
personalstage
.
check
;
package
com
.
pcloud
.
book
.
personalstage
.
check
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.consumer.content.ResourceConsr
;
import
com.pcloud.book.keywords.enums.ReplyTypeEnum
;
import
com.pcloud.book.keywords.enums.ReplyTypeEnum
;
import
com.pcloud.book.personalstage.entity.PersonalStage
;
import
com.pcloud.book.personalstage.entity.PersonalStage
;
import
com.pcloud.book.personalstage.entity.PersonalStageReply
;
import
com.pcloud.book.personalstage.entity.PersonalStageReply
;
...
@@ -9,13 +10,20 @@ import com.pcloud.book.personalstage.entity.PersonalStageWakeup;
...
@@ -9,13 +10,20 @@ import com.pcloud.book.personalstage.entity.PersonalStageWakeup;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.contentcenter.resource.dto.ResourceDTO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
@Component
(
"定制化参数校验"
)
@Component
(
"定制化参数校验"
)
public
class
PersonalStageCheck
{
public
class
PersonalStageCheck
{
@Autowired
private
ResourceConsr
resourceConsr
;
@ParamLog
(
"新增定制化阶段参数校验"
)
@ParamLog
(
"新增定制化阶段参数校验"
)
public
void
createPersonalStageParamCheck
(
PersonalStage
personalStage
)
{
public
void
createPersonalStageParamCheck
(
PersonalStage
personalStage
)
{
if
(
personalStage
==
null
){
if
(
personalStage
==
null
){
...
@@ -90,6 +98,7 @@ public class PersonalStageCheck {
...
@@ -90,6 +98,7 @@ public class PersonalStageCheck {
@ParamLog
(
"校验回复项"
)
@ParamLog
(
"校验回复项"
)
private
void
checkReplayItems
(
List
<
PersonalStageReplyItem
>
list
)
{
private
void
checkReplayItems
(
List
<
PersonalStageReplyItem
>
list
)
{
List
<
Long
>
audioIds
=
new
ArrayList
<>();
for
(
PersonalStageReplyItem
item:
list
){
for
(
PersonalStageReplyItem
item:
list
){
if
(
item
==
null
){
if
(
item
==
null
){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"回复项不能为空!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"回复项不能为空!"
);
...
@@ -106,6 +115,25 @@ public class PersonalStageCheck {
...
@@ -106,6 +115,25 @@ public class PersonalStageCheck {
if
(
ReplyTypeEnum
.
RESOURCE
.
value
.
equals
(
item
.
getReplyType
())&&
item
.
getResourceId
()==
null
){
if
(
ReplyTypeEnum
.
RESOURCE
.
value
.
equals
(
item
.
getReplyType
())&&
item
.
getResourceId
()==
null
){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"资源id不能为空!"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"资源id不能为空!"
);
}
}
if
(
ReplyTypeEnum
.
AUDIO
.
value
.
equals
(
item
.
getReplyType
())){
audioIds
.
add
(
item
.
getResourceId
());
}
}
checkAudioLimit60S
(
audioIds
);
}
@ParamLog
(
"校验语音不超过60s"
)
public
void
checkAudioLimit60S
(
List
<
Long
>
resourceIds
){
if
(!
ListUtils
.
isEmpty
(
resourceIds
)){
Map
<
Long
,
ResourceDTO
>
map
=
resourceConsr
.
mapByIds
(
resourceIds
);
if
(
map
!=
null
){
for
(
Long
audioId:
resourceIds
){
ResourceDTO
resourceDTO
=
map
.
get
(
audioId
);
if
(
resourceDTO
!=
null
&&
resourceDTO
.
getDuration
()!=
null
&&
resourceDTO
.
getDuration
().
doubleValue
()-
60
>
0
){
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"音频不能超过60s!"
);
}
}
}
}
}
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/entity/PersonalStageJumpLinkup.java
View file @
c3870ff6
package
com
.
pcloud
.
book
.
personalstage
.
entity
;
package
com
.
pcloud
.
book
.
personalstage
.
entity
;
import
com.pcloud.common.entity.BaseEntity
;
import
com.pcloud.common.entity.BaseEntity
;
import
com.pcloud.contentcenter.resource.dto.ResourceOfficeItemDTO
;
import
com.pcloud.contentcenter.resource.dto.ResourcePdfItemDTO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.List
;
@ApiModel
(
"定制化阶段跳转衔接语"
)
@ApiModel
(
"定制化阶段跳转衔接语"
)
@Data
@Data
public
class
PersonalStageJumpLinkup
extends
BaseEntity
{
public
class
PersonalStageJumpLinkup
extends
BaseEntity
{
...
@@ -18,10 +22,37 @@ public class PersonalStageJumpLinkup extends BaseEntity {
...
@@ -18,10 +22,37 @@ public class PersonalStageJumpLinkup extends BaseEntity {
@ApiModelProperty
(
"距离阶段开始时间"
)
@ApiModelProperty
(
"距离阶段开始时间"
)
private
Integer
toStageStartTime
;
private
Integer
toStageStartTime
;
@ApiModelProperty
(
"类型:1:文字;2:图片;"
)
@ApiModelProperty
(
"类型:1:文字;2:图片;
6语音
"
)
private
Integer
replyType
;
private
Integer
replyType
;
@ApiModelProperty
(
"图片链接"
)
@ApiModelProperty
(
"图片链接"
)
private
String
picUrl
;
private
String
picUrl
;
@ApiModelProperty
(
"资源id"
)
private
Long
resourceId
;
@ApiModelProperty
(
"资源链接"
)
private
String
resourceUrl
;
@ApiModelProperty
(
"资源名称"
)
private
String
resourceName
;
@ApiModelProperty
(
"资源类型编码"
)
private
String
resourceTypeCode
;
@ApiModelProperty
(
"资源类型名称"
)
private
String
resourceTypeName
;
@ApiModelProperty
(
"文件类型"
)
private
String
fileType
;
@ApiModelProperty
(
"pdf转码后的单张图片集合"
)
private
List
<
ResourcePdfItemDTO
>
resourcePdfItems
;
@ApiModelProperty
(
"文件转码后的单张图片集合"
)
private
List
<
ResourceOfficeItemDTO
>
resourceOfficeItemDTOs
;
@ApiModelProperty
(
"文件大小"
)
private
Long
fileSize
;
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/entity/PersonalStageReplyItem.java
View file @
c3870ff6
...
@@ -16,7 +16,7 @@ public class PersonalStageReplyItem extends BaseEntity {
...
@@ -16,7 +16,7 @@ public class PersonalStageReplyItem extends BaseEntity {
@ApiModelProperty
(
"定制化阶段回复id"
)
@ApiModelProperty
(
"定制化阶段回复id"
)
private
Long
personalStageReplyId
;
private
Long
personalStageReplyId
;
@ApiModelProperty
(
"回复类型 1 文字 2 图片 3 链接 4应用 5素材"
)
@ApiModelProperty
(
"回复类型 1 文字 2 图片 3 链接 4应用 5素材
6语音
"
)
private
Integer
replyType
;
private
Integer
replyType
;
@ApiModelProperty
(
"内容"
)
@ApiModelProperty
(
"内容"
)
...
...
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/vo/request/BaseStageJumpRequestVO.java
View file @
c3870ff6
...
@@ -84,6 +84,7 @@ public abstract class BaseStageJumpRequestVO extends BaseRequestVO {
...
@@ -84,6 +84,7 @@ public abstract class BaseStageJumpRequestVO extends BaseRequestVO {
jumpLinkup
.
setToStageStartTime
(
linkup
.
getToStageStartTime
());
jumpLinkup
.
setToStageStartTime
(
linkup
.
getToStageStartTime
());
jumpLinkup
.
setReplyType
((
null
==
linkup
.
getReplyType
()
||
linkup
.
getReplyType
()
==
0
?
1
:
linkup
.
getReplyType
()));
jumpLinkup
.
setReplyType
((
null
==
linkup
.
getReplyType
()
||
linkup
.
getReplyType
()
==
0
?
1
:
linkup
.
getReplyType
()));
jumpLinkup
.
setPicUrl
(
linkup
.
getPicUrl
());
jumpLinkup
.
setPicUrl
(
linkup
.
getPicUrl
());
jumpLinkup
.
setResourceId
(
linkup
.
getResourceId
());
jumpLinkups
.
add
(
jumpLinkup
);
jumpLinkups
.
add
(
jumpLinkup
);
}
}
return
jumpLinkups
;
return
jumpLinkups
;
...
...
pcloud-service-book/src/main/resources/mapper/personalstage/PersonalStageJumpLinkup.xml
View file @
c3870ff6
...
@@ -9,10 +9,11 @@
...
@@ -9,10 +9,11 @@
<result
property=
"toStageStartTime"
column=
"to_stage_start_time"
jdbcType=
"INTEGER"
/>
<result
property=
"toStageStartTime"
column=
"to_stage_start_time"
jdbcType=
"INTEGER"
/>
<result
property=
"replyType"
column=
"reply_type"
jdbcType=
"INTEGER"
/>
<result
property=
"replyType"
column=
"reply_type"
jdbcType=
"INTEGER"
/>
<result
property=
"picUrl"
column=
"pic_url"
jdbcType=
"VARCHAR"
/>
<result
property=
"picUrl"
column=
"pic_url"
jdbcType=
"VARCHAR"
/>
<result
property=
"resourceId"
column=
"resource_id"
jdbcType=
"BIGINT"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, personal_stage_jump_id, linkup_content, to_stage_start_time, reply_type, pic_url
id, personal_stage_jump_id, linkup_content, to_stage_start_time, reply_type, pic_url
, resource_id
</sql>
</sql>
<select
id=
"getById"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
<select
id=
"getById"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
...
@@ -56,14 +57,16 @@
...
@@ -56,14 +57,16 @@
linkup_content,
linkup_content,
to_stage_start_time,
to_stage_start_time,
reply_type,
reply_type,
pic_url
pic_url,
resource_id
</trim>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
#{personalStageJumpId,jdbcType=BIGINT},
#{personalStageJumpId,jdbcType=BIGINT},
#{linkupContent,jdbcType=VARCHAR},
#{linkupContent,jdbcType=VARCHAR},
#{toStageStartTime,jdbcType=INTEGER},
#{toStageStartTime,jdbcType=INTEGER},
#{replyType,jdbcType=INTEGER},
#{replyType,jdbcType=INTEGER},
#{picUrl,jdbcType=VARCHAR}
#{picUrl,jdbcType=VARCHAR},
#{resourceId,jdbcType=BIGINT}
</trim>
</trim>
</insert>
</insert>
...
@@ -74,7 +77,8 @@
...
@@ -74,7 +77,8 @@
linkup_content,
linkup_content,
to_stage_start_time,
to_stage_start_time,
reply_type,
reply_type,
pic_url
pic_url,
resource_id
</trim>
</trim>
values
values
<foreach
collection=
"list"
item=
"item"
separator=
","
>
<foreach
collection=
"list"
item=
"item"
separator=
","
>
...
@@ -83,7 +87,8 @@
...
@@ -83,7 +87,8 @@
#{item.linkupContent,jdbcType=VARCHAR},
#{item.linkupContent,jdbcType=VARCHAR},
#{item.toStageStartTime,jdbcType=INTEGER},
#{item.toStageStartTime,jdbcType=INTEGER},
#{item.replyType,jdbcType=INTEGER},
#{item.replyType,jdbcType=INTEGER},
#{item.picUrl,jdbcType=VARCHAR}
#{item.picUrl,jdbcType=VARCHAR},
#{item.resourceId,jdbcType=BIGINT}
</trim>
</trim>
</foreach>
</foreach>
</insert>
</insert>
...
...
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