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
9fc84683
Commit
9fc84683
authored
May 17, 2019
by
lili
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合并代码
parent
3e5f1ad6
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
118 additions
and
29 deletions
+118
-29
GroupQrcodeBaseDTO.java
...in/java/com/pcloud/book/group/dto/GroupQrcodeBaseDTO.java
+13
-0
ReaderConsr.java
...ain/java/com/pcloud/book/consumer/reader/ReaderConsr.java
+15
-0
BookGroupClassifyBizImpl.java
.../pcloud/book/group/biz/impl/BookGroupClassifyBizImpl.java
+4
-1
GroupQrcodeBizImpl.java
...va/com/pcloud/book/group/biz/impl/GroupQrcodeBizImpl.java
+10
-0
GroupQrcodeInfoDTO.java
...in/java/com/pcloud/book/group/dto/GroupQrcodeInfoDTO.java
+11
-0
GroupQrcode.java
...c/main/java/com/pcloud/book/group/entity/GroupQrcode.java
+10
-0
SendWeixinRequestTools.java
...a/com/pcloud/book/group/tools/SendWeixinRequestTools.java
+14
-0
ListClassify4WechatVO.java
.../java/com/pcloud/book/group/vo/ListClassify4WechatVO.java
+3
-1
BookGuideBizImpl.java
...a/com/pcloud/book/keywords/biz/impl/BookGuideBizImpl.java
+15
-7
BookGroupClassify.Mapper.xml
.../main/resources/mapper/group/BookGroupClassify.Mapper.xml
+17
-15
GroupQrcode.Mapper.xml
...ok/src/main/resources/mapper/group/GroupQrcode.Mapper.xml
+4
-3
BookKeyword.Mapper.xml
...src/main/resources/mapper/keywords/BookKeyword.Mapper.xml
+2
-2
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/group/dto/GroupQrcodeBaseDTO.java
View file @
9fc84683
...
...
@@ -18,6 +18,19 @@ public class GroupQrcodeBaseDTO implements Serializable {
*/
private
String
groupName
;
/**
* 图书名称
*/
private
String
bookName
;
public
String
getBookName
()
{
return
bookName
;
}
public
void
setBookName
(
String
bookName
)
{
this
.
bookName
=
bookName
;
}
public
String
getWeixinGroupId
()
{
return
weixinGroupId
;
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/consumer/reader/ReaderConsr.java
View file @
9fc84683
package
com
.
pcloud
.
book
.
consumer
.
reader
;
import
com.alibaba.druid.support.json.JSONUtils
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.ResponseHandleUtil
;
import
com.pcloud.readercenter.wechat.dto.WechatUserRobotDto
;
import
com.pcloud.readercenter.wechat.entity.WechatUser
;
...
...
@@ -12,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @author lily
...
...
@@ -55,6 +58,18 @@ public class ReaderConsr {
}
return
null
;
}
@ParamLog
(
"获取9个用户头像"
)
public
String
getNineHeadUrl
()
{
List
<
WechatUserRobotDto
>
wechatUsers
=
this
.
selectRobotsRandom
(
9
);
if
(
ListUtils
.
isEmpty
(
wechatUsers
))
{
return
""
;
}
List
<
String
>
headUrls
=
wechatUsers
.
stream
().
map
(
a
->
a
.
getWechatUserHeadUrl
()).
collect
(
Collectors
.
toList
());
return
JSONUtils
.
toJSONString
(
headUrls
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupClassifyBizImpl.java
View file @
9fc84683
package
com
.
pcloud
.
book
.
group
.
biz
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.consumer.common.ExportConsr
;
import
com.pcloud.book.consumer.message.MessageConsr
;
...
...
@@ -158,6 +159,7 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
groupQrcode
.
setGroupSeq
(
1
);
groupQrcode
.
setGroupName
(
groupName
+
addClassifyVO
.
getClassify
()
+
"1群"
);
groupQrcode
.
setClassifyId
(
bookGroupClassify
.
getId
());
groupQrcode
.
setQrcodeHeadUrl
(
readerConsr
.
getNineHeadUrl
());
groupQrcodeBiz
.
insert
(
groupQrcode
);
//新增一个规格
Long
specId
=
addSpecification
(
bookGroupClassify
.
getPrice
(),
qrcodeNameAndProId
.
getProductId
(),
addClassifyVO
.
getChannelId
(),
bookGroupClassify
.
getClassify
());
...
...
@@ -396,7 +398,7 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
//设置二维码信息
setGroupQrcodeInfo
(
listClassify4WechatVOS
);
//获取头像信息
setUserHeader
(
listClassify4WechatVOS
);
//
setUserHeader(listClassify4WechatVOS);
//设置是否购买
setIsBuy
(
listClassify4WechatVOS
,
wechatUserId
);
return
listClassify4WechatVOS
;
...
...
@@ -736,6 +738,7 @@ public class BookGroupClassifyBizImpl implements BookGroupClassifyBiz {
if
(
groupQrcodeInfoDTO
!=
null
)
{
listClassify4WechatVO
.
setUserNumber
(
groupQrcodeInfoDTO
.
getUserNumber
());
listClassify4WechatVO
.
setGroupSeq
(
groupQrcodeInfoDTO
.
getGroupSeq
());
listClassify4WechatVO
.
setHeadUrl
(
JSONObject
.
parseArray
(
groupQrcodeInfoDTO
.
getQrcodeHeadUrl
(),
String
.
class
));
}
}
}
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/GroupQrcodeBizImpl.java
View file @
9fc84683
package
com
.
pcloud
.
book
.
group
.
biz
.
impl
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.consumer.reader.ReaderConsr
;
import
com.pcloud.book.consumer.wechatgroup.WechatGroupConsr
;
import
com.pcloud.book.group.biz.BookGroupClassifyBiz
;
import
com.pcloud.book.group.biz.GroupQrcodeBiz
;
...
...
@@ -29,6 +30,7 @@ import com.pcloud.common.page.PageParam;
import
com.pcloud.common.utils.ListUtils
;
import
com.pcloud.common.utils.cache.redis.JedisClusterUtils
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.sdk.wxgroup.WxGroupSDK
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -61,6 +63,8 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
private
BookMQProducer
bookMQProducer
;
@Autowired
private
BookKeywordRecordDao
bookKeywordRecordDao
;
@Autowired
private
ReaderConsr
readerConsr
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -159,6 +163,11 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
@Override
@ParamLog
(
"新增一个用户"
)
public
void
addOneUser
(
String
weixinGroupId
,
Integer
memberCount
)
{
String
robotIdByGroupId
=
wechatGroupConsr
.
getRobotIdByGroupId
(
weixinGroupId
);
Integer
peopleCounts
=
WxGroupSDK
.
getPeopleCounts
(
weixinGroupId
,
robotIdByGroupId
);
if
(
peopleCounts
!=
null
)
{
memberCount
=
peopleCounts
;
}
//获取群基本信息
GroupQrcodeDTO
groupQrcodeDTO
=
groupQrcodeDao
.
getGroupQrcodeInfo
(
weixinGroupId
);
if
(
groupQrcodeDTO
==
null
)
{
...
...
@@ -222,6 +231,7 @@ public class GroupQrcodeBizImpl implements GroupQrcodeBiz {
groupQrcode
.
setCreateUser
(
groupNameAndMaxSeqDTO
.
getCreateUser
());
groupQrcode
.
setWeixinQrcodeId
(
oneQrcode
.
getId
());
groupQrcode
.
setGroupSeq
(
maxSeq
);
groupQrcode
.
setQrcodeHeadUrl
(
readerConsr
.
getNineHeadUrl
());
groupQrcode
.
setUserNumber
(
oneQrcode
.
getUserNumber
());
groupQrcode
.
setGroupName
(
groupName
);
groupQrcode
.
setClassifyId
(
classifyId
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/dto/GroupQrcodeInfoDTO.java
View file @
9fc84683
...
...
@@ -14,6 +14,16 @@ public class GroupQrcodeInfoDTO implements Serializable {
private
Integer
userNumber
;
private
String
qrcodeHeadUrl
;
public
String
getQrcodeHeadUrl
()
{
return
qrcodeHeadUrl
;
}
public
void
setQrcodeHeadUrl
(
String
qrcodeHeadUrl
)
{
this
.
qrcodeHeadUrl
=
qrcodeHeadUrl
;
}
public
Long
getId
()
{
return
id
;
}
...
...
@@ -44,6 +54,7 @@ public class GroupQrcodeInfoDTO implements Serializable {
"id="
+
id
+
", groupSeq="
+
groupSeq
+
", userNumber="
+
userNumber
+
", qrcodeHeadUrl='"
+
qrcodeHeadUrl
+
'\''
+
'}'
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/entity/GroupQrcode.java
View file @
9fc84683
...
...
@@ -87,6 +87,16 @@ public class GroupQrcode extends BaseEntity {
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
updateTime
;
private
String
qrcodeHeadUrl
;
public
String
getQrcodeHeadUrl
()
{
return
qrcodeHeadUrl
;
}
public
void
setQrcodeHeadUrl
(
String
qrcodeHeadUrl
)
{
this
.
qrcodeHeadUrl
=
qrcodeHeadUrl
;
}
@Override
public
Long
getId
()
{
return
id
;
...
...
pcloud-service-book/src/main/java/com/pcloud/book/group/tools/SendWeixinRequestTools.java
View file @
9fc84683
...
...
@@ -279,4 +279,18 @@ public class SendWeixinRequestTools {
sendTextMessageVO
.
setGroupId
(
"14108963419@chatroom"
);
WxGroupSDK
.
sendTextMessage
(
sendTextMessageVO
);
}
public
static
void
sendDefaultMessage
(
String
groupName
,
String
robotId
,
String
weixinGroupId
)
{
String
content
=
""
;
if
(
StringUtil
.
isEmpty
(
groupName
))
{
content
=
"欢迎加入本书!凭以下关键词领取任务或资源:"
;
}
else
{
content
=
"欢迎加入本书!\""
+
groupName
+
"\"凭以下关键词领取任务或资源:"
;
}
SendTextMessageVO
sendTextMessageVO
=
new
SendTextMessageVO
();
sendTextMessageVO
.
setContent
(
content
);
sendTextMessageVO
.
setAltId
(
robotId
);
sendTextMessageVO
.
setGroupId
(
weixinGroupId
);
WxGroupSDK
.
sendTextMessage
(
sendTextMessageVO
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/vo/ListClassify4WechatVO.java
View file @
9fc84683
...
...
@@ -179,6 +179,7 @@ public class ListClassify4WechatVO implements Serializable {
public
void
setHeadUrl
(
List
<
String
>
headUrl
)
{
this
.
headUrl
=
headUrl
;
}
@Override
public
String
toString
()
{
return
"ListClassify4WechatVO{"
+
...
...
@@ -187,7 +188,7 @@ public class ListClassify4WechatVO implements Serializable {
", channelId="
+
channelId
+
", bookGroupId="
+
bookGroupId
+
", classify='"
+
classify
+
'\''
+
", classifyIntroduce=
"
+
classifyIntroduce
+
", classifyIntroduce=
'"
+
classifyIntroduce
+
'\''
+
", price="
+
price
+
", productId="
+
productId
+
", productSpecId="
+
productSpecId
+
...
...
@@ -196,6 +197,7 @@ public class ListClassify4WechatVO implements Serializable {
", userNumber="
+
userNumber
+
", headUrl="
+
headUrl
+
", groupQrcodeId="
+
groupQrcodeId
+
", isBuy="
+
isBuy
+
'}'
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/keywords/biz/impl/BookGuideBizImpl.java
View file @
9fc84683
...
...
@@ -5,10 +5,12 @@ import com.pcloud.book.consumer.channel.QrcodeSceneConsr;
import
com.pcloud.book.consumer.resource.ProductConsr
;
import
com.pcloud.book.consumer.wechatgroup.WechatGroupConsr
;
import
com.pcloud.book.group.biz.BookGroupClassifyBiz
;
import
com.pcloud.book.group.biz.GroupQrcodeBiz
;
import
com.pcloud.book.group.dao.BookGroupDao
;
import
com.pcloud.book.group.dto.BookGroupDTO
;
import
com.pcloud.book.group.dto.GroupClassifyQrcodeDTO
;
import
com.pcloud.book.group.tools.SendWeixinRequestTools
;
import
com.pcloud.book.group.vo.GroupQrcodeBaseInfoVO
;
import
com.pcloud.book.keywords.biz.BookGuideBiz
;
import
com.pcloud.book.keywords.biz.BookKeywordBiz
;
import
com.pcloud.book.keywords.dao.BookGuideDao
;
...
...
@@ -59,6 +61,8 @@ public class BookGuideBizImpl implements BookGuideBiz {
private
WechatGroupConsr
wechatGroupConsr
;
@Autowired
private
ProductConsr
productConsr
;
@Autowired
private
GroupQrcodeBiz
groupQrcodeBiz
;
@Override
@ParamLog
(
"新增欢迎语"
)
...
...
@@ -182,15 +186,19 @@ public class BookGuideBizImpl implements BookGuideBiz {
}
else
if
(
bookGuide
!=
null
)
{
replyMessages
=
bookGuideReplyDao
.
getReplyMessage
(
bookGuide
.
getId
());
}
if
(
ListUtils
.
isEmpty
(
replyMessages
))
{
return
;
}
//获取公众号基本信息
AccountSettingDto
wechatInfo
=
qrcodeSceneConsr
.
getWechatInfo
(
classifyQrcodeInfo
.
getChannelId
());
//处理链接
handleUrl
(
replyMessages
,
wechatInfo
,
classifyQrcodeInfo
);
//推送消息
SendWeixinRequestTools
.
sendGuideMessage
(
replyMessages
,
robotId
,
weixinGroupId
);
if
(
ListUtils
.
isEmpty
(
replyMessages
))
{
//获取群名称
GroupQrcodeBaseInfoVO
groupInfo
=
groupQrcodeBiz
.
getBaseById
(
classifyQrcodeInfo
.
getGroupQrcodeId
());
//推送消息
SendWeixinRequestTools
.
sendDefaultMessage
(
groupInfo
==
null
?
""
:
groupInfo
.
getGroupName
(),
robotId
,
weixinGroupId
);
}
else
{
//处理链接
handleUrl
(
replyMessages
,
wechatInfo
,
classifyQrcodeInfo
);
//推送消息
SendWeixinRequestTools
.
sendGuideMessage
(
replyMessages
,
robotId
,
weixinGroupId
);
}
//获取关键词信息
List
<
KeywordDTO
>
keywords
=
bookKeywordBiz
.
listFiveKeyword
(
classifyQrcodeInfo
.
getClassifyId
(),
classifyQrcodeInfo
.
getBookGroupId
());
SendWeixinRequestTools
.
sendKeywordsInfo
(
keywords
,
robotId
,
weixinGroupId
);
...
...
pcloud-service-book/src/main/resources/mapper/group/BookGroupClassify.Mapper.xml
View file @
9fc84683
...
...
@@ -194,7 +194,7 @@
from
book_group_classify c join book_group_qrcode q on c.id = q.classify_id
where
book_group_id = #{_parameter,jdbcType=BIGINT} and c.is_delete = 0 group by c.id order by userNumberTotal desc,id
book_group_id = #{_parameter,jdbcType=BIGINT} and c.is_delete = 0 group by c.id order by userNumberTotal desc,
c.
id
</select>
<select
id=
"getBaseInfoBySpecId"
resultType=
"ClassifyDTO"
parameterType=
"Long"
>
...
...
@@ -226,7 +226,7 @@
from
book_group_classify
where
book_group_id = #{_parameter,jdbcType=BIGINT} and is_delete = 0 order by rank
book_group_id = #{_parameter,jdbcType=BIGINT} and is_delete = 0 order by rank
, id
</select>
<select
id=
"listClassifyByUser"
resultType=
"ClassifyNameVO"
parameterType=
"Long"
>
...
...
@@ -236,7 +236,7 @@
from
book_group_classify c join book_group_qrcode q on c.id = q.classify_id
where
book_group_id = #{_parameter,jdbcType=BIGINT} and c.is_delete = 0 group by c.id order by sum(user_number) desc
book_group_id = #{_parameter,jdbcType=BIGINT} and c.is_delete = 0 group by c.id order by sum(user_number) desc
, c.id
</select>
<select
id=
"getGroupCount"
resultType=
"Integer"
parameterType=
"Long"
>
...
...
@@ -278,7 +278,7 @@
join
book_group g
on
c.book_group_id = g.id and c.id =#{_parameter}
c.book_group_id = g.id and c.id =#{_parameter}
and c.is_delete = 0
LEFT JOIN book_group_qrcode q on c.id = q.classify_id LIMIT 1
</select>
...
...
@@ -322,10 +322,10 @@
AND q.is_delete = 0
GROUP BY c.id
<if
test=
"rankType == 0"
>
order by sum(q.user_number) desc
order by sum(q.user_number) desc
, c.id
</if>
<if
test=
"rankType == 1"
>
order by c.rank
order by c.rank
asc, c.id
</if>
</select>
...
...
@@ -354,15 +354,14 @@
book_group_classify c
JOIN
book_group_qrcode g ON c.id = g.classify_id
AND
LEFT JOIN BOOK_GROUP bg on bg.id = c.book_group_id
LEFT JOIN book b ON c.book_id = b.book_id
WHERE
c.is_delete = 0
AND
g.is_delete = 0
AND
c.create_user = #{adviserId}
LEFT JOIN BOOK_GROUP bg on bg.id = c.book_group_id
LEFT JOIN book b ON c.book_id = b.book_id
WHERE 1= 1
<if
test=
"bookIds != null"
>
AND c.book_id IN
<foreach
collection =
"bookIds"
index=
"index"
item =
"item"
open =
"("
separator=
","
close =
")"
>
...
...
@@ -375,6 +374,7 @@
OR group_name LIKE CONCAT('%', #{name},'%')
)
</if>
order by c.id desc, g.id desc
</select>
<select
id=
"listGroupQrcode4Platform"
resultType=
"GroupQrcodeVO"
parameterType=
"map"
>
...
...
@@ -546,14 +546,15 @@
<resultMap
id=
"GroupQrcodeMap"
type=
"GroupQrcodeBaseDTO"
>
<id
column=
"weixin_group_id"
property=
"weixinGroupId"
jdbcType=
"VARCHAR"
/>
<result
column=
"group_name"
property=
"groupName"
jdbcType=
"VARCHAR"
/>
<result
column=
"book_name"
property=
"bookName"
jdbcType=
"VARCHAR"
/>
</resultMap>
<select
id=
"listGroupQrcodeBaseInfo"
resultMap=
"GroupQrcodeMap"
parameterType=
"list"
>
select
weixin_group_id, group_name
weixin_group_id, group_name
, book_name
from
book_group_qrcode
where
weixin_group_id in
book_group_qrcode
q
join book_group_classify c on q.classify_id = c.id
LEFT JOIN book b on c.book_id = b.BOOK_ID
<foreach
collection =
"list"
index=
"index"
item =
"item"
open =
"("
separator=
","
close =
")"
>
#{item}
</foreach>
...
...
@@ -592,7 +593,7 @@
serve_type ='PRODUCT'
AND
bk.set_type = 1
)
)
and is_delete = 0
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/group/GroupQrcode.Mapper.xml
View file @
9fc84683
...
...
@@ -34,6 +34,7 @@
weixin_qrcode_id,
weixin_group_id,
qrcode_url,
qrcode_head_url,
user_number,
create_user,
create_time,
...
...
@@ -45,6 +46,7 @@
#{weixinQrcodeId,jdbcType=BIGINT},
#{weixinGroupId,jdbcType=BIGINT},
#{qrcodeUrl,jdbcType=VARCHAR},
#{qrcodeHeadUrl,jdbcType=VARCHAR},
#{userNumber,jdbcType=BIGINT},
#{createUser,jdbcType=BIGINT},
NOW(),
...
...
@@ -151,8 +153,6 @@
id=#{_parameter}
</select>
<update
id=
"updateUserNumber"
parameterType=
"map"
>
update
book_group_qrcode
...
...
@@ -208,7 +208,8 @@
select
id,
group_seq groupSeq,
user_number userNumber
user_number userNumber,
qrcode_head_url qrcodeHeadUrl
from
book_group_qrcode
where
...
...
pcloud-service-book/src/main/resources/mapper/keywords/BookKeyword.Mapper.xml
View file @
9fc84683
...
...
@@ -92,7 +92,7 @@
<if
test=
"keywords!=null"
>
AND keywords like concat('%', #{keywords}, '%')
</if>
order by bk.rank
order by bk.rank
ASC, bk.id DESC
</select>
<select
id=
"listFiveKeyword"
resultType=
"keywordDTO"
parameterType=
"map"
>
...
...
@@ -109,7 +109,7 @@
AND
k.is_delete = 0
AND classify_id = #{classifyId}
AND book_group_id = #{bookGroupId} order by bk.rank limit 5
AND book_group_id = #{bookGroupId} order by bk.rank
, bk.id desc
limit 5
</select>
<select
id=
"getKeywordId"
resultType=
"ReplyKeywordDTO"
parameterType=
"map"
>
...
...
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