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
54dde52b
Commit
54dde52b
authored
Mar 09, 2020
by
裴大威
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat-1002542' into 'master'
【1002542】通过定制方案单跨阶段 See merge request rays/pcloud-book!532
parents
3ff16fd5
b2d4efbc
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
123 additions
and
5 deletions
+123
-5
PersonalStageJumpBiz.java
...m/pcloud/book/personalstage/biz/PersonalStageJumpBiz.java
+3
-1
PersonalStageBizImpl.java
...oud/book/personalstage/biz/impl/PersonalStageBizImpl.java
+4
-1
PersonalStageJumpBizImpl.java
...book/personalstage/biz/impl/PersonalStageJumpBizImpl.java
+84
-2
PlanJumpNextDTO.java
...va/com/pcloud/book/personalstage/dto/PlanJumpNextDTO.java
+20
-0
JumpTypeEnum.java
...ava/com/pcloud/book/personalstage/enums/JumpTypeEnum.java
+2
-1
PersonalStageFacade.java
...pcloud/book/personalstage/facade/PersonalStageFacade.java
+10
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/biz/PersonalStageJumpBiz.java
View file @
54dde52b
...
@@ -3,6 +3,7 @@ package com.pcloud.book.personalstage.biz;
...
@@ -3,6 +3,7 @@ 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.EndServiceJumpNextDTO
;
import
com.pcloud.book.personalstage.dto.PersonalStageJumpDto
;
import
com.pcloud.book.personalstage.dto.PersonalStageJumpDto
;
import
com.pcloud.book.personalstage.dto.PlanJumpNextDTO
;
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
;
import
com.pcloud.book.personalstage.vo.request.UpdateStageJumpRequestVO
;
import
com.pcloud.book.personalstage.vo.request.UpdateStageJumpRequestVO
;
...
@@ -106,11 +107,12 @@ public interface PersonalStageJumpBiz {
...
@@ -106,11 +107,12 @@ public interface PersonalStageJumpBiz {
void
endServiceJumpNext
(
EndServiceJumpNextDTO
endServiceJumpNextDTO
);
void
endServiceJumpNext
(
EndServiceJumpNextDTO
endServiceJumpNextDTO
);
void
planJumpNext
(
PlanJumpNextDTO
planJumpNextDTO
);
/**
/**
* 删除用户的需求单记录
* 删除用户的需求单记录
* @param robotId
* @param robotId
* @param userWxId
* @param userWxId
*/
*/
public
void
deletePaperRecord
(
String
robotId
,
String
userWxId
);
public
void
deletePaperRecord
(
String
robotId
,
String
userWxId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/biz/impl/PersonalStageBizImpl.java
View file @
54dde52b
...
@@ -48,6 +48,7 @@ import com.pcloud.common.page.PageBean;
...
@@ -48,6 +48,7 @@ import com.pcloud.common.page.PageBean;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.page.PageParam
;
import
com.pcloud.common.utils.DateUtils
;
import
com.pcloud.common.utils.DateUtils
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ListUtils
;
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
;
...
@@ -742,8 +743,10 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
...
@@ -742,8 +743,10 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
if
(
content
.
indexOf
(
PersonalStageConstant
.
CUSTOM_PLAN
)
>
-
1
)
{
if
(
content
.
indexOf
(
PersonalStageConstant
.
CUSTOM_PLAN
)
>
-
1
)
{
String
url
=
wechatLinkPrefix
+
"/personalCenter/madeProject?"
;
String
url
=
wechatLinkPrefix
+
"/personalCenter/madeProject?"
;
Integer
planId
=
customPlanModuleSuggestionMapper
.
getLatestPlanId
(
userWxId
);
Integer
planId
=
customPlanModuleSuggestionMapper
.
getLatestPlanId
(
userWxId
);
//查询该用户最后的阶段
PersonalStageUser
last
=
personalStageUserDao
.
getLast
(
userWxId
,
robotId
,
null
);
if
(
null
!=
planId
)
{
if
(
null
!=
planId
)
{
String
longUrl
=
url
+
"planId="
+
planId
+
"&wxId="
+
userWxId
+
"&robotWxId="
+
robotId
;
String
longUrl
=
url
+
"planId="
+
planId
+
"&wxId="
+
userWxId
+
"&robotWxId="
+
robotId
+
(
last
!=
null
&&
NumberUtil
.
isNumber
(
last
.
getPersonalStageId
())
&&
last
.
getPersonalStageId
()
>
0
?
"&personalStageId="
+
last
.
getPersonalStageId
()
:
""
)
;
content
=
content
.
replace
(
PersonalStageConstant
.
CUSTOM_PLAN
,
UrlUtils
.
getShortUrl4Own
(
longUrl
));
content
=
content
.
replace
(
PersonalStageConstant
.
CUSTOM_PLAN
,
UrlUtils
.
getShortUrl4Own
(
longUrl
));
}
}
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/biz/impl/PersonalStageJumpBizImpl.java
View file @
54dde52b
...
@@ -125,7 +125,7 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -125,7 +125,7 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
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
())){
&&!
JumpTypeEnum
.
END_SERVICE
.
key
.
equals
(
vo
.
getJumpType
())
&&!
JumpTypeEnum
.
PLAN_TRIGGER
.
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
())){
...
@@ -134,6 +134,9 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -134,6 +134,9 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
if
(
JumpTypeEnum
.
END_SERVICE
.
key
.
equals
(
vo
.
getJumpType
())){
if
(
JumpTypeEnum
.
END_SERVICE
.
key
.
equals
(
vo
.
getJumpType
())){
checkOnlyOneEndServiceJump
(
vo
.
getPersonalStageId
(),
null
);
checkOnlyOneEndServiceJump
(
vo
.
getPersonalStageId
(),
null
);
}
}
if
(
JumpTypeEnum
.
PLAN_TRIGGER
.
key
.
equals
(
vo
.
getJumpType
())){
checkOnlyOnePlanJump
(
vo
.
getPersonalStageId
(),
null
);
}
if
(
vo
.
getOpenEmail
()){
if
(
vo
.
getOpenEmail
()){
this
.
checkEmail
(
vo
.
getEmails
());
this
.
checkEmail
(
vo
.
getEmails
());
}
}
...
@@ -180,6 +183,22 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -180,6 +183,22 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
}
}
}
}
@ParamLog
(
"人工客服结束阶段跳转配置唯一性"
)
private
void
checkOnlyOnePlanJump
(
Long
personalStageId
,
Long
personalStageJumpId
)
{
List
<
PersonalStageJump
>
stageJumps
=
personalStageJumpDao
.
getByJumpType
(
personalStageId
,
JumpTypeEnum
.
PLAN_TRIGGER
.
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
)
{
...
@@ -279,7 +298,7 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -279,7 +298,7 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
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
())){
&&!
JumpTypeEnum
.
END_SERVICE
.
key
.
equals
(
vo
.
getJumpType
())
&&!
JumpTypeEnum
.
PLAN_TRIGGER
.
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
())){
...
@@ -288,6 +307,9 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -288,6 +307,9 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
if
(
JumpTypeEnum
.
END_SERVICE
.
key
.
equals
(
vo
.
getJumpType
())){
if
(
JumpTypeEnum
.
END_SERVICE
.
key
.
equals
(
vo
.
getJumpType
())){
checkOnlyOneEndServiceJump
(
vo
.
getPersonalStageId
(),
vo
.
getPersonalStageJumpId
());
checkOnlyOneEndServiceJump
(
vo
.
getPersonalStageId
(),
vo
.
getPersonalStageJumpId
());
}
}
if
(
JumpTypeEnum
.
PLAN_TRIGGER
.
key
.
equals
(
vo
.
getJumpType
())){
checkOnlyOnePlanJump
(
vo
.
getPersonalStageId
(),
vo
.
getPersonalStageJumpId
());
}
if
(
vo
.
getOpenEmail
()){
if
(
vo
.
getOpenEmail
()){
this
.
checkEmail
(
vo
.
getEmails
());
this
.
checkEmail
(
vo
.
getEmails
());
}
}
...
@@ -689,6 +711,66 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -689,6 +711,66 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
pcloudGuideBiz
.
stopPcloudGuidePush
(
robotId
,
wxId
);
pcloudGuideBiz
.
stopPcloudGuidePush
(
robotId
,
wxId
);
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@ParamLog
(
"获取定制化阶段是否含有方案跳转"
)
@Override
public
void
planJumpNext
(
PlanJumpNextDTO
planJumpNextDTO
)
{
if
(
planJumpNextDTO
==
null
){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"参数为空!"
);
}
if
(
planJumpNextDTO
.
getPersonalStageId
()==
null
){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"阶段id参数为空!"
);
}
if
(
StringUtil
.
isEmpty
(
planJumpNextDTO
.
getRobotWxId
())){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"机器人id参数为空!"
);
}
if
(
StringUtil
.
isEmpty
(
planJumpNextDTO
.
getWxId
())){
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_NULL
,
"用户id参数为空!"
);
}
String
wxId
=
planJumpNextDTO
.
getWxId
();
String
robotId
=
planJumpNextDTO
.
getRobotWxId
();
Long
personalStageId
=
planJumpNextDTO
.
getPersonalStageId
();
PersonalStageUser
last
=
personalStageUserDao
.
getLast
(
wxId
,
robotId
,
personalStageId
);
if
(
last
==
null
){
LOGGER
.
info
(
"用户无阶段,无法进行方案跳转!"
);
return
;
}
if
(!
last
.
getPersonalStageId
().
equals
(
personalStageId
)){
LOGGER
.
info
(
"用户已不在当前阶段,无法进行方案跳转!"
);
return
;
}
//查询跳转
List
<
PersonalStageJump
>
jumps
=
personalStageJumpDao
.
getByJumpType
(
personalStageId
,
JumpTypeEnum
.
PLAN_TRIGGER
.
key
);
if
(
ListUtils
.
isEmpty
(
jumps
)){
LOGGER
.
info
(
"没有该类型的跳转的阶段,无法进行方案跳转!"
);
return
;
}
PersonalStageJump
personalStageJump
=
jumps
.
get
(
0
);
Long
afterStageId
=
personalStageJump
.
getAfterPersonalStageId
();
Long
stageJumpId
=
personalStageJump
.
getId
();
if
(
afterStageId
==
null
){
LOGGER
.
info
(
"没有下一阶段,无法进行方案跳转!"
);
return
;
}
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
());
//处理需求单记录
dealPaperRecord
(
personalStageId
,
afterStageId
,
wxId
,
robotId
);
// 将用户置为下个阶段
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/PlanJumpNextDTO.java
0 → 100644
View file @
54dde52b
package
com
.
pcloud
.
book
.
personalstage
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
PlanJumpNextDTO
implements
Serializable
{
@ApiModelProperty
(
"机器人id"
)
private
String
robotWxId
;
@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 @
54dde52b
...
@@ -6,7 +6,8 @@ public enum JumpTypeEnum {
...
@@ -6,7 +6,8 @@ public enum JumpTypeEnum {
ROBOT_TRIGGER
(
2
,
"小睿发送关键词触发"
),
ROBOT_TRIGGER
(
2
,
"小睿发送关键词触发"
),
PAY_TRIGGER
(
3
,
"转账触发"
),
PAY_TRIGGER
(
3
,
"转账触发"
),
PAPER_TRIGGER
(
4
,
"需求定制单触发"
),
PAPER_TRIGGER
(
4
,
"需求定制单触发"
),
END_SERVICE
(
5
,
"人工客服结束触发"
);
END_SERVICE
(
5
,
"人工客服结束触发"
),
PLAN_TRIGGER
(
6
,
"方案定制单触发"
);
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 @
54dde52b
...
@@ -5,6 +5,7 @@ import com.pcloud.book.personalstage.biz.PersonalStageProgressMessageBiz;
...
@@ -5,6 +5,7 @@ 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.EndServiceJumpNextDTO
;
import
com.pcloud.book.personalstage.dto.PersonalStageProgressDTO
;
import
com.pcloud.book.personalstage.dto.PersonalStageProgressDTO
;
import
com.pcloud.book.personalstage.dto.PlanJumpNextDTO
;
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
;
import
com.pcloud.book.personalstage.enums.JumpTypeEnum
;
import
com.pcloud.book.personalstage.enums.JumpTypeEnum
;
...
@@ -292,6 +293,15 @@ public class PersonalStageFacade {
...
@@ -292,6 +293,15 @@ public class PersonalStageFacade {
return
new
ResponseDto
<>();
return
new
ResponseDto
<>();
}
}
@ApiOperation
(
"方案阶段跳转"
)
@PostMapping
(
"/planJumpNext"
)
public
ResponseDto
<?>
planJumpNext
(
@RequestBody
@ApiParam
(
"方案阶段跳转"
)
PlanJumpNextDTO
planJumpNextDTO
)
throws
BizException
,
PermissionException
{
personalStageJumpBiz
.
planJumpNext
(
planJumpNextDTO
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
"获取进度单列表"
)
@ApiOperation
(
"获取进度单列表"
)
@GetMapping
(
"getProgressList"
)
@GetMapping
(
"getProgressList"
)
public
ResponseDto
<?>
getProgressList
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
)
throws
PermissionException
{
public
ResponseDto
<?>
getProgressList
(
@RequestHeader
(
"token"
)
@ApiParam
(
"token信息"
)
String
token
)
throws
PermissionException
{
...
...
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