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 ab2b4c5e
authored
Oct 16, 2022
by
liushuangwu
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
departMentName
1 parent
a608dec0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
0 deletions
src/main/java/com/pipihelper/project/feishu/controller/FeiShuEventController.java
src/main/java/com/pipihelper/project/feishu/dao/PainDao.java
src/main/java/com/pipihelper/project/feishu/service/PainService.java
src/main/resources/mybatis/PainMapper.xml
src/main/java/com/pipihelper/project/feishu/controller/FeiShuEventController.java
View file @
ab2b4c5
...
...
@@ -8,6 +8,7 @@ import com.pipihelper.project.feishu.dto.FeiShuConfig;
import
com.pipihelper.project.feishu.dto.FeiShuEventDTO
;
import
com.pipihelper.project.feishu.dto.FeiShuMsgCardEventDTO
;
import
com.pipihelper.project.feishu.dto.chat.FeiShuChatDTO
;
import
com.pipihelper.project.feishu.dto.department.FeiShuDepartmentDTO
;
import
com.pipihelper.project.feishu.dto.employee.FeiShuEmployeeDTO
;
import
com.pipihelper.project.feishu.dto.msg.FeiShuMsgDTO
;
import
com.pipihelper.project.feishu.entity.Employee
;
...
...
@@ -33,7 +34,9 @@ import java.io.InputStream;
import
java.io.InputStreamReader
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
...
...
@@ -196,6 +199,17 @@ public class FeiShuEventController {
maxEmploeeId
=
employees
.
stream
().
map
(
Employee:
:
getId
).
max
(
Comparator
.
comparing
(
x
->
x
)).
orElse
(
0
);
employeeList
.
addAll
(
employees
);
}
System
.
out
.
println
(
maxEmploeeId
);
Map
<
String
,
FeiShuDepartmentDTO
>
departmentMap
=
new
HashMap
<>();
List
<
String
>
departmentIdList
=
employeeList
.
stream
().
map
(
Employee:
:
getDepartmentId
).
distinct
().
collect
(
Collectors
.
toList
());
departmentIdList
.
forEach
(
it
->
{
FeiShuDepartmentDTO
department
=
feiShuApiService
.
getDepartment
(
it
);
departmentMap
.
put
(
it
,
department
);
});
painService
.
deleteAllByFloor
(
14
);
AtomicInteger
i
=
new
AtomicInteger
();
employeeList
.
forEach
(
it
->
{
Pain
pain
=
new
Pain
();
...
...
@@ -204,6 +218,7 @@ public class FeiShuEventController {
pain
.
setFloor
(
it
.
getFloor
());
pain
.
setIndex
(
i
.
getAndIncrement
());
pain
.
setName
(
it
.
getName
());
pain
.
setDepartMentName
(
departmentMap
.
getOrDefault
(
it
.
getDepartmentId
(),
new
FeiShuDepartmentDTO
()).
getName
());
painService
.
create
(
pain
);
});
/* massageService.sendMassageMsgCardToPiPiChat(userList);*/
...
...
src/main/java/com/pipihelper/project/feishu/dao/PainDao.java
View file @
ab2b4c5
...
...
@@ -26,4 +26,6 @@ public interface PainDao {
List
<
Pain
>
findListAsc
(
int
limit
);
List
<
Pain
>
findBackIndex
(
@Param
(
value
=
"index"
)
Integer
index
,
@Param
(
value
=
"limit"
)
int
limit
);
void
deleteAllByFloor
(
int
floor
);
}
src/main/java/com/pipihelper/project/feishu/service/PainService.java
View file @
ab2b4c5
...
...
@@ -52,4 +52,8 @@ public class PainService {
public
List
<
Pain
>
findBackIndex
(
Integer
index
,
int
limit
)
{
return
painDao
.
findBackIndex
(
index
,
limit
);
}
public
void
deleteAllByFloor
(
int
floor
)
{
painDao
.
deleteAllByFloor
(
floor
);
}
}
src/main/resources/mybatis/PainMapper.xml
View file @
ab2b4c5
...
...
@@ -64,6 +64,10 @@
</where>
</select>
<delete
id=
"deleteAllByFloor"
>
delete from t_pain where floor = #{floor}
</delete>
<select
id=
"findByIndex"
parameterType=
"java.lang.String"
resultMap=
"PainResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
...
...
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