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
c787af15
Commit
c787af15
authored
Nov 10, 2021
by
吴博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: [1005883] 小睿消息优化
parent
b46dd8e9
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
169 additions
and
19 deletions
+169
-19
TemplateConsr.java
.../java/com/pcloud/book/consumer/message/TemplateConsr.java
+2
-2
ReaderConsr.java
...ain/java/com/pcloud/book/consumer/reader/ReaderConsr.java
+14
-0
CultivateNotifyBizImpl.java
...cloud/book/cultivate/biz/impl/CultivateNotifyBizImpl.java
+93
-10
CultivateRaysBizImpl.java
.../pcloud/book/cultivate/biz/impl/CultivateRaysBizImpl.java
+2
-1
CultivateNotifyItemDao.java
...com/pcloud/book/cultivate/dao/CultivateNotifyItemDao.java
+4
-0
CultivateNotifyItemDaoImpl.java
...d/book/cultivate/dao/impl/CultivateNotifyItemDaoImpl.java
+13
-1
CultivateNotifyDTO.java
...ava/com/pcloud/book/cultivate/dto/CultivateNotifyDTO.java
+7
-0
CultivateNotifyPageDTO.java
...com/pcloud/book/cultivate/dto/CultivateNotifyPageDTO.java
+6
-0
CultivateNotify.java
...ava/com/pcloud/book/cultivate/entity/CultivateNotify.java
+3
-0
CultivateNotify.xml
...k/src/main/resources/mapper/cultivate/CultivateNotify.xml
+6
-3
CultivateNotifyItem.xml
...c/main/resources/mapper/cultivate/CultivateNotifyItem.xml
+17
-1
CultivateNotifySend.xml
...c/main/resources/mapper/cultivate/CultivateNotifySend.xml
+2
-1
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/consumer/message/TemplateConsr.java
View file @
c787af15
...
@@ -107,11 +107,11 @@ public class TemplateConsr {
...
@@ -107,11 +107,11 @@ public class TemplateConsr {
}
}
}
}
public
void
sendTempletMessage4Project
(
String
keyword1
,
String
keyword2
,
Long
wechatUserId
,
String
pagepath
)
{
public
void
sendTempletMessage4Project
(
String
keyword1
,
String
keyword2
,
Long
wechatUserId
,
String
pagepath
,
String
first
)
{
LOGGER
.
info
(
"小睿宠物发送模板消息业务进度提醒keyword1:{},keyword2:{}, wechatUserId:{},pagepath:{},"
,
LOGGER
.
info
(
"小睿宠物发送模板消息业务进度提醒keyword1:{},keyword2:{}, wechatUserId:{},pagepath:{},"
,
keyword1
,
keyword2
,
wechatUserId
,
pagepath
);
keyword1
,
keyword2
,
wechatUserId
,
pagepath
);
Map
<
String
,
String
>
temParam
=
new
HashMap
<>();
Map
<
String
,
String
>
temParam
=
new
HashMap
<>();
temParam
.
put
(
"first"
,
"主人召回提醒"
);
temParam
.
put
(
"first"
,
first
);
temParam
.
put
(
"keyword1"
,
keyword1
);
temParam
.
put
(
"keyword1"
,
keyword1
);
temParam
.
put
(
"keyword2"
,
keyword2
);
temParam
.
put
(
"keyword2"
,
keyword2
);
temParam
.
put
(
"remark"
,
"点击查看详情"
);
temParam
.
put
(
"remark"
,
"点击查看详情"
);
...
...
pcloud-service-book/src/main/java/com/pcloud/book/consumer/reader/ReaderConsr.java
View file @
c787af15
...
@@ -539,6 +539,20 @@ public class ReaderConsr {
...
@@ -539,6 +539,20 @@ public class ReaderConsr {
}
}
return
userGradeLabelIdDTO
;
return
userGradeLabelIdDTO
;
}
}
public
List
<
Long
>
getAllRelateUnionUsers
(
List
<
Long
>
subList
,
Long
operateOfficalId
)
{
LOGGER
.
info
(
"【获取指定用户的关联公众号用户id ,<START>.[subList]"
);
List
<
Long
>
wechatUserIds
=
new
ArrayList
<>();
try
{
wechatUserIds
=
ResponseHandleUtil
.
parseList
(
raysUnionUserService
.
getAllRelateUnionUsers
(
subList
,
operateOfficalId
),
Long
.
class
);
}
catch
(
Exception
e
)
{
LOGGER
.
warn
(
"raysUnionUserService.getAllRelateUnionUsers"
+
e
.
getMessage
(),
e
);
}
return
wechatUserIds
;
}
}
}
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/biz/impl/CultivateNotifyBizImpl.java
View file @
c787af15
...
@@ -38,6 +38,7 @@ import com.pcloud.book.cultivate.entity.AppletNotifySendDTO;
...
@@ -38,6 +38,7 @@ import com.pcloud.book.cultivate.entity.AppletNotifySendDTO;
import
com.pcloud.book.cultivate.entity.CultivateNotify
;
import
com.pcloud.book.cultivate.entity.CultivateNotify
;
import
com.pcloud.book.cultivate.entity.CultivateNotifyItem
;
import
com.pcloud.book.cultivate.entity.CultivateNotifyItem
;
import
com.pcloud.book.cultivate.entity.CultivateNotifySend
;
import
com.pcloud.book.cultivate.entity.CultivateNotifySend
;
import
com.pcloud.book.cultivate.enums.NotifyMessageType
;
import
com.pcloud.book.cultivate.enums.NotifySendTypeEnum
;
import
com.pcloud.book.cultivate.enums.NotifySendTypeEnum
;
import
com.pcloud.book.group.tools.SendWeixinRequestTools
;
import
com.pcloud.book.group.tools.SendWeixinRequestTools
;
import
com.pcloud.book.util.common.ThreadPoolUtils
;
import
com.pcloud.book.util.common.ThreadPoolUtils
;
...
@@ -54,6 +55,7 @@ import com.pcloud.common.utils.ServeLinkUtils;
...
@@ -54,6 +55,7 @@ import com.pcloud.common.utils.ServeLinkUtils;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.contentcenter.resource.dto.ResourceDTO
;
import
com.pcloud.contentcenter.resource.dto.ResourceDTO
;
import
com.pcloud.readercenter.applet.entity.AppletQuestion
;
import
com.pcloud.readercenter.applet.entity.AppletQuestion
;
import
com.pcloud.readercenter.common.utils.ReaderConstants
;
import
com.pcloud.readercenter.wechat.dto.MiniUserDto
;
import
com.pcloud.readercenter.wechat.dto.MiniUserDto
;
import
com.pcloud.readercenter.wechat.dto.ReaderMessageDto
;
import
com.pcloud.readercenter.wechat.dto.ReaderMessageDto
;
import
com.pcloud.resourcecenter.product.dto.ProductDto
;
import
com.pcloud.resourcecenter.product.dto.ProductDto
;
...
@@ -123,8 +125,13 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
...
@@ -123,8 +125,13 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
cultivateNotify
.
setTitle
(
cultivateNotifyDTO
.
getTitle
());
cultivateNotify
.
setTitle
(
cultivateNotifyDTO
.
getTitle
());
cultivateNotify
.
setSendType
(
cultivateNotifyDTO
.
getSendType
());
cultivateNotify
.
setSendType
(
cultivateNotifyDTO
.
getSendType
());
cultivateNotify
.
setShowHome
(
cultivateNotifyDTO
.
getShowHome
());
cultivateNotify
.
setShowHome
(
cultivateNotifyDTO
.
getShowHome
());
cultivateNotify
.
setSquareImg
(
cultivateNotifyDTO
.
getSquareImg
());
cultivateNotify
.
setAgentId
(
null
==
cultivateNotifyDTO
.
getAgentId
()?
0L
:
cultivateNotifyDTO
.
getAgentId
());
cultivateNotify
.
setAgentId
(
null
==
cultivateNotifyDTO
.
getAgentId
()?
0L
:
cultivateNotifyDTO
.
getAgentId
());
cultivateNotifyDao
.
insert
(
cultivateNotify
);
cultivateNotifyDao
.
insert
(
cultivateNotify
);
//合并消息
if
(!
ListUtils
.
isEmpty
(
cultivateNotifyDTO
.
getJumpNotifyItems
()))
{
cultivateNotifyDTO
.
getCultivateNotifyItems
().
addAll
(
cultivateNotifyDTO
.
getJumpNotifyItems
());
}
cultivateNotifyDTO
.
getCultivateNotifyItems
().
forEach
(
a
->
a
.
setMessageId
(
cultivateNotify
.
getMessageId
()));
cultivateNotifyDTO
.
getCultivateNotifyItems
().
forEach
(
a
->
a
.
setMessageId
(
cultivateNotify
.
getMessageId
()));
cultivateNotifyItemDao
.
insert
(
cultivateNotifyDTO
.
getCultivateNotifyItems
());
cultivateNotifyItemDao
.
insert
(
cultivateNotifyDTO
.
getCultivateNotifyItems
());
ThreadPoolUtils
.
SEND_NOTIFY_POOL
.
execute
(()->{
ThreadPoolUtils
.
SEND_NOTIFY_POOL
.
execute
(()->{
...
@@ -165,10 +172,19 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
...
@@ -165,10 +172,19 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
PageBeanNew
<
CultivateNotifyDTO
>
pageBeanNew
=
cultivateNotifySendDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
map
,
"getNotifyListByType"
);
PageBeanNew
<
CultivateNotifyDTO
>
pageBeanNew
=
cultivateNotifySendDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
map
,
"getNotifyListByType"
);
List
<
CultivateNotifyItem
>
cultivateNotifyItemList
=
new
ArrayList
<>();
List
<
CultivateNotifyItem
>
cultivateNotifyItemList
=
new
ArrayList
<>();
for
(
CultivateNotifyDTO
cultivateNotifyDTO:
pageBeanNew
.
getRecordList
())
{
for
(
CultivateNotifyDTO
cultivateNotifyDTO:
pageBeanNew
.
getRecordList
())
{
List
<
CultivateNotifyItem
>
cultivateNotifyItems
=
new
ArrayList
<>();
List
<
CultivateNotifyItem
>
list1
=
cultivateNotifyItemDao
.
getNotifyItemsByMessageId
(
cultivateNotifyDTO
.
getMessageId
());
List
<
CultivateNotifyItem
>
list1
=
cultivateNotifyItemDao
.
getNotifyItemsByMessageId
(
cultivateNotifyDTO
.
getMessageId
());
fillResource
(
list1
);
List
<
CultivateNotifyItem
>
list2
=
cultivateNotifyItemDao
.
getNotifyItemsByMessageId4Jump
(
cultivateNotifyDTO
.
getMessageId
());
if
(!
ListUtils
.
isEmpty
(
list1
))
{
cultivateNotifyItems
.
addAll
(
list1
);
}
if
(!
ListUtils
.
isEmpty
(
list2
))
{
cultivateNotifyItems
.
addAll
(
list2
);
}
fillResource
(
cultivateNotifyItems
);
cultivateNotifyDTO
.
setCultivateNotifyItems
(
list1
);
cultivateNotifyDTO
.
setCultivateNotifyItems
(
list1
);
cultivateNotifyItemList
.
addAll
(
list1
);
cultivateNotifyDTO
.
setJumpNotifyItems
(
list2
);
cultivateNotifyItemList
.
addAll
(
cultivateNotifyItems
);
}
}
ThreadPoolUtils
.
OTHER_THREAD_POOL
.
execute
(()
->
{
ThreadPoolUtils
.
OTHER_THREAD_POOL
.
execute
(()
->
{
//批量更新消息已读未读
//批量更新消息已读未读
...
@@ -271,8 +287,14 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
...
@@ -271,8 +287,14 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
cultivateNotifySendList
.
add
(
cultivateNotifySend
);
cultivateNotifySendList
.
add
(
cultivateNotifySend
);
}
}
cultivateNotifySendDao
.
insert
(
cultivateNotifySendList
);
cultivateNotifySendDao
.
insert
(
cultivateNotifySendList
);
//1005883【优化】平台端-消息通知管理-发布站内消息优化,小睿新鲜事支持模板消息推送 改成公众号模板消息推送
sendAppletTemplateMessage
(
cultivateNotifySendList
,
cultivateNotify
.
getAgentId
(),
null
);
sendAppletTemplateMessage
(
cultivateNotifySendList
,
cultivateNotify
.
getAgentId
(),
null
);
//根据小程序用户id查找对用的23用户id,并推送模板消息
/* if (NotifyMessageType.SYSTEM.code.equals(cultivateNotifyDTO.getMessageType())) {
sendOfficeTemplateMessage4Notify(cultivateNotifyDTO.getTitle(), subList);
}*/
}
}
}
}
}
}
//全局发送
//全局发送
...
@@ -339,12 +361,31 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
...
@@ -339,12 +361,31 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
cultivateNotifySendList
.
add
(
cultivateNotifySend
);
cultivateNotifySendList
.
add
(
cultivateNotifySend
);
}
}
cultivateNotifySendDao
.
insert
(
cultivateNotifySendList
);
cultivateNotifySendDao
.
insert
(
cultivateNotifySendList
);
sendAppletTemplateMessage
(
cultivateNotifySendList
,
cultivateNotify
.
getAgentId
(),
null
);
if
(
NotifyMessageType
.
SYSTEM
.
code
.
equals
(
cultivateNotifyDTO
.
getMessageType
()))
{
sendOfficeTemplateMessage4Notify
(
cultivateNotifyDTO
.
getTitle
(),
subList
);
}
}
}
}
}
}
}
}
}
private
void
sendOfficeTemplateMessage4Notify
(
String
title
,
List
<
Long
>
subList
)
{
if
(
ListUtils
.
isEmpty
(
subList
))
{
return
;
}
List
<
Long
>
wechatUserIds
=
readerConsr
.
getAllRelateUnionUsers
(
subList
,
BookProps
.
getOperateOfficalId
());
if
(
ListUtils
.
isEmpty
(
wechatUserIds
))
{
return
;
}
wechatUserIds
.
stream
().
forEach
(
wechatUserId
->
{
String
text1
=
"小睿新鲜事"
;
String
text2
=
title
;
String
first
=
"推送消息提醒"
;
String
page
=
"pages/notify/message/index"
;
templateConsr
.
sendTempletMessage4Project
(
text1
,
text2
,
wechatUserId
,
page
,
first
);
});
}
/**
/**
* 发送小程序模板消息
* 发送小程序模板消息
* @param list
* @param list
...
@@ -397,11 +438,17 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
...
@@ -397,11 +438,17 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
List
<
Long
>
messageIds
=
list
.
stream
().
filter
(
a
->
null
!=
a
.
getMessageId
()).
map
(
a
->
a
.
getMessageId
()).
distinct
().
collect
(
Collectors
.
toList
());
List
<
Long
>
messageIds
=
list
.
stream
().
filter
(
a
->
null
!=
a
.
getMessageId
()).
map
(
a
->
a
.
getMessageId
()).
distinct
().
collect
(
Collectors
.
toList
());
Map
<
Long
,
String
>
titleMap
=
new
HashMap
<>();
Map
<
Long
,
String
>
titleMap
=
new
HashMap
<>();
Map
<
Long
,
List
<
CultivateNotifyItem
>>
itemMap
=
new
HashMap
<>();
Map
<
Long
,
List
<
CultivateNotifyItem
>>
itemMap
=
new
HashMap
<>();
Map
<
Long
,
List
<
CultivateNotifyItem
>>
jumpMap
=
new
HashMap
<>();
if
(!
ListUtils
.
isEmpty
(
messageIds
)){
if
(!
ListUtils
.
isEmpty
(
messageIds
)){
/* List<CultivateNotify> cultivateNotifies = cultivateNotifyDao.getByIds(messageIds);
/* List<CultivateNotify> cultivateNotifies = cultivateNotifyDao.getByIds(messageIds);
titleMap= cultivateNotifies.stream().collect(Collectors.toMap(a -> a.getMessageId(), a -> a.getTitle(), (k1, k2) -> k2));*/
titleMap= cultivateNotifies.stream().collect(Collectors.toMap(a -> a.getMessageId(), a -> a.getTitle(), (k1, k2) -> k2));*/
List
<
CultivateNotifyItem
>
cultivateNotifyItems
=
cultivateNotifyItemDao
.
getByMessageIds
(
messageIds
);
List
<
CultivateNotifyItem
>
cultivateNotifyItems
=
cultivateNotifyItemDao
.
getByMessageIds
(
messageIds
);
itemMap
=
cultivateNotifyItems
.
stream
().
collect
(
Collectors
.
groupingBy
(
a
->
a
.
getMessageId
()));
itemMap
=
cultivateNotifyItems
.
stream
().
collect
(
Collectors
.
groupingBy
(
a
->
a
.
getMessageId
()));
List
<
CultivateNotifyItem
>
jumplist
=
cultivateNotifyItemDao
.
getNotifyItemsByMessageIds4Jump
(
messageIds
);
if
(!
ListUtils
.
isEmpty
(
jumplist
))
{
jumpMap
=
jumplist
.
stream
().
collect
(
Collectors
.
groupingBy
(
a
->
a
.
getMessageId
()));
}
}
}
List
<
CultivateNotifyItem
>
cultivateNotifyItems
=
new
ArrayList
<>();
List
<
CultivateNotifyItem
>
cultivateNotifyItems
=
new
ArrayList
<>();
for
(
CultivateNotifyPageDTO
cultivateNotifyPageDTO
:
list
)
{
for
(
CultivateNotifyPageDTO
cultivateNotifyPageDTO
:
list
)
{
...
@@ -411,10 +458,16 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
...
@@ -411,10 +458,16 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
if
(
MapUtils
.
isNotEmpty
(
itemMap
)
&&
itemMap
.
containsKey
(
cultivateNotifyPageDTO
.
getMessageId
())){
if
(
MapUtils
.
isNotEmpty
(
itemMap
)
&&
itemMap
.
containsKey
(
cultivateNotifyPageDTO
.
getMessageId
())){
cultivateNotifyPageDTO
.
setCultivateNotifyItems
(
itemMap
.
get
(
cultivateNotifyPageDTO
.
getMessageId
()));
cultivateNotifyPageDTO
.
setCultivateNotifyItems
(
itemMap
.
get
(
cultivateNotifyPageDTO
.
getMessageId
()));
}
}
if
(
MapUtils
.
isNotEmpty
(
jumpMap
)
&&
jumpMap
.
containsKey
(
cultivateNotifyPageDTO
.
getMessageId
())){
cultivateNotifyPageDTO
.
setJumpNotifyItems
(
jumpMap
.
get
(
cultivateNotifyPageDTO
.
getMessageId
()));
}
if
(!
ListUtils
.
isEmpty
(
cultivateNotifyPageDTO
.
getCultivateNotifyItems
())){
if
(!
ListUtils
.
isEmpty
(
cultivateNotifyPageDTO
.
getCultivateNotifyItems
())){
fillResource
(
cultivateNotifyPageDTO
.
getCultivateNotifyItems
());
fillResource
(
cultivateNotifyPageDTO
.
getCultivateNotifyItems
());
cultivateNotifyItems
.
addAll
(
cultivateNotifyPageDTO
.
getCultivateNotifyItems
());
cultivateNotifyItems
.
addAll
(
cultivateNotifyPageDTO
.
getCultivateNotifyItems
());
}
}
if
(!
ListUtils
.
isEmpty
(
cultivateNotifyPageDTO
.
getJumpNotifyItems
())){
cultivateNotifyItems
.
addAll
(
cultivateNotifyPageDTO
.
getJumpNotifyItems
());
}
}
}
//填充资讯应用作品
//填充资讯应用作品
fillAppOrProduct4Notify
(
cultivateNotifyItems
);
fillAppOrProduct4Notify
(
cultivateNotifyItems
);
...
@@ -627,10 +680,19 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
...
@@ -627,10 +680,19 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
PageBeanNew
<
CultivateNotifyDTO
>
pageBeanNew
=
cultivateNotifySendDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
map
,
"getNotifyListByType"
);
PageBeanNew
<
CultivateNotifyDTO
>
pageBeanNew
=
cultivateNotifySendDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
map
,
"getNotifyListByType"
);
List
<
CultivateNotifyItem
>
cultivateNotifyItemList
=
new
ArrayList
<>();
List
<
CultivateNotifyItem
>
cultivateNotifyItemList
=
new
ArrayList
<>();
for
(
CultivateNotifyDTO
cultivateNotifyDTO:
pageBeanNew
.
getRecordList
())
{
for
(
CultivateNotifyDTO
cultivateNotifyDTO:
pageBeanNew
.
getRecordList
())
{
List
<
CultivateNotifyItem
>
cultivateNotifyItems
=
new
ArrayList
<>();
List
<
CultivateNotifyItem
>
list1
=
cultivateNotifyItemDao
.
getNotifyItemsByMessageId
(
cultivateNotifyDTO
.
getMessageId
());
List
<
CultivateNotifyItem
>
list1
=
cultivateNotifyItemDao
.
getNotifyItemsByMessageId
(
cultivateNotifyDTO
.
getMessageId
());
fillResource
(
list1
);
List
<
CultivateNotifyItem
>
list2
=
cultivateNotifyItemDao
.
getNotifyItemsByMessageId4Jump
(
cultivateNotifyDTO
.
getMessageId
());
if
(!
ListUtils
.
isEmpty
(
list1
))
{
cultivateNotifyItems
.
addAll
(
list1
);
}
if
(!
ListUtils
.
isEmpty
(
list2
))
{
cultivateNotifyItems
.
addAll
(
list2
);
}
fillResource
(
cultivateNotifyItems
);
cultivateNotifyDTO
.
setCultivateNotifyItems
(
list1
);
cultivateNotifyDTO
.
setCultivateNotifyItems
(
list1
);
cultivateNotifyItemList
.
addAll
(
list1
);
cultivateNotifyDTO
.
setJumpNotifyItems
(
list2
);
cultivateNotifyItemList
.
addAll
(
cultivateNotifyItems
);
}
}
//填充资讯应用作品问题
//填充资讯应用作品问题
fillAppOrProduct4Notify
(
cultivateNotifyItemList
);
fillAppOrProduct4Notify
(
cultivateNotifyItemList
);
...
@@ -709,17 +771,38 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
...
@@ -709,17 +771,38 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
if
(
ListUtils
.
isEmpty
(
messageIds
)){
if
(
ListUtils
.
isEmpty
(
messageIds
)){
return
new
ArrayList
<>();
return
new
ArrayList
<>();
}
}
List
<
CultivateNotifyItem
>
cultivateNotifyItems
=
new
ArrayList
<>();
List
<
CultivateNotifyItem
>
list
=
cultivateNotifyItemDao
.
getByMessageIds
(
messageIds
);
List
<
CultivateNotifyItem
>
list
=
cultivateNotifyItemDao
.
getByMessageIds
(
messageIds
);
fillResource
(
list
);
fillAppOrProduct4Notify
(
list
);
Map
<
Long
,
List
<
CultivateNotifyItem
>>
cultivateNotifyItemMap
=
list
.
stream
().
collect
(
Collectors
.
groupingBy
(
CultivateNotifyItem:
:
getMessageId
));
List
<
CultivateNotifyItem
>
list2
=
cultivateNotifyItemDao
.
getNotifyItemsByMessageIds4Jump
(
messageIds
);
if
(!
ListUtils
.
isEmpty
(
list
))
{
cultivateNotifyItems
.
addAll
(
list
);
}
if
(!
ListUtils
.
isEmpty
(
list2
))
{
cultivateNotifyItems
.
addAll
(
list2
);
}
fillResource
(
cultivateNotifyItems
);
fillAppOrProduct4Notify
(
cultivateNotifyItems
);
Map
<
Long
,
List
<
CultivateNotifyItem
>>
cultivateNotifyItemMap
=
new
HashMap
<>();
if
(!
ListUtils
.
isEmpty
(
list
))
{
cultivateNotifyItemMap
=
list
.
stream
().
collect
(
Collectors
.
groupingBy
(
CultivateNotifyItem:
:
getMessageId
));
}
Map
<
Long
,
List
<
CultivateNotifyItem
>>
cultivateNotifyItemMap4Jump
=
new
HashMap
<>();
if
(!
ListUtils
.
isEmpty
(
list2
))
{
cultivateNotifyItemMap4Jump
=
list2
.
stream
().
collect
(
Collectors
.
groupingBy
(
CultivateNotifyItem:
:
getMessageId
));
}
List
<
CultivateNotify
>
cultivateNotifyList
=
cultivateNotifyDao
.
getByIds
(
messageIds
);
List
<
CultivateNotify
>
cultivateNotifyList
=
cultivateNotifyDao
.
getByIds
(
messageIds
);
List
<
CultivateNotifyDTO
>
cultivateNotifyDTOList
=
new
ArrayList
<>();
List
<
CultivateNotifyDTO
>
cultivateNotifyDTOList
=
new
ArrayList
<>();
Map
<
Long
,
List
<
CultivateNotifyItem
>>
finalCultivateNotifyItemMap
=
cultivateNotifyItemMap
;
Map
<
Long
,
List
<
CultivateNotifyItem
>>
finalCultivateNotifyItemMap4Jump
=
cultivateNotifyItemMap4Jump
;
cultivateNotifyList
.
stream
().
forEach
(
e
->
{
cultivateNotifyList
.
stream
().
forEach
(
e
->
{
CultivateNotifyDTO
notifyDTO
=
new
CultivateNotifyDTO
();
CultivateNotifyDTO
notifyDTO
=
new
CultivateNotifyDTO
();
BeanUtils
.
copyProperties
(
e
,
notifyDTO
);
BeanUtils
.
copyProperties
(
e
,
notifyDTO
);
notifyDTO
.
setCultivateNotifyItems
(
cultivateNotifyItemMap
.
get
(
e
.
getMessageId
()));
notifyDTO
.
setCultivateNotifyItems
(
finalCultivateNotifyItemMap
.
get
(
e
.
getMessageId
()));
if
(
MapUtils
.
isNotEmpty
(
finalCultivateNotifyItemMap4Jump
)
&&
!
ListUtils
.
isEmpty
(
finalCultivateNotifyItemMap4Jump
.
get
(
e
.
getMessageId
())))
{
notifyDTO
.
setJumpNotifyItems
(
finalCultivateNotifyItemMap4Jump
.
get
(
e
.
getMessageId
()));
}
cultivateNotifyDTOList
.
add
(
notifyDTO
);
cultivateNotifyDTOList
.
add
(
notifyDTO
);
});
});
ThreadPoolUtils
.
OTHER_THREAD_POOL
.
execute
(()
->
{
ThreadPoolUtils
.
OTHER_THREAD_POOL
.
execute
(()
->
{
...
...
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/biz/impl/CultivateRaysBizImpl.java
View file @
c787af15
...
@@ -242,6 +242,7 @@ public class CultivateRaysBizImpl implements CultivateRaysBiz {
...
@@ -242,6 +242,7 @@ public class CultivateRaysBizImpl implements CultivateRaysBiz {
Map
<
String
,
String
>
tempMap
=
new
HashMap
<>();
Map
<
String
,
String
>
tempMap
=
new
HashMap
<>();
String
text1
=
"主人~我快要饿晕了"
;
String
text1
=
"主人~我快要饿晕了"
;
String
text2
=
"快来,还可以抢救下!"
;
String
text2
=
"快来,还可以抢救下!"
;
String
first
=
"主人召回提醒"
;
if
(
"pro"
.
equals
(
BookProps
.
getSystemEnv
()))
{
if
(
"pro"
.
equals
(
BookProps
.
getSystemEnv
()))
{
tempMap
.
put
(
"thing3"
,
text1
);
tempMap
.
put
(
"thing3"
,
text1
);
tempMap
.
put
(
"thing2"
,
text2
);
tempMap
.
put
(
"thing2"
,
text2
);
...
@@ -253,7 +254,7 @@ public class CultivateRaysBizImpl implements CultivateRaysBiz {
...
@@ -253,7 +254,7 @@ public class CultivateRaysBizImpl implements CultivateRaysBiz {
//发送小程序服务消息
//发送小程序服务消息
templateConsr
.
sendAppletMessageQueue
(
appletTemplateMessage
);
templateConsr
.
sendAppletMessageQueue
(
appletTemplateMessage
);
//发送公众号模板消息
//发送公众号模板消息
templateConsr
.
sendTempletMessage4Project
(
text1
,
text2
,
wechatUserId
,
appletTemplateMessage
.
getPage
());
templateConsr
.
sendTempletMessage4Project
(
text1
,
text2
,
wechatUserId
,
appletTemplateMessage
.
getPage
()
,
first
);
}
}
/**
/**
...
...
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/dao/CultivateNotifyItemDao.java
View file @
c787af15
...
@@ -12,4 +12,8 @@ public interface CultivateNotifyItemDao extends BaseDao<CultivateNotifyItem> {
...
@@ -12,4 +12,8 @@ public interface CultivateNotifyItemDao extends BaseDao<CultivateNotifyItem> {
List
<
CultivateNotifyItem
>
getNotifyItemsByMessageId
(
Long
messageId
);
List
<
CultivateNotifyItem
>
getNotifyItemsByMessageId
(
Long
messageId
);
List
<
CultivateNotifyItem
>
getByMessageIds
(
List
<
Long
>
messageIds
);
List
<
CultivateNotifyItem
>
getByMessageIds
(
List
<
Long
>
messageIds
);
List
<
CultivateNotifyItem
>
getNotifyItemsByMessageId4Jump
(
Long
messageId
);
List
<
CultivateNotifyItem
>
getNotifyItemsByMessageIds4Jump
(
List
<
Long
>
messageIds
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/dao/impl/CultivateNotifyItemDaoImpl.java
View file @
c787af15
...
@@ -24,4 +24,15 @@ public class CultivateNotifyItemDaoImpl extends BaseDaoImpl<CultivateNotifyItem>
...
@@ -24,4 +24,15 @@ public class CultivateNotifyItemDaoImpl extends BaseDaoImpl<CultivateNotifyItem>
map
.
put
(
"messageIds"
,
messageIds
);
map
.
put
(
"messageIds"
,
messageIds
);
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getByMessageIds"
),
map
);
return
super
.
getSqlSession
().
selectList
(
getStatement
(
"getByMessageIds"
),
map
);
}
}
}
@Override
public
List
<
CultivateNotifyItem
>
getNotifyItemsByMessageId4Jump
(
Long
messageId
)
{
return
super
.
getSessionTemplate
().
selectList
(
getStatement
(
"getNotifyItemsByMessageId4Jump"
),
messageId
);
}
@Override
public
List
<
CultivateNotifyItem
>
getNotifyItemsByMessageIds4Jump
(
List
<
Long
>
messageIds
)
{
return
super
.
getSessionTemplate
().
selectList
(
getStatement
(
"getNotifyItemsByMessageIds4Jump"
),
messageIds
);
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/dto/CultivateNotifyDTO.java
View file @
c787af15
...
@@ -43,6 +43,10 @@ public class CultivateNotifyDTO {
...
@@ -43,6 +43,10 @@ public class CultivateNotifyDTO {
@ApiModelProperty
(
"发送内容"
)
@ApiModelProperty
(
"发送内容"
)
private
List
<
CultivateNotifyItem
>
cultivateNotifyItems
;
private
List
<
CultivateNotifyItem
>
cultivateNotifyItems
;
@ApiModelProperty
(
"跳转选择的应用作品"
)
private
List
<
CultivateNotifyItem
>
jumpNotifyItems
;
@ApiModelProperty
(
"用户id"
)
@ApiModelProperty
(
"用户id"
)
private
List
<
WechatUserDTO
>
wechatUserDTOS
;
private
List
<
WechatUserDTO
>
wechatUserDTOS
;
...
@@ -64,4 +68,7 @@ public class CultivateNotifyDTO {
...
@@ -64,4 +68,7 @@ public class CultivateNotifyDTO {
@ApiModelProperty
(
"是否首页弹窗"
)
@ApiModelProperty
(
"是否首页弹窗"
)
private
Integer
showHome
;
private
Integer
showHome
;
@ApiModelProperty
(
"首页推图"
)
private
String
squareImg
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/dto/CultivateNotifyPageDTO.java
View file @
c787af15
...
@@ -26,6 +26,10 @@ public class CultivateNotifyPageDTO {
...
@@ -26,6 +26,10 @@ public class CultivateNotifyPageDTO {
@ApiModelProperty
(
"发送内容"
)
@ApiModelProperty
(
"发送内容"
)
private
List
<
CultivateNotifyItem
>
cultivateNotifyItems
;
private
List
<
CultivateNotifyItem
>
cultivateNotifyItems
;
@ApiModelProperty
(
"跳转选择的应用作品"
)
private
List
<
CultivateNotifyItem
>
jumpNotifyItems
;
@ApiModelProperty
(
"发送时间"
)
@ApiModelProperty
(
"发送时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
sendTime
;
private
Date
sendTime
;
...
@@ -33,4 +37,6 @@ public class CultivateNotifyPageDTO {
...
@@ -33,4 +37,6 @@ public class CultivateNotifyPageDTO {
@ApiModelProperty
(
"是否首页弹窗"
)
@ApiModelProperty
(
"是否首页弹窗"
)
private
Integer
showHome
;
private
Integer
showHome
;
private
String
squareImg
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/entity/CultivateNotify.java
View file @
c787af15
...
@@ -27,4 +27,7 @@ public class CultivateNotify extends BaseEntity {
...
@@ -27,4 +27,7 @@ public class CultivateNotify extends BaseEntity {
@ApiModelProperty
(
"是否首页弹窗"
)
@ApiModelProperty
(
"是否首页弹窗"
)
private
Integer
showHome
;
private
Integer
showHome
;
@ApiModelProperty
(
"首页推图"
)
private
String
squareImg
;
}
}
pcloud-service-book/src/main/resources/mapper/cultivate/CultivateNotify.xml
View file @
c787af15
...
@@ -10,10 +10,11 @@
...
@@ -10,10 +10,11 @@
<result
column=
"send_type"
property=
"sendType"
jdbcType=
"INTEGER"
/>
<result
column=
"send_type"
property=
"sendType"
jdbcType=
"INTEGER"
/>
<result
column=
"agent_id"
property=
"agentId"
jdbcType=
"BIGINT"
/>
<result
column=
"agent_id"
property=
"agentId"
jdbcType=
"BIGINT"
/>
<result
column=
"show_home"
property=
"showHome"
jdbcType=
"TINYINT"
/>
<result
column=
"show_home"
property=
"showHome"
jdbcType=
"TINYINT"
/>
<result
column=
"square_img"
property=
"squareImg"
jdbcType=
"VARCHAR"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
message_id, message_type, title, create_time,update_time,send_type,agent_id, show_home
message_id, message_type, title, create_time,update_time,send_type,agent_id, show_home
,square_img
</sql>
</sql>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.cultivate.entity.CultivateNotify"
useGeneratedKeys=
"true"
keyProperty=
"messageId"
>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.cultivate.entity.CultivateNotify"
useGeneratedKeys=
"true"
keyProperty=
"messageId"
>
...
@@ -25,7 +26,8 @@
...
@@ -25,7 +26,8 @@
update_time,
update_time,
send_type,
send_type,
agent_id,
agent_id,
show_home
show_home,
square_img
)
)
values (
values (
#{messageType},
#{messageType},
...
@@ -34,7 +36,8 @@
...
@@ -34,7 +36,8 @@
NOW(),
NOW(),
#{sendType},
#{sendType},
#{agentId},
#{agentId},
#{showHome}
#{showHome},
#{squareImg}
)
)
</insert>
</insert>
...
...
pcloud-service-book/src/main/resources/mapper/cultivate/CultivateNotifyItem.xml
View file @
c787af15
...
@@ -66,7 +66,7 @@
...
@@ -66,7 +66,7 @@
</insert>
</insert>
<select
id=
"getNotifyItemsByMessageId"
resultMap=
"BaseResultMap"
>
<select
id=
"getNotifyItemsByMessageId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from cultivate_notify_item where message_id=#{messageId}
select
<include
refid=
"Base_Column_List"
/>
from cultivate_notify_item where message_id=#{messageId}
and jump_type is null
</select>
</select>
<select
id=
"getByMessageIds"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
<select
id=
"getByMessageIds"
parameterType=
"map"
resultMap=
"BaseResultMap"
>
...
@@ -77,6 +77,21 @@
...
@@ -77,6 +77,21 @@
<foreach
collection=
"messageIds"
open=
"("
close=
")"
separator=
","
item=
"item"
>
<foreach
collection=
"messageIds"
open=
"("
close=
")"
separator=
","
item=
"item"
>
#{item}
#{item}
</foreach>
</foreach>
and content_type
<
4
</select>
</select>
<select
id=
"getNotifyItemsByMessageId4Jump"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from cultivate_notify_item where message_id=#{messageId} and jump_type is not null
</select>
<select
id=
"getNotifyItemsByMessageIds4Jump"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from cultivate_notify_item
where
message_id in
<foreach
collection=
"list"
item=
"item"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
and jump_type is not null
</select>
</mapper>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/cultivate/CultivateNotifySend.xml
View file @
c787af15
...
@@ -143,7 +143,8 @@
...
@@ -143,7 +143,8 @@
a.message_id messageId,
a.message_id messageId,
a.create_time sendTime,
a.create_time sendTime,
a.title title,
a.title title,
a.show_home showHome
a.show_home showHome,
a.square_img squareImg
from cultivate_notify a
from cultivate_notify a
<if
test=
"keyword !=null"
>
<if
test=
"keyword !=null"
>
LEFT JOIN cultivate_notify_item b on a.message_id=b.message_id
LEFT JOIN cultivate_notify_item b on a.message_id=b.message_id
...
...
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