Commit cca6ea2d by xmh

1

1 parent 59619fb9
......@@ -139,14 +139,16 @@ public class ReidService {
}
String poolName = Constants.getReidPoolName(packId);
List<String> personUnidNeedDeleteAndUpdate = needMergePersonUnidList.subList(0, 1);
List<String> personUnidNeedDeleteAndUpdate = needMergePersonUnidList.stream().filter(x -> !x.equals(newPersonUnid)).collect(Collectors.toList());
// 更新personUnid
PicExample picExample = new PicExample();
picExample.createCriteria().andPersonUnidIn(needMergePersonUnidList);
Pic pic = new Pic();
pic.setPersonUnid(newPersonUnid);
pic.setStatus(PicStatus.TO_BE_LABELED.val);
if (!Objects.equals(newPersonUnid, currentPerson)) {
pic.setStatus(PicStatus.TO_BE_LABELED.val);
}
picService.updateByExampleSelective(pic, picExample);
// 删除和更新特征池
CompletableFuture<AlgResult> future = matchClient.EASY_PERSON_API.deletePerson(poolName, personUnidNeedDeleteAndUpdate);
......@@ -208,6 +210,7 @@ public class ReidService {
pics = picService.selectByExample(picExample);
Map<String, List<Pic>> picMap = pics.stream().collect(Collectors.groupingBy(Pic::getPersonUnid, Collectors.toList()));
Set<String> keySet = picMap.keySet();
//如果keySet中没有原来的personUnid了,说明某个人的照片全部被合并走了需要从特征池中删掉
for (String personUnid : originalPersonUnidSet) {
if (!keySet.contains(personUnid)) {
future = matchClient.EASY_PERSON_API.deletePerson(poolName, Collections.singletonList(personUnid));
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!