若依 4.0
This commit is contained in:
@ -35,6 +35,14 @@ public interface SysDictTypeMapper
|
||||
*/
|
||||
public SysDictType selectDictTypeById(Long dictId);
|
||||
|
||||
/**
|
||||
* 根据字典类型查询信息
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @return 字典类型
|
||||
*/
|
||||
public SysDictType selectDictTypeByType(String dictType);
|
||||
|
||||
/**
|
||||
* 通过字典ID删除字典信息
|
||||
*
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.core.domain.Ztree;
|
||||
import com.ruoyi.system.domain.SysDictType;
|
||||
|
||||
/**
|
||||
@ -33,6 +34,14 @@ public interface ISysDictTypeService
|
||||
*/
|
||||
public SysDictType selectDictTypeById(Long dictId);
|
||||
|
||||
/**
|
||||
* 根据字典类型查询信息
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @return 字典类型
|
||||
*/
|
||||
public SysDictType selectDictTypeByType(String dictType);
|
||||
|
||||
/**
|
||||
* 通过字典ID删除字典信息
|
||||
*
|
||||
@ -73,4 +82,12 @@ public interface ISysDictTypeService
|
||||
* @return 结果
|
||||
*/
|
||||
public String checkDictTypeUnique(SysDictType dictType);
|
||||
|
||||
/**
|
||||
* 查询字典类型树
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @return 所有字典类型
|
||||
*/
|
||||
public List<Ztree> selectDictTree(SysDictType dictType);
|
||||
}
|
||||
|
@ -1,10 +1,12 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.Ztree;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.exception.BusinessException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
@ -62,6 +64,17 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
||||
return dictTypeMapper.selectDictTypeById(dictId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型查询信息
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @return 字典类型
|
||||
*/
|
||||
public SysDictType selectDictTypeByType(String dictType)
|
||||
{
|
||||
return dictTypeMapper.selectDictTypeByType(dictType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过字典ID删除字典信息
|
||||
*
|
||||
@ -140,4 +153,36 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
|
||||
}
|
||||
return UserConstants.DICT_TYPE_UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询字典类型树
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @return 所有字典类型
|
||||
*/
|
||||
public List<Ztree> selectDictTree(SysDictType dictType)
|
||||
{
|
||||
List<Ztree> ztrees = new ArrayList<Ztree>();
|
||||
List<SysDictType> dictList = dictTypeMapper.selectDictTypeList(dictType);
|
||||
for (SysDictType dict : dictList)
|
||||
{
|
||||
if (UserConstants.DICT_NORMAL.equals(dict.getStatus()))
|
||||
{
|
||||
Ztree ztree = new Ztree();
|
||||
ztree.setId(dict.getDictId());
|
||||
ztree.setName(transDictName(dict));
|
||||
ztree.setTitle(dict.getDictType());
|
||||
ztrees.add(ztree);
|
||||
}
|
||||
}
|
||||
return ztrees;
|
||||
}
|
||||
|
||||
public String transDictName(SysDictType dictType)
|
||||
{
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append("(" + dictType.getDictName() + ")");
|
||||
sb.append(" " + dictType.getDictType());
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
Ztree ztree = new Ztree();
|
||||
ztree.setId(menu.getMenuId());
|
||||
ztree.setpId(menu.getParentId());
|
||||
ztree.setName(transMenuName(menu, roleMenuList, permsFlag));
|
||||
ztree.setName(transMenuName(menu, permsFlag));
|
||||
ztree.setTitle(menu.getMenuName());
|
||||
if (isCheck)
|
||||
{
|
||||
@ -217,7 +217,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||
return ztrees;
|
||||
}
|
||||
|
||||
public String transMenuName(SysMenu menu, List<String> roleMenuList, boolean permsFlag)
|
||||
public String transMenuName(SysMenu menu, boolean permsFlag)
|
||||
{
|
||||
StringBuffer sb = new StringBuffer();
|
||||
sb.append(menu.getMenuName());
|
||||
|
Reference in New Issue
Block a user