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
07acfc1d
Commit
07acfc1d
authored
Mar 06, 2020
by
阮思源
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat-1002509' into 'master'
1002509客服介入结束控制用户跨过当前阶段 See merge request rays/pcloud-book!515
parents
1e777734
60197661
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
142 additions
and
3 deletions
+142
-3
PersonalStageJumpBiz.java
...m/pcloud/book/personalstage/biz/PersonalStageJumpBiz.java
+5
-0
PersonalStageJumpBizImpl.java
...book/personalstage/biz/impl/PersonalStageJumpBizImpl.java
+93
-2
EndServiceJumpNextDTO.java
.../pcloud/book/personalstage/dto/EndServiceJumpNextDTO.java
+20
-0
JumpTypeEnum.java
...ava/com/pcloud/book/personalstage/enums/JumpTypeEnum.java
+2
-1
PersonalStageFacade.java
...pcloud/book/personalstage/facade/PersonalStageFacade.java
+22
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/biz/PersonalStageJumpBiz.java
View file @
07acfc1d
package
com
.
pcloud
.
book
.
personalstage
.
biz
;
package
com
.
pcloud
.
book
.
personalstage
.
biz
;
import
com.pcloud.book.personalstage.dto.LinkClickRecordDTO
;
import
com.pcloud.book.personalstage.dto.LinkClickRecordDTO
;
import
com.pcloud.book.personalstage.dto.EndServiceJumpNextDTO
;
import
com.pcloud.book.personalstage.dto.PersonalStageJumpDto
;
import
com.pcloud.book.personalstage.dto.PersonalStageJumpDto
;
import
com.pcloud.book.personalstage.enums.JumpTypeEnum
;
import
com.pcloud.book.personalstage.enums.JumpTypeEnum
;
import
com.pcloud.book.personalstage.vo.request.CreateStageJumpRequestVO
;
import
com.pcloud.book.personalstage.vo.request.CreateStageJumpRequestVO
;
...
@@ -92,4 +93,8 @@ public interface PersonalStageJumpBiz {
...
@@ -92,4 +93,8 @@ public interface PersonalStageJumpBiz {
* @param dto
* @param dto
*/
*/
void
delayPaper
(
DelayQueueDTO
dto
);
void
delayPaper
(
DelayQueueDTO
dto
);
Boolean
getHasEndServiceJump
(
Long
personalStageId
);
void
endServiceJumpNext
(
EndServiceJumpNextDTO
endServiceJumpNextDTO
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/biz/impl/PersonalStageJumpBizImpl.java
View file @
07acfc1d
...
@@ -115,12 +115,16 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -115,12 +115,16 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
createPersonalStageJump
(
CreateStageJumpRequestVO
vo
)
{
public
void
createPersonalStageJump
(
CreateStageJumpRequestVO
vo
)
{
//校验关键词是否重复
//校验关键词是否重复
if
(!
JumpTypeEnum
.
PAY_TRIGGER
.
key
.
equals
(
vo
.
getJumpType
())
&&
!
JumpTypeEnum
.
PAPER_TRIGGER
.
key
.
equals
(
vo
.
getJumpType
())){
if
(!
JumpTypeEnum
.
PAY_TRIGGER
.
key
.
equals
(
vo
.
getJumpType
())
&&
!
JumpTypeEnum
.
PAPER_TRIGGER
.
key
.
equals
(
vo
.
getJumpType
())
&&!
JumpTypeEnum
.
END_SERVICE
.
key
.
equals
(
vo
.
getJumpType
())){
this
.
checkKeywords
(
vo
.
getKeywords
(),
vo
.
getPersonalStageId
(),
null
);
this
.
checkKeywords
(
vo
.
getKeywords
(),
vo
.
getPersonalStageId
(),
null
);
}
}
if
(
JumpTypeEnum
.
PAPER_TRIGGER
.
key
.
equals
(
vo
.
getJumpType
())){
if
(
JumpTypeEnum
.
PAPER_TRIGGER
.
key
.
equals
(
vo
.
getJumpType
())){
this
.
checkPaper
(
vo
.
getPersonalStageId
(),
null
);
this
.
checkPaper
(
vo
.
getPersonalStageId
(),
null
);
}
}
if
(
JumpTypeEnum
.
END_SERVICE
.
key
.
equals
(
vo
.
getJumpType
())){
checkOnlyOneEndServiceJump
(
vo
.
getPersonalStageId
(),
null
);
}
if
(
vo
.
getOpenEmail
()){
if
(
vo
.
getOpenEmail
()){
this
.
checkEmail
(
vo
.
getEmails
());
this
.
checkEmail
(
vo
.
getEmails
());
}
}
...
@@ -141,6 +145,22 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -141,6 +145,22 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
}
}
}
}
@ParamLog
(
"人工客服结束阶段跳转配置唯一性"
)
private
void
checkOnlyOneEndServiceJump
(
Long
personalStageId
,
Long
personalStageJumpId
)
{
List
<
PersonalStageJump
>
stageJumps
=
personalStageJumpDao
.
getByJumpType
(
personalStageId
,
JumpTypeEnum
.
END_SERVICE
.
key
);
if
(!
ListUtils
.
isEmpty
(
stageJumps
)){
if
(
personalStageJumpId
==
null
){
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"已有其他阶段跳转配置了人工客服结束跳转"
);
}
else
{
//判断是不是旧的已有的修改
List
<
Long
>
jumpIds
=
stageJumps
.
stream
().
filter
(
s
->
s
.
getId
()!=
null
).
map
(
PersonalStageJump:
:
getId
).
collect
(
Collectors
.
toList
());
if
(!
jumpIds
.
contains
(
personalStageJumpId
)){
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"已有其他阶段跳转配置了人工客服结束跳转"
);
}
}
}
}
@Override
@Override
@ParamLog
(
"获取跳转设置列表"
)
@ParamLog
(
"获取跳转设置列表"
)
public
PageBeanNew
getJumpList
(
Long
personalStageId
,
Integer
currentPage
,
Integer
numPerPage
)
{
public
PageBeanNew
getJumpList
(
Long
personalStageId
,
Integer
currentPage
,
Integer
numPerPage
)
{
...
@@ -209,12 +229,16 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -209,12 +229,16 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
@ParamLog
(
"修改跳转阶段"
)
@ParamLog
(
"修改跳转阶段"
)
public
void
updatePersonalStageJump
(
UpdateStageJumpRequestVO
vo
)
{
public
void
updatePersonalStageJump
(
UpdateStageJumpRequestVO
vo
)
{
//校验关键词是否重复
//校验关键词是否重复
if
(!
JumpTypeEnum
.
PAY_TRIGGER
.
key
.
equals
(
vo
.
getJumpType
())
&&
!
JumpTypeEnum
.
PAPER_TRIGGER
.
key
.
equals
(
vo
.
getJumpType
())){
if
(!
JumpTypeEnum
.
PAY_TRIGGER
.
key
.
equals
(
vo
.
getJumpType
())
&&
!
JumpTypeEnum
.
PAPER_TRIGGER
.
key
.
equals
(
vo
.
getJumpType
())
&&!
JumpTypeEnum
.
END_SERVICE
.
key
.
equals
(
vo
.
getJumpType
())){
this
.
checkKeywords
(
vo
.
getKeywords
(),
vo
.
getPersonalStageId
(),
vo
.
getPersonalStageJumpId
());
this
.
checkKeywords
(
vo
.
getKeywords
(),
vo
.
getPersonalStageId
(),
vo
.
getPersonalStageJumpId
());
}
}
if
(
JumpTypeEnum
.
PAPER_TRIGGER
.
key
.
equals
(
vo
.
getJumpType
())){
if
(
JumpTypeEnum
.
PAPER_TRIGGER
.
key
.
equals
(
vo
.
getJumpType
())){
this
.
checkPaper
(
vo
.
getPersonalStageId
(),
vo
.
getPersonalStageJumpId
());
this
.
checkPaper
(
vo
.
getPersonalStageId
(),
vo
.
getPersonalStageJumpId
());
}
}
if
(
JumpTypeEnum
.
END_SERVICE
.
key
.
equals
(
vo
.
getJumpType
())){
checkOnlyOneEndServiceJump
(
vo
.
getPersonalStageId
(),
vo
.
getPersonalStageJumpId
());
}
if
(
vo
.
getOpenEmail
()){
if
(
vo
.
getOpenEmail
()){
this
.
checkEmail
(
vo
.
getEmails
());
this
.
checkEmail
(
vo
.
getEmails
());
}
}
...
@@ -496,6 +520,73 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -496,6 +520,73 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
}
}
}
}
@ParamLog
(
"获取定制化阶段是否含有人工客服结束跳转"
)
@Override
public
Boolean
getHasEndServiceJump
(
Long
personalStageId
)
{
if
(
personalStageId
==
null
){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"参数为空!"
);
}
List
<
PersonalStageJump
>
jumps
=
personalStageJumpDao
.
getByJumpType
(
personalStageId
,
JumpTypeEnum
.
END_SERVICE
.
key
);
if
(
ListUtils
.
isEmpty
(
jumps
)){
return
false
;
}
return
true
;
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@ParamLog
(
"获取定制化阶段是否含有人工客服结束跳转"
)
@Override
public
void
endServiceJumpNext
(
EndServiceJumpNextDTO
endServiceJumpNextDTO
)
{
if
(
endServiceJumpNextDTO
==
null
){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"参数为空!"
);
}
if
(
endServiceJumpNextDTO
.
getPersonalStageId
()==
null
){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"阶段id参数为空!"
);
}
if
(
StringUtil
.
isEmpty
(
endServiceJumpNextDTO
.
getRobotId
())){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"机器人id参数为空!"
);
}
if
(
StringUtil
.
isEmpty
(
endServiceJumpNextDTO
.
getWxId
())){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"用户id参数为空!"
);
}
String
wxId
=
endServiceJumpNextDTO
.
getWxId
();
String
robotId
=
endServiceJumpNextDTO
.
getRobotId
();
Long
personalStageId
=
endServiceJumpNextDTO
.
getPersonalStageId
();
PersonalStageUser
last
=
personalStageUserDao
.
getLast
(
wxId
,
robotId
,
personalStageId
);
if
(
last
==
null
){
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"用户无阶段!"
);
}
if
(!
last
.
getPersonalStageId
().
equals
(
personalStageId
)){
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"用户已不在当前阶段!"
);
}
//查询跳转
List
<
PersonalStageJump
>
jumps
=
personalStageJumpDao
.
getByJumpType
(
personalStageId
,
JumpTypeEnum
.
END_SERVICE
.
key
);
if
(
ListUtils
.
isEmpty
(
jumps
)){
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"没有该类型的跳转的阶段!"
);
}
PersonalStageJump
personalStageJump
=
jumps
.
get
(
0
);
Long
afterStageId
=
personalStageJump
.
getAfterPersonalStageId
();
Long
stageJumpId
=
personalStageJump
.
getId
();
if
(
afterStageId
==
null
){
throw
new
BookBizException
(
BookBizException
.
ERROR
,
"没有下一阶段!"
);
}
if
(
personalStageJump
.
getOpenEmail
()!=
null
&&
personalStageJump
.
getOpenEmail
()){
PersonalStageJumpKeywordDto
jumpKeywordDto
=
new
PersonalStageJumpKeywordDto
();
jumpKeywordDto
.
setAfterPersonalStageId
(
afterStageId
);
jumpKeywordDto
.
setPersonalStageJumpId
(
stageJumpId
);
String
content
=
"如果读者提交了对方案的反馈意见,请到“定制服务”中查看。"
;
sendEmail
(
wxId
,
robotId
,
content
,
jumpKeywordDto
);
}
GroupRobotDTO
groupRobotDTO
=
wechatGroupConsr
.
getGroupRobotByWxId
(
robotId
);
String
ip
=
weixinQrcodeBiz
.
getRobotIpByGeneration
(
groupRobotDTO
.
getVersion
());
// 将用户置为下个阶段
PersonalStageUser
nextPersonalStageUser
=
personalStageBiz
.
nextStageAddStageUserAndWakeupDelay
(
robotId
,
wxId
,
ip
,
afterStageId
);
// 发送内容衔接语
sendJumpLinkups
(
wxId
,
robotId
,
ip
,
stageJumpId
,
nextPersonalStageUser
.
getId
());
// 停止发送引导语
pcloudGuideBiz
.
stopPcloudGuidePush
(
robotId
,
wxId
);
}
@ParamLog
(
"发送阶段跳转邮件"
)
@ParamLog
(
"发送阶段跳转邮件"
)
private
void
sendEmail
(
String
userWxId
,
String
robotWxId
,
String
content
,
PersonalStageJumpKeywordDto
jumpKeywordDto
)
{
private
void
sendEmail
(
String
userWxId
,
String
robotWxId
,
String
content
,
PersonalStageJumpKeywordDto
jumpKeywordDto
)
{
try
{
try
{
...
...
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/dto/EndServiceJumpNextDTO.java
0 → 100644
View file @
07acfc1d
package
com
.
pcloud
.
book
.
personalstage
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
EndServiceJumpNextDTO
implements
Serializable
{
@ApiModelProperty
(
"机器人id"
)
private
String
robotId
;
@ApiModelProperty
(
"微信Id"
)
private
String
wxId
;
@ApiModelProperty
(
"阶段id"
)
private
Long
personalStageId
;
}
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/enums/JumpTypeEnum.java
View file @
07acfc1d
...
@@ -5,7 +5,8 @@ public enum JumpTypeEnum {
...
@@ -5,7 +5,8 @@ public enum JumpTypeEnum {
READER_TRIGGER
(
1
,
"读者输入关键词触发"
),
READER_TRIGGER
(
1
,
"读者输入关键词触发"
),
ROBOT_TRIGGER
(
2
,
"小睿发送关键词触发"
),
ROBOT_TRIGGER
(
2
,
"小睿发送关键词触发"
),
PAY_TRIGGER
(
3
,
"转账触发"
),
PAY_TRIGGER
(
3
,
"转账触发"
),
PAPER_TRIGGER
(
4
,
"需求定制单触发"
);
PAPER_TRIGGER
(
4
,
"需求定制单触发"
),
END_SERVICE
(
5
,
"人工客服结束触发"
);
public
final
Integer
key
;
public
final
Integer
key
;
public
final
String
desc
;
public
final
String
desc
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/facade/PersonalStageFacade.java
View file @
07acfc1d
...
@@ -3,6 +3,7 @@ package com.pcloud.book.personalstage.facade;
...
@@ -3,6 +3,7 @@ package com.pcloud.book.personalstage.facade;
import
com.pcloud.book.personalstage.biz.PersonalStageBiz
;
import
com.pcloud.book.personalstage.biz.PersonalStageBiz
;
import
com.pcloud.book.personalstage.biz.PersonalStageProgressMessageBiz
;
import
com.pcloud.book.personalstage.biz.PersonalStageProgressMessageBiz
;
import
com.pcloud.book.personalstage.dto.LinkClickRecordDTO
;
import
com.pcloud.book.personalstage.dto.LinkClickRecordDTO
;
import
com.pcloud.book.personalstage.dto.EndServiceJumpNextDTO
;
import
com.pcloud.book.personalstage.dto.PersonalStageProgressDTO
;
import
com.pcloud.book.personalstage.dto.PersonalStageProgressDTO
;
import
com.pcloud.book.personalstage.entity.PersonalStage
;
import
com.pcloud.book.personalstage.entity.PersonalStage
;
import
com.pcloud.book.personalstage.entity.PersonalStageProgressMessage
;
import
com.pcloud.book.personalstage.entity.PersonalStageProgressMessage
;
...
@@ -267,4 +268,25 @@ public class PersonalStageFacade {
...
@@ -267,4 +268,25 @@ public class PersonalStageFacade {
personalStageJumpBiz
.
addLinkClickRecord
(
linkClickRecordDTO
);
personalStageJumpBiz
.
addLinkClickRecord
(
linkClickRecordDTO
);
return
new
ResponseDto
<>();
return
new
ResponseDto
<>();
}
}
@ApiOperation
(
"获取定制化阶段是否含有人工客服结束跳转"
)
@GetMapping
(
"/getHasEndServiceJump"
)
public
ResponseDto
<?>
getEndServiceJump
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestParam
(
"personalStageId"
)
@ApiParam
(
"阶段id"
)
Long
personalStageId
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
return
new
ResponseDto
<>(
personalStageJumpBiz
.
getHasEndServiceJump
(
personalStageId
));
}
@ApiOperation
(
"人工客服阶段跳转"
)
@PostMapping
(
"/endServiceJumpNext"
)
public
ResponseDto
<?>
endServiceJumpNext
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
,
@RequestBody
@ApiParam
(
"人工客服阶段跳转"
)
EndServiceJumpNextDTO
endServiceJumpNextDTO
)
throws
BizException
,
PermissionException
{
SessionUtil
.
getVlaue
(
token
,
SessionUtil
.
PARTY_ID
);
personalStageJumpBiz
.
endServiceJumpNext
(
endServiceJumpNextDTO
);
return
new
ResponseDto
<>();
}
}
}
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