Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
W
wlOfficialAccount
Project
Project
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
mengmeng
wlOfficialAccount
Commits
c8d51489
Commit
c8d51489
authored
Jan 05, 2021
by
mengmeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
meeting updateApi modify
parent
3085dabe
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
0 deletions
+43
-0
MeetingService.java
.../java/io/hmit/modules/meeting/service/MeetingService.java
+4
-0
MeetingServiceImpl.java
...hmit/modules/meeting/service/impl/MeetingServiceImpl.java
+39
-0
No files found.
hmit-admin/src/main/java/io/hmit/modules/meeting/service/MeetingService.java
View file @
c8d51489
...
...
@@ -14,4 +14,8 @@ public interface MeetingService extends CrudService<MeetingEntity, MeetingDTO> {
@Override
void
save
(
MeetingDTO
dto
);
@Override
void
update
(
MeetingDTO
dto
);
}
hmit-admin/src/main/java/io/hmit/modules/meeting/service/impl/MeetingServiceImpl.java
View file @
c8d51489
...
...
@@ -5,6 +5,7 @@ import io.hmit.common.service.impl.CrudServiceImpl;
import
io.hmit.common.utils.ConvertUtils
;
import
io.hmit.modules.meeting.dao.MeetingDao
;
import
io.hmit.modules.meeting.dto.MeetingDTO
;
import
io.hmit.modules.meeting.dto.WlMeetingStaffDTO
;
import
io.hmit.modules.meeting.entity.MeetingEntity
;
import
io.hmit.modules.meeting.entity.WlMeetingStaffEntity
;
import
io.hmit.modules.meeting.service.MeetingService
;
...
...
@@ -17,6 +18,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -54,6 +56,43 @@ public class MeetingServiceImpl extends CrudServiceImpl<MeetingDao, MeetingEntit
BeanUtils
.
copyProperties
(
entity
,
dto
);
//会议人员对应关系保存
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"meetingId"
,
dto
.
getId
());
List
<
WlMeetingStaffDTO
>
wl
=
wlMeetingStaffService
.
list
(
params
);
if
(
wl
.
size
()>
0
){
wl
.
forEach
(
wlMeetingStaffDTO
->
{
wlMeetingStaffService
.
deleteById
(
wlMeetingStaffDTO
.
getId
());
});
}
List
<
WlMeetingStaffEntity
>
wlMeetingStaffList
=
new
ArrayList
<>();
dto
.
getInvitedUserIDs
().
stream
().
forEach
(
userId
->{
WlMeetingStaffEntity
meetingStaff
=
new
WlMeetingStaffEntity
();
meetingStaff
=
meetingStaff
.
assembleWlMeetingStaff
(
dto
.
getId
(),
userId
,
null
);
wlMeetingStaffList
.
add
(
meetingStaff
);
});
wlMeetingStaffService
.
insertBatch
(
wlMeetingStaffList
);
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
update
(
MeetingDTO
dto
)
{
MeetingEntity
entity
=
ConvertUtils
.
sourceToTarget
(
dto
,
currentModelClass
());
updateById
(
entity
);
//copy主键值到dto
// BeanUtils.copyProperties(entity, dto);
//会议人员对应关系查询是否存在,有先删除再保存
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"meetingId"
,
dto
.
getId
());
List
<
WlMeetingStaffDTO
>
wl
=
wlMeetingStaffService
.
list
(
params
);
if
(
wl
.
size
()>
0
){
wl
.
forEach
(
wlMeetingStaffDTO
->
{
wlMeetingStaffService
.
deleteById
(
wlMeetingStaffDTO
.
getId
());
});
}
List
<
WlMeetingStaffEntity
>
wlMeetingStaffList
=
new
ArrayList
<>();
dto
.
getInvitedUserIDs
().
stream
().
forEach
(
userId
->{
...
...
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