master
parent
98c1fb0c0a
commit
6a2c4e5d61
|
|
@ -71,8 +71,9 @@ public class DictController {
|
||||||
* 获取字典数据
|
* 获取字典数据
|
||||||
*/
|
*/
|
||||||
@GetMapping("/dict_data")
|
@GetMapping("/dict_data")
|
||||||
public R<List<ObtainDictDataResult>> obtainDictData(@RequestParam String dictKey) {
|
public R<List<ObtainDictDataResult>> obtainDictData(@RequestParam("dictKey") String dictKey,
|
||||||
return R.success(dictService.obtainDictData(dictKey));
|
@RequestParam(value = "txt", required = false) String txt) {
|
||||||
|
return R.success(dictService.obtainDictData(dictKey, txt));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,13 +67,25 @@ public class DictService extends ServiceImpl<DictMapper, DictEntity> implements
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*/
|
*/
|
||||||
public PageResult<DictEntity> paging(PageParam pageParam, DictEntity dictEntity) {
|
public PageResult<DictEntity> paging(PageParam pageParam, DictEntity dictEntity) {
|
||||||
|
String dictName = dictEntity.getDictName();
|
||||||
return PageResult.of(this.page(pageParam.toPage(), Wrappers.<DictEntity>lambdaQuery()
|
return PageResult.of(this.page(pageParam.toPage(), Wrappers.<DictEntity>lambdaQuery()
|
||||||
.like(StrUtil.isNotBlank(dictEntity.getDictName()), DictEntity::getDictName, dictEntity.getDictName())));
|
.and(StrUtil.isNotBlank(dictName), it ->
|
||||||
|
it.like(DictEntity::getDictKey, dictName)
|
||||||
|
.or().like(DictEntity::getDictName, dictName)
|
||||||
|
.or().like(DictEntity::getMemo, dictName)
|
||||||
|
)
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<ObtainDictDataResult> obtainDictData(String dictKey, String keywords) {
|
||||||
public List<ObtainDictDataResult> obtainDictData(String dictKey) {
|
return dictItemService.list(Wrappers.<DictItemEntity>lambdaQuery().eq(DictItemEntity::getDictKey, dictKey)
|
||||||
return dictItemService.list(Wrappers.<DictItemEntity>lambdaQuery().eq(DictItemEntity::getDictKey, dictKey))
|
.and(StrUtil.isNotBlank(keywords), it ->
|
||||||
|
it.like(DictItemEntity::getTxt, keywords)
|
||||||
|
.or().like(DictItemEntity::getVal, keywords)
|
||||||
|
.or().like(DictItemEntity::getMemo, keywords)
|
||||||
|
)
|
||||||
|
.orderByAsc(DictItemEntity::getSort, DictItemEntity::getVal)
|
||||||
|
)
|
||||||
.stream().map(it -> BeanUtil.copyProperties(it, ObtainDictDataResult.class))
|
.stream().map(it -> BeanUtil.copyProperties(it, ObtainDictDataResult.class))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ public class MenuDetailResult {
|
||||||
* 主键 Id
|
* 主键 Id
|
||||||
*/
|
*/
|
||||||
private Long id;
|
private Long id;
|
||||||
|
private String sn;
|
||||||
/**
|
/**
|
||||||
* 上级 Id; 层级为 1 的节点值为 0
|
* 上级 Id; 层级为 1 的节点值为 0
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue