This commit is contained in:
佟明轩 2025-05-20 11:53:08 +08:00
parent 659d00e4d9
commit 1163720b4b
1 changed files with 7 additions and 5 deletions

View File

@ -102,6 +102,8 @@ public class OrganizationMemberService extends BaseService {
organizationMemberSectionMapper.delete(delWrapper); organizationMemberSectionMapper.delete(delWrapper);
List<OrganizationMemberSection> sectionList = new ArrayList<>(); List<OrganizationMemberSection> sectionList = new ArrayList<>();
List<String> sectionNameList = new ArrayList<>(); List<String> sectionNameList = new ArrayList<>();
organizationMember.setSectionNames("");
organizationMemberMapper.insertOrUpdate(organizationMember);
for (Integer sectionId : sectionIds) { for (Integer sectionId : sectionIds) {
OrganizationSection dbSection = organizationSectionMapper.selectById(sectionId); OrganizationSection dbSection = organizationSectionMapper.selectById(sectionId);
if (dbSection == null){ if (dbSection == null){
@ -116,11 +118,11 @@ public class OrganizationMemberService extends BaseService {
sectionList.add(memberSection); sectionList.add(memberSection);
} }
organizationMember.setSectionNames(String.join("/", sectionNameList)); OrganizationMember updateMember = new OrganizationMember();
organizationMemberMapper.insertOrUpdate(organizationMember); updateMember.setId(organizationMember.getId());
for (OrganizationMemberSection section : sectionList){ updateMember.setSectionNames(String.join("/", sectionNameList));
section.setOrganizationMemberId(organizationMember.getId()); organizationMemberMapper.updateById(updateMember);
}
organizationMemberSectionMapper.insert(sectionList); organizationMemberSectionMapper.insert(sectionList);
ManagerUser user = dto.getUserInfo(); ManagerUser user = dto.getUserInfo();