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
3c74816e
Commit
3c74816e
authored
Feb 05, 2020
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
未订阅主动回复
parent
7333eb32
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
40 deletions
+88
-40
SelfRobotKeywordBiz.java
...ava/com/pcloud/book/keywords/biz/SelfRobotKeywordBiz.java
+2
-0
SelfRobotKeywordBizImpl.java
...cloud/book/keywords/biz/impl/SelfRobotKeywordBizImpl.java
+75
-40
SelfRobotKeywordFacade.java
...m/pcloud/book/keywords/facade/SelfRobotKeywordFacade.java
+4
-0
SelfRobotKeywordFacadeImpl.java
...book/keywords/facade/impl/SelfRobotKeywordFacadeImpl.java
+7
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/SelfRobotKeywordBiz.java
View file @
3c74816e
...
@@ -34,4 +34,6 @@ public interface SelfRobotKeywordBiz {
...
@@ -34,4 +34,6 @@ public interface SelfRobotKeywordBiz {
String
getResource
(
Integer
id
,
String
robotId
,
String
wxUserId
);
String
getResource
(
Integer
id
,
String
robotId
,
String
wxUserId
);
String
joinGroup
(
Integer
id
,
String
robotId
,
String
wxUserId
);
String
joinGroup
(
Integer
id
,
String
robotId
,
String
wxUserId
);
void
sendWhenNoReply
(
Integer
id
,
String
robotId
,
String
wxUserId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/impl/SelfRobotKeywordBizImpl.java
View file @
3c74816e
...
@@ -26,6 +26,7 @@ import com.pcloud.book.keywords.enums.ReplyTypeEnum;
...
@@ -26,6 +26,7 @@ import com.pcloud.book.keywords.enums.ReplyTypeEnum;
import
com.pcloud.book.keywords.vo.GuideWordVO
;
import
com.pcloud.book.keywords.vo.GuideWordVO
;
import
com.pcloud.book.keywords.vo.LabelVO
;
import
com.pcloud.book.keywords.vo.LabelVO
;
import
com.pcloud.book.keywords.vo.SelfRobotReplyVO
;
import
com.pcloud.book.keywords.vo.SelfRobotReplyVO
;
import
com.pcloud.book.util.common.ThreadPoolUtils
;
import
com.pcloud.channelcenter.wechat.dto.AccountSettingDto
;
import
com.pcloud.channelcenter.wechat.dto.AccountSettingDto
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.page.PageBeanNew
;
...
@@ -360,11 +361,11 @@ public class SelfRobotKeywordBizImpl implements SelfRobotKeywordBiz {
...
@@ -360,11 +361,11 @@ public class SelfRobotKeywordBizImpl implements SelfRobotKeywordBiz {
//todo 根据全平台关键词查id 找关联任务id集合
//todo 根据全平台关键词查id 找关联任务id集合
List
<
Integer
>
taskIds
=
new
ArrayList
<>();
List
<
Integer
>
taskIds
=
new
ArrayList
<>();
if
(
id
==
1
)
{
if
(
id
==
1
)
{
taskIds
=
Arrays
.
asList
(
5
);
taskIds
=
Arrays
.
asList
(
7
);
}
else
if
(
id
==
2
)
{
}
else
if
(
id
==
2
)
{
taskIds
=
Arrays
.
asList
(
5
,
6
);
taskIds
=
Arrays
.
asList
(
6
);
}
else
{
}
else
{
taskIds
=
Arrays
.
asList
(
5
,
6
,
7
);
taskIds
=
Arrays
.
asList
(
5
);
}
}
List
<
TaskDto
>
taskDtoList
=
ResponseHandleUtil
.
parseList
(
timeControlTaskService
.
listTaskByIds4User
(
wxUserId
,
taskIds
),
TaskDto
.
class
);
List
<
TaskDto
>
taskDtoList
=
ResponseHandleUtil
.
parseList
(
timeControlTaskService
.
listTaskByIds4User
(
wxUserId
,
taskIds
),
TaskDto
.
class
);
if
(!
ListUtils
.
isEmpty
(
taskDtoList
))
{
if
(!
ListUtils
.
isEmpty
(
taskDtoList
))
{
...
@@ -392,35 +393,37 @@ public class SelfRobotKeywordBizImpl implements SelfRobotKeywordBiz {
...
@@ -392,35 +393,37 @@ public class SelfRobotKeywordBizImpl implements SelfRobotKeywordBiz {
@Override
@Override
public
String
getResource
(
Integer
id
,
String
robotId
,
String
wxUserId
)
{
public
String
getResource
(
Integer
id
,
String
robotId
,
String
wxUserId
)
{
TempRobotSkill
skill
=
tempRobotSkillDao
.
getById
(
id
);
TempRobotSkill
skill
=
tempRobotSkillDao
.
getById
(
id
);
if
(
"text"
.
equals
(
skill
.
getResourceType
()))
{
ThreadPoolUtils
.
OTHER_THREAD_POOL
.
execute
(()
->
{
// 发送文本
if
(
"text"
.
equals
(
skill
.
getResourceType
()))
{
SendTextMessageVO
sendTextMessageVO
=
new
SendTextMessageVO
();
// 发送文本
sendTextMessageVO
.
setContent
(
skill
.
getText
());
SendTextMessageVO
sendTextMessageVO
=
new
SendTextMessageVO
();
sendTextMessageVO
.
setCode
(
SendMessageTypeEnum
.
SELF
.
getCode
());
sendTextMessageVO
.
setContent
(
skill
.
getText
());
sendTextMessageVO
.
setWxId
(
robotId
);
sendTextMessageVO
.
setCode
(
SendMessageTypeEnum
.
SELF
.
getCode
());
sendTextMessageVO
.
setAltId
(
robotId
);
sendTextMessageVO
.
setWxId
(
robotId
);
sendTextMessageVO
.
setWxGroupId
(
wxUserId
);
sendTextMessageVO
.
setAltId
(
robotId
);
sendTextMessageVO
.
setIp
(
getIpByRobot
(
robotId
));
sendTextMessageVO
.
setWxGroupId
(
wxUserId
);
WxGroupSDK
.
sendTextMessage
(
sendTextMessageVO
);
sendTextMessageVO
.
setIp
(
getIpByRobot
(
robotId
));
}
else
if
(
"file"
.
equals
(
skill
.
getResourceType
()))
{
WxGroupSDK
.
sendTextMessage
(
sendTextMessageVO
);
// 发送文件
}
else
if
(
"file"
.
equals
(
skill
.
getResourceType
()))
{
SendFileVO
sendFileVO
=
new
SendFileVO
();
// 发送文件
sendFileVO
.
setFileUrl
(
skill
.
getFileUrl
());
SendFileVO
sendFileVO
=
new
SendFileVO
();
sendFileVO
.
setFileName
(
skill
.
getFileName
());
sendFileVO
.
setFileUrl
(
skill
.
getFileUrl
());
sendFileVO
.
setIp
(
getIpByRobot
(
robotId
));
sendFileVO
.
setFileName
(
skill
.
getFileName
());
sendFileVO
.
setAltId
(
robotId
);
sendFileVO
.
setIp
(
getIpByRobot
(
robotId
));
sendFileVO
.
setWxId
(
wxUserId
);
sendFileVO
.
setAltId
(
robotId
);
WxGroupSDK
.
sendFile
(
sendFileVO
);
sendFileVO
.
setWxId
(
wxUserId
);
}
else
if
(
"img"
.
equals
(
skill
.
getResourceType
()))
{
WxGroupSDK
.
sendFile
(
sendFileVO
);
// 发送图片
}
else
if
(
"img"
.
equals
(
skill
.
getResourceType
()))
{
SendPicMessageVO
sendPicMessageVO
=
new
SendPicMessageVO
();
// 发送图片
sendPicMessageVO
.
setCode
(
SendMessageTypeEnum
.
SELF
.
getCode
());
SendPicMessageVO
sendPicMessageVO
=
new
SendPicMessageVO
();
sendPicMessageVO
.
setAltId
(
robotId
);
sendPicMessageVO
.
setCode
(
SendMessageTypeEnum
.
SELF
.
getCode
());
sendPicMessageVO
.
setWxGroupId
(
wxUserId
);
sendPicMessageVO
.
setAltId
(
robotId
);
sendPicMessageVO
.
setPicUrl
(
skill
.
getImgUrl
());
sendPicMessageVO
.
setWxGroupId
(
wxUserId
);
sendPicMessageVO
.
setIp
(
getIpByRobot
(
robotId
));
sendPicMessageVO
.
setPicUrl
(
skill
.
getImgUrl
());
WxGroupSDK
.
sendPicMessage
(
sendPicMessageVO
);
sendPicMessageVO
.
setIp
(
getIpByRobot
(
robotId
));
}
WxGroupSDK
.
sendPicMessage
(
sendPicMessageVO
);
}
});
return
skill
.
getReplyContent
();
return
skill
.
getReplyContent
();
}
}
...
@@ -444,17 +447,49 @@ public class SelfRobotKeywordBizImpl implements SelfRobotKeywordBiz {
...
@@ -444,17 +447,49 @@ public class SelfRobotKeywordBizImpl implements SelfRobotKeywordBiz {
@Override
@Override
public
String
joinGroup
(
Integer
id
,
String
robotId
,
String
wxUserId
)
{
public
String
joinGroup
(
Integer
id
,
String
robotId
,
String
wxUserId
)
{
TempRobotSkill
skill
=
tempRobotSkillDao
.
getById
(
id
);
TempRobotSkill
skill
=
tempRobotSkillDao
.
getById
(
id
);
// 发送群二维码图片
ThreadPoolUtils
.
OTHER_THREAD_POOL
.
execute
(()
->
{
SendPicMessageVO
sendPicMessageVO
=
new
SendPicMessageVO
();
// 发送群二维码图片
sendPicMessageVO
.
setCode
(
SendMessageTypeEnum
.
SELF
.
getCode
());
SendPicMessageVO
sendPicMessageVO
=
new
SendPicMessageVO
();
sendPicMessageVO
.
setAltId
(
robotId
);
sendPicMessageVO
.
setCode
(
SendMessageTypeEnum
.
SELF
.
getCode
());
sendPicMessageVO
.
setWxGroupId
(
wxUserId
);
sendPicMessageVO
.
setAltId
(
robotId
);
sendPicMessageVO
.
setPicUrl
(
skill
.
getImgUrl
());
sendPicMessageVO
.
setWxGroupId
(
wxUserId
);
sendPicMessageVO
.
setIp
(
getIpByRobot
(
robotId
));
sendPicMessageVO
.
setPicUrl
(
skill
.
getImgUrl
());
WxGroupSDK
.
sendPicMessage
(
sendPicMessageVO
);
sendPicMessageVO
.
setIp
(
getIpByRobot
(
robotId
));
WxGroupSDK
.
sendPicMessage
(
sendPicMessageVO
);
});
return
skill
.
getReplyContent
();
return
skill
.
getReplyContent
();
}
}
@Override
public
void
sendWhenNoReply
(
Integer
id
,
String
robotId
,
String
wxUserId
)
{
SendTextMessageVO
sendTextMessageVO
=
new
SendTextMessageVO
();
if
(
id
==
1
)
{
sendTextMessageVO
.
setContent
(
"怎么样?计划很棒吧,等你订阅哦"
);
sendTextMessageVO
.
setCode
(
SendMessageTypeEnum
.
SELF
.
getCode
());
sendTextMessageVO
.
setWxId
(
robotId
);
sendTextMessageVO
.
setAltId
(
robotId
);
sendTextMessageVO
.
setWxGroupId
(
wxUserId
);
sendTextMessageVO
.
setIp
(
getIpByRobot
(
robotId
));
WxGroupSDK
.
sendTextMessage
(
sendTextMessageVO
);
}
else
if
(
id
==
2
){
sendTextMessageVO
.
setContent
(
"计划怎么样?我按照计划执行后效果很好哦,等你订阅后我们一起阅读"
);
sendTextMessageVO
.
setCode
(
SendMessageTypeEnum
.
SELF
.
getCode
());
sendTextMessageVO
.
setWxId
(
robotId
);
sendTextMessageVO
.
setAltId
(
robotId
);
sendTextMessageVO
.
setWxGroupId
(
wxUserId
);
sendTextMessageVO
.
setIp
(
getIpByRobot
(
robotId
));
WxGroupSDK
.
sendTextMessage
(
sendTextMessageVO
);
}
else
{
sendTextMessageVO
.
setContent
(
" 你还在犹豫吗?早起的鸟儿有虫吃,我先行动起来喽~"
);
sendTextMessageVO
.
setCode
(
SendMessageTypeEnum
.
SELF
.
getCode
());
sendTextMessageVO
.
setWxId
(
robotId
);
sendTextMessageVO
.
setAltId
(
robotId
);
sendTextMessageVO
.
setWxGroupId
(
wxUserId
);
sendTextMessageVO
.
setIp
(
getIpByRobot
(
robotId
));
WxGroupSDK
.
sendTextMessage
(
sendTextMessageVO
);
}
}
@ParamLog
(
"填充列表"
)
@ParamLog
(
"填充列表"
)
private
void
fillSelfRobotKeyword
(
List
<
SelfRobotKeyword
>
selfRobotKeywords
)
{
private
void
fillSelfRobotKeyword
(
List
<
SelfRobotKeyword
>
selfRobotKeywords
)
{
if
(
ListUtils
.
isEmpty
(
selfRobotKeywords
)){
if
(
ListUtils
.
isEmpty
(
selfRobotKeywords
)){
...
...
pcloud-service-book/src/main/java/com/pcloud/book/keywords/facade/SelfRobotKeywordFacade.java
View file @
3c74816e
...
@@ -117,4 +117,8 @@ public interface SelfRobotKeywordFacade {
...
@@ -117,4 +117,8 @@ public interface SelfRobotKeywordFacade {
@ApiOperation
(
value
=
"进群"
,
httpMethod
=
"GET"
)
@ApiOperation
(
value
=
"进群"
,
httpMethod
=
"GET"
)
@GetMapping
(
"joinGroup"
)
@GetMapping
(
"joinGroup"
)
ResponseDto
<?>
joinGroup
(
Integer
id
,
String
robotId
,
String
wxUserId
);
ResponseDto
<?>
joinGroup
(
Integer
id
,
String
robotId
,
String
wxUserId
);
@ApiOperation
(
value
=
"用户点击引导语未操作时,主动回复"
,
httpMethod
=
"GET"
)
@GetMapping
(
"sendWhenNoReply"
)
ResponseDto
<?>
sendWhenNoReply
(
Integer
id
,
String
robotId
,
String
wxUserId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/keywords/facade/impl/SelfRobotKeywordFacadeImpl.java
View file @
3c74816e
...
@@ -178,4 +178,11 @@ public class SelfRobotKeywordFacadeImpl implements SelfRobotKeywordFacade {
...
@@ -178,4 +178,11 @@ public class SelfRobotKeywordFacadeImpl implements SelfRobotKeywordFacade {
return
new
ResponseDto
<>(
selfRobotKeywordBiz
.
joinGroup
(
id
,
robotId
,
wxUserId
));
return
new
ResponseDto
<>(
selfRobotKeywordBiz
.
joinGroup
(
id
,
robotId
,
wxUserId
));
}
}
@Override
@GetMapping
(
"sendWhenNoReply"
)
public
ResponseDto
<?>
sendWhenNoReply
(
@RequestParam
Integer
id
,
@RequestParam
String
robotId
,
@RequestParam
String
wxUserId
)
{
selfRobotKeywordBiz
.
sendWhenNoReply
(
id
,
robotId
,
wxUserId
);
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