This commit is contained in:
@jyuhsin
2025-12-18 10:40:53 +08:00
parent 276fbae2ed
commit 21c4c1c6de
4 changed files with 32 additions and 5 deletions
@@ -69,6 +69,8 @@ public class TeacherCongressSessionServiceImpl extends BaseServiceImpl<Teacher_c
//代表团角色ID
Sys_role delegationHeadRole = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_DELEGATION_HEAD);
Sys_role delegationViceHeadRole = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_VICE_DELEGATION_HEAD);
Sys_role delegationContactRole = sysRoleService.getByCode(RoleConstant.TEACHER_CONGRESS_DELEGATION_CONTACT);
// 继承上届信息
//查询本届上次的信息
@@ -105,6 +107,24 @@ public class TeacherCongressSessionServiceImpl extends BaseServiceImpl<Teacher_c
newHeadUser.setTcSessionId(session.getId());
dao().insert(newHeadUser);
}
//副团长角色权限继承
List<Sys_user_role> lastViceHeadUserRoles = dao().query(Sys_user_role.class, Cnd.where(Sys_user_role::getTcDelegationId, "=", lastDelegation.getId())
.and(Sys_user_role::getRoleId, "=", delegationViceHeadRole.getId()));
for (Sys_user_role lastViceHeadUser : lastViceHeadUserRoles) {
Sys_user_role newViceHeadUser = BeanUtil.copyProperties(lastViceHeadUser, Sys_user_role.class);
newViceHeadUser.setTcDelegationId(newDelegation.getId());
newViceHeadUser.setTcSessionId(session.getId());
dao().insert(newViceHeadUser);
}
//联络人角色权限继承
List<Sys_user_role> lastContactUserRoles = dao().query(Sys_user_role.class, Cnd.where(Sys_user_role::getTcDelegationId, "=", lastDelegation.getId())
.and(Sys_user_role::getRoleId, "=", delegationContactRole.getId()));
for (Sys_user_role lastContactUser : lastContactUserRoles) {
Sys_user_role newContactUser = BeanUtil.copyProperties(lastContactUser, Sys_user_role.class);
newContactUser.setTcDelegationId(newDelegation.getId());
newContactUser.setTcSessionId(session.getId());
dao().insert(newContactUser);
}
//组成分工会
List<Teacher_congress_delegation_union> lastDelegationUnions = dao().query(Teacher_congress_delegation_union.class, Cnd.where(Teacher_congress_delegation_union::getDelegationId, "=", lastDelegation.getId()));
@@ -273,7 +293,7 @@ public class TeacherCongressSessionServiceImpl extends BaseServiceImpl<Teacher_c
dao().insert(newInstitution);
//插入机构人员数据
String lastSessionId = (String) child.get("sessionId");
List<Teacher_congress_institution_user> lastInstitutionUsers = dao().query(Teacher_congress_institution_user.class, Cnd.where("sessionId", "=", lastSessionId));
List<Teacher_congress_institution_user> lastInstitutionUsers = dao().query(Teacher_congress_institution_user.class, Cnd.where("sessionId", "=", lastSessionId).and("institutionId", "=", child.getId()));
List<Teacher_congress_institution_user> newInstitutionUsers = lastInstitutionUsers.stream().map(institutionUser -> {
Teacher_congress_institution_user teacherCongressInstitutionUser = new Teacher_congress_institution_user();
teacherCongressInstitutionUser.setUserId(institutionUser.getUserId());