Commit b041fbb2 by shenjunjie

绑定项目补充过滤条件

parent be2e97f8
...@@ -160,7 +160,14 @@ public class ProjectController extends BaseController { ...@@ -160,7 +160,14 @@ public class ProjectController extends BaseController {
public ResponseResult getLinkedGroups(@RequestParam(value = "keyword", defaultValue = "") String keyword) { public ResponseResult getLinkedGroups(@RequestParam(value = "keyword", defaultValue = "") String keyword) {
ResponseEntity<JSONObject> entity = restTemplate.getForEntity(yqProjectUrl, JSONObject.class); ResponseEntity<JSONObject> entity = restTemplate.getForEntity(yqProjectUrl, JSONObject.class);
List<JSONObject> dataList = Objects.requireNonNull(entity.getBody()).getJSONArray("data").toJavaList(JSONObject.class); List<JSONObject> dataList = Objects.requireNonNull(entity.getBody()).getJSONArray("data").toJavaList(JSONObject.class);
List<JSONObject> resList = dataList.stream().filter(json -> json.getString("projectName").contains(keyword)).map(json -> { List<JSONObject> resList = dataList.stream().filter(json -> {
// 排除停用项目
Integer status = json.getInteger("status");
if (null == status || 0 == status) {
return false;
}
return json.getString("projectName").contains(keyword);
}).map(json -> {
JSONObject res = new JSONObject(); JSONObject res = new JSONObject();
res.put("groupName", json.getString("projectName")); res.put("groupName", json.getString("projectName"));
res.put("id", json.getString("id")); res.put("id", json.getString("id"));
......
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