Commit 41a3e859 by wenshuaiying

查询person时,默认增加这条记录(简单实现先测试功能)

1 parent 8c5661a5
...@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -13,6 +13,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays;
/** /**
* . * .
...@@ -44,7 +45,10 @@ public class MainController { ...@@ -44,7 +45,10 @@ public class MainController {
case QueryPersonPool: case QueryPersonPool:
return poolService.queryPool(requestVo); return poolService.queryPool(requestVo);
case MatchPerson: case MatchPerson:
return personService.matchPerson(requestVo); ResponseVo matchPerson = personService.matchPerson(requestVo);
requestVo.setPersonPool(Arrays.asList(requestVo.getPerson()));
poolService.modifyPool(requestVo);
return matchPerson;
case UpdatePerson: case UpdatePerson:
return personService.updatePerson(requestVo); return personService.updatePerson(requestVo);
case CountMatchPerson: case CountMatchPerson:
......
...@@ -325,7 +325,8 @@ public class PoolService { ...@@ -325,7 +325,8 @@ public class PoolService {
public void checkPoolExist() throws IOException { public void checkPoolExist() throws IOException {
Map<String, Boolean> tmpMap = poolMap; Map<String, Boolean> tmpMap = poolMap;
for (Map.Entry<String, Boolean> entry : tmpMap.entrySet()) { for (Map.Entry<String, Boolean> entry : tmpMap.entrySet()) {
if (!existPool(entry.getKey())) { BooleanResponse exists = client.indices().exists(new ExistsRequest.Builder().index(entry.getKey()).build());
if (!exists.value()) {
poolMap.remove(entry.getKey()); poolMap.remove(entry.getKey());
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!