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
fb69a367
Commit
fb69a367
authored
Mar 13, 2020
by
阮思源
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat_1002577-new2' into 'master'
1002577 See merge request rays/pcloud-book!549
parents
b82e49ca
f8ceb414
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
3 deletions
+58
-3
BookConstant.java
...main/java/com/pcloud/book/book/constant/BookConstant.java
+18
-0
PersonalStageBizImpl.java
...oud/book/personalstage/biz/impl/PersonalStageBizImpl.java
+31
-2
PersonalStage.java
...a/com/pcloud/book/personalstage/entity/PersonalStage.java
+4
-0
StageReplyRelevEnum.java
.../pcloud/book/personalstage/enums/StageReplyRelevEnum.java
+5
-1
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/book/constant/BookConstant.java
View file @
fb69a367
...
@@ -301,4 +301,22 @@ public class BookConstant {
...
@@ -301,4 +301,22 @@ public class BookConstant {
}
}
}
}
public
static
final
Integer
REPLACE_CODE_BOOK_NAME
=
1
;
public
static
final
String
SPECPATTEN
=
"^[_`~!@#$%^&*()+=|{}':;',\\[\\].·<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?]+$"
;
public
static
final
String
SPECPATTEN_1
=
"^[\\[\\]❤❥웃유♋☮✌☏☢☠✔☑♚▲♪✈✞÷↑↓◆◇⊙■□△▽¿─│♥❣♂♀☿Ⓐ✍✉☣☤✘☒♛▼♫⌘☪≈←→◈◎☉★☆⊿※¡━┃"
+
"♡ღツ☼☁❅♒✎©®™Σ✪✯☭➳卐√↖↗●◐Θ◤◥︻〖〗┄┆℃℉°✿ϟ☃☂✄¢€£∞✫★½✡×↙↘○◑⊕◣◢︼【】┅┇☽☾✚〓▂▃▄▅▆▇█▉▊▋▌▍▎▏↔↕☽☾の•▸◂▴▾┈┊"
+
"①②③④⑤⑥⑦⑧⑨⑩ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩ㍿▓♨♛❖♓☪✙┉┋☹☺☻تヅツッシÜϡﭢ™℠℗©®♥❤❥❣❦❧♡۵웃유ღ♋♂♀☿☼☀☁☂☄☾☽❄☃☈⊙☉℃℉❅✺ϟ☇♤♧♡♢♠♣♥♦☜☞☝✍☚"
+
"☛☟✌✽✾✿❁❃❋❀⚘☑✓✔√☐☒✗✘ㄨ✕✖✖⋆✢✣✤✥❋✦✧✩✰✪✫✬✭✮✯❂✡★✱✲✳✴✵✶✷✸✹✺✻✼❄❅❆❇❈❉❊†☨✞✝☥☦☓☩☯☧☬☸✡♁✙♆。,、':∶"
+
";?‘’“”〝〞ˆˇ﹕︰﹔﹖﹑•¨….¸;!´?!~—ˉ|‖"〃`@﹫¡¿﹏﹋﹌︴々﹟#﹩$﹠&﹪%*﹡﹢﹦﹤‐ ̄¯―﹨ˆ˜﹍﹎+=<__-\\ˇ~﹉﹊()〈〉‹›﹛﹜"
+
"『』〖〗[]《》〔〕{}「」【】︵︷︿︹︽_﹁﹃︻︶︸﹀︺︾ˉ﹂﹄︼☩☨☦✞✛✜✝✙✠✚†‡◉○◌◍◎●◐◑◒◓◔◕◖◗❂☢⊗⊙◘◙◍⅟½⅓⅕⅙⅛⅔⅖⅚⅜¾⅗⅝⅞⅘≂"
+
"≃≄≅≆≇≈≉≊≋≌≍≎≏≐≑≒≓≔≕≖≗≘≙≚≛≜≝≞≟≠≡≢≣≤≥≦≧≨≩⊰⊱⋛⋚∫∬∭∮∯∰∱∲∳%℅‰‱㊣㊎㊍㊌㊋㊏㊐㊊㊚㊛㊤㊥㊦㊧㊨㊒"
+
"㊞㊑㊒㊓㊔㊕㊖㊗㊘㊜㊝㊟㊠㊡㊢㊩㊪㊫㊬㊭㊮㊯㊰㊙㉿囍♔♕♖♗♘♙♚♛♜♝♞♟ℂℍℕℙℚℝℤℬℰℯℱℊℋℎℐℒℓℳℴ℘ℛℭ℮ℌℑℜℨ♪♫♩♬"
+
"♭♮♯°øⒶ☮✌☪✡☭✯卐✐✎✏✑✒✍✉✁✂✃✄✆✉☎☏➟➡➢➣➤➥➦➧➨➚➘➙➛➜➝➞➸♐➲➳⏎➴➵➶➷➸➹➺➻➼➽←↑→↓↔↕↖↗↘"
+
"↙↚↛↜↝↞↟↠↡↢↣↤↥↦↧↨➫➬➩➪➭➮➯➱↩↪↫↬↭↮↯↰↱↲↳↴↵↶↷↸↹↺↻↼↽↾↿⇀⇁⇂⇃⇄⇅⇆⇇⇈⇉⇊⇋⇌⇍⇎⇏⇐⇑⇒⇓⇔⇕⇖⇗⇘⇙⇚⇛⇜⇝⇞"
+
"⇟⇠⇡⇢⇣⇤⇥⇦⇧⇨⇩⇪➀➁➂➃➄➅➆➇➈➉➊➋➌➍➎➏➐➑➒➓㊀㊁㊂㊃㊄㊅㊆㊇㊈㊉ⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏⓐⓑⓒⓓⓔⓕⓖⓗⓘ"
+
"ⓙⓚⓛⓜⓝⓞⓟⓠⓡⓢⓣⓤⓥⓦⓧⓨⓩ⒜⒝⒞⒟⒠⒡⒢⒣⒤⒥⒦⒧⒨⒩⒪⒫⒬⒭⒮⒯⒰⒱⒲⒳⒴⒵ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫⅬⅭⅮⅯⅰⅱⅲⅳⅴⅵⅶⅷⅸ"
+
"ⅹⅺⅻⅼⅽⅾⅿ┌┍┎┏┐┑┒┓└┕┖┗┘┙┚┛├┝┞┟┠┡┢┣┤┥┦┧┨┩┪┫┬┭┮┯┰┱┲┳┴┵┶┷┸┹┺┻┼┽┾┿╀╁╂╃╄╅╆╇╈╉╊╋╌╍╎╏═║╒╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡╢╣╤╥╦╧╨╩╪╫╬◤◥◄►▶◀◣◢▲▼◥▸◂"
+
"▴▾△▽▷◁⊿▻◅▵▿▹◃❏❐❑❒▀▁▂▃▄▅▆▇▉▊▋█▌▍▎▏▐░▒▓▔▕■□▢▣▤▥▦▧▨▩▪▫▬▭▮▯㋀㋁㋂㋃㋄㋅㋆㋇㋈㋉㋊㋋]+$"
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/biz/impl/PersonalStageBizImpl.java
View file @
fb69a367
...
@@ -3,6 +3,7 @@ package com.pcloud.book.personalstage.biz.impl;
...
@@ -3,6 +3,7 @@ package com.pcloud.book.personalstage.biz.impl;
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.base.exception.BookBizException
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.book.constant.BookConstant
;
import
com.pcloud.book.consumer.content.ResourceConsr
;
import
com.pcloud.book.consumer.content.ResourceConsr
;
import
com.pcloud.book.consumer.wechatgroup.WechatGroupConsr
;
import
com.pcloud.book.consumer.wechatgroup.WechatGroupConsr
;
import
com.pcloud.book.custom.mapper.CustomPlanModuleSuggestionMapper
;
import
com.pcloud.book.custom.mapper.CustomPlanModuleSuggestionMapper
;
...
@@ -68,6 +69,8 @@ import com.sdk.wxgroup.SendTextMessageVO;
...
@@ -68,6 +69,8 @@ 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.BusinessConstant
;
import
com.sdk.wxgroup.im.mimc.dto.SendMomentsDTO
;
import
com.sdk.wxgroup.im.mimc.dto.SendMomentsDTO
;
import
com.sun.org.apache.xpath.internal.operations.Bool
;
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
;
...
@@ -204,6 +207,7 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
...
@@ -204,6 +207,7 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
}
}
}
}
personalStage
.
setStageNotKeywordReplies
(
replies
.
stream
().
filter
(
s
->
StageReplyRelevEnum
.
STAGE_NOT_KEYWORD
.
value
.
equals
(
s
.
getRelevanceType
())).
collect
(
Collectors
.
toList
()));
personalStage
.
setStageNotKeywordReplies
(
replies
.
stream
().
filter
(
s
->
StageReplyRelevEnum
.
STAGE_NOT_KEYWORD
.
value
.
equals
(
s
.
getRelevanceType
())).
collect
(
Collectors
.
toList
()));
personalStage
.
setBookStageNotKeywordReplies
(
replies
.
stream
().
filter
(
s
->
StageReplyRelevEnum
.
BOOK_STAGE_NOT_KEYWORD
.
value
.
equals
(
s
.
getRelevanceType
())).
collect
(
Collectors
.
toList
()));
personalStage
.
setFusingNotKeywordReplies
(
replies
.
stream
().
filter
(
s
->
StageReplyRelevEnum
.
FUSING_NOT_KEYWORD
.
value
.
equals
(
s
.
getRelevanceType
())).
collect
(
Collectors
.
toList
()));
personalStage
.
setFusingNotKeywordReplies
(
replies
.
stream
().
filter
(
s
->
StageReplyRelevEnum
.
FUSING_NOT_KEYWORD
.
value
.
equals
(
s
.
getRelevanceType
())).
collect
(
Collectors
.
toList
()));
List
<
PersonalStageReply
>
wakeupReplies
=
replies
.
stream
().
filter
(
s
->
StageReplyRelevEnum
.
WAKEUP
.
value
.
equals
(
s
.
getRelevanceType
())).
collect
(
Collectors
.
toList
());
List
<
PersonalStageReply
>
wakeupReplies
=
replies
.
stream
().
filter
(
s
->
StageReplyRelevEnum
.
WAKEUP
.
value
.
equals
(
s
.
getRelevanceType
())).
collect
(
Collectors
.
toList
());
wakeupReplyMap
=
wakeupReplies
.
stream
().
collect
(
Collectors
.
groupingBy
(
PersonalStageReply:
:
getRelevanceId
));
wakeupReplyMap
=
wakeupReplies
.
stream
().
collect
(
Collectors
.
groupingBy
(
PersonalStageReply:
:
getRelevanceId
));
...
@@ -288,6 +292,14 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
...
@@ -288,6 +292,14 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
reply
.
setRelevanceId
(
personalStageId
);
reply
.
setRelevanceId
(
personalStageId
);
}
}
allReply
.
addAll
(
personalStage
.
getStageNotKeywordReplies
());
allReply
.
addAll
(
personalStage
.
getStageNotKeywordReplies
());
if
(!
ListUtils
.
isEmpty
(
personalStage
.
getBookStageNotKeywordReplies
())){
for
(
PersonalStageReply
reply:
personalStage
.
getBookStageNotKeywordReplies
()){
reply
.
setRelevanceType
(
StageReplyRelevEnum
.
BOOK_STAGE_NOT_KEYWORD
.
value
);
reply
.
setPersonalStageId
(
personalStageId
);
reply
.
setRelevanceId
(
personalStageId
);
}
allReply
.
addAll
(
personalStage
.
getBookStageNotKeywordReplies
());
}
for
(
PersonalStageReply
reply:
personalStage
.
getFusingNotKeywordReplies
()){
for
(
PersonalStageReply
reply:
personalStage
.
getFusingNotKeywordReplies
()){
reply
.
setRelevanceType
(
StageReplyRelevEnum
.
FUSING_NOT_KEYWORD
.
value
);
reply
.
setRelevanceType
(
StageReplyRelevEnum
.
FUSING_NOT_KEYWORD
.
value
);
reply
.
setPersonalStageId
(
personalStageId
);
reply
.
setPersonalStageId
(
personalStageId
);
...
@@ -633,8 +645,23 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
...
@@ -633,8 +645,23 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
LOGGER
.
info
(
"人工客服服务中,userWxId="
+
userWxId
+
"+robotId+"
+
robotId
);
LOGGER
.
info
(
"人工客服服务中,userWxId="
+
userWxId
+
"+robotId+"
+
robotId
);
return
;
return
;
}
}
PersonalStage
personalStage
=
personalStageDao
.
getById
(
personalStageId
);
List
<
PersonalStageReplyItem
>
items
=
new
ArrayList
<>();
//确认是图书获取阶段 判断是否是特殊符号
Boolean
isSpecial
=
false
;
List
<
Long
>
ids
=
new
ArrayList
<>();
if
(
null
!=
personalStage
&&
null
!=
personalStage
.
getReplaceCodeId
()
&&
BookConstant
.
REPLACE_CODE_BOOK_NAME
.
equals
(
personalStage
.
getReplaceCodeId
().
intValue
())
&&
((!
StringUtil
.
isEmpty
(
userSendContent
)
&&
userSendContent
.
matches
(
BookConstant
.
SPECPATTEN
))
||
StringUtil
.
isEmpty
(
userSendContent
))){
ids
=
personalStageReplyDao
.
getIdsByRelevance
(
StageReplyRelevEnum
.
BOOK_STAGE_NOT_KEYWORD
.
value
,
personalStageId
);
if
(!
ListUtils
.
isEmpty
(
ids
)){
isSpecial
=
true
;
}
}
if
(
isSpecial
){
items
=
personalStageReplyItemDao
.
getListByReplyIds
(
ids
);
}
else
{
PersonalStageReply
personalStageReply
=
null
;
PersonalStageReply
personalStageReply
=
null
;
List
<
Long
>
ids
=
personalStageReplyDao
.
getIdsByRelevance
(
StageReplyRelevEnum
.
STAGE_NOT_KEYWORD
.
value
,
personalStageId
);
ids
=
personalStageReplyDao
.
getIdsByRelevance
(
StageReplyRelevEnum
.
STAGE_NOT_KEYWORD
.
value
,
personalStageId
);
Long
replyId
=
null
;
Long
replyId
=
null
;
if
(
ListUtils
.
isEmpty
(
ids
)){
if
(
ListUtils
.
isEmpty
(
ids
)){
return
;
return
;
...
@@ -656,7 +683,7 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
...
@@ -656,7 +683,7 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
}
}
ids
=
Lists
.
newArrayList
(
replyId
);
ids
=
Lists
.
newArrayList
(
replyId
);
}
}
List
<
PersonalStageReplyItem
>
items
=
personalStageReplyItemDao
.
getListByReplyIds
(
Arrays
.
asList
(
replyId
));
items
=
personalStageReplyItemDao
.
getListByReplyIds
(
Arrays
.
asList
(
replyId
));
if
(
ListUtils
.
isEmpty
(
items
)){
if
(
ListUtils
.
isEmpty
(
items
)){
return
;
return
;
}
}
...
@@ -667,6 +694,8 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
...
@@ -667,6 +694,8 @@ public class PersonalStageBizImpl implements PersonalStageBiz {
}
}
//替换需求定制单链接
//替换需求定制单链接
this
.
replacePaperUrl
(
items
,
robotId
,
userWxId
,
personalStageReply
.
getPaperId
(),
ip
);
this
.
replacePaperUrl
(
items
,
robotId
,
userWxId
,
personalStageReply
.
getPaperId
(),
ip
);
}
sendReplyItems
(
items
,
robotId
,
userWxId
,
ip
,
personalStageUserId
);
sendReplyItems
(
items
,
robotId
,
userWxId
,
ip
,
personalStageUserId
);
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/entity/PersonalStage.java
View file @
fb69a367
...
@@ -51,4 +51,7 @@ public class PersonalStage extends BaseEntity {
...
@@ -51,4 +51,7 @@ public class PersonalStage extends BaseEntity {
@ApiModelProperty
(
"替换字符串id"
)
@ApiModelProperty
(
"替换字符串id"
)
private
Long
replaceCodeId
;
private
Long
replaceCodeId
;
@ApiModelProperty
(
"书籍阶段非关键词回复集合"
)
private
List
<
PersonalStageReply
>
bookStageNotKeywordReplies
;
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/personalstage/enums/StageReplyRelevEnum.java
View file @
fb69a367
...
@@ -13,7 +13,11 @@ public enum StageReplyRelevEnum {
...
@@ -13,7 +13,11 @@ public enum StageReplyRelevEnum {
/**
/**
* 唤醒
* 唤醒
*/
*/
WAKEUP
(
3
);
WAKEUP
(
3
),
/**
* 书籍阶段非关键词回复
*/
BOOK_STAGE_NOT_KEYWORD
(
4
);
public
final
Integer
value
;
public
final
Integer
value
;
...
...
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