fix(测试跟踪): 修复首页跳转

This commit is contained in:
shiziyuan9527 2021-03-23 11:40:52 +08:00
parent 6be8af57a3
commit 39f48e3583
5 changed files with 19 additions and 4 deletions

View File

@ -306,9 +306,12 @@
or test_case.num like CONCAT('%', #{request.name},'%') or test_case.num like CONCAT('%', #{request.name},'%')
or test_case.tags like CONCAT('%', #{request.name},'%')) or test_case.tags like CONCAT('%', #{request.name},'%'))
</if> </if>
<if test="request.createTime >0"> <if test="request.relevanceCreateTime >0">
and test_case.id in (select test_case_id from test_case_test where test_case_test.create_time >= #{request.createTime}) and test_case.id in (select test_case_id from test_case_test where test_case_test.create_time >= #{request.createTime})
</if> </if>
<if test="request.createTime >0">
and test_case.create_time >= #{request.createTime}
</if>
<if test="request.nodeIds != null and request.nodeIds.size() > 0"> <if test="request.nodeIds != null and request.nodeIds.size() > 0">
and test_case.node_id in and test_case.node_id in
<foreach collection="request.nodeIds" item="nodeId" separator="," open="(" close=")"> <foreach collection="request.nodeIds" item="nodeId" separator="," open="(" close=")">

View File

@ -24,8 +24,10 @@ public class QueryTestCaseRequest extends BaseQueryRequest {
private String reviewId; private String reviewId;
private boolean isSelectThisWeedData = false; private boolean isSelectThisWeedData = false;
private boolean isSelectThisWeedRelevanceData = false;
private String caseCoverage; private String caseCoverage;
private long createTime = 0; private long createTime = 0;
private long relevanceCreateTime = 0;
} }

View File

@ -210,13 +210,19 @@ public class TestCaseService {
*/ */
private void initRequest(QueryTestCaseRequest request, boolean checkThisWeekData) { private void initRequest(QueryTestCaseRequest request, boolean checkThisWeekData) {
if (checkThisWeekData) { if (checkThisWeekData) {
Map<String, Date> weekFirstTimeAndLastTime = DateUtils.getWeedFirstTimeAndLastTime(new Date());
Date weekFirstTime = weekFirstTimeAndLastTime.get("firstTime");
if (request.isSelectThisWeedData()) { if (request.isSelectThisWeedData()) {
Map<String, Date> weekFirstTimeAndLastTime = DateUtils.getWeedFirstTimeAndLastTime(new Date());
Date weekFirstTime = weekFirstTimeAndLastTime.get("firstTime");
if (weekFirstTime != null) { if (weekFirstTime != null) {
request.setCreateTime(weekFirstTime.getTime()); request.setCreateTime(weekFirstTime.getTime());
} }
} }
if (request.isSelectThisWeedRelevanceData()) {
if (weekFirstTime != null) {
request.setRelevanceCreateTime(weekFirstTime.getTime());
}
}
} }
} }

View File

@ -409,11 +409,15 @@ export default {
getData() { getData() {
this.getSelectDataRange(); this.getSelectDataRange();
this.condition.selectThisWeedData = false; this.condition.selectThisWeedData = false;
this.condition.selectThisWeedRelevanceData = false;
this.condition.caseCoverage = null; this.condition.caseCoverage = null;
switch (this.selectDataRange) { switch (this.selectDataRange) {
case 'thisWeekCount': case 'thisWeekCount':
this.condition.selectThisWeedData = true; this.condition.selectThisWeedData = true;
break; break;
case 'thisWeekRelevanceCount':
this.condition.selectThisWeedRelevanceData = true;
break;
case 'uncoverage': case 'uncoverage':
this.condition.caseCoverage = 'uncoverage'; this.condition.caseCoverage = 'uncoverage';
break; break;

View File

@ -40,7 +40,7 @@
<el-row> <el-row>
<el-col> <el-col>
{{$t('api_test.home_page.api_details_card.this_week_add')}} {{$t('api_test.home_page.api_details_card.this_week_add')}}
<el-link type="info" @click="redirectPage('thisWeekCount')" target="_blank" style="color: #000000">{{relevanceCountData.thisWeekAddedCount}} <el-link type="info" @click="redirectPage('thisWeekRelevanceCount')" target="_blank" style="color: #000000">{{relevanceCountData.thisWeekAddedCount}}
</el-link> </el-link>
{{$t('api_test.home_page.unit_of_measurement')}} {{$t('api_test.home_page.unit_of_measurement')}}
</el-col> </el-col>