diff --git a/report-stat/backend/src/main/java/io/metersphere/reportstatistics/controller/TestCaseCountController.java b/report-stat/backend/src/main/java/io/metersphere/reportstatistics/controller/TestCaseCountController.java index 4c145029df..07a4029c21 100644 --- a/report-stat/backend/src/main/java/io/metersphere/reportstatistics/controller/TestCaseCountController.java +++ b/report-stat/backend/src/main/java/io/metersphere/reportstatistics/controller/TestCaseCountController.java @@ -19,9 +19,9 @@ public class TestCaseCountController { @Resource TestCaseCountService testCaseCountService; - @PostMapping("/initDatas") + @PostMapping("/initData") public Map>> initDatas(@RequestBody TestCaseCountRequest request) { - Map>> returnMap = testCaseCountService.getSelectFilterDatas(request.getProjectId()); + Map>> returnMap = testCaseCountService.getSelectFilterData(request.getProjectId()); return returnMap; } diff --git a/report-stat/backend/src/main/java/io/metersphere/reportstatistics/dto/request/emun/EnterpriseReportStatus.java b/report-stat/backend/src/main/java/io/metersphere/reportstatistics/dto/request/emun/EnterpriseReportStatus.java index e296a41ac5..5e4890c9ee 100644 --- a/report-stat/backend/src/main/java/io/metersphere/reportstatistics/dto/request/emun/EnterpriseReportStatus.java +++ b/report-stat/backend/src/main/java/io/metersphere/reportstatistics/dto/request/emun/EnterpriseReportStatus.java @@ -1,5 +1,5 @@ package io.metersphere.reportstatistics.dto.request.emun; public enum EnterpriseReportStatus { - NEW, SENDED, SEND_FAILD + NEW, SENDED, SEND_FAILED } diff --git a/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/EnterpriseTestReportService.java b/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/EnterpriseTestReportService.java index ca27be053c..e845e66ab8 100644 --- a/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/EnterpriseTestReportService.java +++ b/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/EnterpriseTestReportService.java @@ -152,7 +152,7 @@ public class EnterpriseTestReportService { request.setCreateTime(time); request.setUpdateTime(time); - boolean sendSucess = false; + boolean sendSuccess = false; if (StringUtils.isEmpty(request.getStatus())) { request.setStatus(EnterpriseReportStatus.NEW.name()); } else if (StringUtils.equalsIgnoreCase(request.getStatus(), "send")) { @@ -160,14 +160,14 @@ public class EnterpriseTestReportService { try { this.sendEmail(request, false); request.setLastSendTime(time); - sendSucess = true; + sendSuccess = true; } catch (Exception e) { - request.setStatus(EnterpriseReportStatus.SEND_FAILD.name()); + request.setStatus(EnterpriseReportStatus.SEND_FAILED.name()); LogUtil.error(e); } } enterpriseTestReportMapper.insert(request); - if (sendSucess) { + if (sendSuccess) { this.insertEnterpriseSendRecord(request); } return request; @@ -175,20 +175,20 @@ public class EnterpriseTestReportService { public EnterpriseTestReport send(EnterpriseTestReportWithBLOBs param) { EnterpriseTestReportWithBLOBs bloBs = enterpriseTestReportMapper.selectByPrimaryKey(param.getId()); - boolean sendSucess = false; + boolean sendSuccess = false; if (bloBs != null) { try { this.sendEmail(bloBs, true); bloBs.setStatus(EnterpriseReportStatus.SENDED.name()); bloBs.setLastSendTime(System.currentTimeMillis()); - sendSucess = true; + sendSuccess = true; } catch (Exception e) { - bloBs.setStatus(EnterpriseReportStatus.SEND_FAILD.name()); + bloBs.setStatus(EnterpriseReportStatus.SEND_FAILED.name()); LogUtil.error("Send email error!", e); MSException.throwException("Send email error!"); } enterpriseTestReportMapper.updateByPrimaryKeySelective(bloBs); - if (sendSucess) { + if (sendSuccess) { this.insertEnterpriseSendRecord(bloBs); } } @@ -205,20 +205,20 @@ public class EnterpriseTestReportService { long time = System.currentTimeMillis(); request.setUpdateTime(time); - boolean sendSucess = false; + boolean sendSuccess = false; if (StringUtils.equalsIgnoreCase(request.getStatus(), "send")) { request.setStatus(EnterpriseReportStatus.SENDED.name()); try { this.sendEmail(request, false); request.setLastSendTime(time); - sendSucess = true; + sendSuccess = true; } catch (Exception e) { - request.setStatus(EnterpriseReportStatus.SEND_FAILD.name()); + request.setStatus(EnterpriseReportStatus.SEND_FAILED.name()); LogUtil.error(e); } } enterpriseTestReportMapper.updateByPrimaryKeySelective(request); - if (sendSucess) { + if (sendSuccess) { this.insertEnterpriseSendRecord(request); } return request; @@ -499,7 +499,6 @@ public class EnterpriseTestReportService { // 读取图片字节数组 try { InputStream in = fileSystemResource.getInputStream(); - System.out.println("文件大小(字节)=" + in.available()); data = new byte[in.available()]; in.read(data); in.close(); @@ -538,13 +537,13 @@ public class EnterpriseTestReportService { return returnList; } - public List parseDTO(List modleList) { - if (CollectionUtils.isEmpty(modleList)) { + public List parseDTO(List modelList) { + if (CollectionUtils.isEmpty(modelList)) { return new ArrayList<>(0); } else { List userIdList = new ArrayList<>(); List idList = new ArrayList<>(); - modleList.forEach(item -> { + modelList.forEach(item -> { idList.add(item.getId()); if (!userIdList.contains(item.getCreateUser())) { userIdList.add(item.getCreateUser()); @@ -554,7 +553,7 @@ public class EnterpriseTestReportService { Map scheduleMap = scheduleByResourceIds.stream().collect(Collectors.toMap(Schedule::getResourceId, Schedule -> Schedule)); List returnList = new ArrayList<>(); Map userMap = baseUserService.queryNameByIds(userIdList); - for (EnterpriseTestReport model : modleList) { + for (EnterpriseTestReport model : modelList) { EnterpriseTestReportDTO dto = new EnterpriseTestReportDTO(); BeanUtils.copyBean(dto, model); if (userMap.containsKey(dto.getCreateUser())) { diff --git a/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/ReportStatisticsService.java b/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/ReportStatisticsService.java index e7119548de..803957b9c4 100644 --- a/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/ReportStatisticsService.java +++ b/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/ReportStatisticsService.java @@ -84,7 +84,7 @@ public class ReportStatisticsService { boolean isReportNeedUpdate = this.isReportNeedUpdate(blob); if (isReportNeedUpdate) { TestCaseCountRequest countRequest = JSON.parseObject(blob.getSelectOption(), TestCaseCountRequest.class); - Map returnDataOption = this.reloadDatas(countRequest, JSON.toJSONString(dataOption.get("chartType"))); + Map returnDataOption = this.reloadData(countRequest, JSON.toJSONString(dataOption.get("chartType"))); if (returnDataOption != null) { dataOption = returnDataOption; } @@ -104,7 +104,7 @@ public class ReportStatisticsService { return blob; } - private Map reloadDatas(TestCaseCountRequest request, String chartType) { + private Map reloadData(TestCaseCountRequest request, String chartType) { if (StringUtils.isEmpty(chartType)) { chartType = "bar"; } @@ -117,7 +117,7 @@ public class ReportStatisticsService { loadOptionObject.put("xaxis", JSON.toJSONString(testCaseCountResponse.getBarChartDTO().getXAxis())); loadOptionObject.put("yAxis", JSON.toJSONString(testCaseCountResponse.getBarChartDTO().getYAxis())); loadOptionObject.put("tooltip", "{}"); - loadOptionObject.put("lable", "{}"); + loadOptionObject.put("label", "{}"); if (!CollectionUtils.isEmpty(testCaseCountResponse.getBarChartDTO().getSeries())) { List list = testCaseCountResponse.getBarChartDTO().getSeries(); for (Series model : list) { diff --git a/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/TestAnalysisService.java b/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/TestAnalysisService.java index c8cd1af8d8..ad2090260a 100644 --- a/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/TestAnalysisService.java +++ b/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/TestAnalysisService.java @@ -146,16 +146,16 @@ public class TestAnalysisService { dto.setSeries(seriesList); } - private void formatLegend(Legend legend, List datas, TestAnalysisChartRequest request) { + private void formatLegend(Legend legend, List dataList, TestAnalysisChartRequest request) { Map selected = new LinkedHashMap<>(); List list = new LinkedList<>(); - if (CollectionUtils.isEmpty(datas)) { + if (CollectionUtils.isEmpty(dataList)) { selected.put(ADD, request.isCreateCase()); selected.put(UPDATE, request.isUpdateCase()); list.add(ADD); list.add(UPDATE); } else { - datas.forEach(item -> { + dataList.forEach(item -> { selected.put(item + "-" + ADD, request.isCreateCase()); selected.put(item + "-" + UPDATE, request.isUpdateCase()); list.add(item + "-" + ADD); diff --git a/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/TestCaseCountService.java b/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/TestCaseCountService.java index c5e16bddd5..f4fe08415a 100644 --- a/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/TestCaseCountService.java +++ b/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/TestCaseCountService.java @@ -12,7 +12,7 @@ import io.metersphere.reportstatistics.dto.table.TestCaseCountTableItemDataDTO; import io.metersphere.reportstatistics.dto.table.TestCaseCountTableRowDTO; import io.metersphere.reportstatistics.service.remote.apitest.ApiCaseRemoteService; import io.metersphere.reportstatistics.service.remote.apitest.ScenarioRemoteService; -import io.metersphere.reportstatistics.service.remote.performancetest.PerformanceRemoteService; +import io.metersphere.reportstatistics.service.remote.performance.PerformanceRemoteService; import io.metersphere.reportstatistics.service.remote.projectmanagement.TestCaseTemplateRemoteService; import io.metersphere.reportstatistics.service.remote.track.TestCaseRemoteService; import io.metersphere.request.member.QueryMemberRequest; @@ -623,7 +623,7 @@ public class TestCaseCountService { } } - Map returmMap = new LinkedHashMap<>(); + Map returnMap = new LinkedHashMap<>(); if (StringUtils.equalsIgnoreCase(order, "desc")) { TreeMap> treeMap = new TreeMap<>(); @@ -643,7 +643,7 @@ public class TestCaseCountService { for (int i = sortedList.size(); i > 0; i--) { TestCaseCountSummary model = sortedList.get(i - 1); - returmMap.put(model.groupName, model); + returnMap.put(model.groupName, model); } } else if (StringUtils.equalsIgnoreCase(order, "asc")) { TreeMap> treeMap = new TreeMap<>(); @@ -658,15 +658,15 @@ public class TestCaseCountService { } for (List list : treeMap.values()) { for (TestCaseCountSummary model : list) { - returmMap.put(model.groupName, model); + returnMap.put(model.groupName, model); } } } else { - returmMap = summaryMap; + returnMap = summaryMap; } - return returmMap; + return returnMap; } private Map getUserIdMap() { @@ -807,11 +807,11 @@ public class TestCaseCountService { dto.setLegend(legend); } - private void formatLegend(Legend legend, List datas, TestCaseCountRequest yrequest) { + private void formatLegend(Legend legend, List dataList, TestCaseCountRequest yrequest) { Map selected = new LinkedHashMap<>(); List list = new LinkedList<>(); legend.setSelected(selected); - legend.setData(datas); + legend.setData(dataList); } private void formatTable(List dtos, Map summaryMap) { @@ -830,7 +830,7 @@ public class TestCaseCountService { return map; } - public Map>> getSelectFilterDatas(String projectId) { + public Map>> getSelectFilterData(String projectId) { Map>> returnMap = new HashMap<>(); //组装用户 diff --git a/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/remote/performancetest/PerformanceRemoteService.java b/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/remote/performance/PerformanceRemoteService.java similarity index 99% rename from report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/remote/performancetest/PerformanceRemoteService.java rename to report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/remote/performance/PerformanceRemoteService.java index eb77937744..91af4bbd24 100644 --- a/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/remote/performancetest/PerformanceRemoteService.java +++ b/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/remote/performance/PerformanceRemoteService.java @@ -1,4 +1,4 @@ -package io.metersphere.reportstatistics.service.remote.performancetest; +package io.metersphere.reportstatistics.service.remote.performance; import io.metersphere.commons.utils.LogUtil; import io.metersphere.reportstatistics.dto.TestCaseCountChartResult; diff --git a/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/remote/performancetest/PerformanceTestBaseService.java b/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/remote/performance/PerformanceTestBaseService.java similarity index 98% rename from report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/remote/performancetest/PerformanceTestBaseService.java rename to report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/remote/performance/PerformanceTestBaseService.java index a579eb8116..995ac53ae3 100644 --- a/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/remote/performancetest/PerformanceTestBaseService.java +++ b/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/remote/performance/PerformanceTestBaseService.java @@ -1,4 +1,4 @@ -package io.metersphere.reportstatistics.service.remote.performancetest; +package io.metersphere.reportstatistics.service.remote.performance; import io.metersphere.commons.constants.MicroServiceName; import io.metersphere.service.RemoteService; diff --git a/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/remote/performancetest/PerformanceTestService.java b/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/remote/performance/PerformanceTestService.java similarity index 98% rename from report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/remote/performancetest/PerformanceTestService.java rename to report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/remote/performance/PerformanceTestService.java index 8714941813..f5a9242680 100644 --- a/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/remote/performancetest/PerformanceTestService.java +++ b/report-stat/backend/src/main/java/io/metersphere/reportstatistics/service/remote/performance/PerformanceTestService.java @@ -1,4 +1,4 @@ -package io.metersphere.reportstatistics.service.remote.performancetest; +package io.metersphere.reportstatistics.service.remote.performance; import io.metersphere.commons.constants.MicroServiceName; import io.metersphere.service.RemoteService; diff --git a/report-stat/backend/src/main/java/io/metersphere/reportstatistics/utils/ScheduleUtil.java b/report-stat/backend/src/main/java/io/metersphere/reportstatistics/utils/ScheduleUtil.java index 0bb65f8920..89ff2a098b 100644 --- a/report-stat/backend/src/main/java/io/metersphere/reportstatistics/utils/ScheduleUtil.java +++ b/report-stat/backend/src/main/java/io/metersphere/reportstatistics/utils/ScheduleUtil.java @@ -13,7 +13,7 @@ public class ScheduleUtil { if (!CronExpression.isValidExpression(cron)) { return 0; } - CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity("Caclulate Date").withSchedule(CronScheduleBuilder.cronSchedule(cron)).build(); + CronTrigger trigger = TriggerBuilder.newTrigger().withIdentity("Calculate Date").withSchedule(CronScheduleBuilder.cronSchedule(cron)).build(); Date time0 = trigger.getStartTime(); Date time1 = trigger.getFireTimeAfter(time0); return time1 == null ? 0 : time1.getTime(); diff --git a/report-stat/backend/src/main/resources/db/migration/V2__2.3.0_release.sql b/report-stat/backend/src/main/resources/db/migration/V2__2.3.0_release.sql new file mode 100644 index 0000000000..0d0bd4f9cf --- /dev/null +++ b/report-stat/backend/src/main/resources/db/migration/V2__2.3.0_release.sql @@ -0,0 +1,2 @@ +-- 更改状态 +update enterprise_test_report set status ='SEND_FAILED' where status = 'SEND_FAILD'; \ No newline at end of file diff --git a/report-stat/frontend/src/api/report.js b/report-stat/frontend/src/api/report.js index 576fa1334c..8056ce5b6f 100644 --- a/report-stat/frontend/src/api/report.js +++ b/report-stat/frontend/src/api/report.js @@ -9,6 +9,6 @@ export function getCountReport(param) { } export function initCountData(param) { - return post("/report/test/case/count/initDatas", param) + return post("/report/test/case/count/initData", param) } diff --git a/report-stat/frontend/src/business/compnent/form/MsSelectTree.vue b/report-stat/frontend/src/business/compnent/form/MsSelectTree.vue index 71734a1802..c6dea22e50 100644 --- a/report-stat/frontend/src/business/compnent/form/MsSelectTree.vue +++ b/report-stat/frontend/src/business/compnent/form/MsSelectTree.vue @@ -152,7 +152,7 @@ export default { popoverWidth: "0px",//下拉框大小 isShowSelect: false, // 是否显示树状选择器 options: [],//select option选项 - returnDatas: [],//返回给父组件数组对象 + returnData: [],//返回给父组件数组对象 returnDataKeys: [],//返回父组件数组主键值 filterText: "", loading: false, @@ -217,7 +217,7 @@ export default { // 多选 if (Object.prototype.toString.call(this.defaultKey).indexOf("Array") != -1) { if (Object.prototype.toString.call(this.defaultKey[0]).indexOf("Object") != -1) {//对象 - this.setDatas(this.defaultKey); + this.setDataFromInit(this.defaultKey); } else if (Object.prototype.toString.call(this.defaultKey[0]).indexOf("Number") != -1 || Object.prototype.toString.call(this.defaultKey[0]).indexOf("String") != -1) { this.setKeys(this.defaultKey); @@ -270,7 +270,7 @@ export default { this.returnDataKeys = this.options.map((item) => { return item.value; }); - this.returnDatas = t; + this.returnData = t; } this.selectNodeIds = []; @@ -290,7 +290,7 @@ export default { //单选:清空选中 clean() { this.$refs.tree.setCurrentKey(null);//清除树选中key - this.returnDatas = null; + this.returnData = null; this.returnDataKeys = ''; this.selectNodeIds = []; this.popoverHide(); @@ -309,7 +309,7 @@ export default { setData(data) { this.options = []; this.options.push({label: data[this.obj.label], value: data[this.obj.id]}); - this.returnDatas = data; + this.returnData = data; this.returnDataKeys = data[this.obj.id] this.selectNodeIds = []; this.getChildNodeId(data, this.selectNodeIds); @@ -328,13 +328,13 @@ export default { return {label: node.label, value: node.key}; } }); - this.returnDatas = t; + this.returnData = t; this.popoverHide() }, //多选:设置、初始化对象 - setDatas(data) { + setDataFromInit(data) { this.$refs.tree.setCheckedNodes(data); - this.returnDatas = data; + this.returnData = data; let t = []; data.map((item) => {//设置option选项 t.push(item[this.obj.id]); @@ -360,7 +360,7 @@ export default { //下拉框关闭执行 popoverHide() { this.$emit('setSelectNodeIds', this.selectNodeIds); - this.$emit('getValue', this.returnDataKeys, this.returnDatas ? this.returnDatas : {}); + this.$emit('getValue', this.returnDataKeys, this.returnData ? this.returnData : {}); }, // 多选,清空所有勾选 clearSelectedNodes() { diff --git a/report-stat/frontend/src/business/enterprisereport/components/list/ProjectReportList.vue b/report-stat/frontend/src/business/enterprisereport/components/list/ProjectReportList.vue index 0d1fcc99e5..b3a25e1880 100644 --- a/report-stat/frontend/src/business/enterprisereport/components/list/ProjectReportList.vue +++ b/report-stat/frontend/src/business/enterprisereport/components/list/ProjectReportList.vue @@ -29,7 +29,7 @@ :content="$t('commons.report_statistics.table.draft')"/> - diff --git a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestAnalysisMapper.java b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestAnalysisMapper.java index 6777395f38..f56caa7870 100644 --- a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestAnalysisMapper.java +++ b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestAnalysisMapper.java @@ -8,7 +8,7 @@ import java.util.List; public interface ExtTestAnalysisMapper { - List getCraeteCaseReport(TestAnalysisChartRequest request); + List getCreateCaseReport(TestAnalysisChartRequest request); List getUpdateCaseReport(TestAnalysisChartRequest request); } diff --git a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestAnalysisMapper.xml b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestAnalysisMapper.xml index 00623082db..f1a5779462 100644 --- a/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestAnalysisMapper.xml +++ b/test-track/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestAnalysisMapper.xml @@ -2,7 +2,7 @@ - select dateStr, ifnull(tt.num,0) countNum from (