Commit 93487f5f authored by 高滢's avatar 高滢

Merge remote-tracking branch 'origin/master'

parents f9cc2211 e746da10
package com.ruoyi.domain.vo;
import lombok.Data;
import java.util.List;
/**
* 标准要求VO
*/
@Data
public class StandardNewVO {
// 标准要求id
private String id;
// 标准要求章节号
private String serialNumber;
// 标准要求
private String requirements;
// 用例VO
List<UseCaseNewVO> useCases;
}
package com.ruoyi.domain.vo;
import lombok.Data;
/**
* 测试用例VO
*/
@Data
public class UseCaseNewVO {
// 用例id
private String id;
// 用例编号
private String customizedID;
// 用例描述
private String description;
}
...@@ -7,6 +7,8 @@ import com.ruoyi.domain.vo.UseCaseUrlVO; ...@@ -7,6 +7,8 @@ import com.ruoyi.domain.vo.UseCaseUrlVO;
import com.ruoyi.web.request.TestUseCaseByScenarioRequest; import com.ruoyi.web.request.TestUseCaseByScenarioRequest;
import com.ruoyi.web.request.TestUseCaseIdListRequest; import com.ruoyi.web.request.TestUseCaseIdListRequest;
import com.ruoyi.web.request.TestUserCaseRequest; import com.ruoyi.web.request.TestUserCaseRequest;
import com.ruoyi.web.response.TestStandardListResponse;
import com.ruoyi.web.response.TestUserCaseListNewResponse;
import com.ruoyi.web.response.TestUserCaseListResponse; import com.ruoyi.web.response.TestUserCaseListResponse;
import com.ruoyi.web.response.UseCaseResponse; import com.ruoyi.web.response.UseCaseResponse;
...@@ -81,4 +83,20 @@ public interface TestUseCaseService extends IService<TestUseCase> { ...@@ -81,4 +83,20 @@ public interface TestUseCaseService extends IService<TestUseCase> {
* @throws IOException * @throws IOException
*/ */
List<String> selectCaseListByScenario(String request) throws IOException; List<String> selectCaseListByScenario(String request) throws IOException;
/**
* 科恩获取测试用例新
* @param request
* @return
* @throws IOException
*/
TestUserCaseListNewResponse getUseCaseListNew(String request) throws IOException;
/**
* 科恩获取测试标准要求
* @param request
* @return
* @throws IOException
*/
TestStandardListResponse getStandardList(String request) throws IOException;
} }
...@@ -178,6 +178,7 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha ...@@ -178,6 +178,7 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
if(task.getTaskResult().equals(ReviewSceneChangeTaskUserRelation.DECISION_PASS)) { if(task.getTaskResult().equals(ReviewSceneChangeTaskUserRelation.DECISION_PASS)) {
// 更新审核标准 // 更新审核标准
reviewSceneService.change(task); reviewSceneService.change(task);
// TODO 评审通过修改标准版本号,每月第一天次数从1开始
//场景变更时发送信息 //场景变更时发送信息
if (Objects.equals(task.getOperationSort(), "ADD_SCENE") || Objects.equals(task.getOperationSort(), "DELETE_SCENE")) { if (Objects.equals(task.getOperationSort(), "ADD_SCENE") || Objects.equals(task.getOperationSort(), "DELETE_SCENE")) {
...@@ -521,6 +522,7 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha ...@@ -521,6 +522,7 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
public List<SysUser> getReviewList() { public List<SysUser> getReviewList() {
// 获取用户ID列表 // 获取用户ID列表
List<Long> reviewerIdList = sysUserRoleMapper.selectReviewerIdByRoleId(ReviewSceneChangeTask.REVIEW_ROLE_ID); List<Long> reviewerIdList = sysUserRoleMapper.selectReviewerIdByRoleId(ReviewSceneChangeTask.REVIEW_ROLE_ID);
System.out.println(reviewerIdList + "========");
// 获取用户列表 // 获取用户列表
List<SysUser> reviewerList = sysUserService.selectUserListByIds(reviewerIdList); List<SysUser> reviewerList = sysUserService.selectUserListByIds(reviewerIdList);
......
...@@ -113,6 +113,8 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask ...@@ -113,6 +113,8 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
// 4. 修改任务状态为 SIGNED 待签字 // 4. 修改任务状态为 SIGNED 待签字
systemReviewTask.setTaskStatus(SystemReviewTask.STATUS_SIGNED); systemReviewTask.setTaskStatus(SystemReviewTask.STATUS_SIGNED);
// TODO setsystemReviewTask.version的值,根据任务的standardId从t_standard表查到current_version的值
// 5. 设置问卷结果 // 5. 设置问卷结果
if (reviewDetailsResultMapper.findNotPass(systemReviewTask.getId()) > 0) { if (reviewDetailsResultMapper.findNotPass(systemReviewTask.getId()) > 0) {
systemReviewTask.setTaskResult("REJECT"); systemReviewTask.setTaskResult("REJECT");
......
...@@ -10,6 +10,8 @@ import com.ruoyi.mapper.TestUseCaseMapper; ...@@ -10,6 +10,8 @@ import com.ruoyi.mapper.TestUseCaseMapper;
import com.ruoyi.web.request.TestUseCaseByScenarioRequest; import com.ruoyi.web.request.TestUseCaseByScenarioRequest;
import com.ruoyi.web.request.TestUseCaseIdListRequest; import com.ruoyi.web.request.TestUseCaseIdListRequest;
import com.ruoyi.web.request.TestUserCaseRequest; import com.ruoyi.web.request.TestUserCaseRequest;
import com.ruoyi.web.response.TestStandardListResponse;
import com.ruoyi.web.response.TestUserCaseListNewResponse;
import com.ruoyi.web.response.TestUserCaseListResponse; import com.ruoyi.web.response.TestUserCaseListResponse;
import com.ruoyi.web.response.UseCaseResponse; import com.ruoyi.web.response.UseCaseResponse;
import lombok.Data; import lombok.Data;
...@@ -270,6 +272,87 @@ public class TestUseCaseServiceImpl extends ServiceImpl<TestUseCaseMapper, TestU ...@@ -270,6 +272,87 @@ public class TestUseCaseServiceImpl extends ServiceImpl<TestUseCaseMapper, TestU
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
/**
* 科恩获取测试用例新
* @param request
* @return
* @throws IOException
*/
@Override
public TestUserCaseListNewResponse getUseCaseListNew(String request) throws IOException {
TestUserCaseListNewResponse userCaseResponse = new TestUserCaseListNewResponse();
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/json");
// 创建请求体
RequestBody body = RequestBody.create(mediaType, "{\"query\":\"query regulationAllUseCases($offset:OffsetConnectionInput$name: String!){regulationByName(name:$name){items(offset:$offset){ nodes{id serialNumber requirements useCases{id customizedID description}}totalCount}}}\",\"variables\":"+ request +"}");
Request requestKE = new Request.Builder()
.url("http://10.12.48.80:8089/api/query")
.method("POST", body)
.addHeader("Content-Type", "application/json")
// TODO 连接
.addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjAsInRva2VuaWQiOjYxLCJ0eXBlIjoiYXBpIiwidXNlcm5hbWUiOiJhZG1pbiJ9.48Ggjx-FtOcecf73vAHn0XglwgLXZlfXxhXiLDHWWQE")
// .addHeader("Host", "10.12.48.80:8089")
// .addHeader("Origin", "http://10.12.48.80:8089")
// .addHeader("Referer", "http://10.12.48.80:8089/api/graphql/playground")
// .addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36")
.build();
Response response = client.newCall(requestKE).execute();
String string = response.body().string();
JSONObject jsonObject = JSONObject.parseObject(string);
// 获取测试用例
List<StandardNewVO> list = jsonObject.getJSONObject("data").getJSONObject("regulationByName").getJSONObject("items").getList("nodes", StandardNewVO.class);
userCaseResponse.setUseCases(list);
// 获取总条数
Integer totalCount = (Integer) jsonObject.getJSONObject("data").getJSONObject("regulationByName").getJSONObject("items").get("totalCount");
userCaseResponse.setTotalCount(totalCount);
return userCaseResponse;
}
@Override
public TestStandardListResponse getStandardList(String request) throws IOException {
TestStandardListResponse standardListResponse = new TestStandardListResponse();
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/json");
// 创建请求体
RequestBody body = RequestBody.create(mediaType, "{\"query\":\"query regulationItems($name:String!$offset:OffsetConnectionInput$orderBy:OrderByInput$searchFields:Map){regulationByName(name:$name){items(offset:$offset orderBy:$orderBy searchFields:$searchFields){totalCount nodes{id serialNumber requirements}}}}\",\"variables\":"+ request +"}");
Request requestKE = new Request.Builder()
.url("http://10.12.48.80:8089/api/query")
.method("POST", body)
.addHeader("Content-Type", "application/json")
// TODO 连接
.addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjAsInRva2VuaWQiOjYxLCJ0eXBlIjoiYXBpIiwidXNlcm5hbWUiOiJhZG1pbiJ9.48Ggjx-FtOcecf73vAHn0XglwgLXZlfXxhXiLDHWWQE")
// .addHeader("Host", "10.12.48.80:8089")
// .addHeader("Origin", "http://10.12.48.80:8089")
// .addHeader("Referer", "http://10.12.48.80:8089/api/graphql/playground")
// .addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36")
.build();
Response response = client.newCall(requestKE).execute();
String string = response.body().string();
JSONObject jsonObject = JSONObject.parseObject(string);
// 获取测试用例
List<StandardNewVO> list = jsonObject.getJSONObject("data").getJSONObject("regulationByName").getJSONObject("items").getList("nodes", StandardNewVO.class);
standardListResponse.setStandards(list);
// 获取总条数
Integer totalCount = (Integer) jsonObject.getJSONObject("data").getJSONObject("regulationByName").getJSONObject("items").get("totalCount");
standardListResponse.setTotalCount(totalCount);
return standardListResponse;
}
} }
......
...@@ -8,6 +8,8 @@ import com.ruoyi.service.TestUseCaseService; ...@@ -8,6 +8,8 @@ import com.ruoyi.service.TestUseCaseService;
import com.ruoyi.web.request.TestUseCaseByScenarioRequest; import com.ruoyi.web.request.TestUseCaseByScenarioRequest;
import com.ruoyi.web.request.TestUseCaseIdListRequest; import com.ruoyi.web.request.TestUseCaseIdListRequest;
import com.ruoyi.web.request.TestUserCaseRequest; import com.ruoyi.web.request.TestUserCaseRequest;
import com.ruoyi.web.response.TestStandardListResponse;
import com.ruoyi.web.response.TestUserCaseListNewResponse;
import com.ruoyi.web.response.TestUserCaseListResponse; import com.ruoyi.web.response.TestUserCaseListResponse;
import com.ruoyi.web.response.UseCaseResponse; import com.ruoyi.web.response.UseCaseResponse;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -83,13 +85,33 @@ public class TestUserCaseController extends BaseController{ ...@@ -83,13 +85,33 @@ public class TestUserCaseController extends BaseController{
@ApiOperation("查询测试用例分页查询(科恩)") @ApiOperation("查询测试用例分页查询(科恩)")
@Trace @Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")}) @Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/getUseCaseList", produces="application/json;charset=UTF-8") @RequestMapping(method = RequestMethod.POST, value = "/getUseCaseListOld", produces="application/json;charset=UTF-8")
public R<TestUserCaseListResponse> getUseCaseList(@Validated @RequestBody String request) throws IOException { public R<TestUserCaseListResponse> getUseCaseListOld(@Validated @RequestBody String request) throws IOException {
return R.ok(testUseCaseService.getUseCaseList(request)); return R.ok(testUseCaseService.getUseCaseList(request));
} }
@ApiOperation("查询测试用例(科恩)新")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/getUseCaseList", produces="application/json;charset=UTF-8")
public R<TestUserCaseListNewResponse> getUseCaseList(@Validated @RequestBody String request) throws IOException {
return R.ok(testUseCaseService.getUseCaseListNew(request));
}
@ApiOperation("查询测试标准要求(科恩)")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/getStandardList", produces="application/json;charset=UTF-8")
public R<TestStandardListResponse> getStandardList(@Validated @RequestBody String request) throws IOException {
return R.ok(testUseCaseService.getStandardList(request));
}
/** /**
* 科恩获取首页信息 * 科恩获取首页信息
......
package com.ruoyi.web.response;
import com.ruoyi.domain.vo.StandardNewVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@ApiModel(value = "TestUserCaseListResponse", description = "查询测试用例")
@Data
public class TestStandardListResponse {
@ApiModelProperty("测试标准要求")
List<StandardNewVO> standards;
@ApiModelProperty("总条数")
Integer totalCount;
}
package com.ruoyi.web.response;
import com.ruoyi.domain.vo.StandardNewVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@ApiModel(value = "TestUserCaseListResponse", description = "查询测试用例")
@Data
public class TestUserCaseListNewResponse {
@ApiModelProperty("测试用例")
List<StandardNewVO> useCases;
@ApiModelProperty("总条数")
Integer totalCount;
}
...@@ -62,7 +62,6 @@ ...@@ -62,7 +62,6 @@
SELECT sct.*, sctu.decision FROM t_review_scene_change_task sct SELECT sct.*, sctu.decision FROM t_review_scene_change_task sct
LEFT JOIN t_review_scene_change_task_user_relation sctu ON sct.id = sctu.task_id LEFT JOIN t_review_scene_change_task_user_relation sctu ON sct.id = sctu.task_id
WHERE sctu.user_id = #{userId} and sctu.decision IS NULL and sctu.role_id = 103 WHERE sctu.user_id = #{userId} and sctu.decision IS NULL and sctu.role_id = 103
and sct.innovation_base_result = 'PASS'
<if test="request.operationSort != null and request.operationSort != ''"> <if test="request.operationSort != null and request.operationSort != ''">
and sct.operation_sort = #{request.operationSort} and sct.operation_sort = #{request.operationSort}
</if> </if>
...@@ -82,7 +81,6 @@ ...@@ -82,7 +81,6 @@
SELECT sct.*, sctu.decision FROM t_review_scene_change_task sct SELECT sct.*, sctu.decision FROM t_review_scene_change_task sct
LEFT JOIN t_review_scene_change_task_user_relation sctu ON sct.id = sctu.task_id LEFT JOIN t_review_scene_change_task_user_relation sctu ON sct.id = sctu.task_id
WHERE sctu.user_id = #{userId} and sctu.decision IS NOT NULL and sctu.role_id = 103 WHERE sctu.user_id = #{userId} and sctu.decision IS NOT NULL and sctu.role_id = 103
and sct.innovation_base_result = 'PASS'
<if test="request.operationSort != null and request.operationSort != ''"> <if test="request.operationSort != null and request.operationSort != ''">
and sct.operation_sort = #{request.operationSort} and sct.operation_sort = #{request.operationSort}
</if> </if>
...@@ -101,7 +99,7 @@ ...@@ -101,7 +99,7 @@
<select id="findCreateListByUserId" resultType="com.ruoyi.domain.ReviewSceneChangeTask"> <select id="findCreateListByUserId" resultType="com.ruoyi.domain.ReviewSceneChangeTask">
SELECT * FROM t_review_scene_change_task SELECT * FROM t_review_scene_change_task
WHERE task_initiator_id = #{userId} and innovation_base_result = 'PASS' WHERE task_initiator_id = #{userId}
<if test="request.operationSort != null and request.operationSort != ''"> <if test="request.operationSort != null and request.operationSort != ''">
and operation_sort = #{request.operationSort} and operation_sort = #{request.operationSort}
</if> </if>
......
package com.ruoyi;
import com.alibaba.fastjson2.JSONObject;
import okhttp3.*;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import java.io.IOException;
@SpringBootTest
public class TestUrlUseCase {
@Test
public void test() throws IOException {
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/json");
// 定义查询变量
String variables = "{\n" +
" \"offset\": {\n" +
" \"offset\": 0,\n" +
" \"limit\": 10\n" +
" },\n" +
" \"name\": \"汽车整车信息安全技术要求\"\n" +
"}";
RequestBody body = RequestBody.create(mediaType, "{\"query\":\"query regulationAllUseCases($offset:OffsetConnectionInput$name: String!){regulationByName(name:$name){items(offset:$offset){ nodes{id serialNumber requirements useCases{id customizedID description}}totalCount}}}\",\"variables\":"+ variables +"}");
Request requestKs = new Request.Builder()
.url("http://10.12.48.80:8089/api/query")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjAsInRva2VuaWQiOjYxLCJ0eXBlIjoiYXBpIiwidXNlcm5hbWUiOiJhZG1pbiJ9.48Ggjx-FtOcecf73vAHn0XglwgLXZlfXxhXiLDHWWQE")
.build();
Response response = client.newCall(requestKs).execute();
String string = response.body().string();
JSONObject jsonObject = JSONObject.parseObject(string);
System.out.println("jsonObject = " + jsonObject);
// List<UseCaseUrlVO> list = jsonObject.getJSONObject("data").getJSONObject("useCases").getList("nodes", UseCaseUrlVO.class);
// list.forEach(item -> {
// System.out.println("item = " + item);
// });
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment