Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MeterSphere
metersphere
提交
dfd6aaee
M
metersphere
项目概览
MeterSphere
/
metersphere
上一次同步 大约 3 年
通知
25
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
metersphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
dfd6aaee
编写于
5月 27, 2020
作者:
C
chenjianxing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
自动更新测试计划状态
上级
a7a50868
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
42 addition
and
3 deletion
+42
-3
backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.java
...etersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.java
+2
-0
backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml
...metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml
+5
-0
backend/src/main/java/io/metersphere/track/controller/TestPlanController.java
...a/io/metersphere/track/controller/TestPlanController.java
+6
-0
backend/src/main/java/io/metersphere/track/service/TestPlanService.java
...in/java/io/metersphere/track/service/TestPlanService.java
+19
-1
frontend/src/business/components/track/case/components/TestCaseEdit.vue
...usiness/components/track/case/components/TestCaseEdit.vue
+1
-1
frontend/src/business/components/track/plan/view/comonents/StatusEdit.vue
...iness/components/track/plan/view/comonents/StatusEdit.vue
+4
-0
frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseEdit.vue
...onents/track/plan/view/comonents/TestPlanTestCaseEdit.vue
+4
-0
frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseList.vue
...onents/track/plan/view/comonents/TestPlanTestCaseList.vue
+1
-1
未找到文件。
backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.java
浏览文件 @
dfd6aaee
...
...
@@ -21,4 +21,6 @@ public interface ExtTestPlanTestCaseMapper {
List
<
TestPlanCaseDTO
>
getRecentTestedTestCase
(
@Param
(
"request"
)
QueryTestPlanCaseRequest
request
);
List
<
TestPlanCaseDTO
>
getPendingTestCases
(
@Param
(
"request"
)
QueryTestPlanCaseRequest
request
);
List
<
String
>
getStatusByPlanId
(
String
planId
);
}
backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestPlanTestCaseMapper.xml
浏览文件 @
dfd6aaee
...
...
@@ -93,4 +93,9 @@
</foreach>
order by test_plan_test_case.update_time asc
</select>
<select
id=
"getStatusByPlanId"
resultType=
"java.lang.String"
>
select status
from test_plan_test_case
where plan_id = #{planId}
</select>
</mapper>
\ No newline at end of file
backend/src/main/java/io/metersphere/track/controller/TestPlanController.java
浏览文件 @
dfd6aaee
...
...
@@ -70,6 +70,12 @@ public class TestPlanController {
testPlanService
.
editTestPlan
(
testPlan
);
}
@PostMapping
(
"/edit/status/{planId}"
)
@RequiresRoles
(
value
=
{
RoleConstants
.
TEST_USER
,
RoleConstants
.
TEST_MANAGER
},
logical
=
Logical
.
OR
)
public
void
editTestPlanStatus
(
@PathVariable
String
planId
){
testPlanService
.
editTestPlanStatus
(
planId
);
}
@PostMapping
(
"/delete/{testPlanId}"
)
@RequiresRoles
(
value
=
{
RoleConstants
.
TEST_USER
,
RoleConstants
.
TEST_MANAGER
},
logical
=
Logical
.
OR
)
public
int
deleteTestPlan
(
@PathVariable
String
testPlanId
){
...
...
backend/src/main/java/io/metersphere/track/service/TestPlanService.java
浏览文件 @
dfd6aaee
...
...
@@ -144,7 +144,8 @@ public class TestPlanService {
sqlSession
.
flushStatements
();
TestPlan
testPlan
=
testPlanMapper
.
selectByPrimaryKey
(
request
.
getPlanId
());
if
(
StringUtils
.
equals
(
testPlan
.
getStatus
(),
TestPlanStatus
.
Prepare
.
name
()))
{
if
(
StringUtils
.
equals
(
testPlan
.
getStatus
(),
TestPlanStatus
.
Prepare
.
name
())
||
StringUtils
.
equals
(
testPlan
.
getStatus
(),
TestPlanStatus
.
Completed
.
name
()))
{
testPlan
.
setStatus
(
TestPlanStatus
.
Underway
.
name
());
testPlanMapper
.
updateByPrimaryKey
(
testPlan
);
}
...
...
@@ -344,4 +345,21 @@ public class TestPlanService {
example
.
createCriteria
().
andIdIn
(
planIds
);
return
testPlanMapper
.
selectByExample
(
example
);
}
public
void
editTestPlanStatus
(
String
planId
)
{
List
<
String
>
statusList
=
extTestPlanTestCaseMapper
.
getStatusByPlanId
(
planId
);
TestPlan
testPlan
=
new
TestPlan
();
testPlan
.
setId
(
planId
);
for
(
String
status:
statusList
){
if
(
StringUtils
.
equals
(
status
,
TestPlanTestCaseStatus
.
Prepare
.
name
())
||
StringUtils
.
equals
(
status
,
TestPlanTestCaseStatus
.
Underway
.
name
()))
{
testPlan
.
setStatus
(
TestPlanStatus
.
Underway
.
name
());
testPlanMapper
.
updateByPrimaryKeySelective
(
testPlan
);
return
;
}
}
testPlan
.
setStatus
(
TestPlanStatus
.
Completed
.
name
());
testPlanMapper
.
updateByPrimaryKeySelective
(
testPlan
);
}
}
frontend/src/business/components/track/case/components/TestCaseEdit.vue
浏览文件 @
dfd6aaee
...
...
@@ -43,7 +43,7 @@
<el-option
v-for=
"item in maintainerOptions"
:key=
"item.id"
:label=
"item.
name
"
:label=
"item.
id + ' (' + item.name + ')'
"
:value=
"item.id"
>
</el-option>
</el-select>
...
...
frontend/src/business/components/track/plan/view/comonents/StatusEdit.vue
浏览文件 @
dfd6aaee
...
...
@@ -34,6 +34,9 @@
props
:
{
selectIds
:
{
type
:
Set
},
planId
:
{
type
:
String
}
},
methods
:
{
...
...
@@ -51,6 +54,7 @@
this
.
$post
(
'
/test/plan/case/batch/edit
'
,
param
,
()
=>
{
this
.
selectIds
.
clear
();
this
.
status
=
''
;
this
.
$post
(
'
/test/plan/edit/status/
'
+
this
.
planId
);
this
.
$success
(
this
.
$t
(
'
commons.save_success
'
));
this
.
statusEditVisible
=
false
;
this
.
$emit
(
'
refresh
'
);
...
...
frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseEdit.vue
浏览文件 @
dfd6aaee
...
...
@@ -239,6 +239,7 @@
param
.
issues
=
JSON
.
stringify
(
this
.
testCase
.
issues
);
this
.
$post
(
'
/test/plan/case/edit
'
,
param
,
()
=>
{
this
.
$success
(
this
.
$t
(
'
commons.save_success
'
));
this
.
setPlanStatus
(
this
.
testCase
.
planId
);
});
},
handleNext
()
{
...
...
@@ -309,6 +310,9 @@
},
addPLabel
(
str
)
{
return
"
<p>
"
+
str
+
"
</p>
"
;
},
setPlanStatus
(
planId
)
{
this
.
$post
(
'
/test/plan/edit/status/
'
+
planId
);
}
}
}
...
...
frontend/src/business/components/track/plan/view/comonents/TestPlanTestCaseList.vue
浏览文件 @
dfd6aaee
...
...
@@ -20,7 +20,7 @@
</template>
<executor-edit
ref=
"executorEdit"
:select-ids=
"selectIds"
@
refresh=
"initTableData"
/>
<status-edit
ref=
"statusEdit"
:select-ids=
"selectIds"
@
refresh=
"initTableData"
/>
<status-edit
ref=
"statusEdit"
:
plan-id=
"planId"
:
select-ids=
"selectIds"
@
refresh=
"initTableData"
/>
<el-table
@
select-all=
"handleSelectAll"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录