This commit is contained in:
2025-12-18 11:01:18 +08:00
8 changed files with 38 additions and 10 deletions
@@ -46,6 +46,7 @@ RoleConstant {
BRANCH_UNION_WENTI_WY("分工会文体委员"),
BRANCH_UNION_SHENGGHUO_WY("分工会生活委员"),
BRANCH_UNION_TIAOJIE_WY("分工会调解委员"),
BRANCH_UNION_WENTI_SPORTS("分工会文体福利委员"),
UNIT_PARTY_SECRETARY("单位党委书记"),
@@ -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());
@@ -409,7 +409,7 @@ public class WelfareListServiceImpl extends BaseServiceImpl<WelfareList> impleme
if (pageForm.getBirthMonths() != null && pageForm.getBirthMonths().length > 0) {
cnd.andEX("MONTH(t2.birthday)", "in", pageForm.getBirthMonths());
}
if(!AuthUtil.hasRole(RoleConstant.SYSADMIN.name()) && AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
if (AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()) || AuthUtil.hasRole(RoleConstant.BRANCH_UNION_ADMIN.name()) || AuthUtil.hasRole(RoleConstant.BRANCH_UNION_WENTI_SPORTS.name())) {
cnd.and("t2.unionId", "=", SecurityUtil.getUnionId());
}
cnd.andEX("t1.welfareUnitId", "in", pageForm.getUnitIds());
@@ -77,7 +77,7 @@ public class WelfareSelectionSituationServiceImpl extends BaseServiceImpl<Welfar
""");
Cnd cnd = Cnd.NEW();
if (AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()) || AuthUtil.hasRole(RoleConstant.BRANCH_UNION_OPERATOR.name())) {
if (AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()) || AuthUtil.hasRole(RoleConstant.BRANCH_UNION_ADMIN.name()) || AuthUtil.hasRole(RoleConstant.BRANCH_UNION_WENTI_SPORTS.name())) {
cnd.and("t1.welfareUnionId", "=", SecurityUtil.getUnionId());
}
@@ -136,7 +136,7 @@ public class WelfareSelectionSituationServiceImpl extends BaseServiceImpl<Welfar
""");
Cnd cnd = Cnd.NEW();
if (AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()) || AuthUtil.hasRole(RoleConstant.BRANCH_UNION_OPERATOR.name())) {
if (AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()) || AuthUtil.hasRole(RoleConstant.BRANCH_UNION_ADMIN.name()) || AuthUtil.hasRole(RoleConstant.BRANCH_UNION_WENTI_SPORTS.name())) {
cnd.and("t1.welfareUnionId", "=", SecurityUtil.getUnionId());
}
@@ -221,7 +221,7 @@ public class WelfareSelectionSituationServiceImpl extends BaseServiceImpl<Welfar
Cnd cnd = Cnd.NEW();
cnd.and("t1.projectId", "=", pageForm.getProjectId());
cnd.groupBy("t1.id");
if (AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()) || AuthUtil.hasRole(RoleConstant.BRANCH_UNION_ADMIN.name())) {
if (AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()) || AuthUtil.hasRole(RoleConstant.BRANCH_UNION_ADMIN.name())|| AuthUtil.hasRole(RoleConstant.BRANCH_UNION_WENTI_SPORTS.name())) {
cnd.and("t1.welfareUnionId", "=", SecurityUtil.getUnionId());
}
cnd.asc("t1.welfareUnitId");
@@ -48,7 +48,7 @@ public class WelfareStatisticsServiceImpl extends BaseServiceImpl<WelfareProject
public NutMap pageData(String projectId, String unionId) {
// 分工会数据
List<Sys_union> unions;
if (AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()) || AuthUtil.hasRole(RoleConstant.BRANCH_UNION_ADMIN.name())) {
if (AuthUtil.hasRole(RoleConstant.BRANCH_UNION_CHAIRMAN.name()) || AuthUtil.hasRole(RoleConstant.BRANCH_UNION_ADMIN.name())|| AuthUtil.hasRole(RoleConstant.BRANCH_UNION_WENTI_SPORTS.name())) {
unions = dao().query(Sys_union.class, Cnd.NEW().andEX(Sys_union::getId, "=", SecurityUtil.getUnionId()).asc(Sys_union::getUnionCode));
}else {
unions = dao().query(Sys_union.class, Cnd.NEW().andEX(Sys_union::getId, "=", unionId).asc(Sys_union::getUnionCode));