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