diff --git a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java index 547fddd52b..090f1bd54c 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestCaseService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestCaseService.java @@ -62,7 +62,6 @@ import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.mybatis.spring.SqlSessionUtils; import org.springframework.context.annotation.Lazy; -import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.multipart.MultipartFile; @@ -1092,12 +1091,7 @@ public class TestCaseService { boolean importFileNeedNum = true; TestCaseTemplateService testCaseTemplateService = CommonBeanFactory.getBean(TestCaseTemplateService.class); TestCaseTemplateDao testCaseTemplate = testCaseTemplateService.getTemplate(request.getProjectId()); - List customFields = null; - if (testCaseTemplate == null) { - customFields = new ArrayList<>(); - } else { - customFields = testCaseTemplate.getCustomFields(); - } + List customFields = Optional.ofNullable(testCaseTemplate.getCustomFields()).orElse(new ArrayList<>()); List> headList = testCaseExcelData.getHead(importFileNeedNum, customFields); List> testCaseDataByExcelList = this.generateTestCaseExcel(headList, datas); @@ -1173,10 +1167,8 @@ public class TestCaseService { for (TestCaseExcelData model : datas) { List list = new ArrayList<>(); - Map customDataMaps = model.getCustomDatas(); - if (customDataMaps == null) { - customDataMaps = new HashMap<>(); - } + Map customDataMaps = Optional.ofNullable(model.getCustomDatas()).orElse(new HashMap<>()); + for (String head : headList) { if (StringUtils.equalsAnyIgnoreCase(head, "ID")) { list.add(model.getCustomNum()); @@ -1208,17 +1200,12 @@ public class TestCaseService { list.add(model.getStepModel()); } else if (StringUtils.equalsAnyIgnoreCase(head, "Priority", "用例等級", "用例等级")) { list.add(model.getPriority()); -// }else if(StringUtils.equalsAnyIgnoreCase(head,"Case status","用例状态","用例狀態")){ -// list.add(model.getStatus()); + } else if(StringUtils.equalsAnyIgnoreCase(head,"Case status","用例状态","用例狀態")){ + list.add(model.getStatus()); } else if (StringUtils.equalsAnyIgnoreCase(head, "Maintainer(ID)", "责任人(ID)", "維護人(ID)")) { - String value = customDataMaps.get("责任人"); - value = value == null ? "" : value; - list.add(value); + list.add(model.getMaintainer()); } else { - String value = customDataMaps.get(head); - if (value == null) { - value = ""; - } + String value = Optional.ofNullable(customDataMaps.get(head)).orElse(""); list.add(value); } } diff --git a/frontend/package.json b/frontend/package.json index db7f91e14e..3f513cb04b 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -54,7 +54,7 @@ "vue-float-action-button": "^0.6.6", "vue-i18n": "^8.15.3", "vue-jsonpath-picker": "^1.1.5", - "vue-minder-editor-plus": "1.0.40", + "vue-minder-editor-plus": "1.0.41", "vue-papa-parse": "^2.0.0", "vue-pdf": "^4.2.0", "vue-router": "^3.1.3", diff --git a/frontend/src/business/components/track/common/minder/TestCaseMinder.vue b/frontend/src/business/components/track/common/minder/TestCaseMinder.vue index 523b45b874..c90c0df551 100644 --- a/frontend/src/business/components/track/common/minder/TestCaseMinder.vue +++ b/frontend/src/business/components/track/common/minder/TestCaseMinder.vue @@ -40,7 +40,6 @@ import {getTestCasesForMinder, getMinderExtraNode} from "@/network/testCase"; import {addIssueHotBox, getSelectedNodeData, handleIssueAdd, handleIssueBatch} from "./minderUtils"; import IssueRelateList from "@/business/components/track/case/components/IssueRelateList"; import TestPlanIssueEdit from "@/business/components/track/case/components/TestPlanIssueEdit"; -import {getIssuesById} from "@/network/Issue"; const {getIssuesListById} = require("@/network/Issue"); const {getCurrentWorkspaceId} = require("@/common/js/utils");