微调
This commit is contained in:
@@ -193,7 +193,7 @@ public class AdPlanController extends BaseController {
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.DOWNLOAD)
|
||||
@GetMapping("/analyse")
|
||||
@PostMapping("/analyse")
|
||||
@ApiOperation("检测数据分析")
|
||||
@ApiImplicitParam(name = "planId", value = "检测计划id", required = true)
|
||||
public void analyse(String planId) {
|
||||
|
||||
@@ -43,13 +43,24 @@ public class DictTreeController extends BaseController {
|
||||
private final IDictTreeService dictTreeService;
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@GetMapping("/getTree")
|
||||
@ApiOperation("按照名称模糊查询字典树")
|
||||
@GetMapping("/getTreeByCode")
|
||||
@ApiOperation("按照code查询字典树")
|
||||
@ApiImplicitParam(name = "keyword", value = "查询参数", required = true)
|
||||
public HttpResult<List<DictTree>> getDictTreeByKeyword(@RequestParam String keyword) {
|
||||
String methodDescribe = getMethodDescribe("getDictTreeByKeyword");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, keyword);
|
||||
List<DictTree> result = dictTreeService.getDictTreeByKeyword(keyword);
|
||||
public HttpResult<List<DictTree>> getTreeByCode(@RequestParam("code") String code) {
|
||||
String methodDescribe = getMethodDescribe("getTreeByCode");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, code);
|
||||
List<DictTree> result = dictTreeService.getTreeByCode(code);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@GetMapping("/getTreeByName")
|
||||
@ApiOperation("按照name模糊查询字典树")
|
||||
@ApiImplicitParam(name = "keyword", value = "查询参数", required = true)
|
||||
public HttpResult<List<DictTree>> getTreeByName(@RequestParam("name") String name) {
|
||||
String methodDescribe = getMethodDescribe("getTreeByName");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, name);
|
||||
List<DictTree> result = dictTreeService.getTreeByName(name);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,12 +21,20 @@ public interface IDictTreeService extends IService<DictTree> {
|
||||
//void refreshDictTreeCache();
|
||||
|
||||
/**
|
||||
* 根据关键字查询字典树
|
||||
* 根据code查询字典树
|
||||
*
|
||||
* @param keyword 关键字
|
||||
* @param code 编码
|
||||
* @return 字典树
|
||||
*/
|
||||
List<DictTree> getDictTreeByKeyword(String keyword);
|
||||
List<DictTree> getTreeByCode(String code);
|
||||
|
||||
/**
|
||||
* 根据name查询字典树
|
||||
*
|
||||
* @param name 编码
|
||||
* @return 字典树
|
||||
*/
|
||||
List<DictTree> getTreeByName(String name);
|
||||
|
||||
boolean addDictTree(DictTreeParam dictTreeParam);
|
||||
|
||||
|
||||
@@ -45,9 +45,24 @@ public class DictTreeServiceImpl extends ServiceImpl<DictTreeMapper, DictTree> i
|
||||
// }
|
||||
|
||||
@Override
|
||||
public List<DictTree> getDictTreeByKeyword(String keyword) {
|
||||
public List<DictTree> getTreeByCode(String code) {
|
||||
List<DictTree> dictTree = this.queryTree();
|
||||
this.filterTreeByName(dictTree, keyword);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(dictTree)) {
|
||||
dictTree = dictTree.stream().filter(item -> item.getCode().equals(code)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
//this.filterTreeByName(dictTree, keyword);
|
||||
return dictTree;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictTree> getTreeByName(String name) {
|
||||
List<DictTree> dictTree = this.queryTree();
|
||||
|
||||
if (ObjectUtil.isNotEmpty(dictTree)) {
|
||||
dictTree = dictTree.stream().filter(item -> item.getName().contains(name)).collect(Collectors.toList());
|
||||
}
|
||||
return dictTree;
|
||||
}
|
||||
|
||||
@@ -160,7 +175,7 @@ public class DictTreeServiceImpl extends ServiceImpl<DictTreeMapper, DictTree> i
|
||||
@Override
|
||||
public List<DictTree> getDictTreeById(List<String> ids) {
|
||||
return this.list(new LambdaQueryWrapper<DictTree>()
|
||||
.in(CollUtil.isNotEmpty(ids), DictTree::getId,ids)
|
||||
.in(CollUtil.isNotEmpty(ids), DictTree::getId, ids)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -171,18 +186,18 @@ public class DictTreeServiceImpl extends ServiceImpl<DictTreeMapper, DictTree> i
|
||||
// return this.list(lambdaQueryWrapper);
|
||||
// }
|
||||
|
||||
// @Override
|
||||
// @Override
|
||||
// public List<DictTree> queryAllByType(Integer type) {
|
||||
// LambdaQueryWrapper<DictTree> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
// lambdaQueryWrapper.eq(DictTree::getState, DictConst.ENABLE).eq(DictTree::getType, type);
|
||||
// return this.list(lambdaQueryWrapper);
|
||||
// }
|
||||
private void checkRepeat(DictTreeParam dictTreeParam,boolean isExcludeSelf){
|
||||
private void checkRepeat(DictTreeParam dictTreeParam, boolean isExcludeSelf) {
|
||||
LambdaQueryWrapper<DictTree> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(DictTree::getCode, dictTreeParam.getCode())
|
||||
.eq(DictTree::getState, DictConst.ENABLE);
|
||||
if(isExcludeSelf){
|
||||
if(dictTreeParam instanceof DictTreeParam.UpdateParam){
|
||||
if (isExcludeSelf) {
|
||||
if (dictTreeParam instanceof DictTreeParam.UpdateParam) {
|
||||
wrapper.ne(DictTree::getId, ((DictTreeParam.UpdateParam) dictTreeParam).getId());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user