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
d34ca97e
Commit
d34ca97e
authored
Dec 05, 2019
by
阮思源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1002031无资源服务时反馈给编辑
parent
fc4c46b8
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
141 additions
and
0 deletions
+141
-0
BookGroupDTO.java
...src/main/java/com/pcloud/book/group/dto/BookGroupDTO.java
+15
-0
BookApplication.java
...e-book/src/main/java/com/pcloud/book/BookApplication.java
+10
-0
BookGroupServeDao.java
...ain/java/com/pcloud/book/group/dao/BookGroupServeDao.java
+2
-0
BookGroupServeDaoImpl.java
...com/pcloud/book/group/dao/impl/BookGroupServeDaoImpl.java
+7
-0
MQTopicConumer.java
...c/main/java/com/pcloud/book/mq/config/MQTopicConumer.java
+5
-0
SomeUserScanBookGroupListener.java
...m/pcloud/book/mq/topic/SomeUserScanBookGroupListener.java
+94
-0
BookGroupServe.xml
...e-book/src/main/resources/mapper/group/BookGroupServe.xml
+8
-0
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/group/dto/BookGroupDTO.java
View file @
d34ca97e
...
@@ -126,6 +126,11 @@ public class BookGroupDTO implements Serializable {
...
@@ -126,6 +126,11 @@ public class BookGroupDTO implements Serializable {
*/
*/
private
Integer
joinGroupType
;
private
Integer
joinGroupType
;
/**
* 二维码id
*/
private
Long
sceneId
;
public
String
getUrl
()
{
public
String
getUrl
()
{
return
url
;
return
url
;
}
}
...
@@ -312,6 +317,14 @@ public class BookGroupDTO implements Serializable {
...
@@ -312,6 +317,14 @@ public class BookGroupDTO implements Serializable {
this
.
joinGroupType
=
joinGroupType
;
this
.
joinGroupType
=
joinGroupType
;
}
}
public
Long
getSceneId
()
{
return
sceneId
;
}
public
void
setSceneId
(
Long
sceneId
)
{
this
.
sceneId
=
sceneId
;
}
@Override
@Override
public
String
toString
()
{
public
String
toString
()
{
return
"BookGroupDTO{"
+
return
"BookGroupDTO{"
+
...
@@ -337,6 +350,7 @@ public class BookGroupDTO implements Serializable {
...
@@ -337,6 +350,7 @@ public class BookGroupDTO implements Serializable {
", bookInfo="
+
bookInfo
+
", bookInfo="
+
bookInfo
+
", url='"
+
url
+
'\''
+
", url='"
+
url
+
'\''
+
", joinGroupType="
+
joinGroupType
+
", joinGroupType="
+
joinGroupType
+
", sceneId="
+
sceneId
+
'}'
;
'}'
;
}
}
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/BookApplication.java
View file @
d34ca97e
...
@@ -230,4 +230,14 @@ public class BookApplication {
...
@@ -230,4 +230,14 @@ public class BookApplication {
public
Binding
wxLiveBroadcastReminderBindBind
(){
public
Binding
wxLiveBroadcastReminderBindBind
(){
return
RabbitMQFactory
.
bindingExchange
(
wxLiveBroadcastReminderBindQueue
(),
MQTopicProducer
.
WX_LIVE_BROADCAST_REMINDER
);
return
RabbitMQFactory
.
bindingExchange
(
wxLiveBroadcastReminderBindQueue
(),
MQTopicProducer
.
WX_LIVE_BROADCAST_REMINDER
);
}
}
@Bean
public
Queue
someUserScanBookGroupQueue
(){
return
RabbitMQFactory
.
queueBuilder
(
MQTopicConumer
.
CONSUMER_SOME_USER_SCAN_BOOK_GROUP
);
}
@Bean
public
Binding
someUserScanBookGroupBind
(){
return
RabbitMQFactory
.
bindingExchange
(
someUserScanBookGroupQueue
(),
MQTopicProducer
.
SOME_USER_SCAN_BOOK_GROUP
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/BookGroupServeDao.java
View file @
d34ca97e
...
@@ -20,4 +20,6 @@ public interface BookGroupServeDao extends BaseDao<BookGroupServe> {
...
@@ -20,4 +20,6 @@ public interface BookGroupServeDao extends BaseDao<BookGroupServe> {
List
<
BookGroupServe
>
getProductServeList
();
List
<
BookGroupServe
>
getProductServeList
();
List
<
BookGroupApp
>
getAllAppServe
();
List
<
BookGroupApp
>
getAllAppServe
();
Integer
getCountByBookGroupId
(
Long
bookGroupId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/dao/impl/BookGroupServeDaoImpl.java
View file @
d34ca97e
...
@@ -54,4 +54,11 @@ public class BookGroupServeDaoImpl extends BaseDaoImpl<BookGroupServe> implement
...
@@ -54,4 +54,11 @@ public class BookGroupServeDaoImpl extends BaseDaoImpl<BookGroupServe> implement
public
List
<
BookGroupApp
>
getAllAppServe
()
{
public
List
<
BookGroupApp
>
getAllAppServe
()
{
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getAllAppServe"
));
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getAllAppServe"
));
}
}
@Override
public
Integer
getCountByBookGroupId
(
Long
bookGroupId
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"bookGroupId"
,
bookGroupId
);
return
super
.
getSqlSession
().
selectOne
(
getStatement
(
"getCountByBookGroupId"
),
map
);
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/mq/config/MQTopicConumer.java
View file @
d34ca97e
...
@@ -85,4 +85,9 @@ public class MQTopicConumer {
...
@@ -85,4 +85,9 @@ public class MQTopicConumer {
*/
*/
public
static
final
String
WX_LIVE_BROADCAST_REMINDER
=
PREFIX
+
MQTopicProducer
.
WX_LIVE_BROADCAST_REMINDER
;
public
static
final
String
WX_LIVE_BROADCAST_REMINDER
=
PREFIX
+
MQTopicProducer
.
WX_LIVE_BROADCAST_REMINDER
;
/**
* 社群码扫码人数达到一定数量
*/
public
static
final
String
CONSUMER_SOME_USER_SCAN_BOOK_GROUP
=
PREFIX
+
MQTopicProducer
.
SOME_USER_SCAN_BOOK_GROUP
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/mq/topic/SomeUserScanBookGroupListener.java
0 → 100644
View file @
d34ca97e
package
com
.
pcloud
.
book
.
mq
.
topic
;
import
com.pcloud.book.consumer.message.TemplateConsr
;
import
com.pcloud.book.group.dao.BookGroupDao
;
import
com.pcloud.book.group.dao.BookGroupServeDao
;
import
com.pcloud.book.group.dto.BookGroupDTO
;
import
com.pcloud.book.group.enums.JoinGroupTypeEnum
;
import
com.pcloud.book.keywords.dao.BookKeywordDao
;
import
com.pcloud.book.mq.config.MQTopicConumer
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.constant.SceneCode
;
import
com.pcloud.common.core.constant.SendType
;
import
com.pcloud.common.core.constant.SystemCode
;
import
com.pcloud.common.exceptions.BizException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.amqp.rabbit.annotation.RabbitHandler
;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* @Description社群码扫码人数达到一定数量
* @Author ruansiyuan
* @Date 2019/12/5 16:34
**/
@Component
(
"someUserScanBookGroupListener"
)
@RabbitListener
(
queues
=
MQTopicConumer
.
CONSUMER_SOME_USER_SCAN_BOOK_GROUP
)
public
class
SomeUserScanBookGroupListener
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
SomeUserScanBookGroupListener
.
class
);
@Autowired
private
BookGroupDao
bookGroupDao
;
@Autowired
private
BookKeywordDao
bookKeywordDao
;
@Autowired
private
BookGroupServeDao
bookGroupServeDao
;
@Autowired
private
TemplateConsr
templateConsr
;
@ParamLog
(
"接收社群码扫码人数达到一定数量topic"
)
@RabbitHandler
public
void
onMessage
(
Long
bookGroupId
)
throws
BizException
{
if
(
bookGroupId
==
null
)
{
return
;
}
BookGroupDTO
dto
=
bookGroupDao
.
getDTOById
(
bookGroupId
);
if
(
dto
==
null
)
{
LOGGER
.
error
(
"没有找到该社群码"
+
bookGroupId
);
return
;
}
Integer
joinGroupType
=
dto
.
getJoinGroupType
();
Boolean
isSend
=
false
;
if
(
JoinGroupTypeEnum
.
GROUP_QRCODE
.
getCode
().
equals
(
joinGroupType
))
{
//普通群查询有没有配置关键词
Integer
keywordCount
=
bookKeywordDao
.
getKeywordCount
(
bookGroupId
,
null
);
if
(
keywordCount
<=
0
)
{
isSend
=
true
;
}
}
if
(
JoinGroupTypeEnum
.
ROBOT
.
getCode
().
equals
(
joinGroupType
))
{
//1v1查询有没有配置资源服务
Integer
count
=
bookGroupServeDao
.
getCountByBookGroupId
(
bookGroupId
);
if
(
count
<=
0
)
{
isSend
=
true
;
}
}
if
(
isSend
)
{
//发送模板消息
sendTemplate
(
dto
);
}
}
@ParamLog
(
"发送模板消息"
)
private
void
sendTemplate
(
BookGroupDTO
dto
)
{
try
{
Map
<
String
,
String
>
temParam
=
new
HashMap
<>();
String
word
=
"已有读者扫码!您的二维码“"
+
dto
.
getGroupQrcodeName
()
+
"”还未配置任何资源服务。请及时完善该二维码资源服务。"
;
temParam
.
put
(
"first"
,
word
);
temParam
.
put
(
"keyword1"
,
"【提醒】您的二维码还未配置资源服务"
);
temParam
.
put
(
"keyword2"
,
"待查看"
);
temParam
.
put
(
"remark"
,
"请及时处理"
);
templateConsr
.
sendManage
(
SceneCode
.
PROJECT_TASK_SCENE
.
value
,
dto
.
getAgentId
(),
dto
.
getCreateUser
(),
SystemCode
.
adviser
.
code
,
""
,
temParam
,
SendType
.
SEND_BY_PARTY_ID
.
value
,
false
);
LOGGER
.
info
(
"资源未配置发送模板消息temParam="
+
temParam
.
toString
()+
"dto="
+
dto
.
toString
());
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"编辑管理--删除副编辑,发送模板消息失败<ERROR>"
+
e
.
getMessage
());
}
}
}
pcloud-service-book/src/main/resources/mapper/group/BookGroupServe.xml
View file @
d34ca97e
...
@@ -120,4 +120,11 @@
...
@@ -120,4 +120,11 @@
t.serve_id,
t.serve_id,
t.serve_type
t.serve_type
</select>
</select>
<!--根据社群码id查询资源服务数量-->
<select
id=
"getCountByBookGroupId"
parameterType=
"map"
resultType=
"integer"
>
select count(1)
from book_group_serve
where book_group_id=#{bookGroupId}
</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