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
fed7045b
Commit
fed7045b
authored
Feb 01, 2020
by
阮思源
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat-jinji' into 'master'
紧急加推名片 See merge request rays/pcloud-book!323
parents
4f44dde8
06388642
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
86 additions
and
14 deletions
+86
-14
BookGuideBizImpl.java
...a/com/pcloud/book/keywords/biz/impl/BookGuideBizImpl.java
+30
-14
BookKeywordBizImpl.java
...com/pcloud/book/keywords/biz/impl/BookKeywordBizImpl.java
+56
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/impl/BookGuideBizImpl.java
View file @
fed7045b
...
...
@@ -142,7 +142,7 @@ public class BookGuideBizImpl implements BookGuideBiz {
dto
=
bookGroupDao
.
getDTOById
(
449L
);
}
if
(
envStr
.
toUpperCase
().
equals
(
"PRO"
)&&
agreeAddUserDTO
.
getRobotWxId
().
equals
(
"wxid_x8i897ryabo722"
)){
dto
=
bookGroupDao
.
getDTOById
(
237
18
L
);
dto
=
bookGroupDao
.
getDTOById
(
237
35
L
);
}
if
(
dto
!=
null
){
Long
bookGroupId
=
dto
.
getId
();
...
...
@@ -166,20 +166,36 @@ public class BookGuideBizImpl implements BookGuideBiz {
//回复关键词引导语
List
<
SelfRobotKeyword
>
selfRobotKeywords
=
selfRobotKeywordDao
.
getListByBookGroupId
(
bookGroupId
);
if
(!
ListUtils
.
isEmpty
(
selfRobotKeywords
)){
String
content
=
"你可以通过以下方式唤醒我,让我知道你的学习需求:\n"
;
for
(
SelfRobotKeyword
selfRobotKeyword:
selfRobotKeywords
){
content
=
content
+
"●"
+
selfRobotKeyword
.
getGuide
()+
"\n"
;
try
{
String
content
=
"你可以通过一下方式唤醒我,让我知道你的学习需求"
;
SendTextMessageVO
voh
=
new
SendTextMessageVO
();
voh
.
setContent
(
content
);
voh
.
setCode
(
SendMessageTypeEnum
.
SELF
.
getCode
());
voh
.
setWxId
(
agreeAddUserDTO
.
getRobotWxId
());
voh
.
setAltId
(
agreeAddUserDTO
.
getRobotWxId
());
voh
.
setWxGroupId
(
agreeAddUserDTO
.
getUserWxId
());
voh
.
setIp
(
agreeAddUserDTO
.
getIp
());
WxGroupSDK
.
sendTextMessage
(
voh
);
log
.
info
(
"临时demo发送个人号加好友信息唤醒"
+
voh
.
toString
());
Thread
.
sleep
(
5000
);
}
catch
(
InterruptedException
e
)
{
log
.
error
(
"发消息休眠5秒出错"
,
e
);
}
if
(!
StringUtil
.
isEmpty
(
content
)){
SendTextMessageVO
vo
=
new
SendTextMessageVO
();
vo
.
setContent
(
content
);
vo
.
setCode
(
SendMessageTypeEnum
.
SELF
.
getCode
());
vo
.
setWxId
(
agreeAddUserDTO
.
getRobotWxId
());
vo
.
setAltId
(
agreeAddUserDTO
.
getRobotWxId
());
vo
.
setWxGroupId
(
agreeAddUserDTO
.
getUserWxId
());
vo
.
setIp
(
agreeAddUserDTO
.
getIp
());
WxGroupSDK
.
sendTextMessage
(
vo
);
log
.
info
(
"临时demo发送个人号加好友信息"
+
vo
.
toString
());
for
(
SelfRobotKeyword
selfRobotKeyword:
selfRobotKeywords
){
try
{
SendTextMessageVO
vo
=
new
SendTextMessageVO
();
vo
.
setContent
(
selfRobotKeyword
.
getGuide
());
vo
.
setCode
(
SendMessageTypeEnum
.
SELF
.
getCode
());
vo
.
setWxId
(
agreeAddUserDTO
.
getRobotWxId
());
vo
.
setAltId
(
agreeAddUserDTO
.
getRobotWxId
());
vo
.
setWxGroupId
(
agreeAddUserDTO
.
getUserWxId
());
vo
.
setIp
(
agreeAddUserDTO
.
getIp
());
WxGroupSDK
.
sendTextMessage
(
vo
);
log
.
info
(
"临时demo发送个人号加好友信息"
+
vo
.
toString
());
Thread
.
sleep
(
5000
);
}
catch
(
InterruptedException
e
)
{
log
.
error
(
"发消息休眠5秒出错"
,
e
);
}
}
}
return
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/impl/BookKeywordBizImpl.java
View file @
fed7045b
...
...
@@ -96,11 +96,13 @@ import com.sdk.wxgroup.SendGroupInviteVO;
import
com.sdk.wxgroup.SendMessageTypeEnum
;
import
com.sdk.wxgroup.SendPicMessageVO
;
import
com.sdk.wxgroup.SendTextMessageVO
;
import
com.sdk.wxgroup.SendXmlCardVO
;
import
com.sdk.wxgroup.WxGroupSDK
;
import
org.apache.commons.collections.MapUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
...
...
@@ -178,6 +180,8 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
private
SelfRobotKeywordDao
selfRobotKeywordDao
;
@Autowired
private
ResourceConsr
resourceConsr
;
@Value
(
"${system.env}"
)
private
String
envStr
;
/**
* 字符串切割长度
*/
...
...
@@ -531,6 +535,58 @@ public class BookKeywordBizImpl implements BookKeywordBiz {
SelfRobotKeyword
selfRobotKeyword
=
selfRobotKeywordDao
.
getByBookGroupIdAndKeyword
(
bookGroupCipherUser
.
getBookGroupId
(),
content
);
if
(
selfRobotKeyword
!=
null
)
{
sendSelfKeyword
(
selfRobotKeyword
,
sendTextDTO
);
//临时,后面要删
String
robotId
=
sendTextDTO
.
getWxId
();
if
(
"一对一"
.
equals
(
content
)){
Boolean
pushIdCard
=
false
;
if
(
envStr
.
toUpperCase
().
equals
(
"TEST"
)&&
robotId
.
equals
(
"wxid_zus32xb5ukjn22"
)
&&
new
Long
(
1621L
).
equals
(
bookGroupCipherUser
.
getBookGroupId
())){
pushIdCard
=
true
;
}
if
(
envStr
.
toUpperCase
().
equals
(
"UAT"
)&&
robotId
.
equals
(
"wxid_51ff9f099l9a22"
)
&&
new
Long
(
449L
).
equals
(
bookGroupCipherUser
.
getBookGroupId
())){
pushIdCard
=
true
;
}
if
(
envStr
.
toUpperCase
().
equals
(
"PRO"
)&&
robotId
.
equals
(
"wxid_x8i897ryabo722"
)
&&
new
Long
(
23735L
).
equals
(
bookGroupCipherUser
.
getBookGroupId
())){
pushIdCard
=
true
;
}
if
(
pushIdCard
){
SendPicMessageVO
sendPicMessageVO
=
new
SendPicMessageVO
();
sendPicMessageVO
.
setWxGroupId
(
sendTextDTO
.
getWechatUserId
());
sendPicMessageVO
.
setAltId
(
robotId
);
sendPicMessageVO
.
setPicUrl
(
"https://oss.5rs.me/oss/uploadfe/jpg/ed67ad219eab128dcd404844ee966483.jpg"
);
sendPicMessageVO
.
setIp
(
sendTextDTO
.
getIp
());
sendPicMessageVO
.
setCode
(
sendTextDTO
.
getCode
());
sendPicMessageVO
.
setWxId
(
sendTextDTO
.
getWechatUserId
());
WxGroupSDK
.
sendPicMessage
(
sendPicMessageVO
);
log
.
info
(
"发送特殊名片"
+
sendPicMessageVO
.
toString
());
}
}
if
(
"学前"
.
equals
(
content
)){
String
wxGroupId
=
""
;
if
(
envStr
.
toUpperCase
().
equals
(
"TEST"
)&&
robotId
.
equals
(
"wxid_zus32xb5ukjn22"
)
&&
new
Long
(
1621L
).
equals
(
bookGroupCipherUser
.
getBookGroupId
())){
wxGroupId
=
"19066199642@chatroom"
;
}
if
(
envStr
.
toUpperCase
().
equals
(
"UAT"
)&&
robotId
.
equals
(
"wxid_51ff9f099l9a22"
)
&&
new
Long
(
449L
).
equals
(
bookGroupCipherUser
.
getBookGroupId
())){
wxGroupId
=
""
;
}
if
(
envStr
.
toUpperCase
().
equals
(
"PRO"
)&&
robotId
.
equals
(
"wxid_x8i897ryabo722"
)
&&
new
Long
(
23735L
).
equals
(
bookGroupCipherUser
.
getBookGroupId
())){
wxGroupId
=
"23084048866@chatroom"
;
}
if
(!
StringUtil
.
isEmpty
(
wxGroupId
)){
SendGroupInviteVO
sendGroupInviteVO
=
new
SendGroupInviteVO
();
sendGroupInviteVO
.
setAltId
(
sendTextDTO
.
getWxId
());
sendGroupInviteVO
.
setWxId
(
sendTextDTO
.
getWechatUserId
());
sendGroupInviteVO
.
setWxGroupId
(
wxGroupId
);
sendGroupInviteVO
.
setIp
(
sendTextDTO
.
getIp
());
WxGroupSDK
.
sendGroupInvite
(
sendGroupInviteVO
);
log
.
info
(
"临时发送入群连接 sendGroupInviteVO:{}"
,
sendGroupInviteVO
);
}
}
}
else
{
BookGroup
bookGroup
=
bookGroupDao
.
getByShortBookName
(
content
);
if
(
bookGroup
==
null
)
{
...
...
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