Package cn.sparrowmini.org.service.impl
Class GroupServiceImpl
- java.lang.Object
-
- cn.sparrowmini.org.service.impl.AbstractPreserveScope
-
- cn.sparrowmini.org.service.impl.GroupServiceImpl
-
- All Implemented Interfaces:
GroupRestService,GroupService,GroupScope,PreserveRole,PreserveScope
@Service public class GroupServiceImpl extends AbstractPreserveScope implements GroupService, GroupScope
群组服务- Author:
- fanmj
-
-
Field Summary
-
Fields inherited from interface cn.sparrowmini.org.service.scope.GroupScope
admin, SCOPE_ADMIN_CREATE, SCOPE_ADMIN_DELETE, SCOPE_ADMIN_LIST, SCOPE_ADMIN_MEMBER_ADD, SCOPE_ADMIN_MEMBER_LIST, SCOPE_ADMIN_MEMBER_REMOVE, SCOPE_ADMIN_PARENT_ORG_ADD, SCOPE_ADMIN_PARENT_ORG_LIST, SCOPE_ADMIN_PARENT_ORG_REMOVE, SCOPE_ADMIN_READ, SCOPE_ADMIN_TREE, SCOPE_ADMIN_UPDATE, type
-
Fields inherited from interface cn.sparrowmini.org.service.scope.PreserveRole
ROLE_ADMIN, ROLE_SUPER_ADMIN, ROLE_SUPER_SYSADMIN, ROLE_SYSADMIN, ROLE_USER
-
-
Constructor Summary
Constructors Constructor Description GroupServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMembers(java.lang.String groupId, @NotNull cn.sparrowmini.org.model.constant.GroupTypeEnum type, java.util.List<java.lang.Object> memberIds)org.springframework.data.domain.Page<cn.sparrowmini.org.model.Group>all(org.springframework.data.domain.Pageable pageable, CommonFilterBean commonFilterBean)voidbuildTree(SparrowTree<cn.sparrowmini.org.model.Group,java.lang.String> myTree)cn.sparrowmini.org.model.Groupcreate(cn.sparrowmini.org.model.Group group)voiddelete(java.util.List<java.lang.String> ids)cn.sparrowmini.org.model.Groupget(java.lang.String groupId)java.util.List<cn.sparrowmini.org.model.Employee>getFinalEmployees(@NotBlank java.lang.String groupId)org.springframework.data.domain.Page<?>getMembers(java.lang.String groupId, @NotNull cn.sparrowmini.org.model.constant.GroupTypeEnum type, org.springframework.data.domain.Pageable pageable)org.springframework.data.domain.Page<cn.sparrowmini.org.model.relation.OrganizationGroup>getParentOrgs(java.lang.String groupId, org.springframework.data.domain.Pageable pageable)SparrowTree<cn.sparrowmini.org.model.Group,java.lang.String>getTree(java.lang.String parentId)voidremoveMembers(java.lang.String groupId, @NotNull cn.sparrowmini.org.model.constant.GroupTypeEnum type, java.util.List<java.lang.Object> memberIds)voidremoveParentOrgs(java.lang.String groupId, java.util.List<java.lang.String> orgs)voidsetParentOrgs(java.lang.String groupId, java.util.List<java.lang.String> orgs)cn.sparrowmini.org.model.Groupupdate(java.lang.String groupId, java.util.Map<java.lang.String,java.lang.Object> map)-
Methods inherited from class cn.sparrowmini.org.service.impl.AbstractPreserveScope
getRoles, getScopes
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface cn.sparrowmini.org.service.scope.PreserveRole
getRoles
-
Methods inherited from interface cn.sparrowmini.org.service.scope.PreserveScope
getScopes
-
-
-
-
Method Detail
-
getTree
public SparrowTree<cn.sparrowmini.org.model.Group,java.lang.String> getTree(java.lang.String parentId)
- Specified by:
getTreein interfaceGroupRestService
-
buildTree
public void buildTree(SparrowTree<cn.sparrowmini.org.model.Group,java.lang.String> myTree)
-
create
@ResponseStatus(code=CREATED) @PreAuthorize("hasAuthority(\'SCOPE_admin:group:create\') or hasRole(\'ROLE_ADMIN\')") public cn.sparrowmini.org.model.Group create(cn.sparrowmini.org.model.Group group)- Specified by:
createin interfaceGroupRestService
-
getFinalEmployees
public java.util.List<cn.sparrowmini.org.model.Employee> getFinalEmployees(@NotBlank @NotBlank java.lang.String groupId)- Specified by:
getFinalEmployeesin interfaceGroupService
-
update
@PreAuthorize("hasAuthority(\'SCOPE_admin:group:update\') or hasRole(\'ROLE_ADMIN\')") public cn.sparrowmini.org.model.Group update(java.lang.String groupId, java.util.Map<java.lang.String,java.lang.Object> map)- Specified by:
updatein interfaceGroupRestService
-
delete
@ResponseStatus(code=NO_CONTENT) @PreAuthorize("hasAuthority(\'SCOPE_admin:group:delete\') or hasRole(\'ROLE_SUPER_ADMIN\')") public void delete(java.util.List<java.lang.String> ids)- Specified by:
deletein interfaceGroupRestService
-
all
@PreAuthorize("hasAuthority(\'SCOPE_admin:group:list\') or hasRole(\'ROLE_ADMIN\')") public org.springframework.data.domain.Page<cn.sparrowmini.org.model.Group> all(@Nullable org.springframework.data.domain.Pageable pageable, CommonFilterBean commonFilterBean)- Specified by:
allin interfaceGroupRestService
-
getParentOrgs
@PreAuthorize("hasAuthority(\'SCOPE_admin:group:parent:org:list\') or hasRole(\'ROLE_ADMIN\')") public org.springframework.data.domain.Page<cn.sparrowmini.org.model.relation.OrganizationGroup> getParentOrgs(java.lang.String groupId, org.springframework.data.domain.Pageable pageable)- Specified by:
getParentOrgsin interfaceGroupRestService
-
setParentOrgs
@Transactional @ResponseStatus(code=NO_CONTENT) @PreAuthorize("hasAuthority(\'SCOPE_admin:group:parent:org:add\') or hasRole(\'ROLE_ADMIN\')") public void setParentOrgs(java.lang.String groupId, java.util.List<java.lang.String> orgs)- Specified by:
setParentOrgsin interfaceGroupRestService
-
removeParentOrgs
@Transactional @ResponseStatus(code=NO_CONTENT) @PreAuthorize("hasAuthority(\'SCOPE_admin:group:parent:org:remove\') or hasRole(\'ROLE_SUPER_ADMIN\')") public void removeParentOrgs(java.lang.String groupId, java.util.List<java.lang.String> orgs)- Specified by:
removeParentOrgsin interfaceGroupRestService
-
getMembers
@PreAuthorize("hasAuthority(\'SCOPE_admin:group:member:list\') or hasRole(\'ROLE_ADMIN\')") public org.springframework.data.domain.Page<?> getMembers(java.lang.String groupId, @NotNull @NotNull cn.sparrowmini.org.model.constant.GroupTypeEnum type, org.springframework.data.domain.Pageable pageable)- Specified by:
getMembersin interfaceGroupRestService
-
addMembers
@Transactional @ResponseStatus(code=NO_CONTENT) @PreAuthorize("hasAuthority(\'SCOPE_admin:group:member:add\') or hasRole(\'ROLE_ADMIN\')") public void addMembers(java.lang.String groupId, @NotNull @NotNull cn.sparrowmini.org.model.constant.GroupTypeEnum type, java.util.List<java.lang.Object> memberIds)- Specified by:
addMembersin interfaceGroupRestService
-
removeMembers
@Transactional @ResponseStatus(code=NO_CONTENT) @PreAuthorize("hasAuthority(\'SCOPE_admin:group:member:remove\') or hasRole(\'ROLE_SUPER_ADMIN\')") public void removeMembers(java.lang.String groupId, @NotNull @NotNull cn.sparrowmini.org.model.constant.GroupTypeEnum type, java.util.List<java.lang.Object> memberIds)- Specified by:
removeMembersin interfaceGroupRestService
-
get
@PreAuthorize("hasAuthority(\'SCOPE_admin:group:read\') or hasRole(\'ROLE_ADMIN\')") public cn.sparrowmini.org.model.Group get(java.lang.String groupId)- Specified by:
getin interfaceGroupRestService
-
-