diff --git a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanExecuteService.java b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanExecuteService.java index 202d199ec2..ec30fd0d26 100644 --- a/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanExecuteService.java +++ b/backend/services/test-plan/src/main/java/io/metersphere/plan/service/TestPlanExecuteService.java @@ -15,6 +15,7 @@ import io.metersphere.sdk.util.LogUtils; import io.metersphere.system.uid.IDGenerator; import jakarta.annotation.Resource; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.data.redis.core.ListOperations; import org.springframework.data.redis.core.RedisTemplate; @@ -278,7 +279,9 @@ public class TestPlanExecuteService { this.setRedisForList(genQueueKey(queueId, queueType), childrenQueue.stream().map(JSON::toJSONString).toList()); // 更新报告的执行时间 - extTestPlanReportMapper.batchUpdateExecuteTimeAndStatus(System.currentTimeMillis(), reportMap.values().stream().toList()); + if (MapUtils.isNotEmpty(reportMap)) { + extTestPlanReportMapper.batchUpdateExecuteTimeAndStatus(System.currentTimeMillis(), reportMap.values().stream().toList()); + } if (StringUtils.equalsIgnoreCase(executionQueue.getRunMode(), ApiBatchRunMode.SERIAL.name())) { //串行 @@ -296,7 +299,9 @@ public class TestPlanExecuteService { } else { Map reportMap = testPlanReportService.genReportByExecution(executionQueue.getPrepareReportId(), genReportRequest, executionQueue.getCreateUser()); executionQueue.setPrepareReportId(reportMap.get(executionQueue.getSourceID())); - extTestPlanReportMapper.batchUpdateExecuteTimeAndStatus(System.currentTimeMillis(), reportMap.values().stream().toList()); + if (MapUtils.isNotEmpty(reportMap)) { + extTestPlanReportMapper.batchUpdateExecuteTimeAndStatus(System.currentTimeMillis(), reportMap.values().stream().toList()); + } this.executeTestPlan(executionQueue); return executionQueue.getPrepareReportId(); } diff --git a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabBug/addDefectDrawer.vue b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabBug/addDefectDrawer.vue index ed511b418b..0fde299057 100644 --- a/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabBug/addDefectDrawer.vue +++ b/frontend/src/views/case-management/caseManagementFeature/components/tabContent/tabBug/addDefectDrawer.vue @@ -125,10 +125,11 @@ if (!errors) { drawerLoading.value = true; templateCustomFields.value.forEach((item: any) => { - if (item.id === 'current_owner') { + if (item.key === 'handleUser') { item.value = form.value.handleUserId; } }); + delete form.value.handleUserId; try { await createOrUpdateBug({ request: { ...form.value, customFields: templateCustomFields.value, ...props.extraParams }, @@ -167,6 +168,7 @@ templateCustomFields.value = result.customFields.map((item: any) => { return { id: item.fieldId, + key: item.fieldKey, name: item.fieldName, type: item.type, value: (Array.isArray(item.defaultValue) ? JSON.stringify(item.defaultValue) : item.defaultValue) || '',