mirror of
https://gitee.com/fit2cloud-feizhiyun/MeterSphere.git
synced 2024-12-04 04:59:48 +08:00
refactor(工作台): 我创建的数据问题
--user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001015938 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001015941
This commit is contained in:
parent
f0973026ec
commit
5a560037b7
@ -652,8 +652,10 @@
|
|||||||
|
|
||||||
<select id="moduleCount" resultType="java.lang.Integer">
|
<select id="moduleCount" resultType="java.lang.Integer">
|
||||||
SELECT count(api_test_case.id) FROM api_test_case
|
SELECT count(api_test_case.id) FROM api_test_case
|
||||||
left join project on api_test_case.project_id = project.id
|
inner join project on api_test_case.project_id = project.id
|
||||||
|
inner JOIN api_definition a ON api_test_case.api_definition_id = a.id
|
||||||
<include refid="criCondition"/>
|
<include refid="criCondition"/>
|
||||||
|
and a.latest is not null
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getRequest" resultType="io.metersphere.api.dto.definition.ApiTestCaseInfo">
|
<select id="getRequest" resultType="io.metersphere.api.dto.definition.ApiTestCaseInfo">
|
||||||
|
@ -13,7 +13,9 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@ -40,10 +42,11 @@ public class WorkstationService {
|
|||||||
apiTestCaseRequest.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
|
apiTestCaseRequest.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
|
||||||
//@see io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml:103
|
//@see io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml:103
|
||||||
Map<String, Object> combine = new HashMap<>(2);
|
Map<String, Object> combine = new HashMap<>(2);
|
||||||
Map<String,String>operatorValue = new HashMap<>(2);
|
Map<String, String> operatorValue = new HashMap<>(2);
|
||||||
operatorValue.put("operator","current user");
|
operatorValue.put("operator", "current user");
|
||||||
operatorValue.put("value","current user");
|
operatorValue.put("value", "current user");
|
||||||
combine.put("creator",operatorValue);
|
combine.put("creator", operatorValue);
|
||||||
|
Map<String, List<String>> filter = new HashMap<>(2);
|
||||||
testPlanRequest.setCombine(combine);
|
testPlanRequest.setCombine(combine);
|
||||||
apiTestCaseRequest.setCombine(combine);
|
apiTestCaseRequest.setCombine(combine);
|
||||||
ApiScenarioRequest apiScenarioRequest = new ApiScenarioRequest();
|
ApiScenarioRequest apiScenarioRequest = new ApiScenarioRequest();
|
||||||
@ -52,17 +55,23 @@ public class WorkstationService {
|
|||||||
QueryTestCaseRequest testCaseRequest = new QueryTestCaseRequest();
|
QueryTestCaseRequest testCaseRequest = new QueryTestCaseRequest();
|
||||||
testCaseRequest.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
|
testCaseRequest.setWorkspaceId(SessionUtils.getCurrentWorkspaceId());
|
||||||
testCaseRequest.setCombine(combine);
|
testCaseRequest.setCombine(combine);
|
||||||
|
List<String> status = new ArrayList<>();
|
||||||
|
status.add("Prepare");
|
||||||
|
status.add("Pass");
|
||||||
|
status.add("UnPass");
|
||||||
|
filter.put("reviewStatus", status);
|
||||||
|
testCaseRequest.setFilters(filter);
|
||||||
//query db
|
//query db
|
||||||
int apiScenarioCaseCount = extApiScenarioMapper.listModule(apiScenarioRequest);
|
int apiScenarioCaseCount = extApiScenarioMapper.listModule(apiScenarioRequest);
|
||||||
int apiTestCaseCount = extApiTestCaseMapper.moduleCount(apiTestCaseRequest);
|
int apiTestCaseCount = extApiTestCaseMapper.moduleCount(apiTestCaseRequest);
|
||||||
int testCaseCount = extTestCaseMapper.moduleCount(testCaseRequest);
|
int testCaseCount = extTestCaseMapper.moduleCount(testCaseRequest);
|
||||||
int loadTestCount = extLoadTestMapper.moduleCount(testPlanRequest);
|
int loadTestCount = extLoadTestMapper.moduleCount(testPlanRequest);
|
||||||
//build result
|
//build result
|
||||||
Map<String, Integer>map = new HashMap<>(4);
|
Map<String, Integer> map = new HashMap<>(4);
|
||||||
map.put("apiScenarioCaseCount",apiScenarioCaseCount);
|
map.put("apiScenarioCaseCount", apiScenarioCaseCount);
|
||||||
map.put("apiTestCaseCount",apiTestCaseCount);
|
map.put("apiTestCaseCount", apiTestCaseCount);
|
||||||
map.put("testCaseCount",testCaseCount);
|
map.put("testCaseCount", testCaseCount);
|
||||||
map.put("loadTestCount",loadTestCount);
|
map.put("loadTestCount", loadTestCount);
|
||||||
return map;
|
return map;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user