diff --git a/src/main/java/com/budwk/app/flow/handler/FlowUnitPartySecretaryHandler.java b/src/main/java/com/budwk/app/flow/handler/FlowUnitPartySecretaryHandler.java index 7ec0994c..e95acbdb 100644 --- a/src/main/java/com/budwk/app/flow/handler/FlowUnitPartySecretaryHandler.java +++ b/src/main/java/com/budwk/app/flow/handler/FlowUnitPartySecretaryHandler.java @@ -34,22 +34,13 @@ public class FlowUnitPartySecretaryHandler implements AssignmentHandler { Sys_role role = sysRoleService.getByCode(RoleConstant.UNIT_PARTY_SECRETARY); View_user user = ServiceContext.find(Dao.class).fetch(View_user.class, Cnd.where(View_user::getId, "=", SecurityUtil.getUserId())); - List roles; - if(user.getUnionName().contains("机关")){ - List unitList = ServiceContext.find(Dao.class).query(Sys_unit.class, Cnd.where(Sys_unit::getUnionId, "=", user.getUnionId())); - List unitIds = unitList.stream().map(Sys_unit::getId).toList(); - roles = ServiceContext.find(Dao.class).query( - Sys_user_role.class, - Cnd.where(Sys_user_role::getRoleId, "=", role.getId()) - .and(Sys_user_role::getUnitId, "in", unitIds) - ); - }else{ - roles = ServiceContext.find(Dao.class).query( - Sys_user_role.class, - Cnd.where(Sys_user_role::getRoleId, "=", role.getId()) - .and(Sys_user_role::getUnitId, "=", unitId) - ); - } + List unitList = ServiceContext.find(Dao.class).query(Sys_unit.class, Cnd.where(Sys_unit::getUnionId, "=", user.getUnionId())); + List unitIds = unitList.stream().map(Sys_unit::getId).toList(); + Listroles = ServiceContext.find(Dao.class).query( + Sys_user_role.class, + Cnd.where(Sys_user_role::getRoleId, "=", role.getId()) + .and(Sys_user_role::getUnitId, "in", unitIds) + ); if (Lang.isEmpty(roles)) { throw new RuntimeException("当前登录用户所在单位未设置单位党委书记,请联系校工会进行设置。"); @@ -59,7 +50,7 @@ public class FlowUnitPartySecretaryHandler implements AssignmentHandler { @Override public String getMessage() { - return "获取当前登录用户所在单位党委书记,若是机关就找出机关分下的党委书记。因为机关只有一个党委书记"; + return "获取当前登录用户所在单位党委书记"; } @Override