diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalCaseController.java b/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalCaseController.java index f2b0867902..ccfa44775d 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalCaseController.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/controller/FunctionalCaseController.java @@ -190,7 +190,8 @@ public class FunctionalCaseController { @CheckOwner(resourceId = "#request.getProjectId()", resourceType = "project") public void batchCopyFunctionalCase(@Validated @RequestBody FunctionalCaseBatchMoveRequest request) { String userId = SessionUtils.getUserId(); - functionalCaseService.batchCopyFunctionalCase(request, userId); + String organizationId = SessionUtils.getCurrentOrganizationId(); + functionalCaseService.batchCopyFunctionalCase(request, userId, organizationId); } @@ -246,7 +247,7 @@ public class FunctionalCaseController { @CheckOwner(resourceId = "#request.getSourceId()", resourceType = "functional_case") public Pager> operationHistoryList(@Validated @RequestBody OperationHistoryRequest request) { Page page = PageHelper.startPage(request.getCurrent(), request.getPageSize(), - StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "create_time desc"); + StringUtils.isNotBlank(request.getSortString()) ? request.getSortString() : "create_time desc"); return PageUtils.setPageInfo(page, functionalCaseService.operationHistoryList(request)); } } diff --git a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseService.java b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseService.java index 23e186b7e3..b37079cb8d 100644 --- a/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseService.java +++ b/backend/services/case-management/src/main/java/io/metersphere/functional/service/FunctionalCaseService.java @@ -734,7 +734,7 @@ public class FunctionalCaseService { * @param userId userId */ @Async - public void batchCopyFunctionalCase(FunctionalCaseBatchMoveRequest request, String userId) { + public void batchCopyFunctionalCase(FunctionalCaseBatchMoveRequest request, String userId, String organizationId) { List ids = doSelectIds(request, request.getProjectId()); if (CollectionUtils.isNotEmpty(ids)) { //基本信息 @@ -800,6 +800,14 @@ public class FunctionalCaseService { functionalCaseAttachmentService.association(fileIds, id, userId, FUNCTIONAL_CASE_BATCH_COPY_FILE_LOG_URL, request.getProjectId()); } + //日志 + FunctionalCaseHistoryLogDTO historyLogDTO = new FunctionalCaseHistoryLogDTO(); + historyLogDTO.setFunctionalCase(functionalCase); + historyLogDTO.setFunctionalCaseBlob(functionalCaseBlob); + historyLogDTO.setCustomFields(customFields); + historyLogDTO.setCaseAttachments(caseAttachments); + historyLogDTO.setFileAssociationList(fileAssociationList); + saveImportDataLog(functionalCase, new FunctionalCaseHistoryLogDTO(), historyLogDTO, userId, organizationId, OperationLogType.ADD.name(), OperationLogModule.CASE_MANAGEMENT_CASE_CREATE); } } }