提交更新
This commit is contained in:
+21
@@ -115,6 +115,17 @@ public class TaskResultItemService {
|
||||
.eq(TaskResultItemEntity::getResultId, resultId));
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void deleteResultItemRowsOnly(Long taskId, String moduleType, Long resultId) {
|
||||
if (taskId == null || taskId <= 0 || isBlank(moduleType) || resultId == null || resultId <= 0) {
|
||||
return;
|
||||
}
|
||||
taskResultItemMapper.delete(new LambdaQueryWrapper<TaskResultItemEntity>()
|
||||
.eq(TaskResultItemEntity::getTaskId, taskId)
|
||||
.eq(TaskResultItemEntity::getModuleType, moduleType)
|
||||
.eq(TaskResultItemEntity::getResultId, resultId));
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void deleteTaskItems(Long taskId, String moduleType) {
|
||||
if (taskId == null || taskId <= 0 || isBlank(moduleType)) {
|
||||
@@ -134,6 +145,16 @@ public class TaskResultItemService {
|
||||
.eq(TaskResultItemEntity::getModuleType, moduleType));
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void deleteTaskItemsRowsOnly(Long taskId, String moduleType) {
|
||||
if (taskId == null || taskId <= 0 || isBlank(moduleType)) {
|
||||
return;
|
||||
}
|
||||
taskResultItemMapper.delete(new LambdaQueryWrapper<TaskResultItemEntity>()
|
||||
.eq(TaskResultItemEntity::getTaskId, taskId)
|
||||
.eq(TaskResultItemEntity::getModuleType, moduleType));
|
||||
}
|
||||
|
||||
private void upsert(Long taskId,
|
||||
String moduleType,
|
||||
Long resultId,
|
||||
|
||||
+10
@@ -188,6 +188,16 @@ public class TaskScopePayloadStorageService {
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void deleteTaskScopePayloadRowsOnly(Long taskId, String moduleType) {
|
||||
if (taskId == null || taskId <= 0 || isBlank(moduleType)) {
|
||||
return;
|
||||
}
|
||||
taskScopeStateMapper.delete(new LambdaQueryWrapper<TaskScopeStateEntity>()
|
||||
.eq(TaskScopeStateEntity::getTaskId, taskId)
|
||||
.eq(TaskScopeStateEntity::getModuleType, moduleType));
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public <T> void saveParsedPayloadMap(Long taskId, String moduleType, Map<String, T> payloadByScope) {
|
||||
if (taskId == null || taskId <= 0 || isBlank(moduleType) || payloadByScope == null || payloadByScope.isEmpty()) {
|
||||
|
||||
+20
-1
@@ -30,10 +30,18 @@ public class TransientPayloadStorageService {
|
||||
return store("task-scope", moduleType, taskId, scopeHash, "latest", content, encodeAsJsonString);
|
||||
}
|
||||
|
||||
public String storeScopePayloadVersioned(String moduleType, Long taskId, String scopeHash, String content, boolean encodeAsJsonString) {
|
||||
return store("task-scope", moduleType, taskId, scopeHash, UUID.randomUUID().toString(), content, encodeAsJsonString);
|
||||
}
|
||||
|
||||
public String storeParsedPayload(String moduleType, Long taskId, String scopeHash, String content, boolean encodeAsJsonString) {
|
||||
return store("task-parsed", moduleType, taskId, scopeHash, "latest", content, encodeAsJsonString);
|
||||
}
|
||||
|
||||
public String storeParsedPayloadFast(String moduleType, Long taskId, String scopeHash, String content, boolean encodeAsJsonString) {
|
||||
return store("task-parsed", moduleType, taskId, scopeHash, "latest", content, encodeAsJsonString, false);
|
||||
}
|
||||
|
||||
public String storeResultPayload(String moduleType, Long taskId, String scopeHash, String submissionId, String content) {
|
||||
return store("task-result-payload", moduleType, taskId, scopeHash, submissionId, content, true);
|
||||
}
|
||||
@@ -114,11 +122,22 @@ public class TransientPayloadStorageService {
|
||||
String entryKey,
|
||||
String content,
|
||||
boolean encodeAsJsonString) {
|
||||
return store(category, moduleType, taskId, scopeHash, entryKey, content, encodeAsJsonString, true);
|
||||
}
|
||||
|
||||
private String store(String category,
|
||||
String moduleType,
|
||||
Long taskId,
|
||||
String scopeHash,
|
||||
String entryKey,
|
||||
String content,
|
||||
boolean encodeAsJsonString,
|
||||
boolean verifyAfterUpload) {
|
||||
if (!isWriteEnabled()) {
|
||||
return content;
|
||||
}
|
||||
String objectKey = buildObjectKey(category, moduleType, taskId, scopeHash, entryKey);
|
||||
String pointer = RUSTFS_POINTER_PREFIX + rustfsObjectStorageService.uploadText(objectKey, content);
|
||||
String pointer = RUSTFS_POINTER_PREFIX + rustfsObjectStorageService.uploadText(objectKey, content, verifyAfterUpload);
|
||||
if (!encodeAsJsonString) {
|
||||
return pointer;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user