Commit c4c319d6 by zhiwj

去掉重复值

parent 08b68303
......@@ -103,7 +103,7 @@ public class DataExplainController {
}
@RequestMapping("/data-module-list")
public RestResponse moduleList() {
public RestResponse moduleList(String moduleId) {
Object cache = RedisUtil.getCache("enterprise:datacloud:moduleList");
if (cache != null) {
List<JSONObject> resultList = JSON.parseArray(cache.toString(), JSONObject.class);
......@@ -112,7 +112,7 @@ public class DataExplainController {
List<DataExplainDTO> result = page.getResult();
Set<String> usedList = result.stream().filter(e -> StringUtils.isNotBlank(e.getModuleId())).map(DataExplainDTO::getModuleId).collect(Collectors.toSet());
resultList = resultList.stream().filter(e -> !usedList.contains(e.getString("moduleId"))).collect(Collectors.toList());
resultList = resultList.stream().filter(e -> !usedList.contains(e.getString("moduleId")) || StringUtils.equals(e.getString("moduleId"), moduleId)).collect(Collectors.toList());
}
return RestResponse.success(resultList);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment