Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
zhangshaowu
/
pipi-helper
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 9c5afbc1
authored
Oct 16, 2022
by
liushuangwu
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix
1 parent
f24b5258
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
src/main/java/com/pipihelper/project/feishu/dao/PainDao.java
src/main/java/com/pipihelper/project/feishu/service/PainService.java
src/main/java/com/pipihelper/project/feishu/dao/PainDao.java
View file @
9c5afbc
...
...
@@ -28,4 +28,6 @@ public interface PainDao {
List
<
Pain
>
findBackIndex
(
@Param
(
value
=
"index"
)
Integer
index
,
@Param
(
value
=
"limit"
)
int
limit
);
void
deleteAllByFloor
(
int
floor
);
List
<
Pain
>
findAllByFloor
(
int
floor
);
}
src/main/java/com/pipihelper/project/feishu/service/PainService.java
View file @
9c5afbc
package
com
.
pipihelper
.
project
.
feishu
.
service
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.pipihelper.project.feishu.dao.PainDao
;
import
com.pipihelper.project.feishu.entity.Pain
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.List
;
@Service
...
...
@@ -37,6 +40,15 @@ public class PainService {
return
painDao
.
findAll
();
}
public
List
<
Pain
>
findAllReorderByFloor
(
int
floor
)
{
List
<
Pain
>
painList
=
painDao
.
findAllByFloor
(
floor
);
if
(
CollectionUtil
.
isEmpty
(
painList
))
{
return
new
ArrayList
<>();
}
painList
.
stream
().
sorted
(
Comparator
.
comparing
(
Pain:
:
getIndex
));
return
new
ArrayList
<>();
}
public
void
waitPain
(
String
openId
)
{
Pain
pain
=
new
Pain
();
pain
.
setOpenId
(
openId
);
...
...
@@ -49,8 +61,8 @@ public class PainService {
return
painDao
.
findListAsc
(
limit
);
}
public
List
<
Pain
>
findBackIndex
(
Integer
index
,
int
limit
)
{
return
painDao
.
findBackIndex
(
index
,
limit
);
public
List
<
Pain
>
findBackIndex
(
Integer
index
,
int
limit
)
{
return
painDao
.
findBackIndex
(
index
,
limit
);
}
public
void
deleteAllByFloor
(
int
floor
)
{
...
...
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