Merge branch 'master' of https://github.com/metersphere/metersphere
# Conflicts: # frontend/src/business/components/api/automation/scenario/EditApiScenario.vue
This commit is contained in:
commit
0665359d60
|
@ -254,7 +254,7 @@ public class APITestController {
|
|||
* */
|
||||
long dateCountByCreateInThisWeek = apiAutomationService.countScenarioByProjectIDAndCreatInThisWeek(projectId);
|
||||
apiCountResult.setThisWeekAddedCount(dateCountByCreateInThisWeek);
|
||||
long executedInThisWeekCountNumber = apiScenarioReportService.countByProjectIDAndCreateInThisWeek(projectId);
|
||||
long executedInThisWeekCountNumber = apiScenarioReportService.countByProjectIdAndCreateInThisWeek(projectId);
|
||||
apiCountResult.setThisWeekExecutedCount(executedInThisWeekCountNumber);
|
||||
long executedCountNumber = apiScenarioReportService.countByProjectID(projectId);
|
||||
apiCountResult.setExecutedCount(executedCountNumber);
|
||||
|
@ -275,21 +275,27 @@ public class APITestController {
|
|||
|
||||
}
|
||||
|
||||
@GetMapping("/scheduleTaskInfoCount/{workSpaceID}")
|
||||
public ApiDataCountDTO scheduleTaskInfoCount(@PathVariable String workSpaceID) {
|
||||
@GetMapping("/scheduleTaskInfoCount/{projectId}")
|
||||
public ApiDataCountDTO scheduleTaskInfoCount(@PathVariable String projectId) {
|
||||
ApiDataCountDTO apiCountResult = new ApiDataCountDTO();
|
||||
|
||||
long allTaskCount = scheduleService.countTaskByWorkspaceIdAndGroup(workSpaceID,ScheduleGroup.API_TEST.name());
|
||||
long allTaskCount = scheduleService.countTaskByProjectId(projectId);
|
||||
|
||||
apiCountResult.setAllApiDataCountNumber(allTaskCount);
|
||||
|
||||
long taskCountInThisWeek = scheduleService.countTaskByWorkspaceIdAndGroupInThisWeek(workSpaceID,ScheduleGroup.API_TEST.name());
|
||||
long taskCountInThisWeek = scheduleService.countTaskByProjectIdInThisWeek(projectId);
|
||||
apiCountResult.setThisWeekAddedCount(taskCountInThisWeek);
|
||||
long executedInThisWeekCountNumber = apiReportService.countByWorkspaceIdAndGroupAndCreateInThisWeek(workSpaceID,ScheduleGroup.API_TEST.name());
|
||||
long api_executedInThisWeekCountNumber = apiReportService.countByProjectIdAndCreateInThisWeek(projectId);
|
||||
long scene_executedInThisWeekCountNumber = apiScenarioReportService.countByProjectIdAndCreateAndByScheduleInThisWeek(projectId);
|
||||
long executedInThisWeekCountNumber = api_executedInThisWeekCountNumber+scene_executedInThisWeekCountNumber;
|
||||
apiCountResult.setThisWeekExecutedCount(executedInThisWeekCountNumber);
|
||||
|
||||
//统计 失败 成功 以及总数
|
||||
List<ApiDataCountResult> allExecuteResult = apiReportService.countByWorkspaceIdAndGroupGroupByExecuteResult(workSpaceID,ScheduleGroup.API_TEST.name());
|
||||
List<ApiDataCountResult> api_allExecuteResult = apiReportService.countByProjectIdGroupByExecuteResult(projectId);
|
||||
List<ApiDataCountResult> scene_allExecuteResult = apiScenarioReportService.countByProjectIdGroupByExecuteResult(projectId);
|
||||
List<ApiDataCountResult> allExecuteResult = new ArrayList<>();
|
||||
allExecuteResult.addAll(api_allExecuteResult);
|
||||
allExecuteResult.addAll(scene_allExecuteResult);
|
||||
apiCountResult.countScheduleExecute(allExecuteResult);
|
||||
|
||||
long allCount = apiCountResult.getExecutedCount();
|
||||
|
@ -330,10 +336,10 @@ public class APITestController {
|
|||
return returnList;
|
||||
}
|
||||
|
||||
@GetMapping("/runningTask/{workspaceID}")
|
||||
public List<TaskInfoResult> runningTask(@PathVariable String workspaceID) {
|
||||
@GetMapping("/runningTask/{projectID}")
|
||||
public List<TaskInfoResult> runningTask(@PathVariable String projectID) {
|
||||
|
||||
List<TaskInfoResult> resultList = scheduleService.findRunningTaskInfoByWorkspaceID(workspaceID);
|
||||
List<TaskInfoResult> resultList = scheduleService.findRunningTaskInfoByProjectID(projectID);
|
||||
for (TaskInfoResult taskInfo :
|
||||
resultList) {
|
||||
Date nextExecutionTime = CronUtils.getNextTriggerTime(taskInfo.getRule());
|
||||
|
|
|
@ -212,7 +212,7 @@ public class APIReportService {
|
|||
apiTestReportMapper.deleteByExample(apiTestReportExample);
|
||||
}
|
||||
|
||||
public long countByWorkspaceIdAndGroupAndCreateInThisWeek(String workspaceID, String group) {
|
||||
public long countByProjectIdAndCreateInThisWeek(String projectId) {
|
||||
Map<String, Date> startAndEndDateInWeek = DateUtils.getWeedFirstTimeAndLastTime(new Date());
|
||||
|
||||
Date firstTime = startAndEndDateInWeek.get("firstTime");
|
||||
|
@ -221,11 +221,11 @@ public class APIReportService {
|
|||
if(firstTime==null || lastTime == null){
|
||||
return 0;
|
||||
}else {
|
||||
return extApiTestReportMapper.countByProjectIDAndCreateInThisWeek(workspaceID,group,firstTime.getTime(),lastTime.getTime());
|
||||
return extApiTestReportMapper.countByProjectIDAndCreateInThisWeek(projectId,firstTime.getTime(),lastTime.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
public List<ApiDataCountResult> countByWorkspaceIdAndGroupGroupByExecuteResult(String workspaceID, String group) {
|
||||
return extApiTestReportMapper.countByWorkspaceIdAndGroupGroupByExecuteResult(workspaceID,group);
|
||||
public List<ApiDataCountResult> countByProjectIdGroupByExecuteResult(String projectId) {
|
||||
return extApiTestReportMapper.countByProjectIdGroupByExecuteResult(projectId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -161,6 +161,7 @@ public class ApiAutomationService {
|
|||
}
|
||||
|
||||
public void preDelete(String scenarioID){
|
||||
scheduleService.deleteByResourceId(scenarioID);
|
||||
|
||||
TestPlanApiScenarioExample example = new TestPlanApiScenarioExample();
|
||||
example.createCriteria().andApiScenarioIdEqualTo(scenarioID);
|
||||
|
@ -172,27 +173,34 @@ public class ApiAutomationService {
|
|||
idList.add(api.getId());
|
||||
}
|
||||
example = new TestPlanApiScenarioExample();
|
||||
example.createCriteria()
|
||||
.andIdIn(idList);
|
||||
testPlanApiScenarioMapper.deleteByExample(example);
|
||||
|
||||
if(!idList.isEmpty()){
|
||||
example.createCriteria().andIdIn(idList);
|
||||
testPlanApiScenarioMapper.deleteByExample(example);
|
||||
}
|
||||
|
||||
}
|
||||
public void preDelete(List<String> scenarioIDList){
|
||||
List<String> idList = new ArrayList<>();
|
||||
List<String> testPlanApiScenarioIdList = new ArrayList<>();
|
||||
List<String> scheduleIdList = new ArrayList<>();
|
||||
for (String id :scenarioIDList) {
|
||||
TestPlanApiScenarioExample example = new TestPlanApiScenarioExample();
|
||||
example.createCriteria().andApiScenarioIdEqualTo(id);
|
||||
List<TestPlanApiScenario> testPlanApiScenarioList = testPlanApiScenarioMapper.selectByExample(example);
|
||||
|
||||
for (TestPlanApiScenario api :testPlanApiScenarioList) {
|
||||
if(!idList.contains(api.getId())){
|
||||
idList.add(api.getId());
|
||||
if(!testPlanApiScenarioIdList.contains(api.getId())){
|
||||
testPlanApiScenarioIdList.add(api.getId());
|
||||
}
|
||||
}
|
||||
|
||||
scheduleService.deleteByResourceId(id);
|
||||
}
|
||||
TestPlanApiScenarioExample example = new TestPlanApiScenarioExample();
|
||||
example.createCriteria()
|
||||
.andIdIn(idList);
|
||||
testPlanApiScenarioMapper.deleteByExample(example);
|
||||
if(!testPlanApiScenarioIdList.isEmpty()){
|
||||
TestPlanApiScenarioExample example = new TestPlanApiScenarioExample();
|
||||
example.createCriteria().andIdIn(testPlanApiScenarioIdList);
|
||||
testPlanApiScenarioMapper.deleteByExample(example);
|
||||
}
|
||||
|
||||
}
|
||||
public void deleteBatch(List<String> ids) {
|
||||
//及连删除外键表
|
||||
|
|
|
@ -6,6 +6,7 @@ import io.metersphere.api.dto.DeleteAPIReportRequest;
|
|||
import io.metersphere.api.dto.QueryAPIReportRequest;
|
||||
import io.metersphere.api.dto.automation.APIScenarioReportResult;
|
||||
import io.metersphere.api.dto.automation.ExecuteType;
|
||||
import io.metersphere.api.dto.datacount.ApiDataCountResult;
|
||||
import io.metersphere.api.jmeter.ScenarioResult;
|
||||
import io.metersphere.api.jmeter.TestResult;
|
||||
import io.metersphere.base.domain.*;
|
||||
|
@ -254,7 +255,7 @@ public class ApiScenarioReportService {
|
|||
return extApiScenarioReportMapper.countByProjectID(projectId);
|
||||
}
|
||||
|
||||
public long countByProjectIDAndCreateInThisWeek(String projectId) {
|
||||
public long countByProjectIdAndCreateAndByScheduleInThisWeek(String projectId) {
|
||||
Map<String, Date> startAndEndDateInWeek = DateUtils.getWeedFirstTimeAndLastTime(new Date());
|
||||
|
||||
Date firstTime = startAndEndDateInWeek.get("firstTime");
|
||||
|
@ -263,7 +264,24 @@ public class ApiScenarioReportService {
|
|||
if (firstTime == null || lastTime == null) {
|
||||
return 0;
|
||||
} else {
|
||||
return extApiScenarioReportMapper.countByProjectIDAndCreateInThisWeek(projectId, firstTime.getTime(), lastTime.getTime());
|
||||
return extApiScenarioReportMapper.countByProjectIdAndCreateAndByScheduleInThisWeek(projectId, firstTime.getTime(), lastTime.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
public long countByProjectIdAndCreateInThisWeek(String projectId) {
|
||||
Map<String, Date> startAndEndDateInWeek = DateUtils.getWeedFirstTimeAndLastTime(new Date());
|
||||
|
||||
Date firstTime = startAndEndDateInWeek.get("firstTime");
|
||||
Date lastTime = startAndEndDateInWeek.get("lastTime");
|
||||
|
||||
if (firstTime == null || lastTime == null) {
|
||||
return 0;
|
||||
} else {
|
||||
return extApiScenarioReportMapper.countByProjectIdAndCreateInThisWeek(projectId, firstTime.getTime(), lastTime.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
public List<ApiDataCountResult> countByProjectIdGroupByExecuteResult(String projectId) {
|
||||
return extApiScenarioReportMapper.countByProjectIdGroupByExecuteResult(projectId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,7 +37,8 @@
|
|||
SELECT testCase.testCaseName AS caseName,testCase.testPlanName AS testPlan ,caseErrorCountData.dataCountNumber AS failureTimes,'apiCase' AS caseType
|
||||
FROM (
|
||||
SELECT apiCase.id AS testCaseID,apiCase.`name` AS testCaseName,group_concat(testPlan.`name`) AS testPlanName FROM api_test_case apiCase
|
||||
LEFT JOIN test_plan testPlan ON testPlan.api_ids like concat('%"',apiCase.id,'"%')
|
||||
LEFT JOIN test_plan_api_case testPlanCase ON testPlanCase.api_case_id = apiCase.id
|
||||
LEFT JOIN test_plan testPlan ON testPlan.id = testPlanCase.test_plan_id
|
||||
GROUP BY apiCase.id
|
||||
ORDER BY apiCase.create_time DESC
|
||||
)testCase
|
||||
|
|
|
@ -2,6 +2,7 @@ package io.metersphere.base.mapper.ext;
|
|||
|
||||
import io.metersphere.api.dto.QueryAPIReportRequest;
|
||||
import io.metersphere.api.dto.automation.APIScenarioReportResult;
|
||||
import io.metersphere.api.dto.datacount.ApiDataCountResult;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
|
@ -14,6 +15,9 @@ public interface ExtApiScenarioReportMapper {
|
|||
|
||||
long countByProjectID(String projectId);
|
||||
|
||||
long countByProjectIDAndCreateInThisWeek(@Param("projectId") String projectId, @Param("firstDayTimestamp") long firstDayTimestamp, @Param("lastDayTimestamp") long lastDayTimestamp);
|
||||
long countByProjectIdAndCreateInThisWeek(@Param("projectId") String projectId, @Param("firstDayTimestamp") long firstDayTimestamp, @Param("lastDayTimestamp") long lastDayTimestamp);
|
||||
|
||||
long countByProjectIdAndCreateAndByScheduleInThisWeek(@Param("projectId") String projectId, @Param("firstDayTimestamp") long firstDayTimestamp, @Param("lastDayTimestamp") long lastDayTimestamp);
|
||||
|
||||
List<ApiDataCountResult> countByProjectIdGroupByExecuteResult(String projectId);
|
||||
}
|
|
@ -169,9 +169,28 @@
|
|||
<select id="countByProjectID" resultType="java.lang.Long">
|
||||
SELECT count(id) AS countNumber FROM api_scenario_report WHERE project_id = #{0}
|
||||
</select>
|
||||
<select id="countByProjectIDAndCreateInThisWeek" resultType="java.lang.Long">
|
||||
<select id="countByProjectIdAndCreateInThisWeek" resultType="java.lang.Long">
|
||||
SELECT count(id) AS countNumber FROM api_scenario_report
|
||||
WHERE project_id = #{projectId}
|
||||
AND create_time BETWEEN #{firstDayTimestamp} AND #{lastDayTimestamp}
|
||||
</select>
|
||||
|
||||
<select id="countByProjectIdAndCreateAndByScheduleInThisWeek" resultType="java.lang.Long">
|
||||
SELECT count(acr.report_id) AS countNumber FROM api_scenario_report_detail acr
|
||||
INNER JOIN api_scenario_report ar ON ar.id = acr.report_id
|
||||
INNER JOIN (
|
||||
SELECT acitem.id FROM api_scenario acitem INNER JOIN `schedule` sc ON acitem.id = sc.resource_id
|
||||
) ac on acr.content like CONCAT('%', ac.id,'%')
|
||||
WHERE acr.project_id = #{projectId} AND ar.create_time BETWEEN #{firstDayTimestamp} AND #{lastDayTimestamp}
|
||||
</select>
|
||||
|
||||
<select id="countByProjectIdGroupByExecuteResult" resultType="io.metersphere.api.dto.datacount.ApiDataCountResult">
|
||||
SELECT count(acr.report_id) AS countNumber,ar.status AS groupField
|
||||
FROM api_scenario_report_detail acr
|
||||
INNER JOIN api_scenario_report ar ON ar.id = acr.report_id
|
||||
INNER JOIN (
|
||||
SELECT acitem.id FROM api_scenario acitem INNER JOIN `schedule` sc ON acitem.id = sc.resource_id
|
||||
) ac on acr.content like CONCAT('%', ac.id,'%')
|
||||
WHERE acr.project_id = #{projectId}
|
||||
</select>
|
||||
</mapper>
|
|
@ -18,7 +18,7 @@ public interface ExtApiTestReportMapper {
|
|||
|
||||
List<DashboardTestDTO> selectDashboardTests(@Param("workspaceId") String workspaceId, @Param("startTimestamp") long startTimestamp);
|
||||
|
||||
List<ApiDataCountResult> countByWorkspaceIdAndGroupGroupByExecuteResult(@Param("workspaceID") String workspaceID, @Param("group")String group);
|
||||
List<ApiDataCountResult> countByProjectIdGroupByExecuteResult(String projectId);
|
||||
|
||||
long countByProjectIDAndCreateInThisWeek(@Param("workspaceID") String workspaceID, @Param("group")String group, @Param("startTime") long startTime, @Param("endTime")long endTime);
|
||||
long countByProjectIDAndCreateInThisWeek(@Param("projectId") String projectId, @Param("startTime") long startTime, @Param("endTime")long endTime);
|
||||
}
|
||||
|
|
|
@ -152,19 +152,24 @@
|
|||
GROUP BY x
|
||||
</select>
|
||||
|
||||
<select id="countByWorkspaceIdAndGroupGroupByExecuteResult" resultType="io.metersphere.api.dto.datacount.ApiDataCountResult">
|
||||
<select id="countByProjectIdGroupByExecuteResult" resultType="io.metersphere.api.dto.datacount.ApiDataCountResult">
|
||||
SELECT testReport.`status` AS groupField,COUNT(testReportDetail.report_id) AS countNumber
|
||||
FROM api_test_report_detail testReportDetail
|
||||
INNER JOIN `schedule` sch ON sch.resource_id = testReportDetail.test_id
|
||||
INNER JOIN api_test_report testReport ON testReportDetail.report_id = testReport.id
|
||||
WHERE workspace_id = #{workspaceID} AND `group` = #{group}
|
||||
WHERE sch.resource_id IN (
|
||||
SELECT id FROM api_test WHERE project_id = #{projectId,jdbcType=VARCHAR}
|
||||
)
|
||||
AND `group` = #{group}
|
||||
</select>
|
||||
|
||||
<select id="countByProjectIDAndCreateInThisWeek" resultType="java.lang.Long">
|
||||
SELECT COUNT(testReportDetail.report_id) AS countNumber FROM api_test_report_detail testReportDetail
|
||||
INNER JOIN `schedule` sch ON sch.resource_id = testReportDetail.test_id
|
||||
INNER JOIN api_test_report testReport ON testReportDetail.report_id = testReport.id
|
||||
WHERE workspace_id = #{workspaceID} AND `group` = #{group}
|
||||
WHERE sch.resource_id IN (
|
||||
SELECT id FROM api_test WHERE project_id = #{projectId,jdbcType=VARCHAR}
|
||||
)
|
||||
AND testReport.create_time BETWEEN #{startTime} and #{endTime}
|
||||
</select>
|
||||
</mapper>
|
|
@ -10,9 +10,9 @@ import java.util.List;
|
|||
public interface ExtScheduleMapper {
|
||||
List<ScheduleDao> list(@Param("request") QueryScheduleRequest request);
|
||||
|
||||
long countTaskByWorkspaceIdAndGroup(@Param("workspaceId") String workspaceId,@Param("group") String group);
|
||||
long countTaskByProjectId(String workspaceId);
|
||||
|
||||
long countTaskByWorkspaceIdAndGroupAndCreateTimeRange(@Param("workspaceId")String workspaceId,@Param("group") String group, @Param("startTime") long startTime, @Param("endTime") long endTime);
|
||||
long countTaskByProjectIdAndCreateTimeRange(@Param("projectId")String projectId, @Param("startTime") long startTime, @Param("endTime") long endTime);
|
||||
|
||||
List<TaskInfoResult> findRunningTaskInfoByWorkspaceID(String workspaceID);
|
||||
List<TaskInfoResult> findRunningTaskInfoByProjectID(String workspaceID);
|
||||
}
|
|
@ -36,26 +36,33 @@
|
|||
</if>
|
||||
</select>
|
||||
|
||||
<select id="countTaskByWorkspaceIdAndGroup" resultType="java.lang.Long">
|
||||
SELECT COUNT(id) AS countNumber FROM `schedule` WHERE `workspace_id` = #{workspaceId} AND `group` = #{group}
|
||||
<select id="countTaskByProjectId" resultType="java.lang.Long">
|
||||
SELECT COUNT(id) AS countNumber FROM `schedule` WHERE resource_id IN (
|
||||
SELECT id FROM api_test WHERE project_id = #{0,jdbcType=VARCHAR}
|
||||
UNION
|
||||
SELECT id FROM api_scenario WHERE project_id = #{0,jdbcType=VARCHAR}
|
||||
)
|
||||
</select>
|
||||
<select id="countTaskByWorkspaceIdAndGroupAndCreateTimeRange" resultType="java.lang.Long">
|
||||
<select id="countTaskByProjectIdAndCreateTimeRange" resultType="java.lang.Long">
|
||||
SELECT COUNT(id) AS countNumber FROM `schedule`
|
||||
WHERE workspace_id = #{workspaceId}
|
||||
AND `group` = #{group}
|
||||
WHERE resource_id IN (
|
||||
SELECT id FROM api_test WHERE project_id = #{projectId,jdbcType=VARCHAR}
|
||||
UNION
|
||||
SELECT id FROM api_scenario WHERE project_id = #{projectId,jdbcType=VARCHAR}
|
||||
)
|
||||
AND create_time BETWEEN #{startTime} and #{endTime}
|
||||
</select>
|
||||
<select id="findRunningTaskInfoByWorkspaceID" resultType="io.metersphere.api.dto.datacount.response.TaskInfoResult">
|
||||
<select id="findRunningTaskInfoByProjectID" resultType="io.metersphere.api.dto.datacount.response.TaskInfoResult">
|
||||
SELECT apiTest.`name` AS scenario,sch.id AS taskID,sch.`value` AS rule,sch.`enable` AS `taskStatus`,u.`name` AS creator,sch.update_time AS updateTime
|
||||
FROM api_test apiTest
|
||||
INNER JOIN `schedule` sch ON apiTest.id = sch.resource_id
|
||||
INNER JOIN `user` u ON u.id = sch.user_id
|
||||
WHERE sch.`enable` = true AND sch.workspace_id = #{0,jdbcType=VARCHAR}
|
||||
WHERE sch.`enable` = true AND apiTest.project_id = #{0,jdbcType=VARCHAR}
|
||||
UNION
|
||||
SELECT apiTest.`name` AS scenario,sch.id AS taskID,sch.`value` AS rule,sch.`enable` AS `taskStatus`,u.`name` AS creator,sch.update_time AS updateTime
|
||||
FROM api_scenario apiTest
|
||||
INNER JOIN `schedule` sch ON apiTest.id = sch.resource_id
|
||||
SELECT apiScene.`name` AS scenario,sch.id AS taskID,sch.`value` AS rule,sch.`enable` AS `taskStatus`,u.`name` AS creator,sch.update_time AS updateTime
|
||||
FROM api_scenario apiScene
|
||||
INNER JOIN `schedule` sch ON apiScene.id = sch.resource_id
|
||||
INNER JOIN `user` u ON u.id = sch.user_id
|
||||
WHERE sch.`enable` = true AND sch.workspace_id = #{0,jdbcType=VARCHAR}
|
||||
WHERE sch.`enable` = true AND apiScene.project_id = #{0,jdbcType=VARCHAR}
|
||||
</select>
|
||||
</mapper>
|
|
@ -20,7 +20,6 @@ import io.metersphere.dto.ScheduleDao;
|
|||
import io.metersphere.job.sechedule.ApiTestJob;
|
||||
import io.metersphere.job.sechedule.ScheduleManager;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.quartz.JobDetail;
|
||||
import org.quartz.JobKey;
|
||||
import org.quartz.SchedulerException;
|
||||
import org.quartz.TriggerKey;
|
||||
|
@ -168,11 +167,11 @@ public class ScheduleService {
|
|||
});
|
||||
}
|
||||
|
||||
public long countTaskByWorkspaceIdAndGroup(String workspaceId,String group) {
|
||||
return extScheduleMapper.countTaskByWorkspaceIdAndGroup(workspaceId,group);
|
||||
public long countTaskByProjectId(String projectId) {
|
||||
return extScheduleMapper.countTaskByProjectId(projectId);
|
||||
}
|
||||
|
||||
public long countTaskByWorkspaceIdAndGroupInThisWeek(String workspaceID, String group) {
|
||||
public long countTaskByProjectIdInThisWeek(String projectId) {
|
||||
Map<String, Date> startAndEndDateInWeek = DateUtils.getWeedFirstTimeAndLastTime(new Date());
|
||||
|
||||
Date firstTime = startAndEndDateInWeek.get("firstTime");
|
||||
|
@ -181,12 +180,12 @@ public class ScheduleService {
|
|||
if(firstTime==null || lastTime == null){
|
||||
return 0;
|
||||
}else {
|
||||
return extScheduleMapper.countTaskByWorkspaceIdAndGroupAndCreateTimeRange(workspaceID,group,firstTime.getTime(),lastTime.getTime());
|
||||
return extScheduleMapper.countTaskByProjectIdAndCreateTimeRange(projectId,firstTime.getTime(),lastTime.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
public List<TaskInfoResult> findRunningTaskInfoByWorkspaceID(String workspaceID) {
|
||||
List<TaskInfoResult> runningTaskInfoList = extScheduleMapper.findRunningTaskInfoByWorkspaceID(workspaceID);
|
||||
public List<TaskInfoResult> findRunningTaskInfoByProjectID(String projectID) {
|
||||
List<TaskInfoResult> runningTaskInfoList = extScheduleMapper.findRunningTaskInfoByProjectID(projectID);
|
||||
return runningTaskInfoList;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
"vue": "^2.6.10",
|
||||
"vue-calendar-heatmap": "^0.8.4",
|
||||
"vue-echarts": "^4.1.0",
|
||||
"vue-float-action-button": "^0.6.6",
|
||||
"vue-i18n": "^8.15.3",
|
||||
"vue-input-tag": "^2.0.7",
|
||||
"vue-pdf": "^4.2.0",
|
||||
|
|
|
@ -344,7 +344,8 @@
|
|||
visibleRef: "",
|
||||
enableCookieShare: false,
|
||||
}
|
||||
},
|
||||
}
|
||||
,
|
||||
created() {
|
||||
if (!this.currentScenario.apiScenarioModuleId) {
|
||||
this.currentScenario.apiScenarioModuleId = "";
|
||||
|
@ -354,8 +355,127 @@
|
|||
this.getMaintainerOptions();
|
||||
this.getApiScenario();
|
||||
this.getEnvironments();
|
||||
}
|
||||
,
|
||||
watch: {}
|
||||
,
|
||||
computed:{
|
||||
buttons() {
|
||||
let buttons = [
|
||||
{
|
||||
title: this.$t('api_test.automation.api_list_import'),
|
||||
show: this.showButton("HTTPSamplerProxy", "DubboSampler", "JDBCSampler", "TCPSampler"),
|
||||
titleColor: "#F56C6C",
|
||||
titleBgColor: "#FCF1F1",
|
||||
icon: "api",
|
||||
click: this.apiListImport
|
||||
}, {
|
||||
title: this.$t('api_test.automation.external_import'),
|
||||
show: this.showButton("OT_IMPORT"),
|
||||
titleColor: "#409EFF",
|
||||
titleBgColor: "#EEF5FE",
|
||||
icon: "next_plan",
|
||||
click: () => {
|
||||
this.addComponent('OT_IMPORT')
|
||||
}
|
||||
}, {
|
||||
title: this.$t('api_test.automation.wait_controller'),
|
||||
show: this.showButton("ConstantTimer"),
|
||||
titleColor: "#67C23A",
|
||||
titleBgColor: "#F2F9EE",
|
||||
icon: "access_time",
|
||||
click: () => {
|
||||
this.addComponent('ConstantTimer')
|
||||
}
|
||||
}, {
|
||||
title: this.$t('api_test.automation.if_controller'),
|
||||
show: this.showButton("IfController"),
|
||||
titleColor: "#E6A23C",
|
||||
titleBgColor: "#FCF6EE",
|
||||
icon: "alt_route",
|
||||
click: () => {
|
||||
this.addComponent('IfController')
|
||||
}
|
||||
}, {
|
||||
title: this.$t('api_test.automation.scenario_import'),
|
||||
show: this.operatingElements.indexOf('scenario') === 0,
|
||||
titleColor: "#606266",
|
||||
titleBgColor: "#F4F4F5",
|
||||
icon: "movie",
|
||||
click: () => {
|
||||
this.addComponent('scenario')
|
||||
}
|
||||
}, {
|
||||
title: this.$t('api_test.automation.customize_script'),
|
||||
show: this.showButton("JSR223Processor"),
|
||||
titleColor: "#7B4D12",
|
||||
titleBgColor: "#F1EEE9",
|
||||
icon: "code",
|
||||
click: () => {
|
||||
this.addComponent('JSR223Processor')
|
||||
}
|
||||
}, {
|
||||
title: this.$t('api_test.automation.customize_req'),
|
||||
show: this.showButton("CustomizeReq"),
|
||||
titleColor: "#008080",
|
||||
titleBgColor: "#EBF2F2",
|
||||
icon: "tune",
|
||||
click: () => {
|
||||
this.addComponent('CustomizeReq')
|
||||
}
|
||||
}, {
|
||||
title: this.$t('api_test.definition.request.pre_script'),
|
||||
show: this.showButton("JSR223PreProcessor"),
|
||||
titleColor: "#B8741A",
|
||||
titleBgColor: "#F9F1EA",
|
||||
icon: "skip_previous",
|
||||
click: () => {
|
||||
this.addComponent('JSR223PreProcessor')
|
||||
}
|
||||
}, {
|
||||
title: this.$t('api_test.definition.request.post_script'),
|
||||
show: this.showButton("JSR223PostProcessor"),
|
||||
titleColor: "#783887",
|
||||
titleBgColor: "#F2ECF3",
|
||||
icon: "skip_next",
|
||||
click: () => {
|
||||
this.addComponent('JSR223PostProcessor')
|
||||
}
|
||||
}, {
|
||||
title: this.$t('api_test.definition.request.assertions_rule'),
|
||||
show: this.showButton("Assertions"),
|
||||
titleColor: "#A30014",
|
||||
titleBgColor: "#F7E6E9",
|
||||
icon: "fact_check",
|
||||
click: () => {
|
||||
this.addComponent('Assertions')
|
||||
}
|
||||
}, {
|
||||
title: this.$t('api_test.definition.request.extract_param'),
|
||||
show: this.showButton("Extract"),
|
||||
titleColor: "#015478",
|
||||
titleBgColor: "#E6EEF2",
|
||||
icon: "colorize",
|
||||
click: () => {
|
||||
this.addComponent('Extract')
|
||||
}
|
||||
}
|
||||
];
|
||||
return buttons.filter(btn => btn.show);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getIdx(index){
|
||||
return -1 * index - 2.25; // 为了向下展示菜单
|
||||
},
|
||||
showButton(...names) {
|
||||
for (const name of names) {
|
||||
if (this.operatingElements.includes(name)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
addComponent(type) {
|
||||
switch (type) {
|
||||
case ELEMENT_TYPE.IfController:
|
||||
|
|
|
@ -50,10 +50,12 @@ function defaultCustomValidate() {
|
|||
}
|
||||
|
||||
const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/);
|
||||
const noticeTemplate = requireComponent.keys().length > 0 ? requireComponent("./notice/NoticeTemplate.vue") : {};
|
||||
|
||||
|
||||
export default {
|
||||
name: "MsScheduleMaintain",
|
||||
components: {CrontabResult, Crontab, MsScheduleNotification},
|
||||
components: {CrontabResult, Crontab, MsScheduleNotification,"NoticeTemplate": noticeTemplate.default},
|
||||
|
||||
props: {
|
||||
customValidate: {
|
||||
|
|
|
@ -7,12 +7,8 @@
|
|||
</div>
|
||||
<div v-else-if="dateType==='2'">
|
||||
<el-link href="https://github.com/metersphere/metersphere/issues" target="_blank" type="primary">😔觉得MeterSphere不好用就来https://github.com/metersphere/metersphere/issues吐个槽吧!</el-link>
|
||||
<!-- <el-link href="https://jmeter.apache.org/usermanual/component_reference.html#BeanShell_PostProcessor"-->
|
||||
<!-- type="primary">{{$t('commons.reference_documentation')}}-->
|
||||
<!-- </el-link>-->
|
||||
</div>
|
||||
<div v-else-if="dateType==='3'">
|
||||
<!-- <el-link :herf="'https://github.com/metersphere/metersphere/issues'" target="_blank"></el-link>-->
|
||||
<el-link href="https://github.com/metersphere/metersphere" target="_blank" type="primary">😄觉得MeterSphere好用就来 https://github.com/metersphere/metersphere 点个star吧!</el-link>
|
||||
</div>
|
||||
<div v-else>
|
||||
|
@ -58,21 +54,15 @@ import MsSceneInfoCard from "./components/SceneInfoCard";
|
|||
import MsScheduleTaskInfoCard from "./components/ScheduleTaskInfoCard";
|
||||
import MsTestCaseInfoCard from "./components/TestCaseInfoCard";
|
||||
|
||||
// import MsApiDetailCard from "./components/ApiDetailCard";
|
||||
// import MsSceneDetailCard from "./components/SceneDetailCard";
|
||||
// import MsScheduleTaskDetailCard from "./components/ScheduleTaskDetailCard";
|
||||
// import MsTestCaseDetailCard from "./components/TestCaseDetailCard";
|
||||
|
||||
import MsFailureTestCaseList from "./components/FailureTestCaseList";
|
||||
import MsRunningTaskList from "./components/RunningTaskList"
|
||||
import {getCurrentProjectID,getCurrentWorkspaceId} from "@/common/js/utils";
|
||||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
|
||||
export default {
|
||||
name: "ApiTestHomePage",
|
||||
|
||||
components: {
|
||||
MsApiInfoCard, MsSceneInfoCard, MsScheduleTaskInfoCard, MsTestCaseInfoCard,
|
||||
// MsApiDetailCard, MsSceneDetailCard, MsScheduleTaskDetailCard, MsTestCaseDetailCard,
|
||||
MsFailureTestCaseList,MsRunningTaskList,
|
||||
MsMainContainer, MsContainer
|
||||
},
|
||||
|
@ -121,8 +111,8 @@ export default {
|
|||
});
|
||||
|
||||
|
||||
let workSpaceID = getCurrentWorkspaceId();
|
||||
this.$get("/api/scheduleTaskInfoCount/"+workSpaceID, response => {
|
||||
// let workSpaceID = getCurrentWorkspaceId();
|
||||
this.$get("/api/scheduleTaskInfoCount/"+selectProjectId, response => {
|
||||
this.scheduleTaskCountData = response.data;
|
||||
});
|
||||
},
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {getCurrentProjectID,getCurrentWorkspaceId} from "@/common/js/utils";
|
||||
import {getCurrentProjectID} from "@/common/js/utils";
|
||||
export default {
|
||||
name: "MsRunningTaskList",
|
||||
|
||||
|
@ -56,8 +56,8 @@ export default {
|
|||
|
||||
methods: {
|
||||
search() {
|
||||
let workSpaceID = getCurrentWorkspaceId();
|
||||
this.result = this.$get("/api/runningTask/"+workSpaceID, response => {
|
||||
let projectID = getCurrentProjectID();
|
||||
this.result = this.$get("/api/runningTask/"+projectID, response => {
|
||||
this.tableData = response.data;
|
||||
});
|
||||
},
|
||||
|
|
|
@ -17,6 +17,7 @@ import CalendarHeatmap from "../common/js/calendar-heatmap";
|
|||
import '../common/css/menu-header.css';
|
||||
import '../common/css/main.css';
|
||||
import CKEditor from '@ckeditor/ckeditor5-vue';
|
||||
import VueFab from 'vue-float-action-button'
|
||||
|
||||
Vue.config.productionTip = false;
|
||||
Vue.use(icon);
|
||||
|
@ -29,7 +30,8 @@ Vue.use(chart);
|
|||
Vue.use(CalendarHeatmap);
|
||||
Vue.use(message);
|
||||
Vue.use(CKEditor);
|
||||
Vue.use(YanProgress)
|
||||
Vue.use(YanProgress);
|
||||
Vue.use(VueFab);
|
||||
|
||||
// v-permission
|
||||
Vue.directive('permission', permission);
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
@font-face {
|
||||
font-family: 'Material Icons';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url(./material.woff2) format('woff2');
|
||||
}
|
||||
|
||||
.material-icons {
|
||||
font-family: 'Material Icons';
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
font-size: 24px;
|
||||
line-height: 1;
|
||||
letter-spacing: normal;
|
||||
text-transform: none;
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
word-wrap: normal;
|
||||
direction: ltr;
|
||||
-webkit-font-feature-settings: 'liga';
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
Binary file not shown.
Loading…
Reference in New Issue