Class GroupServiceImpl

    • Constructor Detail

      • GroupServiceImpl

        public GroupServiceImpl()
    • Method Detail

      • getTree

        public SparrowTree<cn.sparrowmini.org.model.Group,​java.lang.String> getTree​(java.lang.String parentId)
        Specified by:
        getTree in interface GroupRestService
      • 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:
        create in interface GroupRestService
      • getFinalEmployees

        public java.util.List<cn.sparrowmini.org.model.Employee> getFinalEmployees​(@NotBlank
                                                                                   @NotBlank java.lang.String groupId)
        Specified by:
        getFinalEmployees in interface GroupService
      • 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:
        update in interface GroupRestService
      • 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:
        delete in interface GroupRestService
      • 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:
        all in interface GroupRestService
      • 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:
        getParentOrgs in interface GroupRestService
      • 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:
        setParentOrgs in interface GroupRestService
      • 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:
        removeParentOrgs in interface GroupRestService
      • 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:
        getMembers in interface GroupRestService
      • 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:
        addMembers in interface GroupRestService
      • 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:
        removeMembers in interface GroupRestService
      • get

        @PreAuthorize("hasAuthority(\'SCOPE_admin:group:read\') or hasRole(\'ROLE_ADMIN\')")
        public cn.sparrowmini.org.model.Group get​(java.lang.String groupId)
        Specified by:
        get in interface GroupRestService