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
b59e244c
Commit
b59e244c
authored
Mar 06, 2020
by
阮思源
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat-1002527' into 'master'
熔断回复限制 See merge request rays/pcloud-book!517
parents
9f635dba
1ad9cfa2
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
44 additions
and
4 deletions
+44
-4
PersonalStageBizImpl.java
...oud/book/personalstage/biz/impl/PersonalStageBizImpl.java
+10
-0
PersonalStageUserDao.java
...m/pcloud/book/personalstage/dao/PersonalStageUserDao.java
+3
-0
PersonalStageUserDaoImpl.java
...book/personalstage/dao/impl/PersonalStageUserDaoImpl.java
+5
-0
PersonalStage.java
...a/com/pcloud/book/personalstage/entity/PersonalStage.java
+4
-0
PersonalStageUser.java
...m/pcloud/book/personalstage/entity/PersonalStageUser.java
+4
-0
PersonalStage.xml
...src/main/resources/mapper/personalstage/PersonalStage.xml
+7
-3
PersonalStageUser.xml
...main/resources/mapper/personalstage/PersonalStageUser.xml
+11
-1
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/biz/impl/PersonalStageBizImpl.java
View file @
b59e244c
...
@@ -775,6 +775,14 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
...
@@ -775,6 +775,14 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
@ParamLog
(
"非关键词熔断回复"
)
@ParamLog
(
"非关键词熔断回复"
)
@Override
@Override
public
void
sendNotKeywordFusingReply
(
String
robotId
,
String
userWxId
,
String
ip
,
Long
personalStageId
,
Long
personalStageUserId
,
Long
paperId
)
{
public
void
sendNotKeywordFusingReply
(
String
robotId
,
String
userWxId
,
String
ip
,
Long
personalStageId
,
Long
personalStageUserId
,
Long
paperId
)
{
PersonalStage
personalStage
=
personalStageDao
.
getById
(
personalStageId
);
PersonalStageUser
personalStageUser
=
personalStageUserDao
.
getById
(
personalStageUserId
);
if
(
personalStage
!=
null
&&
personalStageUser
!=
null
)
{
Integer
notReplyFusingCount
=
personalStage
.
getNotReplyFusingCount
();
if
(
notReplyFusingCount
!=
null
&&
personalStageUser
.
getFusingReplyCount
()
>=
personalStage
.
getNotReplyFusingCount
())
{
return
;
}
}
//判断人工客服服务状态
//判断人工客服服务状态
Integer
serviceState
=
wechatGroupConsr
.
getServiceStateByRobotUser
(
robotId
,
userWxId
);
Integer
serviceState
=
wechatGroupConsr
.
getServiceStateByRobotUser
(
robotId
,
userWxId
);
if
(
serviceState
==
1
){
if
(
serviceState
==
1
){
...
@@ -793,6 +801,7 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
...
@@ -793,6 +801,7 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
}
}
this
.
replacePaperUrl
(
items
,
robotId
,
userWxId
,
paperId
,
ip
);
this
.
replacePaperUrl
(
items
,
robotId
,
userWxId
,
paperId
,
ip
);
sendReplyItems
(
items
,
robotId
,
userWxId
,
ip
,
personalStageUserId
);
sendReplyItems
(
items
,
robotId
,
userWxId
,
ip
,
personalStageUserId
);
personalStageUserDao
.
updateFusingReplyCount
(
personalStageUserId
);
}
}
@ParamLog
(
"发送回复"
)
@ParamLog
(
"发送回复"
)
...
@@ -889,6 +898,7 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
...
@@ -889,6 +898,7 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
user
.
setId
(
personalStageUserId
);
user
.
setId
(
personalStageUserId
);
user
.
setState
(
PersonalStageUserStateEnum
.
NORMAL
.
value
);
user
.
setState
(
PersonalStageUserStateEnum
.
NORMAL
.
value
);
user
.
setNotKeywordSendCount
(
0
);
user
.
setNotKeywordSendCount
(
0
);
user
.
setFusingReplyCount
(
0
);
personalStageUserDao
.
update
(
user
);
personalStageUserDao
.
update
(
user
);
//刪除发送非关键词次数緩存
//刪除发送非关键词次数緩存
JedisClusterUtils
.
del
(
PersonalStageConstant
.
USER_SEND_KEYWORD_COUNT_LOCK
+
personalStageId
+
"_"
+
wxId
);
JedisClusterUtils
.
del
(
PersonalStageConstant
.
USER_SEND_KEYWORD_COUNT_LOCK
+
personalStageId
+
"_"
+
wxId
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/dao/PersonalStageUserDao.java
View file @
b59e244c
...
@@ -12,4 +12,6 @@ public interface PersonalStageUserDao extends BaseDao<PersonalStageUser> {
...
@@ -12,4 +12,6 @@ public interface PersonalStageUserDao extends BaseDao<PersonalStageUser> {
void
updateRequireNumber
(
Long
personalStageUserId
,
String
requireNumber
);
void
updateRequireNumber
(
Long
personalStageUserId
,
String
requireNumber
);
void
updateScore
(
Long
id
,
Integer
score
);
void
updateScore
(
Long
id
,
Integer
score
);
void
updateFusingReplyCount
(
Long
id
);
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/dao/impl/PersonalStageUserDaoImpl.java
View file @
b59e244c
...
@@ -44,4 +44,9 @@ public class PersonalStageUserDaoImpl extends BaseDaoImpl<PersonalStageUser> imp
...
@@ -44,4 +44,9 @@ public class PersonalStageUserDaoImpl extends BaseDaoImpl<PersonalStageUser> imp
map
.
put
(
"score"
,
score
);
map
.
put
(
"score"
,
score
);
super
.
getSessionTemplate
().
update
(
getStatement
(
"updateScore"
),
map
);
super
.
getSessionTemplate
().
update
(
getStatement
(
"updateScore"
),
map
);
}
}
@Override
public
void
updateFusingReplyCount
(
Long
id
)
{
super
.
getSessionTemplate
().
update
(
getStatement
(
"updateFusingReplyCount"
),
id
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/entity/PersonalStage.java
View file @
b59e244c
...
@@ -45,4 +45,7 @@ public class PersonalStage extends BaseEntity {
...
@@ -45,4 +45,7 @@ public class PersonalStage extends BaseEntity {
@ApiModelProperty
(
"回复方式 1 随机,2顺序"
)
@ApiModelProperty
(
"回复方式 1 随机,2顺序"
)
private
Integer
sendMode
;
private
Integer
sendMode
;
@ApiModelProperty
(
"熔断回复的次数 将不再回复任何熔断消息"
)
private
Integer
notReplyFusingCount
;
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/entity/PersonalStageUser.java
View file @
b59e244c
...
@@ -40,4 +40,7 @@ public class PersonalStageUser extends BaseEntity {
...
@@ -40,4 +40,7 @@ public class PersonalStageUser extends BaseEntity {
@ApiModelProperty
(
"进度开始时间"
)
@ApiModelProperty
(
"进度开始时间"
)
private
Date
progressStartTime
;
private
Date
progressStartTime
;
@ApiModelProperty
(
"熔断回复次数"
)
private
Integer
fusingReplyCount
;
}
}
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/personalstage/PersonalStage.xml
View file @
b59e244c
...
@@ -13,10 +13,11 @@
...
@@ -13,10 +13,11 @@
<result
property=
"showProgress"
column=
"show_progress"
jdbcType=
"INTEGER"
/>
<result
property=
"showProgress"
column=
"show_progress"
jdbcType=
"INTEGER"
/>
<result
property=
"createTime"
column=
"create_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"createTime"
column=
"create_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"sendMode"
column=
"send_mode"
jdbcType=
"INTEGER"
/>
<result
property=
"sendMode"
column=
"send_mode"
jdbcType=
"INTEGER"
/>
<result
property=
"notReplyFusingCount"
column=
"not_reply_fusing_count"
jdbcType=
"INTEGER"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, name, not_keyword_fusing_count, not_keyword_fusing_time, robot_classify_id, paper_id, seq_num, show_progress, create_time,send_mode
id, name, not_keyword_fusing_count, not_keyword_fusing_time, robot_classify_id, paper_id, seq_num, show_progress, create_time,send_mode
,not_reply_fusing_count
</sql>
</sql>
<select
id=
"getById"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
<select
id=
"getById"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
...
@@ -42,7 +43,8 @@
...
@@ -42,7 +43,8 @@
seq_num,
seq_num,
show_progress,
show_progress,
create_time,
create_time,
send_mode
send_mode,
not_reply_fusing_count
</trim>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
#{name,jdbcType=VARCHAR},
#{name,jdbcType=VARCHAR},
...
@@ -53,7 +55,8 @@
...
@@ -53,7 +55,8 @@
#{seqNum,jdbcType=INTEGER},
#{seqNum,jdbcType=INTEGER},
#{showProgress,jdbcType=INTEGER},
#{showProgress,jdbcType=INTEGER},
NOW(),
NOW(),
#{sendMode}
#{sendMode},
#{notReplyFusingCount}
</trim>
</trim>
</insert>
</insert>
...
@@ -82,6 +85,7 @@
...
@@ -82,6 +85,7 @@
<if
test=
"sendMode != null"
>
<if
test=
"sendMode != null"
>
send_mode = #{sendMode,jdbcType=INTEGER},
send_mode = #{sendMode,jdbcType=INTEGER},
</if>
</if>
not_reply_fusing_count = #{notReplyFusingCount,jdbcType=INTEGER},
</set>
</set>
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</update>
...
...
pcloud-service-book/src/main/resources/mapper/personalstage/PersonalStageUser.xml
View file @
b59e244c
...
@@ -15,10 +15,11 @@
...
@@ -15,10 +15,11 @@
<result
property=
"requireNumber"
column=
"require_number"
jdbcType=
"VARCHAR"
/>
<result
property=
"requireNumber"
column=
"require_number"
jdbcType=
"VARCHAR"
/>
<result
property=
"score"
column=
"score"
jdbcType=
"INTEGER"
/>
<result
property=
"score"
column=
"score"
jdbcType=
"INTEGER"
/>
<result
property=
"progressStartTime"
column=
"progress_start_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"progressStartTime"
column=
"progress_start_time"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"fusingReplyCount"
column=
"fusing_reply_count"
jdbcType=
"INTEGER"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, personal_stage_id, wx_id, robot_id, robot_classify_id, state, not_keyword_send_count, create_time,update_time,require_number,score,progress_start_time
id, personal_stage_id, wx_id, robot_id, robot_classify_id, state, not_keyword_send_count, create_time,update_time,require_number,score,progress_start_time
,fusing_reply_count
</sql>
</sql>
<select
id=
"getById"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
<select
id=
"getById"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.Long"
>
...
@@ -81,6 +82,9 @@
...
@@ -81,6 +82,9 @@
<if
test=
"progressStartTime != null"
>
<if
test=
"progressStartTime != null"
>
progress_start_time = #{progressStartTime},
progress_start_time = #{progressStartTime},
</if>
</if>
<if
test=
"fusingReplyCount != null"
>
fusing_reply_count = #{fusingReplyCount},
</if>
update_time=now()
update_time=now()
</set>
</set>
where id = #{id,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
...
@@ -131,4 +135,9 @@
...
@@ -131,4 +135,9 @@
score = score + #{score} where id = #{id}
score = score + #{score} where id = #{id}
</update>
</update>
<update
id=
"updateFusingReplyCount"
parameterType=
"java.lang.Long"
>
update personal_stage_user set
fusing_reply_count = fusing_reply_count + 1 where id = #{id}
</update>
</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