Search in sources :

Example 1 with SysMenuInfo

use of tk.ainiyue.danyuan.application.softm.sysmenu.po.SysMenuInfo in project danyuan-application by 514840279.

the class SysMenuServiceImpl method findzTreeByUser.

@Override
public List<AuthorityzTreeVO> findzTreeByUser(String id, String userName) {
    List<AuthorityzTreeVO> list = null;
    List<SysMenuInfo> listt = sysMenuDao.findzTreeByUser(id, userName);
    if (listt != null && listt.size() > 0) {
        list = new ArrayList<>();
        for (SysMenuInfo sysMenuInfo : listt) {
            AuthorityzTreeVO vo = new AuthorityzTreeVO();
            vo.setId(sysMenuInfo.getUuid());
            vo.setName(sysMenuInfo.getName());
            vo.setIcon(sysMenuInfo.getIcon());
            vo.setUrl(sysMenuInfo.getUri());
            List<AuthorityzTreeVO> listt1 = findzTreeByUser(sysMenuInfo.getUuid(), userName);
            if (listt1 != null) {
                vo.getChildren().addAll(listt1);
            }
            list.add(vo);
        }
    }
    return list;
}
Also used : AuthorityzTreeVO(tk.ainiyue.danyuan.application.softm.sysmenu.vo.AuthorityzTreeVO) SysMenuInfo(tk.ainiyue.danyuan.application.softm.sysmenu.po.SysMenuInfo)

Example 2 with SysMenuInfo

use of tk.ainiyue.danyuan.application.softm.sysmenu.po.SysMenuInfo in project danyuan-application by 514840279.

the class SysMenuServiceImpl method findAllBySearchText.

/**
 * 方法名 : findAllBySearchText
 * 功 能 : TODO(这里用一句话描述这个方法的作用)
 * 参 数 : @param pageNumber
 * 参 数 : @param pageSize
 * 参 数 : @param info
 * 参 数 : @return
 * 参 考 : @see
 * tk.ainiyue.danyuan.application.softm.sysmenu.service.SysMenuService#findAllBySearchText(int,
 * int, tk.ainiyue.danyuan.application.softm.sysmenu.po.SysMenuInfo)
 * 作 者 : Administrator
 */
@Override
public Page<SysMenuInfo> findAllBySearchText(int pageNumber, int pageSize, SysMenuInfo info) {
    Example<SysMenuInfo> example = Example.of(info);
    Sort sort = new Sort(new Order(Direction.DESC, "insertDatetime"));
    PageRequest request = new PageRequest(pageNumber - 1, pageSize, sort);
    Page<SysMenuInfo> sourceCodes = sysMenuDao.findAll(example, request);
    return sourceCodes;
}
Also used : Order(org.springframework.data.domain.Sort.Order) PageRequest(org.springframework.data.domain.PageRequest) SysMenuInfo(tk.ainiyue.danyuan.application.softm.sysmenu.po.SysMenuInfo) Sort(org.springframework.data.domain.Sort)

Example 3 with SysMenuInfo

use of tk.ainiyue.danyuan.application.softm.sysmenu.po.SysMenuInfo in project danyuan-application by 514840279.

the class SysMenuServiceImpl method findzTreeRole.

@Override
public List<AuthorityzTreeVO> findzTreeRole(String id, String roleUuid) {
    List<AuthorityzTreeVO> list = null;
    List<SysMenuInfo> listt = sysMenuDao.findAllByParentsIdOrderByF_SortCode(id);
    if (listt != null && listt.size() > 0) {
        list = new ArrayList<>();
        for (SysMenuInfo sysMenuInfo : listt) {
            AuthorityzTreeVO vo = new AuthorityzTreeVO();
            vo.setId(sysMenuInfo.getUuid());
            vo.setName(sysMenuInfo.getName());
            vo.setIcon(sysMenuInfo.getIcon());
            vo.setUrl(sysMenuInfo.getUri());
            SysRolesJurisdictionInfo jurisdiction = new SysRolesJurisdictionInfo();
            SysRolesJurisdictionInfoPK pk = new SysRolesJurisdictionInfoPK(sysMenuInfo.getUuid(), roleUuid);
            jurisdiction = sysRolesJurisdictionDao.findById(SysRolesJurisdictionInfo.class, pk);
            if (jurisdiction != null) {
                vo.setChecked(jurisdiction.getChecked());
            }
            List<AuthorityzTreeVO> listt1 = findzTreeRole(sysMenuInfo.getUuid(), roleUuid);
            if (listt1 != null) {
                vo.getChildren().addAll(listt1);
            }
            list.add(vo);
        }
    }
    return list;
}
Also used : AuthorityzTreeVO(tk.ainiyue.danyuan.application.softm.sysmenu.vo.AuthorityzTreeVO) SysRolesJurisdictionInfo(tk.ainiyue.danyuan.application.crm.jurisdiction.po.SysRolesJurisdictionInfo) SysRolesJurisdictionInfoPK(tk.ainiyue.danyuan.application.crm.jurisdiction.po.SysRolesJurisdictionInfoPK) SysMenuInfo(tk.ainiyue.danyuan.application.softm.sysmenu.po.SysMenuInfo)

Example 4 with SysMenuInfo

use of tk.ainiyue.danyuan.application.softm.sysmenu.po.SysMenuInfo in project danyuan-application by 514840279.

the class SysMenuServiceImpl method onDropAuthority.

/**
 * 方法名 : onDropAuthority
 * 功 能 : TODO(这里用一句话描述这个方法的作用)
 * 参 数 : @param authorityzTreeVO
 * 参 数 : @return
 * 参 考 : @see
 * tk.ainiyue.danyuan.application.authority.service.AuthorityService#onDropAuthority(tk.ainiyue.danyuan.application.authority.vo.AuthorityzTreeVO)
 * 作 者 : wang
 */
@Override
public AuthorityzTreeVO onDropAuthority(SysMenuInfo sysMenuInfo) {
    String[] str = sysMenuInfo.getUuid().split(",");
    if ("inner".equals(sysMenuInfo.getMoveType())) {
        List<SysMenuInfo> list = sysMenuDao.getSize(sysMenuInfo.getParentsId());
        int num = list.size();
        for (String string : str) {
            sysMenuDao.updateSysMenuInfoName(sysMenuInfo.getParentsId(), num++, string);
        }
    } else {
        SysMenuInfo temp = sysMenuDao.getParentId(sysMenuInfo.getParentsId() == null ? "0" : sysMenuInfo.getParentsId());
        List<SysMenuInfo> list = sysMenuDao.findAllByParentsIdOrderByF_SortCode(temp.getParentsId());
        int num = 0;
        for (int i = 0; i < list.size(); i++) {
            for (String string : str) {
                if (string.equals(list.get(i).getUuid())) {
                    list.remove(i);
                    i--;
                }
            }
        }
        if ("prev".equals(sysMenuInfo.getMoveType())) {
            for (SysMenuInfo sysMenuInfo2 : list) {
                if (temp.getUuid().equals(sysMenuInfo2.getUuid())) {
                    for (String string : str) {
                        sysMenuDao.updateSysMenuInfoName(temp.getParentsId(), num++, string);
                    }
                }
                sysMenuDao.updateSysMenuInfoName(temp.getParentsId(), num++, sysMenuInfo2.getUuid());
            }
        } else if ("next".equals(sysMenuInfo.getMoveType())) {
            for (SysMenuInfo authority2 : list) {
                sysMenuDao.updateSysMenuInfoName(temp.getParentsId(), num++, authority2.getUuid());
                if (temp.getUuid().equals(authority2.getUuid())) {
                    for (String string : str) {
                        sysMenuDao.updateSysMenuInfoName(temp.getParentsId(), num++, string);
                    }
                }
            }
        }
    }
    return new AuthorityzTreeVO();
}
Also used : AuthorityzTreeVO(tk.ainiyue.danyuan.application.softm.sysmenu.vo.AuthorityzTreeVO) SysMenuInfo(tk.ainiyue.danyuan.application.softm.sysmenu.po.SysMenuInfo)

Example 5 with SysMenuInfo

use of tk.ainiyue.danyuan.application.softm.sysmenu.po.SysMenuInfo in project danyuan-application by 514840279.

the class SysMenuServiceImpl method findzTreeByF_ParentId.

/**
 * 方法名 : findzTreeByF_ParentId
 * 功 能 : TODO(这里用一句话描述这个方法的作用)
 * 参 数 : @param string
 * 参 数 : @return
 * 参 考 : @see
 * tk.ainiyue.danyuan.application.authority.service.AuthorityService#findzTreeByF_ParentId(java.lang.String)
 * 作 者 : wang
 */
@Override
public List<AuthorityzTreeVO> findzTreeByF_ParentId(String id) {
    List<AuthorityzTreeVO> list = null;
    List<SysMenuInfo> listt = sysMenuDao.findAllByParentsIdOrderByF_SortCode(id);
    if (listt != null && listt.size() > 0) {
        list = new ArrayList<>();
        for (SysMenuInfo sysMenuInfo : listt) {
            AuthorityzTreeVO vo = new AuthorityzTreeVO();
            vo.setId(sysMenuInfo.getUuid());
            vo.setName(sysMenuInfo.getName());
            vo.setIcon(sysMenuInfo.getIcon());
            vo.setUrl(sysMenuInfo.getUri());
            List<AuthorityzTreeVO> listt1 = findzTreeByF_ParentId(sysMenuInfo.getUuid());
            if (listt1 != null) {
                vo.getChildren().addAll(listt1);
            }
            list.add(vo);
        }
    }
    return list;
}
Also used : AuthorityzTreeVO(tk.ainiyue.danyuan.application.softm.sysmenu.vo.AuthorityzTreeVO) SysMenuInfo(tk.ainiyue.danyuan.application.softm.sysmenu.po.SysMenuInfo)

Aggregations

SysMenuInfo (tk.ainiyue.danyuan.application.softm.sysmenu.po.SysMenuInfo)6 AuthorityzTreeVO (tk.ainiyue.danyuan.application.softm.sysmenu.vo.AuthorityzTreeVO)4 ArrayList (java.util.ArrayList)1 PageRequest (org.springframework.data.domain.PageRequest)1 Sort (org.springframework.data.domain.Sort)1 Order (org.springframework.data.domain.Sort.Order)1 GrantedAuthority (org.springframework.security.core.GrantedAuthority)1 SimpleGrantedAuthority (org.springframework.security.core.authority.SimpleGrantedAuthority)1 User (org.springframework.security.core.userdetails.User)1 UserDetails (org.springframework.security.core.userdetails.UserDetails)1 UsernameNotFoundException (org.springframework.security.core.userdetails.UsernameNotFoundException)1 SysRolesJurisdictionInfo (tk.ainiyue.danyuan.application.crm.jurisdiction.po.SysRolesJurisdictionInfo)1 SysRolesJurisdictionInfoPK (tk.ainiyue.danyuan.application.crm.jurisdiction.po.SysRolesJurisdictionInfoPK)1 SysUserBaseInfo (tk.ainiyue.danyuan.application.user.userbase.po.SysUserBaseInfo)1