fix(用例管理): 创建用例和导入日志区分

This commit is contained in:
WangXu10 2024-01-30 10:03:03 +08:00 committed by 刘瑞斌
parent 2cd64faaac
commit d9811e4234
1 changed files with 5 additions and 5 deletions

View File

@ -173,7 +173,7 @@ public class FunctionalCaseService {
//记录日志 //记录日志
FunctionalCaseHistoryLogDTO historyLogDTO = getImportLogModule(functionalCase); FunctionalCaseHistoryLogDTO historyLogDTO = getImportLogModule(functionalCase);
saveImportDataLog(functionalCase, new FunctionalCaseHistoryLogDTO(), historyLogDTO, userId, organizationId); saveImportDataLog(functionalCase, new FunctionalCaseHistoryLogDTO(), historyLogDTO, userId, organizationId, OperationLogType.ADD.name());
return functionalCase; return functionalCase;
} }
@ -938,7 +938,7 @@ public class FunctionalCaseService {
List<FunctionalCaseCustomField> customFields = functionalCaseCustomFieldMapper.selectByExample(fieldExample); List<FunctionalCaseCustomField> customFields = functionalCaseCustomFieldMapper.selectByExample(fieldExample);
FunctionalCaseHistoryLogDTO historyLogDTO = new FunctionalCaseHistoryLogDTO(functionalCase, caseBlob, customFields, new ArrayList<>(), new ArrayList<>()); FunctionalCaseHistoryLogDTO historyLogDTO = new FunctionalCaseHistoryLogDTO(functionalCase, caseBlob, customFields, new ArrayList<>(), new ArrayList<>());
saveImportDataLog(functionalCase, new FunctionalCaseHistoryLogDTO(), historyLogDTO, userId, organizationId); saveImportDataLog(functionalCase, new FunctionalCaseHistoryLogDTO(), historyLogDTO, userId, organizationId, OperationLogType.IMPORT.name());
} }
@ -1047,7 +1047,7 @@ public class FunctionalCaseService {
//记录新值 //记录新值
FunctionalCaseHistoryLogDTO modifiedLogDTO = getImportLogModule(functionalCase); FunctionalCaseHistoryLogDTO modifiedLogDTO = getImportLogModule(functionalCase);
//记录日志 //记录日志
saveImportDataLog(functionalCase, originalValue, modifiedLogDTO, userId, organizationId); saveImportDataLog(functionalCase, originalValue, modifiedLogDTO, userId, organizationId, OperationLogType.IMPORT.name());
} }
private void handleUpdateCustomField(FunctionalCaseExcelData functionalCaseExcelData, String caseId, FunctionalCaseCustomFieldMapper customFieldMapper, Map<String, TemplateCustomFieldDTO> customFieldsMap) { private void handleUpdateCustomField(FunctionalCaseExcelData functionalCaseExcelData, String caseId, FunctionalCaseCustomFieldMapper customFieldMapper, Map<String, TemplateCustomFieldDTO> customFieldsMap) {
@ -1065,13 +1065,13 @@ public class FunctionalCaseService {
* @param originalValue 原值 * @param originalValue 原值
* @param modifiedLogDTO 新值 * @param modifiedLogDTO 新值
*/ */
private void saveImportDataLog(FunctionalCase functionalCase, FunctionalCaseHistoryLogDTO originalValue, FunctionalCaseHistoryLogDTO modifiedLogDTO, String userId, String organizationId) { private void saveImportDataLog(FunctionalCase functionalCase, FunctionalCaseHistoryLogDTO originalValue, FunctionalCaseHistoryLogDTO modifiedLogDTO, String userId, String organizationId, String type) {
LogDTO dto = new LogDTO( LogDTO dto = new LogDTO(
functionalCase.getProjectId(), functionalCase.getProjectId(),
organizationId, organizationId,
functionalCase.getId(), functionalCase.getId(),
userId, userId,
OperationLogType.IMPORT.name(), type,
OperationLogModule.FUNCTIONAL_CASE, OperationLogModule.FUNCTIONAL_CASE,
functionalCase.getName()); functionalCase.getName());
dto.setHistory(true); dto.setHistory(true);