Commit bca2cb7e authored by 黎博's avatar 黎博

修改qa_process洗数据

parent d56d16c6
......@@ -75,11 +75,12 @@ public class EffectController {
@GetMapping("/qa/transfer")
public JsonResult transferData() {
String doraemonUrl = "https://doraemon.quantgroups.cn/qa/process/transfer";
List<DingRobot> dingRobotList = dingRobotService.list();
for (DingRobot dingRobot: dingRobotList) {
// String doraemonUrl = "http://localhost:8086/qa/process/transfer";
List<SubmitTestInstruction> submitTestInstructionList = submitTestInstructionService.list();
for (SubmitTestInstruction submitTestInstruction: submitTestInstructionList) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("projectName", dingRobot.getProjectName());
String jiraKey = dingRobot.getJiraProjectKey();
jsonObject.put("projectName", submitTestInstruction.getProjectName());
String jiraKey = submitTestInstruction.getJiraProjectKey();
// 1-toc, 2-tob, 3-金融,4-大数据
int bizLineId;
switch (jiraKey) {
......@@ -105,14 +106,9 @@ public class EffectController {
}
jsonObject.put("businessLineId", bizLineId);
jsonObject.put("jiraKey", jiraKey);
jsonObject.put("dingUrl", dingRobot.getDingUrl());
Integer insId = dingRobot.getSubmitTestInstructionId();
if (insId != null) {
SubmitTestInstruction testInstruction = submitTestInstructionService.getById(insId);
if (testInstruction != null) {
// 服务与分支
List<Map<String, String>> newMapList = new ArrayList<>();
String serviceAndBranch = testInstruction.getServiceAndBranch();
String serviceAndBranch = submitTestInstruction.getServiceAndBranch();
if (!StringUtils.isEmpty(serviceAndBranch)) {
List<Map<String, String>> mapList = JSON.parseObject(serviceAndBranch, List.class);
for (Map<String, String> map: mapList) {
......@@ -127,7 +123,7 @@ public class EffectController {
// apollo
Map<String, Object> apolloMap = new HashMap<>();
String apollo = testInstruction.getApollo();
String apollo = submitTestInstruction.getApollo();
if (!StringUtils.isEmpty(apollo)) {
List<Map<String, String>> oldApolloList = JSON.parseObject(apollo, List.class);
for (Map<String, String> map: oldApolloList) {
......@@ -153,7 +149,7 @@ public class EffectController {
// 数据库
StringBuilder sb = new StringBuilder();
String database = testInstruction.getDatabase();
String database = submitTestInstruction.getDatabase();
if (!StringUtils.isEmpty(database)) {
List<Map<String, String>> dbList = JSON.parseObject(database, List.class);
for (Map<String, String> map: dbList) {
......@@ -163,11 +159,16 @@ public class EffectController {
}
jsonObject.put("databaseUpdate", sb.toString());
jsonObject.put("prodDocument", testInstruction.getRequirement());
jsonObject.put("interfaceDocument", testInstruction.getApi());
jsonObject.put("remark", testInstruction.getScope());
}
}
jsonObject.put("prodDocument", submitTestInstruction.getRequirement());
jsonObject.put("interfaceDocument", submitTestInstruction.getApi());
jsonObject.put("remark", submitTestInstruction.getScope());
jsonObject.put("status", 1);
QueryWrapper<DingRobot> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("submit_test_instruction_id", submitTestInstruction.getId());
DingRobot dingRobot = dingRobotService.getOne(queryWrapper);
if (dingRobot != null) {
jsonObject.put("dingUrl", dingRobot.getDingUrl());
jsonObject.put("env", dingRobot.getNamespace());
jsonObject.put("refuseNum", dingRobot.getRepulseNum());
// 项目状态
......@@ -182,6 +183,7 @@ public class EffectController {
jsonObject.put("status", 3);
}
jsonObject.put("creator", dingRobot.getCreator());
}
String response = HttpClientUtils.doPostJson(doraemonUrl, null, jsonObject.toJSONString());
log.info(response);
......
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