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
5b7f0a8e
Commit
5b7f0a8e
authored
Mar 07, 2020
by
裴大威
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat-1002537' into 'master'
1002537 See merge request rays/pcloud-book!526
parents
c50cb1a1
096b3b15
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
98 additions
and
0 deletions
+98
-0
FeedbackConsr.java
...java/com/pcloud/book/consumer/feedback/FeedbackConsr.java
+10
-0
BookGuideBizImpl.java
...a/com/pcloud/book/keywords/biz/impl/BookGuideBizImpl.java
+7
-0
PersonalStageJumpBiz.java
...m/pcloud/book/personalstage/biz/PersonalStageJumpBiz.java
+17
-0
PersonalStageJumpBizImpl.java
...book/personalstage/biz/impl/PersonalStageJumpBizImpl.java
+47
-0
PersonalStageDao.java
...a/com/pcloud/book/personalstage/dao/PersonalStageDao.java
+3
-0
PersonalStageDaoImpl.java
...oud/book/personalstage/dao/impl/PersonalStageDaoImpl.java
+5
-0
PersonalStage.xml
...src/main/resources/mapper/personalstage/PersonalStage.xml
+9
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/consumer/feedback/FeedbackConsr.java
View file @
5b7f0a8e
...
@@ -88,4 +88,14 @@ public class FeedbackConsr {
...
@@ -88,4 +88,14 @@ public class FeedbackConsr {
}
}
@ParamLog
(
"删除用户答卷记录"
)
public
void
deleteUserAnswerRecord
(
List
<
Long
>
paperIds
,
String
userWxId
)
{
try
{
paperService
.
deleteUserAnswerRecord
(
paperIds
,
userWxId
);
}
catch
(
Exception
e
){
LOGGER
.
error
(
"deleteUserAnswerRecord调用失败"
+
e
.
getMessage
(),
e
);
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/impl/BookGuideBizImpl.java
View file @
5b7f0a8e
...
@@ -57,6 +57,7 @@ import com.pcloud.book.pcloudkeyword.biz.PcloudRobotBiz;
...
@@ -57,6 +57,7 @@ import com.pcloud.book.pcloudkeyword.biz.PcloudRobotBiz;
import
com.pcloud.book.pcloudkeyword.dao.PcloudRobotDao
;
import
com.pcloud.book.pcloudkeyword.dao.PcloudRobotDao
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobot
;
import
com.pcloud.book.pcloudkeyword.entity.PcloudRobot
;
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.constant.PersonalStageConstant
;
import
com.pcloud.book.personalstage.constant.PersonalStageConstant
;
import
com.pcloud.book.weixinclock.dao.WeixinClockGroupClassifyDao
;
import
com.pcloud.book.weixinclock.dao.WeixinClockGroupClassifyDao
;
import
com.pcloud.book.weixinclock.dto.WeixinClockDto
;
import
com.pcloud.book.weixinclock.dto.WeixinClockDto
;
...
@@ -148,6 +149,8 @@ public class BookGuideBizImpl implements BookGuideBiz {
...
@@ -148,6 +149,8 @@ public class BookGuideBizImpl implements BookGuideBiz {
@Value
(
"${wechat.group.link.prefix}"
)
@Value
(
"${wechat.group.link.prefix}"
)
private
String
wechatGroupLinkPrefix
;
private
String
wechatGroupLinkPrefix
;
@Autowired
private
PersonalStageJumpBiz
personalStageJumpBiz
;
@ParamLog
(
"同意加好友发送欢迎语"
)
@ParamLog
(
"同意加好友发送欢迎语"
)
@Override
@Override
...
@@ -163,6 +166,8 @@ public class BookGuideBizImpl implements BookGuideBiz {
...
@@ -163,6 +166,8 @@ public class BookGuideBizImpl implements BookGuideBiz {
//判断是否是平台端小号
//判断是否是平台端小号
PcloudRobot
pcloudRobot
=
pcloudRobotDao
.
getByWxId
(
agreeAddUserDTO
.
getRobotWxId
());
PcloudRobot
pcloudRobot
=
pcloudRobotDao
.
getByWxId
(
agreeAddUserDTO
.
getRobotWxId
());
if
(
pcloudRobot
!=
null
){
if
(
pcloudRobot
!=
null
){
//删除需求单记录
personalStageJumpBiz
.
deletePaperRecord
(
agreeAddUserDTO
.
getRobotWxId
(),
agreeAddUserDTO
.
getUserWxId
());
pcloudRobotBiz
.
sendWelcomeReply
(
agreeAddUserDTO
.
getRobotWxId
(),
agreeAddUserDTO
.
getUserWxId
(),
agreeAddUserDTO
.
getIp
());
pcloudRobotBiz
.
sendWelcomeReply
(
agreeAddUserDTO
.
getRobotWxId
(),
agreeAddUserDTO
.
getUserWxId
(),
agreeAddUserDTO
.
getIp
());
//好友引导语
//好友引导语
sendFriendGuide
(
null
,
agreeAddUserDTO
);
sendFriendGuide
(
null
,
agreeAddUserDTO
);
...
@@ -279,6 +284,8 @@ public class BookGuideBizImpl implements BookGuideBiz {
...
@@ -279,6 +284,8 @@ public class BookGuideBizImpl implements BookGuideBiz {
//判断是否是平台端小号
//判断是否是平台端小号
PcloudRobot
pcloudRobot
=
pcloudRobotDao
.
getByWxId
(
agreeAddUserDTO
.
getRobotWxId
());
PcloudRobot
pcloudRobot
=
pcloudRobotDao
.
getByWxId
(
agreeAddUserDTO
.
getRobotWxId
());
if
(
pcloudRobot
!=
null
){
if
(
pcloudRobot
!=
null
){
//删除需求单记录
personalStageJumpBiz
.
deletePaperRecord
(
agreeAddUserDTO
.
getRobotWxId
(),
agreeAddUserDTO
.
getUserWxId
());
pcloudRobotBiz
.
sendWelcomeReply
(
agreeAddUserDTO
.
getRobotWxId
(),
agreeAddUserDTO
.
getUserWxId
(),
agreeAddUserDTO
.
getIp
());
pcloudRobotBiz
.
sendWelcomeReply
(
agreeAddUserDTO
.
getRobotWxId
(),
agreeAddUserDTO
.
getUserWxId
(),
agreeAddUserDTO
.
getIp
());
//好友引导语
//好友引导语
sendFriendGuide
(
null
,
agreeAddUserDTO
);
sendFriendGuide
(
null
,
agreeAddUserDTO
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/biz/PersonalStageJumpBiz.java
View file @
5b7f0a8e
...
@@ -40,6 +40,15 @@ public interface PersonalStageJumpBiz {
...
@@ -40,6 +40,15 @@ public interface PersonalStageJumpBiz {
*/
*/
Boolean
handlePersonalStageJump
(
String
userWxId
,
String
robotWxId
,
String
content
,
JumpTypeEnum
jumpTypeEnum
);
Boolean
handlePersonalStageJump
(
String
userWxId
,
String
robotWxId
,
String
content
,
JumpTypeEnum
jumpTypeEnum
);
/**
* 跳转到之前的阶段,清除用户填写需求单记录
* @param personalStageId
* @param afterPersonalStageId
* @param userWxId
* @param robotId
*/
public
void
dealPaperRecord
(
Long
personalStageId
,
Long
afterPersonalStageId
,
String
userWxId
,
String
robotId
);
void
dealDelayLinkup
(
DelayQueueDTO
dto
);
void
dealDelayLinkup
(
DelayQueueDTO
dto
);
/**
/**
...
@@ -96,4 +105,12 @@ public interface PersonalStageJumpBiz {
...
@@ -96,4 +105,12 @@ public interface PersonalStageJumpBiz {
Boolean
getHasEndServiceJump
(
Long
personalStageId
);
Boolean
getHasEndServiceJump
(
Long
personalStageId
);
void
endServiceJumpNext
(
EndServiceJumpNextDTO
endServiceJumpNextDTO
);
void
endServiceJumpNext
(
EndServiceJumpNextDTO
endServiceJumpNextDTO
);
/**
* 删除用户的需求单记录
* @param robotId
* @param userWxId
*/
public
void
deletePaperRecord
(
String
robotId
,
String
userWxId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/biz/impl/PersonalStageJumpBizImpl.java
View file @
5b7f0a8e
...
@@ -443,6 +443,8 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -443,6 +443,8 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
}
}
GroupRobotDTO
groupRobotDTO
=
wechatGroupConsr
.
getGroupRobotByWxId
(
robotWxId
);
GroupRobotDTO
groupRobotDTO
=
wechatGroupConsr
.
getGroupRobotByWxId
(
robotWxId
);
String
ip
=
weixinQrcodeBiz
.
getRobotIpByGeneration
(
groupRobotDTO
.
getVersion
());
String
ip
=
weixinQrcodeBiz
.
getRobotIpByGeneration
(
groupRobotDTO
.
getVersion
());
//处理需求单记录
dealPaperRecord
(
currentStageUser
.
getPersonalStageId
(),
jumpKeywordDto
.
getAfterPersonalStageId
(),
userWxId
,
robotWxId
);
// 发送邮件
// 发送邮件
sendEmail
(
userWxId
,
robotWxId
,
content
,
jumpKeywordDto
);
sendEmail
(
userWxId
,
robotWxId
,
content
,
jumpKeywordDto
);
// 将用户置为下个阶段
// 将用户置为下个阶段
...
@@ -454,6 +456,30 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -454,6 +456,30 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
return
true
;
return
true
;
}
}
@ParamLog
(
"跳转到之前的阶段,清除用户填写需求单记录"
)
public
void
dealPaperRecord
(
Long
personalStageId
,
Long
afterPersonalStageId
,
String
userWxId
,
String
robotId
){
PersonalStage
personalStage
=
personalStageDao
.
getById
(
personalStageId
);
PersonalStage
afterPersonalStage
=
personalStageDao
.
getById
(
afterPersonalStageId
);
if
(
null
==
personalStage
||
null
==
afterPersonalStage
){
return
;
}
Boolean
jumpBefore
=
false
;
if
(
null
!=
personalStage
.
getSeqNum
()
&&
null
!=
afterPersonalStage
.
getSeqNum
()){
//当前阶段比下一阶段序号大
if
(
personalStage
.
getSeqNum
()>
afterPersonalStage
.
getSeqNum
()){
jumpBefore
=
true
;
}
else
if
(
personalStage
.
getSeqNum
().
equals
(
afterPersonalStage
.
getSeqNum
())){
//序号相同,当前阶段id比下一阶段大
if
(
personalStageId
.
compareTo
(
afterPersonalStageId
)>
0
){
jumpBefore
=
true
;
}
}
}
if
(
jumpBefore
){
this
.
deletePaperRecord
(
robotId
,
userWxId
);
}
}
@ParamLog
(
"处理衔接语跳转延时"
)
@ParamLog
(
"处理衔接语跳转延时"
)
@Override
@Override
public
void
dealDelayLinkup
(
DelayQueueDTO
dto
)
{
public
void
dealDelayLinkup
(
DelayQueueDTO
dto
)
{
...
@@ -543,6 +569,8 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -543,6 +569,8 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
jumpKeywordDto
.
setAfterPersonalStageId
(
paperJump
.
getAfterPersonalStageId
());
jumpKeywordDto
.
setAfterPersonalStageId
(
paperJump
.
getAfterPersonalStageId
());
jumpKeywordDto
.
setPersonalStageJumpId
(
paperJump
.
getId
());
jumpKeywordDto
.
setPersonalStageJumpId
(
paperJump
.
getId
());
sendEmail
(
userWxId
,
robotWxId
,
content
,
jumpKeywordDto
);
sendEmail
(
userWxId
,
robotWxId
,
content
,
jumpKeywordDto
);
//处理需求单记录
dealPaperRecord
(
stageId
,
paperJump
.
getAfterPersonalStageId
(),
userWxId
,
robotWxId
);
// 将用户置为下个阶段
// 将用户置为下个阶段
PersonalStageUser
nextPersonalStageUser
=
personalStageBiz
.
nextStageAddStageUserAndWakeupDelay
(
robotWxId
,
userWxId
,
ip
,
paperJump
.
getAfterPersonalStageId
());
PersonalStageUser
nextPersonalStageUser
=
personalStageBiz
.
nextStageAddStageUserAndWakeupDelay
(
robotWxId
,
userWxId
,
ip
,
paperJump
.
getAfterPersonalStageId
());
// 发送内容衔接语
// 发送内容衔接语
...
@@ -651,6 +679,8 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -651,6 +679,8 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
}
}
GroupRobotDTO
groupRobotDTO
=
wechatGroupConsr
.
getGroupRobotByWxId
(
robotId
);
GroupRobotDTO
groupRobotDTO
=
wechatGroupConsr
.
getGroupRobotByWxId
(
robotId
);
String
ip
=
weixinQrcodeBiz
.
getRobotIpByGeneration
(
groupRobotDTO
.
getVersion
());
String
ip
=
weixinQrcodeBiz
.
getRobotIpByGeneration
(
groupRobotDTO
.
getVersion
());
//处理需求单记录
dealPaperRecord
(
personalStageId
,
afterStageId
,
wxId
,
robotId
);
// 将用户置为下个阶段
// 将用户置为下个阶段
PersonalStageUser
nextPersonalStageUser
=
personalStageBiz
.
nextStageAddStageUserAndWakeupDelay
(
robotId
,
wxId
,
ip
,
afterStageId
);
PersonalStageUser
nextPersonalStageUser
=
personalStageBiz
.
nextStageAddStageUserAndWakeupDelay
(
robotId
,
wxId
,
ip
,
afterStageId
);
// 发送内容衔接语
// 发送内容衔接语
...
@@ -987,4 +1017,21 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
...
@@ -987,4 +1017,21 @@ public class PersonalStageJumpBizImpl implements PersonalStageJumpBiz {
}
}
return
map
;
return
map
;
}
}
@Override
@ParamLog
(
"删除用户的需求单记录"
)
public
void
deletePaperRecord
(
String
robotId
,
String
userWxId
){
PcloudRobot
pcloudRobot
=
pcloudRobotDao
.
getByWxId
(
robotId
);
if
(
null
!=
pcloudRobot
&&
null
!=
pcloudRobot
.
getRobotType
()){
List
<
Long
>
paperIds
=
personalStageDao
.
getPaperIdListByRobotClassify
(
pcloudRobot
.
getRobotType
().
longValue
());
if
(!
ListUtils
.
isEmpty
(
paperIds
)){
feedbackConsr
.
deleteUserAnswerRecord
(
paperIds
,
userWxId
);
}
}
//删除书名和阅读偏好缓存
String
bookKey
=
"BOOK:USER_SEND_CONTENT:"
+
userWxId
+
"-"
+
robotId
;
String
readingKey
=
"BOOK:READING_STYLE:"
+
userWxId
+
"-"
+
robotId
;
JedisClusterUtils
.
del
(
bookKey
);
JedisClusterUtils
.
del
(
readingKey
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/dao/PersonalStageDao.java
View file @
5b7f0a8e
...
@@ -17,4 +17,6 @@ public interface PersonalStageDao extends BaseDao<PersonalStage> {
...
@@ -17,4 +17,6 @@ public interface PersonalStageDao extends BaseDao<PersonalStage> {
PersonalStage
getFirstStage
(
Long
robotClassifyId
);
PersonalStage
getFirstStage
(
Long
robotClassifyId
);
List
<
PersonalStageDTO
>
getPersonalStageList
(
Long
robotClassifyId
);
List
<
PersonalStageDTO
>
getPersonalStageList
(
Long
robotClassifyId
);
List
<
Long
>
getPaperIdListByRobotClassify
(
Long
robotClassifyId
);
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/dao/impl/PersonalStageDaoImpl.java
View file @
5b7f0a8e
...
@@ -41,4 +41,9 @@ public class PersonalStageDaoImpl extends BaseDaoImpl<PersonalStage> implements
...
@@ -41,4 +41,9 @@ public class PersonalStageDaoImpl extends BaseDaoImpl<PersonalStage> implements
paramMap
.
put
(
"robotClassifyId"
,
robotClassifyId
);
paramMap
.
put
(
"robotClassifyId"
,
robotClassifyId
);
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getPersonalStageList"
),
paramMap
);
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getPersonalStageList"
),
paramMap
);
}
}
@Override
public
List
<
Long
>
getPaperIdListByRobotClassify
(
Long
robotClassifyId
)
{
return
getSessionTemplate
().
selectList
(
getStatement
(
"getPaperIdListByRobotClassify"
),
robotClassifyId
);
}
}
}
pcloud-service-book/src/main/resources/mapper/personalstage/PersonalStage.xml
View file @
5b7f0a8e
...
@@ -134,4 +134,12 @@
...
@@ -134,4 +134,12 @@
order by seq_num, id
order by seq_num, id
limit 1
limit 1
</select>
</select>
<select
id=
"getPaperIdListByRobotClassify"
parameterType=
"long"
resultType=
"long"
>
SELECT DISTINCT paper_id FROM personal_stage
WHERE
robot_classify_id = #{robotClassifyId}
AND paper_id>0
</select>
</mapper>
</mapper>
\ 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