commit
This commit is contained in:
@@ -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<Sys_user_role> roles;
|
||||
if(user.getUnionName().contains("机关")){
|
||||
List<Sys_unit> unitList = ServiceContext.find(Dao.class).query(Sys_unit.class, Cnd.where(Sys_unit::getUnionId, "=", user.getUnionId()));
|
||||
List<String> 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<Sys_unit> unitList = ServiceContext.find(Dao.class).query(Sys_unit.class, Cnd.where(Sys_unit::getUnionId, "=", user.getUnionId()));
|
||||
List<String> unitIds = unitList.stream().map(Sys_unit::getId).toList();
|
||||
List<Sys_user_role>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)
|
||||
);
|
||||
|
||||
if (Lang.isEmpty(roles)) {
|
||||
throw new RuntimeException("当前登录用户所在单位未设置单位党委书记,请联系校工会进行设置。");
|
||||
@@ -59,7 +50,7 @@ public class FlowUnitPartySecretaryHandler implements AssignmentHandler {
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "获取当前登录用户所在单位党委书记,若是机关就找出机关分下的党委书记。因为机关只有一个党委书记";
|
||||
return "获取当前登录用户所在单位党委书记";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user