use of org.jeecg.modules.system.model.SysDictTree in project kms by mahonelau.
the class SysDictController method treeList.
/**
* @功能:获取树形字典数据
* @param sysDict
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@SuppressWarnings("unchecked")
@RequestMapping(value = "/treeList", method = RequestMethod.GET)
public Result<List<SysDictTree>> treeList(SysDict sysDict, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
Result<List<SysDictTree>> result = new Result<>();
LambdaQueryWrapper<SysDict> query = new LambdaQueryWrapper<>();
// 构造查询条件
String dictName = sysDict.getDictName();
if (oConvertUtils.isNotEmpty(dictName)) {
query.like(true, SysDict::getDictName, dictName);
}
query.orderByDesc(true, SysDict::getCreateTime);
List<SysDict> list = sysDictService.list(query);
List<SysDictTree> treeList = new ArrayList<>();
for (SysDict node : list) {
treeList.add(new SysDictTree(node));
}
result.setSuccess(true);
result.setResult(treeList);
return result;
}
use of org.jeecg.modules.system.model.SysDictTree in project jeecg-boot by jeecgboot.
the class SysDictController method treeList.
/**
* @功能:获取树形字典数据
* @param sysDict
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@SuppressWarnings("unchecked")
@RequestMapping(value = "/treeList", method = RequestMethod.GET)
public Result<List<SysDictTree>> treeList(SysDict sysDict, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
Result<List<SysDictTree>> result = new Result<>();
LambdaQueryWrapper<SysDict> query = new LambdaQueryWrapper<>();
// 构造查询条件
String dictName = sysDict.getDictName();
if (oConvertUtils.isNotEmpty(dictName)) {
query.like(true, SysDict::getDictName, dictName);
}
query.orderByDesc(true, SysDict::getCreateTime);
List<SysDict> list = sysDictService.list(query);
List<SysDictTree> treeList = new ArrayList<>();
for (SysDict node : list) {
treeList.add(new SysDictTree(node));
}
result.setSuccess(true);
result.setResult(treeList);
return result;
}
use of org.jeecg.modules.system.model.SysDictTree in project kykms by mahonelau.
the class SysDictController method treeList.
/**
* @功能:获取树形字典数据
* @param sysDict
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@SuppressWarnings("unchecked")
@RequestMapping(value = "/treeList", method = RequestMethod.GET)
public Result<List<SysDictTree>> treeList(SysDict sysDict, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
Result<List<SysDictTree>> result = new Result<>();
LambdaQueryWrapper<SysDict> query = new LambdaQueryWrapper<>();
// 构造查询条件
String dictName = sysDict.getDictName();
if (oConvertUtils.isNotEmpty(dictName)) {
query.like(true, SysDict::getDictName, dictName);
}
query.orderByDesc(true, SysDict::getCreateTime);
List<SysDict> list = sysDictService.list(query);
List<SysDictTree> treeList = new ArrayList<>();
for (SysDict node : list) {
treeList.add(new SysDictTree(node));
}
result.setSuccess(true);
result.setResult(treeList);
return result;
}
Aggregations