Commit 7c529878 by xmh

<fix> reid 中对 subtask 的操作加上 packId 条件

1 parent a5067a9d
......@@ -162,7 +162,7 @@ public class ReidService {
// 更新personUnid
SubTaskExample subTaskExample = new SubTaskExample();
subTaskExample.createCriteria().andPersonUnidIn(needMergePersonUnidList);
subTaskExample.createCriteria().andPersonUnidIn(needMergePersonUnidList).andPackIdEqualTo(packId);
SubTask subTask = new SubTask();
subTask.setPersonUnid(newPersonUnid);
if (!Objects.equals(newPersonUnid, currentPerson)) {
......@@ -236,7 +236,7 @@ public class ReidService {
future.get();
// 更新被合并的人对应的person
subTaskExample = new SubTaskExample();
subTaskExample.createCriteria().andPersonUnidIn(new ArrayList<>(originalPersonUnidSet));
subTaskExample.createCriteria().andPersonUnidIn(new ArrayList<>(originalPersonUnidSet)).andPackIdEqualTo(packId);
subTasks = subTaskService.selectByExample(subTaskExample);
Map<String, List<SubTask>> subTaskMap = subTasks.stream().collect(Collectors.groupingBy(SubTask::getPersonUnid, Collectors.toList()));
Set<String> keySet = subTaskMap.keySet();
......@@ -302,7 +302,7 @@ public class ReidService {
}
// 更新pic对应的原来的person
for (String originalPersonUnid : originalPersonUnidSet) {
updatePoolByPersonUnid(originalPersonUnid, poolName);
updatePoolByPersonUnid(originalPersonUnid, packId, poolName);
}
// 移除缓存
for (Long picId : picIdSet) {
......@@ -382,7 +382,7 @@ public class ReidService {
*/
public void finishLabeling(String personUnid, Long packId) {
SubTaskExample subTaskExample = new SubTaskExample();
subTaskExample.createCriteria().andPersonUnidEqualTo(personUnid);
subTaskExample.createCriteria().andPersonUnidEqualTo(personUnid).andPackIdEqualTo(packId);
List<SubTask> subTasks = subTaskService.selectByExample(subTaskExample);
if (subTasks.size() == 0) {
......@@ -465,7 +465,7 @@ public class ReidService {
}
SubTaskExample subTaskExample = new SubTaskExample();
subTaskExample.createCriteria().andPersonUnidIn(personUnidList);
subTaskExample.createCriteria().andPersonUnidIn(personUnidList).andPackIdEqualTo(packId);
subTasks = subTaskService.selectByExample(subTaskExample);
final Set<String> matchFilter = currentPerson == null ? Collections.emptySet() : getMatchFilter(currentPerson, packId);
......@@ -521,7 +521,7 @@ public class ReidService {
try {
for (String item : personUnidSet) {
updatePoolByPersonUnid(item, reidPoolName);
updatePoolByPersonUnid(item, packId, reidPoolName);
}
} catch (Exception e) {
log.info("", e);
......@@ -554,7 +554,7 @@ public class ReidService {
subTask.setAnnotatorId(StpUtil.getLoginIdAsLong());
SubTaskExample subTaskExample = new SubTaskExample();
subTaskExample.createCriteria().andPersonUnidEqualTo(personUnid);
subTaskExample.createCriteria().andPersonUnidEqualTo(personUnid).andPackIdEqualTo(packId);
List<SubTask> subTasks = subTaskService.selectByExample(subTaskExample);
......@@ -608,7 +608,7 @@ public class ReidService {
Set<String> personUnidNeedUpdate = subTasks.stream().map(SubTask::getPersonUnid).collect(Collectors.toSet());
subTaskService.updateByExampleSelective(subTask, subTaskExample);
for (String s : personUnidNeedUpdate) {
updatePoolByPersonUnid(s, poolName);
updatePoolByPersonUnid(s, packId, poolName);
}
}
}
......@@ -658,12 +658,12 @@ public class ReidService {
return Collections.singletonList(bodyFeature);
}
private void updatePoolByPersonUnid(String personUnid, String poolName) throws Exception {
private void updatePoolByPersonUnid(String personUnid, Long packId, String poolName) throws Exception {
if (personUnid == null || poolName == null) {
return;
}
SubTaskExample subTaskExample = new SubTaskExample();
subTaskExample.createCriteria().andPersonUnidEqualTo(personUnid);
subTaskExample.createCriteria().andPersonUnidEqualTo(personUnid).andPackIdEqualTo(packId);
List<SubTask> subTasks = subTaskService.selectByExample(subTaskExample);
if (subTasks.size() > 0) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!