Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 43bccb7c
authored
Oct 25, 2023
by
Ren Ping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消息模块开发
1 parent
be67cdc4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
project-order/src/main/java/com/dituhui/pea/order/dao/MsgDao.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/MsgServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/dao/MsgDao.java
View file @
43bccb7
...
...
@@ -50,5 +50,6 @@ public interface MsgDao extends JpaRepository<MsgEntity, Long> {
") t"
,
nativeQuery
=
true
// 开启原生sql
)
List
<
Map
<
String
,
Objects
>>
getList
(
@Param
(
"req"
)
MsgDTO
.
Request
req
,
@Param
(
"msgGroupResp"
)
MsgGroupResp
msgGroupResp
,
Pageable
pageable
);
List
<
Map
<
String
,
Objects
>>
getList
(
@Param
(
"req"
)
MsgDTO
.
Request
req
,
@Param
(
"msgGroupResp"
)
MsgGroupResp
msgGroupResp
,
Pageable
pageable
);
}
project-order/src/main/java/com/dituhui/pea/order/service/impl/MsgServiceImpl.java
View file @
43bccb7
...
...
@@ -59,9 +59,9 @@ public class MsgServiceImpl implements MsgService {
msgGroupResp
.
setGroupName
(
clusterDao
.
getByClusterId
(
msgGroupResp
.
getBranchId
()).
getName
());
}
Sort
sort2
=
Sort
.
by
(
"asc"
.
equalsIgnoreCase
(
request
.
getSortType
())
?
Sort
.
Direction
.
ASC
:
Sort
.
Direction
.
DESC
,
request
.
getSort
());
Pageable
pageable2
=
PageRequest
.
of
(
0
,
Integer
.
MAX_VALUE
,
sort2
);
List
<
Map
<
String
,
Objects
>>
msgMapList
=
msgDao
.
getList
(
request
,
msgGroupResp
,
pageable2
);
List
<
Map
<
String
,
Objects
>>
msgMapList
=
msgDao
.
getList
(
request
,
msgGroupResp
,
PageRequest
.
of
(
0
,
Integer
.
MAX_VALUE
,
sort
)
);
List
<
MsgResp
>
msgList
=
msgMapList
.
stream
().
map
(
msgMap
->
{
MsgResp
msgResp
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
msgMap
),
MsgResp
.
class
);
msgResp
.
setTypeName
(
MsgTypeEnum
.
getNameByValue
(
msgResp
.
getType
()));
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment