use of tk.ainiyue.danyuan.application.softm.sysmenu.vo.AuthorityzTreeVO 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;
}
use of tk.ainiyue.danyuan.application.softm.sysmenu.vo.AuthorityzTreeVO in project danyuan-application by 514840279.
the class SysMenuServiceImpl method deleteAuthority.
/**
* 方法名 : deleteAuthority
* 功 能 : TODO(这里用一句话描述这个方法的作用)
* 参 数 : @param authority
* 参 数 : @return
* 参 考 : @see
* tk.ainiyue.danyuan.application.authority.service.AuthorityService#deleteAuthority(tk.ainiyue.danyuan.application.authority.po.Authority)
* 作 者 : wang
*/
@Override
public void deleteAuthority(SysMenuInfo sysMenuInfo) {
List<AuthorityzTreeVO> list = findzTreeByF_ParentId(sysMenuInfo.getUuid());
if (list != null) {
for (AuthorityzTreeVO authorityzTreeVO : list) {
sysMenuDao.delete(authorityzTreeVO.getId());
}
}
sysMenuDao.delete(sysMenuInfo.getUuid());
}
use of tk.ainiyue.danyuan.application.softm.sysmenu.vo.AuthorityzTreeVO 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;
}
use of tk.ainiyue.danyuan.application.softm.sysmenu.vo.AuthorityzTreeVO 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();
}
use of tk.ainiyue.danyuan.application.softm.sysmenu.vo.AuthorityzTreeVO in project danyuan-application by 514840279.
the class SysMenuServiceImpl method save.
/**
* 方法名 : save
* 功 能 : TODO(这里用一句话描述这个方法的作用)
* 参 数 : @param authority
* 参 考 : @see tk.ainiyue.danyuan.application.datacentor.authority.service.
* AuthorityService#save(tk.ainiyue.danyuan.application.datacentor.authority
* .po.Authority)
* 作 者 : Tenghui.Wang
*/
@Override
public AuthorityzTreeVO save(SysMenuInfo authority) {
sysMenuDao.save(authority);
AuthorityzTreeVO vo = new AuthorityzTreeVO();
vo.setId(authority.getUuid());
vo.setName(authority.getName());
vo.setIconSkin(authority.getIcon());
return vo;
}
Aggregations