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
9559320d
Commit
9559320d
authored
Sep 24, 2019
by
阮思源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改1v1入群逻辑
parent
383a8c30
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
188 additions
and
154 deletions
+188
-154
BookGroupBizImpl.java
...java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
+3
-23
BookGroupCipherUserDao.java
...ava/com/pcloud/book/group/dao/BookGroupCipherUserDao.java
+15
-0
BookGroupClassifyDao.java
.../java/com/pcloud/book/group/dao/BookGroupClassifyDao.java
+1
-1
BookGroupDao.java
...src/main/java/com/pcloud/book/group/dao/BookGroupDao.java
+7
-0
BookGroupCipherUserDaoImpl.java
...cloud/book/group/dao/impl/BookGroupCipherUserDaoImpl.java
+19
-0
BookGroupClassifyDaoImpl.java
.../pcloud/book/group/dao/impl/BookGroupClassifyDaoImpl.java
+2
-2
BookGroupDaoImpl.java
...java/com/pcloud/book/group/dao/impl/BookGroupDaoImpl.java
+5
-0
OwnAltQrcodeInfoDTO.java
...n/java/com/pcloud/book/group/dto/OwnAltQrcodeInfoDTO.java
+12
-0
BookGroupCipherUser.java
...ava/com/pcloud/book/group/entity/BookGroupCipherUser.java
+57
-0
GroupQrcode4ClassifyVO.java
...java/com/pcloud/book/group/vo/GroupQrcode4ClassifyVO.java
+12
-0
BookGuideBizImpl.java
...a/com/pcloud/book/keywords/biz/impl/BookGuideBizImpl.java
+0
-122
BookKeywordBizImpl.java
...com/pcloud/book/keywords/biz/impl/BookKeywordBizImpl.java
+0
-0
BookGroupCipherUser.xml
...k/src/main/resources/mapper/group/BookGroupCipherUser.xml
+39
-0
BookGroupClassify.Mapper.xml
.../main/resources/mapper/group/BookGroupClassify.Mapper.xml
+6
-6
BookGroupMapper.xml
...-book/src/main/resources/mapper/group/BookGroupMapper.xml
+10
-0
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
View file @
9559320d
...
@@ -1255,6 +1255,9 @@ public class BookGroupBizImpl implements BookGroupBiz {
...
@@ -1255,6 +1255,9 @@ public class BookGroupBizImpl implements BookGroupBiz {
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"没有该社群码"
);
throw
new
BookBizException
(
BookBizException
.
PARAM_IS_ERROR
,
"没有该社群码"
);
}
}
ownAltQrcodeInfoDTO
.
setCustomerServiceName
(
bookGroupDTO
.
getCustomerServiceName
());
ownAltQrcodeInfoDTO
.
setCustomerServiceName
(
bookGroupDTO
.
getCustomerServiceName
());
//这里的暗号从社群书获取
ownAltQrcodeInfoDTO
.
setCipher
(
bookGroupDTO
.
getBookGroupCipher
());
ownAltQrcodeInfoDTO
.
setAddFriendGuide
(
bookGroupDTO
.
getAddFriendGuide
());
Long
bookId
=
bookGroupDTO
.
getBookId
();
Long
bookId
=
bookGroupDTO
.
getBookId
();
Map
<
String
,
Object
>
paramMap
=
Maps
.
newHashMap
();
Map
<
String
,
Object
>
paramMap
=
Maps
.
newHashMap
();
paramMap
.
put
(
"bookId"
,
bookId
);
paramMap
.
put
(
"bookId"
,
bookId
);
...
@@ -1276,29 +1279,6 @@ public class BookGroupBizImpl implements BookGroupBiz {
...
@@ -1276,29 +1279,6 @@ public class BookGroupBizImpl implements BookGroupBiz {
ownAltQrcodeInfoDTO
.
setAltNickName
(
selfRobotDTO
.
getNickName
());
ownAltQrcodeInfoDTO
.
setAltNickName
(
selfRobotDTO
.
getNickName
());
ownAltQrcodeInfoDTO
.
setAltQrcodeUrl
(
selfRobotDTO
.
getQrcodeUrl
());
ownAltQrcodeInfoDTO
.
setAltQrcodeUrl
(
selfRobotDTO
.
getQrcodeUrl
());
ownAltQrcodeInfoDTO
.
setAltHeadUrl
(
selfRobotDTO
.
getHeadPic
());
ownAltQrcodeInfoDTO
.
setAltHeadUrl
(
selfRobotDTO
.
getHeadPic
());
//获取之前是否有没有使用的暗号
JoinGroupCipher
joinGroupCipher
=
joinGroupCipherDao
.
getByCondition
(
wechatUserId
,
bookGroupId
,
CipherTypeEnum
.
BOOK_GROUP_CIPHER
.
code
);
String
cipher
;
if
(
joinGroupCipher
!=
null
)
{
cipher
=
joinGroupCipher
.
getCipher
();
}
else
{
//新增暗号
cipher
=
UUIDUitl
.
generateShort
();
//查重,如果有重复,再次生成
JoinGroupCipher
joinGroupCipherHas
=
joinGroupCipherDao
.
getByCipher
(
cipher
);
if
(
joinGroupCipherHas
!=
null
)
{
cipher
=
UUIDUitl
.
generateShort
();
}
cipher
=
"RAYS_"
+
cipher
;
JoinGroupCipher
joinGroupCipherNew
=
new
JoinGroupCipher
();
joinGroupCipherNew
.
setCipher
(
cipher
);
joinGroupCipherNew
.
setWechatUserId
(
wechatUserId
);
joinGroupCipherNew
.
setBookGroupId
(
bookGroupId
);
joinGroupCipherNew
.
setAltId
(
selfRobotDTO
.
getWxId
());
joinGroupCipherNew
.
setType
(
CipherTypeEnum
.
BOOK_GROUP_CIPHER
.
code
);
joinGroupCipherDao
.
insert
(
joinGroupCipherNew
);
}
ownAltQrcodeInfoDTO
.
setCipher
(
cipher
);
return
ownAltQrcodeInfoDTO
;
return
ownAltQrcodeInfoDTO
;
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/BookGroupCipherUserDao.java
0 → 100644
View file @
9559320d
package
com
.
pcloud
.
book
.
group
.
dao
;
import
com.pcloud.book.group.entity.BookGroupCipherUser
;
import
com.pcloud.common.core.dao.BaseDao
;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/9/24 15:18
**/
public
interface
BookGroupCipherUserDao
extends
BaseDao
<
BookGroupCipherUser
>
{
Long
getBookGroupIdByWxUserId
(
String
wxUserId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/BookGroupClassifyDao.java
View file @
9559320d
...
@@ -263,5 +263,5 @@ public interface BookGroupClassifyDao extends BaseDao<BookGroupClassify> {
...
@@ -263,5 +263,5 @@ public interface BookGroupClassifyDao extends BaseDao<BookGroupClassify> {
List
<
ListClassifyVO
>
getClassifyIngoreDelete
(
Long
bookGroupId
);
List
<
ListClassifyVO
>
getClassifyIngoreDelete
(
Long
bookGroupId
);
List
<
BookGroupClassify
>
getListByBookGroupId
s
(
List
<
Long
>
bookGroupIds
);
List
<
BookGroupClassify
>
getListByBookGroupId
(
Long
bookGroupId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/BookGroupDao.java
View file @
9559320d
...
@@ -162,4 +162,11 @@ public interface BookGroupDao extends BaseDao<BookGroup> {
...
@@ -162,4 +162,11 @@ public interface BookGroupDao extends BaseDao<BookGroup> {
* @return
* @return
*/
*/
public
Integer
getBookGroupFriendsCountByAdviser
(
Long
adviserId
);
public
Integer
getBookGroupFriendsCountByAdviser
(
Long
adviserId
);
/**
* 根据社群码暗号获取社群码
* @param bookGroupCipher
* @return
*/
BookGroup
getByBookGroupCipher
(
String
bookGroupCipher
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/BookGroupCipherUserDaoImpl.java
0 → 100644
View file @
9559320d
package
com
.
pcloud
.
book
.
group
.
dao
.
impl
;
import
com.pcloud.book.group.dao.BookGroupCipherUserDao
;
import
com.pcloud.book.group.entity.BookGroupCipherUser
;
import
com.pcloud.common.core.dao.BaseDaoImpl
;
import
org.springframework.stereotype.Component
;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/9/24 15:19
**/
@Component
(
"bookGroupCipherUserDao"
)
public
class
BookGroupCipherUserDaoImpl
extends
BaseDaoImpl
<
BookGroupCipherUser
>
implements
BookGroupCipherUserDao
{
@Override
public
Long
getBookGroupIdByWxUserId
(
String
wxUserId
)
{
return
this
.
getSqlSession
().
selectOne
(
this
.
getStatement
(
"getBookGroupIdByWxUserId"
),
wxUserId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/BookGroupClassifyDaoImpl.java
View file @
9559320d
...
@@ -250,7 +250,7 @@ public class BookGroupClassifyDaoImpl extends BaseDaoImpl<BookGroupClassify> imp
...
@@ -250,7 +250,7 @@ public class BookGroupClassifyDaoImpl extends BaseDaoImpl<BookGroupClassify> imp
}
}
@Override
@Override
public
List
<
BookGroupClassify
>
getListByBookGroupId
s
(
List
<
Long
>
bookGroupIds
)
{
public
List
<
BookGroupClassify
>
getListByBookGroupId
(
Long
bookGroupId
)
{
return
this
.
getSqlSession
().
selectList
(
this
.
getStatement
(
"getListByBookGroupIds"
),
bookGroupId
s
);
return
this
.
getSqlSession
().
selectList
(
this
.
getStatement
(
"getListByBookGroupIds"
),
bookGroupId
);
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/BookGroupDaoImpl.java
View file @
9559320d
...
@@ -168,4 +168,9 @@ public class BookGroupDaoImpl extends BaseDaoImpl<BookGroup> implements BookGrou
...
@@ -168,4 +168,9 @@ public class BookGroupDaoImpl extends BaseDaoImpl<BookGroup> implements BookGrou
public
Integer
getBookGroupFriendsCountByAdviser
(
Long
adviserId
)
{
public
Integer
getBookGroupFriendsCountByAdviser
(
Long
adviserId
)
{
return
this
.
getSqlSession
().
selectOne
(
getStatement
(
"getBookGroupFriendsCountByAdviser"
),
adviserId
);
return
this
.
getSqlSession
().
selectOne
(
getStatement
(
"getBookGroupFriendsCountByAdviser"
),
adviserId
);
}
}
@Override
public
BookGroup
getByBookGroupCipher
(
String
bookGroupCipher
)
{
return
this
.
getSqlSession
().
selectOne
(
getStatement
(
"getByBookGroupCipher"
),
bookGroupCipher
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dto/OwnAltQrcodeInfoDTO.java
View file @
9559320d
...
@@ -31,6 +31,9 @@ public class OwnAltQrcodeInfoDTO implements Serializable {
...
@@ -31,6 +31,9 @@ public class OwnAltQrcodeInfoDTO implements Serializable {
@ApiModelProperty
(
"客服称谓"
)
@ApiModelProperty
(
"客服称谓"
)
private
String
customerServiceName
;
private
String
customerServiceName
;
@ApiModelProperty
(
"加好友宣传语"
)
private
String
addFriendGuide
;
public
String
getAltId
()
{
public
String
getAltId
()
{
return
altId
;
return
altId
;
}
}
...
@@ -79,6 +82,14 @@ public class OwnAltQrcodeInfoDTO implements Serializable {
...
@@ -79,6 +82,14 @@ public class OwnAltQrcodeInfoDTO implements Serializable {
this
.
customerServiceName
=
customerServiceName
;
this
.
customerServiceName
=
customerServiceName
;
}
}
public
String
getAddFriendGuide
()
{
return
addFriendGuide
;
}
public
void
setAddFriendGuide
(
String
addFriendGuide
)
{
this
.
addFriendGuide
=
addFriendGuide
;
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"OwnAltQrcodeInfoDTO{"
+
return
"OwnAltQrcodeInfoDTO{"
+
...
@@ -88,6 +99,7 @@ public class OwnAltQrcodeInfoDTO implements Serializable {
...
@@ -88,6 +99,7 @@ public class OwnAltQrcodeInfoDTO implements Serializable {
", altQrcodeUrl='"
+
altQrcodeUrl
+
'\''
+
", altQrcodeUrl='"
+
altQrcodeUrl
+
'\''
+
", cipher='"
+
cipher
+
'\''
+
", cipher='"
+
cipher
+
'\''
+
", customerServiceName='"
+
customerServiceName
+
'\''
+
", customerServiceName='"
+
customerServiceName
+
'\''
+
", addFriendGuide='"
+
addFriendGuide
+
'\''
+
'}'
;
'}'
;
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/entity/BookGroupCipherUser.java
0 → 100644
View file @
9559320d
package
com
.
pcloud
.
book
.
group
.
entity
;
import
com.pcloud.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
/**
* @Description
* @Author ruansiyuan
* @Date 2019/9/24 15:16
**/
@ApiModel
(
"社群书暗号关联用户"
)
public
class
BookGroupCipherUser
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1763812276337850708L
;
@ApiModelProperty
(
"社群码id"
)
private
Long
bookGroupId
;
@ApiModelProperty
(
"社群码暗号"
)
private
String
bookGroupCipher
;
@ApiModelProperty
(
"用户微信id"
)
private
String
wxUserId
;
public
Long
getBookGroupId
()
{
return
bookGroupId
;
}
public
void
setBookGroupId
(
Long
bookGroupId
)
{
this
.
bookGroupId
=
bookGroupId
;
}
public
String
getBookGroupCipher
()
{
return
bookGroupCipher
;
}
public
void
setBookGroupCipher
(
String
bookGroupCipher
)
{
this
.
bookGroupCipher
=
bookGroupCipher
;
}
public
String
getWxUserId
()
{
return
wxUserId
;
}
public
void
setWxUserId
(
String
wxUserId
)
{
this
.
wxUserId
=
wxUserId
;
}
@Override
public
String
toString
()
{
return
"BookGroupCipherUser{"
+
"bookGroupId="
+
bookGroupId
+
", bookGroupCipher='"
+
bookGroupCipher
+
'\''
+
", wxUserId='"
+
wxUserId
+
'\''
+
"} "
+
super
.
toString
();
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/vo/GroupQrcode4ClassifyVO.java
View file @
9559320d
...
@@ -36,6 +36,9 @@ public class GroupQrcode4ClassifyVO implements Serializable {
...
@@ -36,6 +36,9 @@ public class GroupQrcode4ClassifyVO implements Serializable {
@ApiModelProperty
(
"分类名称"
)
@ApiModelProperty
(
"分类名称"
)
private
String
classify
;
private
String
classify
;
@ApiModelProperty
(
"微信群名称"
)
private
String
weixinGroupId
;
public
String
getClassify
()
{
public
String
getClassify
()
{
return
classify
;
return
classify
;
}
}
...
@@ -92,6 +95,14 @@ public class GroupQrcode4ClassifyVO implements Serializable {
...
@@ -92,6 +95,14 @@ public class GroupQrcode4ClassifyVO implements Serializable {
this
.
spareQr
=
spareQr
;
this
.
spareQr
=
spareQr
;
}
}
public
String
getWeixinGroupId
()
{
return
weixinGroupId
;
}
public
void
setWeixinGroupId
(
String
weixinGroupId
)
{
this
.
weixinGroupId
=
weixinGroupId
;
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"GroupQrcode4ClassifyVO{"
+
return
"GroupQrcode4ClassifyVO{"
+
...
@@ -102,6 +113,7 @@ public class GroupQrcode4ClassifyVO implements Serializable {
...
@@ -102,6 +113,7 @@ public class GroupQrcode4ClassifyVO implements Serializable {
", groupQrcodeId="
+
groupQrcodeId
+
", groupQrcodeId="
+
groupQrcodeId
+
", spareQr='"
+
spareQr
+
'\''
+
", spareQr='"
+
spareQr
+
'\''
+
", classify='"
+
classify
+
'\''
+
", classify='"
+
classify
+
'\''
+
", weixinGroupId='"
+
weixinGroupId
+
'\''
+
'}'
;
'}'
;
}
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/impl/BookGuideBizImpl.java
View file @
9559320d
...
@@ -26,7 +26,6 @@ import com.pcloud.book.group.enums.CipherTypeEnum;
...
@@ -26,7 +26,6 @@ import com.pcloud.book.group.enums.CipherTypeEnum;
import
com.pcloud.book.group.enums.TouchTypeEnum
;
import
com.pcloud.book.group.enums.TouchTypeEnum
;
import
com.pcloud.book.group.tools.SendWeixinRequestTools
;
import
com.pcloud.book.group.tools.SendWeixinRequestTools
;
import
com.pcloud.book.group.vo.GroupQrcodeBaseInfoVO
;
import
com.pcloud.book.group.vo.GroupQrcodeBaseInfoVO
;
import
com.pcloud.book.group.vo.ListClassifyVO
;
import
com.pcloud.book.keywords.biz.BookGuideBiz
;
import
com.pcloud.book.keywords.biz.BookGuideBiz
;
import
com.pcloud.book.keywords.biz.BookKeywordBiz
;
import
com.pcloud.book.keywords.biz.BookKeywordBiz
;
import
com.pcloud.book.keywords.dao.BookGuideDao
;
import
com.pcloud.book.keywords.dao.BookGuideDao
;
...
@@ -107,10 +106,6 @@ public class BookGuideBizImpl implements BookGuideBiz {
...
@@ -107,10 +106,6 @@ public class BookGuideBizImpl implements BookGuideBiz {
private
KeywordDao
keywordDao
;
private
KeywordDao
keywordDao
;
@Autowired
@Autowired
private
WeixinClockGroupClassifyDao
weixinClockGroupClassifyDao
;
private
WeixinClockGroupClassifyDao
weixinClockGroupClassifyDao
;
/**
* 字符串切割长度
*/
private
static
final
Integer
LE
=
1000
;
@ParamLog
(
"同意加好友发送欢迎语"
)
@ParamLog
(
"同意加好友发送欢迎语"
)
@Override
@Override
...
@@ -127,12 +122,6 @@ public class BookGuideBizImpl implements BookGuideBiz {
...
@@ -127,12 +122,6 @@ public class BookGuideBizImpl implements BookGuideBiz {
log
.
info
(
"[同意加好友发送欢迎语] 暗号为空 agreeAddUserDTO:{}"
,
agreeAddUserDTO
);
log
.
info
(
"[同意加好友发送欢迎语] 暗号为空 agreeAddUserDTO:{}"
,
agreeAddUserDTO
);
return
;
return
;
}
}
// 判断是否是书的暗号,如果是,就走书的暗号流程
JoinGroupCipher
joinGroupCipher
=
joinGroupCipherDao
.
getByCipher
(
cipher
);
if
(
joinGroupCipher
!=
null
&&
CipherTypeEnum
.
BOOK_GROUP_CIPHER
.
code
.
equals
(
joinGroupCipher
.
getType
()))
{
dealByBookGroup
(
joinGroupCipher
,
agreeAddUserDTO
);
return
;
}
final
JoinGroupCipherDTO
dto
=
joinGroupCipherDao
.
getDTOByCipher
(
cipher
);
final
JoinGroupCipherDTO
dto
=
joinGroupCipherDao
.
getDTOByCipher
(
cipher
);
//获取群
//获取群
GroupQrcodeBaseInfoVO
wxGroup
=
bookGroupClassifyBiz
.
getWxGroupIdByClassifyIdAndWechatId
(
dto
.
getClassifyId
(),
dto
.
getWechatUserId
());
GroupQrcodeBaseInfoVO
wxGroup
=
bookGroupClassifyBiz
.
getWxGroupIdByClassifyIdAndWechatId
(
dto
.
getClassifyId
(),
dto
.
getWechatUserId
());
...
@@ -209,117 +198,6 @@ public class BookGuideBizImpl implements BookGuideBiz {
...
@@ -209,117 +198,6 @@ public class BookGuideBizImpl implements BookGuideBiz {
}
}
}
}
@ParamLog
(
"按照书处理暗号回复"
)
private
void
dealByBookGroup
(
JoinGroupCipher
joinGroupCipher
,
AgreeAddUserDTO
agreeAddUserDTO
)
{
Long
bookGroupId
=
joinGroupCipher
.
getBookGroupId
();
BookGroupDTO
bookGroupDTO
=
bookGroupDao
.
getBookBaseInfoById
(
bookGroupId
);
String
text
=
""
;
Boolean
isInviteGroup
=
bookGroupDTO
.
getIsInviteGroup
();
String
addFriendGuide
=
bookGroupDTO
.
getAddFriendGuide
();
if
(!
StringUtil
.
isEmpty
(
addFriendGuide
))
{
text
=
text
+
addFriendGuide
+
"\n"
;
}
//获取配套关键词
List
<
KeywordDTO
>
keywordDTOS
=
bookKeywordBiz
.
getListByBookGroupId
(
bookGroupId
);
if
(!
ListUtils
.
isEmpty
(
keywordDTOS
))
{
text
=
text
+
"回复括号内关键词领取本书配套资源学习资料:\n"
;
for
(
KeywordDTO
keywordDTO
:
keywordDTOS
)
{
if
(!
StringUtil
.
isEmpty
(
keywordDTO
.
getKeywords
()))
{
text
=
text
+
"【"
+
keywordDTO
.
getKeywords
()
+
"】"
;
}
}
text
=
text
+
"\n"
;
}
//邀请进群
if
(
isInviteGroup
!=
null
&&
isInviteGroup
)
{
//获取社群码下的分类
List
<
ListClassifyVO
>
listClassifyVOS
=
bookGroupClassifyBiz
.
listAllClassify
(
bookGroupId
);
if
(!
ListUtils
.
isEmpty
(
listClassifyVOS
))
{
if
(
listClassifyVOS
.
size
()
==
1
)
{
ListClassifyVO
listClassifyVO
=
listClassifyVOS
.
get
(
0
);
//如果只有一个分类
text
=
text
+
"本书还配有交流群“"
+
listClassifyVO
.
getClassify
()
+
"”,"
+
listClassifyVO
.
getClassifyIntroduce
()
+
",点击下方邀请链接,即可进群"
;
//发送欢迎语
if
(
text
.
length
()
>
LE
)
{
sendTextBatch
(
agreeAddUserDTO
,
text
,
LE
);
}
else
{
sendText
(
agreeAddUserDTO
,
text
);
}
dealGroupInvite
(
agreeAddUserDTO
,
listClassifyVO
.
getId
(),
joinGroupCipher
.
getWechatUserId
());
}
else
{
text
=
text
+
"本书还配有以下交流群,选择你想加入的微信群,回复群名称,我会拉你入群!\n"
;
for
(
ListClassifyVO
listClassifyVO
:
listClassifyVOS
)
{
text
=
text
+
listClassifyVO
.
getClassify
()
+
":"
+
listClassifyVO
.
getClassifyIntroduce
()
+
"\n"
;
}
//发送欢迎语
if
(
text
.
length
()
>
LE
)
{
sendTextBatch
(
agreeAddUserDTO
,
text
,
LE
);
}
else
{
sendText
(
agreeAddUserDTO
,
text
);
}
}
}
return
;
}
//发送欢迎语
if
(
text
.
length
()
>
LE
)
{
sendTextBatch
(
agreeAddUserDTO
,
text
,
LE
);
}
else
{
sendText
(
agreeAddUserDTO
,
text
);
}
}
@ParamLog
(
"发送收到暗号后的本书介绍"
)
private
void
sendText
(
AgreeAddUserDTO
agreeAddUserDTO
,
String
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
(
"发送收到暗号后的本书介绍 : {}"
,
vo
);
}
@ParamLog
(
"发送收到暗号后的本书介绍"
)
private
void
sendTextBatch
(
AgreeAddUserDTO
agreeAddUserDTO
,
String
content
,
Integer
le
)
{
List
<
String
>
contents
=
new
ArrayList
<>();
String
s
=
content
;
while
(
s
.
length
()
>
le
)
{
contents
.
add
(
s
.
substring
(
0
,
le
));
s
=
s
.
substring
(
le
,
s
.
length
());
}
contents
.
add
(
s
);
for
(
String
sin
:
contents
)
{
sendText
(
agreeAddUserDTO
,
sin
);
}
}
@ParamLog
(
"分类群发送邀请入群链接"
)
private
void
dealGroupInvite
(
AgreeAddUserDTO
agreeAddUserDTO
,
Long
classifyId
,
Long
wechatUserId
)
{
//获取群
final
GroupQrcodeBaseInfoVO
wxGroup
=
bookGroupClassifyBiz
.
getWxGroupIdByClassifyIdAndWechatId
(
classifyId
,
wechatUserId
);
if
(
null
==
wxGroup
)
{
log
.
error
(
"[同意加好友发送欢迎语] : bookGroupClassifyBiz.getWxGroupIdByClassifyIdAndWechatId dto:{}"
);
throw
new
BookBizException
(
BookBizException
.
ID_NOT_EXIST
,
"群不存在"
);
}
String
wxGroupId
=
wxGroup
.
getWeixinGroupId
();
//发送邀请入群
SendGroupInviteVO
sendGroupInviteVO
=
new
SendGroupInviteVO
();
sendGroupInviteVO
.
setAltId
(
agreeAddUserDTO
.
getRobotWxId
());
sendGroupInviteVO
.
setWxId
(
agreeAddUserDTO
.
getUserWxId
());
sendGroupInviteVO
.
setWxGroupId
(
wxGroupId
);
sendGroupInviteVO
.
setIp
(
agreeAddUserDTO
.
getIp
());
WxGroupSDK
.
sendGroupInvite
(
sendGroupInviteVO
);
log
.
info
(
"[同意加好友发送欢迎语] 发送进群链接 sendGroupInviteVO:{}"
,
sendGroupInviteVO
);
}
@ParamLog
(
"进群之后更新群qrCodeId"
)
@ParamLog
(
"进群之后更新群qrCodeId"
)
private
void
updateQrcodeForCipher
(
String
wxGroupId
,
String
cipher
,
String
userWxId
){
private
void
updateQrcodeForCipher
(
String
wxGroupId
,
String
cipher
,
String
userWxId
){
log
.
info
(
"根据群id查询群信息wxGroupId"
,
wxGroupId
);
log
.
info
(
"根据群id查询群信息wxGroupId"
,
wxGroupId
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/impl/BookKeywordBizImpl.java
View file @
9559320d
This diff is collapsed.
Click to expand it.
pcloud-service-book/src/main/resources/mapper/group/BookGroupCipherUser.xml
0 → 100644
View file @
9559320d
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.pcloud.book.group.dao.impl.BookGroupCipherUserDaoImpl"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.group.entity.BookGroupCipherUser"
>
<id
column=
"id"
property=
"id"
jdbcType=
"BIGINT"
/>
<result
column=
"book_group_id"
property=
"bookGroupId"
jdbcType=
"BIGINT"
/>
<result
column=
"book_group_cipher"
property=
"bookGroupCipher"
jdbcType=
"VARCHAR"
/>
<result
column=
"wx_user_id"
property=
"wxUserId"
jdbcType=
"VARCHAR"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, book_group_id, book_group_cipher, wx_user_id, create_time
</sql>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.group.entity.BookGroupCipherUser"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into book_group_cipher_user
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
book_group_id,
book_group_cipher,
wx_user_id,
create_time
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
#{bookGroupId,jdbcType=BIGINT},
#{bookGroupCipher,jdbcType=VARCHAR},
#{wxUserId,jdbcType=VARCHAR},
NOW()
</trim>
</insert>
<!--根据用户查询社群码id-->
<select
id=
"getBookGroupIdByWxUserId"
parameterType=
"String"
resultType=
"long"
>
select book_group_id t where t.wx_user_id=#{wxUserId} order by create_time desc limit 1
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/group/BookGroupClassify.Mapper.xml
View file @
9559320d
...
@@ -402,10 +402,11 @@
...
@@ -402,10 +402,11 @@
classify_id classifyId,
classify_id classifyId,
id groupQrcodeId,
id groupQrcodeId,
qrcode_url qrcodeUrl,
qrcode_url qrcodeUrl,
weixin_group_id weixinGroupId,
group_name groupName
group_name groupName
FROM
FROM
book_group_qrcode
book_group_qrcode
WHERE user_number
<![CDATA[ < ]]>
#{changeNumber} AND classify_id = #{classifyId} AND use_state = 1 AND is_delete = 0 limit 1
WHERE user_number
<![CDATA[ < ]]>
#{changeNumber} AND classify_id = #{classifyId} AND use_state = 1 AND is_delete = 0
order by user_number asc
limit 1
</select>
</select>
<select
id=
"listGroupClassifyByAdviser"
resultType=
"com.pcloud.book.group.vo.BookGroupClassifyVO"
parameterType=
"map"
>
<select
id=
"listGroupClassifyByAdviser"
resultType=
"com.pcloud.book.group.vo.BookGroupClassifyVO"
parameterType=
"map"
>
...
@@ -976,16 +977,14 @@
...
@@ -976,16 +977,14 @@
</select>
</select>
<!--根据社群码id集合获取-->
<!--根据社群码id集合获取-->
<select
id=
"getListByBookGroupId
s
"
parameterType=
"list"
resultMap=
"BaseResultMap"
>
<select
id=
"getListByBookGroupId"
parameterType=
"list"
resultMap=
"BaseResultMap"
>
SELECT
SELECT
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
FROM
FROM
book_group_classify t
book_group_classify t
WHERE
WHERE
t.book_group_id IN
t.book_group_id =#{bookGroupId}
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
AND t.is_delete = 0
AND t.is_delete = 0
order by create_time asc
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/group/BookGroupMapper.xml
View file @
9559320d
...
@@ -426,4 +426,13 @@
...
@@ -426,4 +426,13 @@
AND G.is_delete = 0
AND G.is_delete = 0
AND c.has_used = 1
AND c.has_used = 1
</select>
</select>
<!--根据社群码暗号获取-->
<select
id=
"getByBookGroupCipher"
parameterType=
"String"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from book_group
where book_group_cipher=#{bookGroupCipher}
and is_delete=0
limit 1
</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