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
8663d9e9
Commit
8663d9e9
authored
Dec 27, 2021
by
吴博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: [1006312] 【优化】自驱-小程序页面展示:一级页消息(层级)优化
parent
b0df64e7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
89 additions
and
16 deletions
+89
-16
AppletNotifySendDTO.java
...com/pcloud/book/cultivate/entity/AppletNotifySendDTO.java
+9
-0
NotifyCreateRoleEnum.java
...com/pcloud/book/cultivate/enums/NotifyCreateRoleEnum.java
+16
-0
CultivateNotifyBizImpl.java
...cloud/book/cultivate/biz/impl/CultivateNotifyBizImpl.java
+30
-4
CultivateNotifyDTO.java
...ava/com/pcloud/book/cultivate/dto/CultivateNotifyDTO.java
+12
-0
CultivateNotify.java
...ava/com/pcloud/book/cultivate/entity/CultivateNotify.java
+4
-0
CultivateNotify.xml
...k/src/main/resources/mapper/cultivate/CultivateNotify.xml
+8
-8
CultivateNotifySend.xml
...c/main/resources/mapper/cultivate/CultivateNotifySend.xml
+10
-4
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/cultivate/entity/AppletNotifySendDTO.java
View file @
8663d9e9
...
...
@@ -29,4 +29,13 @@ public class AppletNotifySendDTO {
private
String
extJson
;
private
Integer
serveType
;
@ApiModelProperty
(
"消息创建人id"
)
private
Long
createUserId
;
@ApiModelProperty
(
"创建人角色 pc or wx"
)
private
String
createUserRole
;
@ApiModelProperty
(
"内容"
)
private
String
content
;
}
pcloud-facade-book/src/main/java/com/pcloud/book/cultivate/enums/NotifyCreateRoleEnum.java
0 → 100644
View file @
8663d9e9
package
com
.
pcloud
.
book
.
cultivate
.
enums
;
public
enum
NotifyCreateRoleEnum
{
PC
(
"pc"
,
"pc端"
),
WX
(
"wx"
,
"客户端"
);
public
String
code
;
public
String
desc
;
NotifyCreateRoleEnum
(
String
code
,
String
desc
)
{
this
.
code
=
code
;
this
.
desc
=
desc
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/biz/impl/CultivateNotifyBizImpl.java
View file @
8663d9e9
package
com
.
pcloud
.
book
.
cultivate
.
biz
.
impl
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.ListUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
...
...
@@ -59,6 +60,7 @@ 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.ReaderMessageDto
;
import
com.pcloud.readercenter.wechat.entity.WechatUser
;
import
com.pcloud.resourcecenter.product.dto.ProductDto
;
import
com.pcloud.usercenter.party.adviser.dto.AdviserBaseInfoDto
;
import
com.pcloud.wechatgroup.selfrobot.dto.SendMessageDTO
;
...
...
@@ -170,11 +172,13 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
@Override
public
PageBeanNew
<
CultivateNotifyDTO
>
getNotifyListByType
(
Long
wechatUserId
,
Integer
messageType
,
Integer
currentPage
,
Integer
numPerPage
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"wechatUserId"
,
wechatUserId
);
map
.
put
(
"messageType"
,
messageType
);
PageBeanNew
<
CultivateNotifyDTO
>
pageBeanNew
=
cultivateNotifySendDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
map
,
"getNotifyListByType"
);
map
.
put
(
"wechatUserId"
,
wechatUserId
);
map
.
put
(
"messageType"
,
messageType
);
PageBeanNew
<
CultivateNotifyDTO
>
pageBeanNew
=
cultivateNotifySendDao
.
listPageNew
(
new
PageParam
(
currentPage
,
numPerPage
),
map
,
"getNotifyListByType"
);
List
<
CultivateNotifyItem
>
cultivateNotifyItemList
=
new
ArrayList
<>();
for
(
CultivateNotifyDTO
cultivateNotifyDTO:
pageBeanNew
.
getRecordList
())
{
//填充用户信息
fillUserInfo
(
pageBeanNew
.
getRecordList
());
for
(
CultivateNotifyDTO
cultivateNotifyDTO
:
pageBeanNew
.
getRecordList
())
{
List
<
CultivateNotifyItem
>
cultivateNotifyItems
=
new
ArrayList
<>();
List
<
CultivateNotifyItem
>
list1
=
cultivateNotifyItemDao
.
getNotifyItemsByMessageId
(
cultivateNotifyDTO
.
getMessageId
());
List
<
CultivateNotifyItem
>
list2
=
cultivateNotifyItemDao
.
getNotifyItemsByMessageId4Jump
(
cultivateNotifyDTO
.
getMessageId
());
...
...
@@ -204,6 +208,22 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
return
pageBeanNew
;
}
private
void
fillUserInfo
(
List
<
CultivateNotifyDTO
>
recordList
)
{
if
(
ListUtils
.
isEmpty
(
recordList
))
{
return
;
}
List
<
Long
>
wechatUserIds
=
recordList
.
stream
().
map
(
e
->
e
.
getWechatUserId
()).
collect
(
Collectors
.
toList
());
if
(
CollUtil
.
isEmpty
(
wechatUserIds
))
{
return
;
}
Map
<
Long
,
WechatUser
>
wechatUserMap
=
readerConsr
.
getUserList
(
wechatUserIds
);
recordList
.
stream
().
forEach
(
e
->
{
if
(
CollUtil
.
isNotEmpty
(
wechatUserMap
)
&&
null
!=
wechatUserMap
.
get
(
e
.
getWechatUserId
()))
{
e
.
setWechatUser
(
wechatUserMap
.
get
(
e
.
getWechatUserId
()));
}
});
}
private
void
fillResource
(
List
<
CultivateNotifyItem
>
list
){
List
<
Long
>
resourceIds
=
new
ArrayList
<>();
for
(
CultivateNotifyItem
notifyItem
:
list
){
...
...
@@ -661,6 +681,8 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
cultivateNotify
.
setTitle
(
newSendDTO
.
getTitle
());
cultivateNotify
.
setSendType
(
newSendDTO
.
getSendType
());
cultivateNotify
.
setAgentId
(
0L
);
cultivateNotify
.
setCreateUserId
(
newSendDTO
.
getCreateUserId
());
cultivateNotify
.
setCreateUserRole
(
newSendDTO
.
getCreateUserRole
());
cultivateNotifyDao
.
insert
(
cultivateNotify
);
CultivateNotifyItem
cultivateNotifyItem
=
new
CultivateNotifyItem
();
cultivateNotifyItem
.
setMessageId
(
cultivateNotify
.
getMessageId
());
...
...
@@ -699,6 +721,8 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
}
//填充资讯应用作品问题
fillAppOrProduct4Notify
(
cultivateNotifyItemList
);
//填充发送用户信息
fillUserInfo
(
pageBeanNew
.
getRecordList
());
ThreadPoolUtils
.
OTHER_THREAD_POOL
.
execute
(()
->
{
//批量更新消息已读未读
if
(
null
!=
pageBeanNew
&&
!
ListUtils
.
isEmpty
(
pageBeanNew
.
getRecordList
()))
{
...
...
@@ -719,6 +743,8 @@ public class CultivateNotifyBizImpl implements CultivateNotifyBiz {
cultivateNotify
.
setTitle
(
newSendDTO
.
getTitle
());
cultivateNotify
.
setSendType
(
newSendDTO
.
getSendType
());
cultivateNotify
.
setAgentId
(
0L
);
cultivateNotify
.
setCreateUserId
(
newSendDTO
.
getCreateUserId
());
cultivateNotify
.
setCreateUserRole
(
newSendDTO
.
getCreateUserRole
());
cultivateNotifyDao
.
insert
(
cultivateNotify
);
CultivateNotifyItem
cultivateNotifyItem
=
new
CultivateNotifyItem
();
cultivateNotifyItem
.
setMessageId
(
cultivateNotify
.
getMessageId
());
...
...
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/dto/CultivateNotifyDTO.java
View file @
8663d9e9
...
...
@@ -2,6 +2,7 @@ package com.pcloud.book.cultivate.dto;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.pcloud.book.cultivate.entity.CultivateNotifyItem
;
import
com.pcloud.readercenter.wechat.entity.WechatUser
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -71,4 +72,15 @@ public class CultivateNotifyDTO {
@ApiModelProperty
(
"首页推图"
)
private
String
squareImg
;
@ApiModelProperty
(
"用户id"
)
private
Long
wechatUserId
;
@ApiModelProperty
(
"微信用户信息"
)
private
WechatUser
wechatUser
;
@ApiModelProperty
(
"内容"
)
private
String
content
;
private
Integer
serveType
;
}
pcloud-service-book/src/main/java/com/pcloud/book/cultivate/entity/CultivateNotify.java
View file @
8663d9e9
...
...
@@ -30,4 +30,8 @@ public class CultivateNotify extends BaseEntity {
@ApiModelProperty
(
"首页推图"
)
private
String
squareImg
;
private
Long
createUserId
;
private
String
createUserRole
;
}
pcloud-service-book/src/main/resources/mapper/cultivate/CultivateNotify.xml
View file @
8663d9e9
...
...
@@ -19,26 +19,26 @@
<insert
id=
"insert"
parameterType=
"com.pcloud.book.cultivate.entity.CultivateNotify"
useGeneratedKeys=
"true"
keyProperty=
"messageId"
>
insert into cultivate_notify
(
message_type,
(message_type,
title,
create_time,
update_time,
send_type,
agent_id,
show_home,
square_img
)
values (
#{messageType},
square_img,
create_user_id,
create_user_role)
values (
#{messageType},
#{title},
NOW(),
NOW(),
#{sendType},
#{agentId},
#{showHome},
#{squareImg}
)
#{squareImg},
#{createUserId},
#{createUserRole})
</insert>
<update
id=
"update"
parameterType=
"com.pcloud.book.cultivate.entity.CultivateNotify"
>
...
...
pcloud-service-book/src/main/resources/mapper/cultivate/CultivateNotifySend.xml
View file @
8663d9e9
...
...
@@ -119,11 +119,17 @@
</select>
<select
id=
"getNotifyListByType"
parameterType=
"map"
resultType=
"com.pcloud.book.cultivate.dto.CultivateNotifyDTO"
>
select a.message_id messageId ,a.title,a.message_type messageType ,c.create_time sendTime from cultivate_notify a, cultivate_notify_send c
where a.message_id=c.message_id
and c.wechat_user_id=#{wechatUserId}
select a.message_id messageId,
a.title,
a.message_type messageType,
c.create_time sendTime,
a.create_user_id wechatUserId
from cultivate_notify a,
cultivate_notify_send c
where a.message_id = c.message_id
and c.wechat_user_id = #{wechatUserId}
<if
test=
"messageType != null"
>
and c.message_type=
#{messageType}
and c.message_type =
#{messageType}
</if>
order by c.create_time desc
</select>
...
...
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