数据库去掉industrytype,适配QA新结构,解决自动和手动归档产生两次记录问题
This commit is contained in:
@@ -296,8 +296,8 @@ public class AnnotationResultService {
|
||||
);
|
||||
saveQaContent(result, updatedQaContent);
|
||||
|
||||
// 更新数据库记录(使用 markArchived 保证幂等性,防止并发重复归档)
|
||||
int updated = annotationResultMapper.markArchived(
|
||||
// 用单条 SQL 原子完成人工审核归档,避免状态部分更新后再次被自动归档扫描到。
|
||||
int updated = annotationResultMapper.markReviewedAndArchived(
|
||||
result.getId(),
|
||||
currentUser.companyId(),
|
||||
currentUser.userId());
|
||||
@@ -307,9 +307,9 @@ public class AnnotationResultService {
|
||||
throw new BusinessException(ResultCode.CONFLICT, "记录已被归档");
|
||||
}
|
||||
|
||||
// 更新 requires_manual_review 字段
|
||||
result.setRequiresManualReview(false);
|
||||
annotationResultMapper.updateById(result);
|
||||
result.setIsDeleted(true);
|
||||
result.setReviewerId(currentUser.userId());
|
||||
|
||||
// 归档到历史表(人工审核后归档)
|
||||
archiveToHistory(result, currentUser, "审核通过后归档", false);
|
||||
@@ -453,7 +453,7 @@ public class AnnotationResultService {
|
||||
} else {
|
||||
// 人工审核后归档:使用审核人信息
|
||||
historyBuilder
|
||||
.reviewerId(result.getReviewerId())
|
||||
.reviewerId(currentUser.userId())
|
||||
.reviewerName(currentUser.realName());
|
||||
}
|
||||
|
||||
@@ -523,4 +523,4 @@ public class AnnotationResultService {
|
||||
private record Metadata(String createdAt) {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user