From 5200c3a61dcbe06d252a928dfc19d1e26943e04e Mon Sep 17 00:00:00 2001 From: WangXu10 Date: Mon, 11 Mar 2024 11:44:59 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=94=A8=E4=BE=8B=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=A4=8D=E5=88=B6=E7=94=A8=E4=BE=8B=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1036375 --user=王旭 【项目管理】批量复制用例-项目管理日志未产生日志 https://www.tapd.cn/55049933/s/1472360 --- .../controller/FunctionalCaseController.java | 5 +++-- .../functional/service/FunctionalCaseService.java | 10 +++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) 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); } } }