parent
3dbbc6c958
commit
6bba28235a
|
@ -19,9 +19,9 @@ public class TestCaseCountController {
|
||||||
@Resource
|
@Resource
|
||||||
TestCaseCountService testCaseCountService;
|
TestCaseCountService testCaseCountService;
|
||||||
|
|
||||||
@PostMapping("/initDatas")
|
@PostMapping("/initData")
|
||||||
public Map<String, List<Map<String, String>>> initDatas(@RequestBody TestCaseCountRequest request) {
|
public Map<String, List<Map<String, String>>> initDatas(@RequestBody TestCaseCountRequest request) {
|
||||||
Map<String, List<Map<String, String>>> returnMap = testCaseCountService.getSelectFilterDatas(request.getProjectId());
|
Map<String, List<Map<String, String>>> returnMap = testCaseCountService.getSelectFilterData(request.getProjectId());
|
||||||
return returnMap;
|
return returnMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
package io.metersphere.reportstatistics.dto.request.emun;
|
package io.metersphere.reportstatistics.dto.request.emun;
|
||||||
|
|
||||||
public enum EnterpriseReportStatus {
|
public enum EnterpriseReportStatus {
|
||||||
NEW, SENDED, SEND_FAILD
|
NEW, SENDED, SEND_FAILED
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,7 +152,7 @@ public class EnterpriseTestReportService {
|
||||||
request.setCreateTime(time);
|
request.setCreateTime(time);
|
||||||
request.setUpdateTime(time);
|
request.setUpdateTime(time);
|
||||||
|
|
||||||
boolean sendSucess = false;
|
boolean sendSuccess = false;
|
||||||
if (StringUtils.isEmpty(request.getStatus())) {
|
if (StringUtils.isEmpty(request.getStatus())) {
|
||||||
request.setStatus(EnterpriseReportStatus.NEW.name());
|
request.setStatus(EnterpriseReportStatus.NEW.name());
|
||||||
} else if (StringUtils.equalsIgnoreCase(request.getStatus(), "send")) {
|
} else if (StringUtils.equalsIgnoreCase(request.getStatus(), "send")) {
|
||||||
|
@ -160,14 +160,14 @@ public class EnterpriseTestReportService {
|
||||||
try {
|
try {
|
||||||
this.sendEmail(request, false);
|
this.sendEmail(request, false);
|
||||||
request.setLastSendTime(time);
|
request.setLastSendTime(time);
|
||||||
sendSucess = true;
|
sendSuccess = true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
request.setStatus(EnterpriseReportStatus.SEND_FAILD.name());
|
request.setStatus(EnterpriseReportStatus.SEND_FAILED.name());
|
||||||
LogUtil.error(e);
|
LogUtil.error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
enterpriseTestReportMapper.insert(request);
|
enterpriseTestReportMapper.insert(request);
|
||||||
if (sendSucess) {
|
if (sendSuccess) {
|
||||||
this.insertEnterpriseSendRecord(request);
|
this.insertEnterpriseSendRecord(request);
|
||||||
}
|
}
|
||||||
return request;
|
return request;
|
||||||
|
@ -175,20 +175,20 @@ public class EnterpriseTestReportService {
|
||||||
|
|
||||||
public EnterpriseTestReport send(EnterpriseTestReportWithBLOBs param) {
|
public EnterpriseTestReport send(EnterpriseTestReportWithBLOBs param) {
|
||||||
EnterpriseTestReportWithBLOBs bloBs = enterpriseTestReportMapper.selectByPrimaryKey(param.getId());
|
EnterpriseTestReportWithBLOBs bloBs = enterpriseTestReportMapper.selectByPrimaryKey(param.getId());
|
||||||
boolean sendSucess = false;
|
boolean sendSuccess = false;
|
||||||
if (bloBs != null) {
|
if (bloBs != null) {
|
||||||
try {
|
try {
|
||||||
this.sendEmail(bloBs, true);
|
this.sendEmail(bloBs, true);
|
||||||
bloBs.setStatus(EnterpriseReportStatus.SENDED.name());
|
bloBs.setStatus(EnterpriseReportStatus.SENDED.name());
|
||||||
bloBs.setLastSendTime(System.currentTimeMillis());
|
bloBs.setLastSendTime(System.currentTimeMillis());
|
||||||
sendSucess = true;
|
sendSuccess = true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
bloBs.setStatus(EnterpriseReportStatus.SEND_FAILD.name());
|
bloBs.setStatus(EnterpriseReportStatus.SEND_FAILED.name());
|
||||||
LogUtil.error("Send email error!", e);
|
LogUtil.error("Send email error!", e);
|
||||||
MSException.throwException("Send email error!");
|
MSException.throwException("Send email error!");
|
||||||
}
|
}
|
||||||
enterpriseTestReportMapper.updateByPrimaryKeySelective(bloBs);
|
enterpriseTestReportMapper.updateByPrimaryKeySelective(bloBs);
|
||||||
if (sendSucess) {
|
if (sendSuccess) {
|
||||||
this.insertEnterpriseSendRecord(bloBs);
|
this.insertEnterpriseSendRecord(bloBs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -205,20 +205,20 @@ public class EnterpriseTestReportService {
|
||||||
long time = System.currentTimeMillis();
|
long time = System.currentTimeMillis();
|
||||||
request.setUpdateTime(time);
|
request.setUpdateTime(time);
|
||||||
|
|
||||||
boolean sendSucess = false;
|
boolean sendSuccess = false;
|
||||||
if (StringUtils.equalsIgnoreCase(request.getStatus(), "send")) {
|
if (StringUtils.equalsIgnoreCase(request.getStatus(), "send")) {
|
||||||
request.setStatus(EnterpriseReportStatus.SENDED.name());
|
request.setStatus(EnterpriseReportStatus.SENDED.name());
|
||||||
try {
|
try {
|
||||||
this.sendEmail(request, false);
|
this.sendEmail(request, false);
|
||||||
request.setLastSendTime(time);
|
request.setLastSendTime(time);
|
||||||
sendSucess = true;
|
sendSuccess = true;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
request.setStatus(EnterpriseReportStatus.SEND_FAILD.name());
|
request.setStatus(EnterpriseReportStatus.SEND_FAILED.name());
|
||||||
LogUtil.error(e);
|
LogUtil.error(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
enterpriseTestReportMapper.updateByPrimaryKeySelective(request);
|
enterpriseTestReportMapper.updateByPrimaryKeySelective(request);
|
||||||
if (sendSucess) {
|
if (sendSuccess) {
|
||||||
this.insertEnterpriseSendRecord(request);
|
this.insertEnterpriseSendRecord(request);
|
||||||
}
|
}
|
||||||
return request;
|
return request;
|
||||||
|
@ -499,7 +499,6 @@ public class EnterpriseTestReportService {
|
||||||
// 读取图片字节数组
|
// 读取图片字节数组
|
||||||
try {
|
try {
|
||||||
InputStream in = fileSystemResource.getInputStream();
|
InputStream in = fileSystemResource.getInputStream();
|
||||||
System.out.println("文件大小(字节)=" + in.available());
|
|
||||||
data = new byte[in.available()];
|
data = new byte[in.available()];
|
||||||
in.read(data);
|
in.read(data);
|
||||||
in.close();
|
in.close();
|
||||||
|
@ -538,13 +537,13 @@ public class EnterpriseTestReportService {
|
||||||
return returnList;
|
return returnList;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<EnterpriseTestReportDTO> parseDTO(List<EnterpriseTestReport> modleList) {
|
public List<EnterpriseTestReportDTO> parseDTO(List<EnterpriseTestReport> modelList) {
|
||||||
if (CollectionUtils.isEmpty(modleList)) {
|
if (CollectionUtils.isEmpty(modelList)) {
|
||||||
return new ArrayList<>(0);
|
return new ArrayList<>(0);
|
||||||
} else {
|
} else {
|
||||||
List<String> userIdList = new ArrayList<>();
|
List<String> userIdList = new ArrayList<>();
|
||||||
List<String> idList = new ArrayList<>();
|
List<String> idList = new ArrayList<>();
|
||||||
modleList.forEach(item -> {
|
modelList.forEach(item -> {
|
||||||
idList.add(item.getId());
|
idList.add(item.getId());
|
||||||
if (!userIdList.contains(item.getCreateUser())) {
|
if (!userIdList.contains(item.getCreateUser())) {
|
||||||
userIdList.add(item.getCreateUser());
|
userIdList.add(item.getCreateUser());
|
||||||
|
@ -554,7 +553,7 @@ public class EnterpriseTestReportService {
|
||||||
Map<String, Schedule> scheduleMap = scheduleByResourceIds.stream().collect(Collectors.toMap(Schedule::getResourceId, Schedule -> Schedule));
|
Map<String, Schedule> scheduleMap = scheduleByResourceIds.stream().collect(Collectors.toMap(Schedule::getResourceId, Schedule -> Schedule));
|
||||||
List<EnterpriseTestReportDTO> returnList = new ArrayList<>();
|
List<EnterpriseTestReportDTO> returnList = new ArrayList<>();
|
||||||
Map<String, User> userMap = baseUserService.queryNameByIds(userIdList);
|
Map<String, User> userMap = baseUserService.queryNameByIds(userIdList);
|
||||||
for (EnterpriseTestReport model : modleList) {
|
for (EnterpriseTestReport model : modelList) {
|
||||||
EnterpriseTestReportDTO dto = new EnterpriseTestReportDTO();
|
EnterpriseTestReportDTO dto = new EnterpriseTestReportDTO();
|
||||||
BeanUtils.copyBean(dto, model);
|
BeanUtils.copyBean(dto, model);
|
||||||
if (userMap.containsKey(dto.getCreateUser())) {
|
if (userMap.containsKey(dto.getCreateUser())) {
|
||||||
|
|
|
@ -84,7 +84,7 @@ public class ReportStatisticsService {
|
||||||
boolean isReportNeedUpdate = this.isReportNeedUpdate(blob);
|
boolean isReportNeedUpdate = this.isReportNeedUpdate(blob);
|
||||||
if (isReportNeedUpdate) {
|
if (isReportNeedUpdate) {
|
||||||
TestCaseCountRequest countRequest = JSON.parseObject(blob.getSelectOption(), TestCaseCountRequest.class);
|
TestCaseCountRequest countRequest = JSON.parseObject(blob.getSelectOption(), TestCaseCountRequest.class);
|
||||||
Map<String, Object> returnDataOption = this.reloadDatas(countRequest, JSON.toJSONString(dataOption.get("chartType")));
|
Map<String, Object> returnDataOption = this.reloadData(countRequest, JSON.toJSONString(dataOption.get("chartType")));
|
||||||
if (returnDataOption != null) {
|
if (returnDataOption != null) {
|
||||||
dataOption = returnDataOption;
|
dataOption = returnDataOption;
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,7 @@ public class ReportStatisticsService {
|
||||||
return blob;
|
return blob;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<String, Object> reloadDatas(TestCaseCountRequest request, String chartType) {
|
private Map<String, Object> reloadData(TestCaseCountRequest request, String chartType) {
|
||||||
if (StringUtils.isEmpty(chartType)) {
|
if (StringUtils.isEmpty(chartType)) {
|
||||||
chartType = "bar";
|
chartType = "bar";
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@ public class ReportStatisticsService {
|
||||||
loadOptionObject.put("xaxis", JSON.toJSONString(testCaseCountResponse.getBarChartDTO().getXAxis()));
|
loadOptionObject.put("xaxis", JSON.toJSONString(testCaseCountResponse.getBarChartDTO().getXAxis()));
|
||||||
loadOptionObject.put("yAxis", JSON.toJSONString(testCaseCountResponse.getBarChartDTO().getYAxis()));
|
loadOptionObject.put("yAxis", JSON.toJSONString(testCaseCountResponse.getBarChartDTO().getYAxis()));
|
||||||
loadOptionObject.put("tooltip", "{}");
|
loadOptionObject.put("tooltip", "{}");
|
||||||
loadOptionObject.put("lable", "{}");
|
loadOptionObject.put("label", "{}");
|
||||||
if (!CollectionUtils.isEmpty(testCaseCountResponse.getBarChartDTO().getSeries())) {
|
if (!CollectionUtils.isEmpty(testCaseCountResponse.getBarChartDTO().getSeries())) {
|
||||||
List<Series> list = testCaseCountResponse.getBarChartDTO().getSeries();
|
List<Series> list = testCaseCountResponse.getBarChartDTO().getSeries();
|
||||||
for (Series model : list) {
|
for (Series model : list) {
|
||||||
|
|
|
@ -146,16 +146,16 @@ public class TestAnalysisService {
|
||||||
dto.setSeries(seriesList);
|
dto.setSeries(seriesList);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void formatLegend(Legend legend, List<String> datas, TestAnalysisChartRequest request) {
|
private void formatLegend(Legend legend, List<String> dataList, TestAnalysisChartRequest request) {
|
||||||
Map<String, Boolean> selected = new LinkedHashMap<>();
|
Map<String, Boolean> selected = new LinkedHashMap<>();
|
||||||
List<String> list = new LinkedList<>();
|
List<String> list = new LinkedList<>();
|
||||||
if (CollectionUtils.isEmpty(datas)) {
|
if (CollectionUtils.isEmpty(dataList)) {
|
||||||
selected.put(ADD, request.isCreateCase());
|
selected.put(ADD, request.isCreateCase());
|
||||||
selected.put(UPDATE, request.isUpdateCase());
|
selected.put(UPDATE, request.isUpdateCase());
|
||||||
list.add(ADD);
|
list.add(ADD);
|
||||||
list.add(UPDATE);
|
list.add(UPDATE);
|
||||||
} else {
|
} else {
|
||||||
datas.forEach(item -> {
|
dataList.forEach(item -> {
|
||||||
selected.put(item + "-" + ADD, request.isCreateCase());
|
selected.put(item + "-" + ADD, request.isCreateCase());
|
||||||
selected.put(item + "-" + UPDATE, request.isUpdateCase());
|
selected.put(item + "-" + UPDATE, request.isUpdateCase());
|
||||||
list.add(item + "-" + ADD);
|
list.add(item + "-" + ADD);
|
||||||
|
|
|
@ -12,7 +12,7 @@ import io.metersphere.reportstatistics.dto.table.TestCaseCountTableItemDataDTO;
|
||||||
import io.metersphere.reportstatistics.dto.table.TestCaseCountTableRowDTO;
|
import io.metersphere.reportstatistics.dto.table.TestCaseCountTableRowDTO;
|
||||||
import io.metersphere.reportstatistics.service.remote.apitest.ApiCaseRemoteService;
|
import io.metersphere.reportstatistics.service.remote.apitest.ApiCaseRemoteService;
|
||||||
import io.metersphere.reportstatistics.service.remote.apitest.ScenarioRemoteService;
|
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.projectmanagement.TestCaseTemplateRemoteService;
|
||||||
import io.metersphere.reportstatistics.service.remote.track.TestCaseRemoteService;
|
import io.metersphere.reportstatistics.service.remote.track.TestCaseRemoteService;
|
||||||
import io.metersphere.request.member.QueryMemberRequest;
|
import io.metersphere.request.member.QueryMemberRequest;
|
||||||
|
@ -623,7 +623,7 @@ public class TestCaseCountService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, TestCaseCountSummary> returmMap = new LinkedHashMap<>();
|
Map<String, TestCaseCountSummary> returnMap = new LinkedHashMap<>();
|
||||||
|
|
||||||
if (StringUtils.equalsIgnoreCase(order, "desc")) {
|
if (StringUtils.equalsIgnoreCase(order, "desc")) {
|
||||||
TreeMap<Long, List<TestCaseCountSummary>> treeMap = new TreeMap<>();
|
TreeMap<Long, List<TestCaseCountSummary>> treeMap = new TreeMap<>();
|
||||||
|
@ -643,7 +643,7 @@ public class TestCaseCountService {
|
||||||
|
|
||||||
for (int i = sortedList.size(); i > 0; i--) {
|
for (int i = sortedList.size(); i > 0; i--) {
|
||||||
TestCaseCountSummary model = sortedList.get(i - 1);
|
TestCaseCountSummary model = sortedList.get(i - 1);
|
||||||
returmMap.put(model.groupName, model);
|
returnMap.put(model.groupName, model);
|
||||||
}
|
}
|
||||||
} else if (StringUtils.equalsIgnoreCase(order, "asc")) {
|
} else if (StringUtils.equalsIgnoreCase(order, "asc")) {
|
||||||
TreeMap<Long, List<TestCaseCountSummary>> treeMap = new TreeMap<>();
|
TreeMap<Long, List<TestCaseCountSummary>> treeMap = new TreeMap<>();
|
||||||
|
@ -658,15 +658,15 @@ public class TestCaseCountService {
|
||||||
}
|
}
|
||||||
for (List<TestCaseCountSummary> list : treeMap.values()) {
|
for (List<TestCaseCountSummary> list : treeMap.values()) {
|
||||||
for (TestCaseCountSummary model : list) {
|
for (TestCaseCountSummary model : list) {
|
||||||
returmMap.put(model.groupName, model);
|
returnMap.put(model.groupName, model);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
returmMap = summaryMap;
|
returnMap = summaryMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return returmMap;
|
return returnMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<String, String> getUserIdMap() {
|
private Map<String, String> getUserIdMap() {
|
||||||
|
@ -807,11 +807,11 @@ public class TestCaseCountService {
|
||||||
dto.setLegend(legend);
|
dto.setLegend(legend);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void formatLegend(Legend legend, List<String> datas, TestCaseCountRequest yrequest) {
|
private void formatLegend(Legend legend, List<String> dataList, TestCaseCountRequest yrequest) {
|
||||||
Map<String, Boolean> selected = new LinkedHashMap<>();
|
Map<String, Boolean> selected = new LinkedHashMap<>();
|
||||||
List<String> list = new LinkedList<>();
|
List<String> list = new LinkedList<>();
|
||||||
legend.setSelected(selected);
|
legend.setSelected(selected);
|
||||||
legend.setData(datas);
|
legend.setData(dataList);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void formatTable(List<TestCaseCountTableDTO> dtos, Map<String, TestCaseCountSummary> summaryMap) {
|
private void formatTable(List<TestCaseCountTableDTO> dtos, Map<String, TestCaseCountSummary> summaryMap) {
|
||||||
|
@ -830,7 +830,7 @@ public class TestCaseCountService {
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, List<Map<String, String>>> getSelectFilterDatas(String projectId) {
|
public Map<String, List<Map<String, String>>> getSelectFilterData(String projectId) {
|
||||||
Map<String, List<Map<String, String>>> returnMap = new HashMap<>();
|
Map<String, List<Map<String, String>>> returnMap = new HashMap<>();
|
||||||
|
|
||||||
//组装用户
|
//组装用户
|
||||||
|
|
|
@ -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.commons.utils.LogUtil;
|
||||||
import io.metersphere.reportstatistics.dto.TestCaseCountChartResult;
|
import io.metersphere.reportstatistics.dto.TestCaseCountChartResult;
|
|
@ -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.commons.constants.MicroServiceName;
|
||||||
import io.metersphere.service.RemoteService;
|
import io.metersphere.service.RemoteService;
|
|
@ -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.commons.constants.MicroServiceName;
|
||||||
import io.metersphere.service.RemoteService;
|
import io.metersphere.service.RemoteService;
|
|
@ -13,7 +13,7 @@ public class ScheduleUtil {
|
||||||
if (!CronExpression.isValidExpression(cron)) {
|
if (!CronExpression.isValidExpression(cron)) {
|
||||||
return 0;
|
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 time0 = trigger.getStartTime();
|
||||||
Date time1 = trigger.getFireTimeAfter(time0);
|
Date time1 = trigger.getFireTimeAfter(time0);
|
||||||
return time1 == null ? 0 : time1.getTime();
|
return time1 == null ? 0 : time1.getTime();
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
-- 更改状态
|
||||||
|
update enterprise_test_report set status ='SEND_FAILED' where status = 'SEND_FAILD';
|
|
@ -9,6 +9,6 @@ export function getCountReport(param) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function initCountData(param) {
|
export function initCountData(param) {
|
||||||
return post("/report/test/case/count/initDatas", param)
|
return post("/report/test/case/count/initData", param)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -152,7 +152,7 @@ export default {
|
||||||
popoverWidth: "0px",//下拉框大小
|
popoverWidth: "0px",//下拉框大小
|
||||||
isShowSelect: false, // 是否显示树状选择器
|
isShowSelect: false, // 是否显示树状选择器
|
||||||
options: [],//select option选项
|
options: [],//select option选项
|
||||||
returnDatas: [],//返回给父组件数组对象
|
returnData: [],//返回给父组件数组对象
|
||||||
returnDataKeys: [],//返回父组件数组主键值
|
returnDataKeys: [],//返回父组件数组主键值
|
||||||
filterText: "",
|
filterText: "",
|
||||||
loading: false,
|
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).indexOf("Array") != -1) {
|
||||||
if (Object.prototype.toString.call(this.defaultKey[0]).indexOf("Object") != -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
|
} else if (Object.prototype.toString.call(this.defaultKey[0]).indexOf("Number") != -1
|
||||||
|| Object.prototype.toString.call(this.defaultKey[0]).indexOf("String") != -1) {
|
|| Object.prototype.toString.call(this.defaultKey[0]).indexOf("String") != -1) {
|
||||||
this.setKeys(this.defaultKey);
|
this.setKeys(this.defaultKey);
|
||||||
|
@ -270,7 +270,7 @@ export default {
|
||||||
this.returnDataKeys = this.options.map((item) => {
|
this.returnDataKeys = this.options.map((item) => {
|
||||||
return item.value;
|
return item.value;
|
||||||
});
|
});
|
||||||
this.returnDatas = t;
|
this.returnData = t;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.selectNodeIds = [];
|
this.selectNodeIds = [];
|
||||||
|
@ -290,7 +290,7 @@ export default {
|
||||||
//单选:清空选中
|
//单选:清空选中
|
||||||
clean() {
|
clean() {
|
||||||
this.$refs.tree.setCurrentKey(null);//清除树选中key
|
this.$refs.tree.setCurrentKey(null);//清除树选中key
|
||||||
this.returnDatas = null;
|
this.returnData = null;
|
||||||
this.returnDataKeys = '';
|
this.returnDataKeys = '';
|
||||||
this.selectNodeIds = [];
|
this.selectNodeIds = [];
|
||||||
this.popoverHide();
|
this.popoverHide();
|
||||||
|
@ -309,7 +309,7 @@ export default {
|
||||||
setData(data) {
|
setData(data) {
|
||||||
this.options = [];
|
this.options = [];
|
||||||
this.options.push({label: data[this.obj.label], value: data[this.obj.id]});
|
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.returnDataKeys = data[this.obj.id]
|
||||||
this.selectNodeIds = [];
|
this.selectNodeIds = [];
|
||||||
this.getChildNodeId(data, this.selectNodeIds);
|
this.getChildNodeId(data, this.selectNodeIds);
|
||||||
|
@ -328,13 +328,13 @@ export default {
|
||||||
return {label: node.label, value: node.key};
|
return {label: node.label, value: node.key};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.returnDatas = t;
|
this.returnData = t;
|
||||||
this.popoverHide()
|
this.popoverHide()
|
||||||
},
|
},
|
||||||
//多选:设置、初始化对象
|
//多选:设置、初始化对象
|
||||||
setDatas(data) {
|
setDataFromInit(data) {
|
||||||
this.$refs.tree.setCheckedNodes(data);
|
this.$refs.tree.setCheckedNodes(data);
|
||||||
this.returnDatas = data;
|
this.returnData = data;
|
||||||
let t = [];
|
let t = [];
|
||||||
data.map((item) => {//设置option选项
|
data.map((item) => {//设置option选项
|
||||||
t.push(item[this.obj.id]);
|
t.push(item[this.obj.id]);
|
||||||
|
@ -360,7 +360,7 @@ export default {
|
||||||
//下拉框关闭执行
|
//下拉框关闭执行
|
||||||
popoverHide() {
|
popoverHide() {
|
||||||
this.$emit('setSelectNodeIds', this.selectNodeIds);
|
this.$emit('setSelectNodeIds', this.selectNodeIds);
|
||||||
this.$emit('getValue', this.returnDataKeys, this.returnDatas ? this.returnDatas : {});
|
this.$emit('getValue', this.returnDataKeys, this.returnData ? this.returnData : {});
|
||||||
},
|
},
|
||||||
// 多选,清空所有勾选
|
// 多选,清空所有勾选
|
||||||
clearSelectedNodes() {
|
clearSelectedNodes() {
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
:content="$t('commons.report_statistics.table.draft')"/>
|
:content="$t('commons.report_statistics.table.draft')"/>
|
||||||
<ms-tag v-else-if="scope.row.status == 'SENDED'" type="success" effect="plain"
|
<ms-tag v-else-if="scope.row.status == 'SENDED'" type="success" effect="plain"
|
||||||
:content="$t('commons.report_statistics.table.sended')"/>
|
:content="$t('commons.report_statistics.table.sended')"/>
|
||||||
<ms-tag v-else-if="scope.row.status == 'SEND_FAILD'" type="error" effect="plain"
|
<ms-tag v-else-if="scope.row.status == 'SEND_FAILED'" type="error" effect="plain"
|
||||||
:content="$t('commons.report_statistics.table.send_error')"/>
|
:content="$t('commons.report_statistics.table.send_error')"/>
|
||||||
<ms-tag v-else type="effect" effect="plain" :content="scope.row.status"/>
|
<ms-tag v-else type="effect" effect="plain" :content="scope.row.status"/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -8,7 +8,7 @@ import java.util.List;
|
||||||
|
|
||||||
public interface ExtTestAnalysisMapper {
|
public interface ExtTestAnalysisMapper {
|
||||||
|
|
||||||
List<TestAnalysisChartResult> getCraeteCaseReport(TestAnalysisChartRequest request);
|
List<TestAnalysisChartResult> getCreateCaseReport(TestAnalysisChartRequest request);
|
||||||
|
|
||||||
List<TestAnalysisChartResult> getUpdateCaseReport(TestAnalysisChartRequest request);
|
List<TestAnalysisChartResult> getUpdateCaseReport(TestAnalysisChartRequest request);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||||
<mapper namespace="io.metersphere.base.mapper.ext.ExtTestAnalysisMapper">
|
<mapper namespace="io.metersphere.base.mapper.ext.ExtTestAnalysisMapper">
|
||||||
|
|
||||||
<select id="getCraeteCaseReport" resultType="io.metersphere.dto.TestAnalysisChartResult">
|
<select id="getCreateCaseReport" resultType="io.metersphere.dto.TestAnalysisChartResult">
|
||||||
select dateStr, ifnull(tt.num,0) countNum
|
select dateStr, ifnull(tt.num,0) countNum
|
||||||
from
|
from
|
||||||
(
|
(
|
||||||
|
|
Loading…
Reference in New Issue