|
@@ -17,6 +17,7 @@ import com.auth0.jwt.algorithms.Algorithm;
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
+import com.google.common.base.Strings;
|
|
|
import com.malk.server.aliwork.YDConf;
|
|
|
import com.malk.server.aliwork.YDParam;
|
|
|
import com.malk.server.common.McR;
|
|
@@ -44,11 +45,7 @@ import org.springframework.stereotype.Service;
|
|
|
import java.io.*;
|
|
|
import java.net.HttpURLConnection;
|
|
|
import java.net.URL;
|
|
|
-import java.net.URLEncoder;
|
|
|
-import java.nio.file.Files;
|
|
|
import java.util.*;
|
|
|
-import java.util.regex.Matcher;
|
|
|
-import java.util.regex.Pattern;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
@@ -82,24 +79,16 @@ public class LingmingguangziServiceImpl implements LingmingguangziService {
|
|
|
|
|
|
private static final Long EXPIRES_IN = 7200000L;
|
|
|
|
|
|
- private static final String TASK_URL_PREFIX = "https://www.teambition.com/project/65bb53546a74a42e2d608f05/tasks/view/65bb5354a0d7b85bc253f863/task/";
|
|
|
+ private static final String TASK_URL_PREFIX = "https://www.teambition.com/task/";
|
|
|
|
|
|
- private static final Map<String,String> STAGES = new HashMap<>();
|
|
|
-
|
|
|
- private static final Map<String,String> TAGS = new HashMap<>();
|
|
|
+ private static final List<String> STAGES = new ArrayList<>();
|
|
|
|
|
|
static {
|
|
|
- STAGES.put("666fff1ec8e7e2eaab75bd81", "TR评审");//TR评审
|
|
|
- STAGES.put("666fff1ebe648654141a5b8b", "TO评审");//TR评审
|
|
|
- STAGES.put("666fff6fa0f1ab8063960627", "EV评审");//EV评审
|
|
|
- STAGES.put("666fff883a26df9ebce13918", "DV评审");//DV评审
|
|
|
- STAGES.put("666fffd4976f23a2d7cf13e1", "PV评审");//PV评审
|
|
|
- STAGES.put("666ffff2592db27f2d342d02", "MP评审");//MP评审
|
|
|
-
|
|
|
- TAGS.put("667002dff456184e9dc794a4", "消费(必选)");//消费(必选)
|
|
|
- TAGS.put("6670028d536f774f09d300f5", "消费(可选)");//消费(可选)
|
|
|
- TAGS.put("6670027cb986d723e63be2a5", "车载(必选)");//车载(必选)
|
|
|
- TAGS.put("667002667e0222a2169802dc", "车载(可选)");//车载(可选)
|
|
|
+ STAGES.add("TR/TO阶段");
|
|
|
+ STAGES.add("EV产品开发验证");
|
|
|
+ STAGES.add("DV过程开发验证");
|
|
|
+ STAGES.add("PV量产爬坡验证");
|
|
|
+ STAGES.add("MP大批量生产");
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -237,8 +226,8 @@ public class LingmingguangziServiceImpl implements LingmingguangziService {
|
|
|
if (Objects.nonNull(formData.get("selectField_lwpqbm82"))){
|
|
|
String makCustomerType = formData.get("selectField_lwpqbm82").toString();
|
|
|
switch (makCustomerType){
|
|
|
- case "001": body.put("makCustomerType", "001");break;
|
|
|
- case "002":body.put("makCustomerType", "002");break;
|
|
|
+ case "内销": body.put("makCustomerType", "001");break;
|
|
|
+ case "外销":body.put("makCustomerType", "002");break;
|
|
|
}
|
|
|
}
|
|
|
//备注
|
|
@@ -442,31 +431,33 @@ public class LingmingguangziServiceImpl implements LingmingguangziService {
|
|
|
}).collect(Collectors.toList());
|
|
|
//附件
|
|
|
List<Map> list2 = (List<Map>) formData.get("tableField_ly8fxusx");
|
|
|
- List<Map> makSoFilesList = list2.stream().map(map1 -> {
|
|
|
- Map detail = new HashMap();
|
|
|
- String fileType = getString(map1.get("selectField_m0ls7yb8"));
|
|
|
- if (fileType.equals("合同")){
|
|
|
- detail.put("fileType","D1_CONTRACT");
|
|
|
- }else {
|
|
|
- detail.put("fileType","D2_TECHNICAL_DOC");
|
|
|
- }
|
|
|
- List<Map> fileList = (List<Map>) JSONArray.parse(String.valueOf(map1.get("attachmentField_ly8fxusz")));
|
|
|
- String ydDownloadUrl = fileList.get(0).get("downloadUrl").toString();
|
|
|
- String fileName = fileList.get(0).get("name").toString();
|
|
|
- //将downloadurl下载到本地
|
|
|
- try {
|
|
|
- downloadFile(ydDownloadUrl, filePath + fileName);
|
|
|
- System.out.println("文件下载成功!");
|
|
|
- } catch (IOException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- //上传附件
|
|
|
- detail.put("files",postWithFile(erpUrl + "pws/sys/common/upload",filePath + fileName));
|
|
|
- return detail;
|
|
|
- }).collect(Collectors.toList());
|
|
|
-
|
|
|
+ if (Objects.nonNull(list2)){
|
|
|
+ List<Map> makSoFilesList = list2.stream().map(map1 -> {
|
|
|
+ Map detail = new HashMap();
|
|
|
+ String fileType = getString(map1.get("selectField_m0ls7yb8"));
|
|
|
+ if (fileType.equals("合同")){
|
|
|
+ detail.put("fileType","D1_CONTRACT");
|
|
|
+ }else {
|
|
|
+ detail.put("fileType","D2_TECHNICAL_DOC");
|
|
|
+ }
|
|
|
+ List<Map> fileList = (List<Map>) JSONArray.parse(String.valueOf(map1.get("attachmentField_ly8fxusz")));
|
|
|
+ String ydDownloadUrl = fileList.get(0).get("downloadUrl").toString();
|
|
|
+ String fileName = fileList.get(0).get("name").toString();
|
|
|
+ //将downloadurl下载到本地
|
|
|
+ try {
|
|
|
+ downloadFile(ydDownloadUrl, filePath + fileName);
|
|
|
+ System.out.println("文件下载成功!");
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ //上传附件
|
|
|
+ detail.put("files",postWithFile(erpUrl + "pws/sys/common/upload",filePath + fileName));
|
|
|
+ return detail;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ body.put("makSoFilesList",makSoFilesList);
|
|
|
+ }
|
|
|
body.put("makSoDetailList",makSoDetailList);
|
|
|
- body.put("makSoFilesList",makSoFilesList);
|
|
|
+
|
|
|
|
|
|
Map res = post(erpUrl + "pws/mak/makSalesOrder/add", null, getHeader(), body);
|
|
|
String orderCode = getString(res.get("result"));
|
|
@@ -566,31 +557,34 @@ public class LingmingguangziServiceImpl implements LingmingguangziService {
|
|
|
}).collect(Collectors.toList());
|
|
|
//附件
|
|
|
List<Map> list2 = (List<Map>) formData.get("tableField_ly8fxusx");
|
|
|
- List<Map> makSoFilesList = list2.stream().map(map1 -> {
|
|
|
- Map detail = new HashMap();
|
|
|
- String fileType = getString(map1.get("selectField_m0ls7yb8"));
|
|
|
- if (fileType.equals("合同")){
|
|
|
- detail.put("fileType","D1_CONTRACT");
|
|
|
- }else {
|
|
|
- detail.put("fileType","D2_TECHNICAL_DOC");
|
|
|
- }
|
|
|
- List<Map> fileList = (List<Map>) JSONArray.parse(String.valueOf(map1.get("attachmentField_ly8fxusz")));
|
|
|
- String ydDownloadUrl = fileList.get(0).get("downloadUrl").toString();
|
|
|
- String fileName = fileList.get(0).get("name").toString();
|
|
|
- //将downloadurl下载到本地
|
|
|
- try {
|
|
|
- downloadFile(ydDownloadUrl, filePath + fileName);
|
|
|
- System.out.println("文件下载成功!");
|
|
|
- } catch (IOException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- //上传附件
|
|
|
- detail.put("files",postWithFile(erpUrl + "pws/sys/common/upload",filePath + fileName));
|
|
|
- return detail;
|
|
|
- }).collect(Collectors.toList());
|
|
|
+ if (Objects.nonNull(list2)){
|
|
|
+ List<Map> makSoFilesList = list2.stream().map(map1 -> {
|
|
|
+ Map detail = new HashMap();
|
|
|
+ String fileType = getString(map1.get("selectField_m0ls7yb8"));
|
|
|
+ if (fileType.equals("合同")){
|
|
|
+ detail.put("fileType","D1_CONTRACT");
|
|
|
+ }else {
|
|
|
+ detail.put("fileType","D2_TECHNICAL_DOC");
|
|
|
+ }
|
|
|
+ List<Map> fileList = (List<Map>) JSONArray.parse(String.valueOf(map1.get("attachmentField_ly8fxusz")));
|
|
|
+ String ydDownloadUrl = fileList.get(0).get("downloadUrl").toString();
|
|
|
+ String fileName = fileList.get(0).get("name").toString();
|
|
|
+ //将downloadurl下载到本地
|
|
|
+ try {
|
|
|
+ downloadFile(ydDownloadUrl, filePath + fileName);
|
|
|
+ System.out.println("文件下载成功!");
|
|
|
+ } catch (IOException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ //上传附件
|
|
|
+ detail.put("files",postWithFile(erpUrl + "pws/sys/common/upload",filePath + fileName));
|
|
|
+ return detail;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ body.put("makSoFilesList",makSoFilesList);
|
|
|
+ }
|
|
|
|
|
|
body.put("makSoDetailList",makSoDetailList);
|
|
|
- body.put("makSoFilesList",makSoFilesList);
|
|
|
+
|
|
|
|
|
|
Map res = put(erpUrl + "pws/mak/makSalesOrder/change", null, getHeader(), body);
|
|
|
|
|
@@ -754,84 +748,169 @@ public class LingmingguangziServiceImpl implements LingmingguangziService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public McR getTbStageDetails(String stageName) {
|
|
|
- Map<String, Object> result = new HashMap<>();
|
|
|
- //查询子任务信息
|
|
|
- for (String stage : STAGES.keySet()) {
|
|
|
- if (STAGES.get(stage).equals(stageName)){
|
|
|
- Map<String,Object> stageDetail = new HashMap<>();
|
|
|
- TBR tbr = (TBR) UtilHttp.doGet("https://open.teambition.com/api/v3/task/query", initHeaderToken(), UtilMap.map("parentTaskId", stage), TBR.class);
|
|
|
- List<Map<String, Object>> task = (List<Map<String, Object>>) tbr.getResult();
|
|
|
- List<Map<String, Object>> list = new ArrayList<>();
|
|
|
- for (Map<String,Object> subTask : task) {
|
|
|
- Map<String,Object> taskDetail = new HashMap<>();
|
|
|
- String content = subTask.get("content").toString();
|
|
|
- taskDetail.put("content", content);
|
|
|
- taskDetail.put("url", TASK_URL_PREFIX + subTask.get("id"));
|
|
|
- //查询子任务状态
|
|
|
- String tfsId = subTask.get("tfsId").toString();
|
|
|
- TBR tbr3 = (TBR) UtilHttp.doGet("https://open.teambition.com/api/v3/project/65bb53546a74a42e2d608f05/taskflowstatus/search", initHeaderToken(), UtilMap.map("tfsIds",tfsId), TBR.class);
|
|
|
- List<Map<String, Object>> result3 = (List<Map<String, Object>>) tbr3.getResult();
|
|
|
- String state = result3.get(0).get("name").toString();
|
|
|
- taskDetail.put("state", state);
|
|
|
-
|
|
|
- List<Map<String,Object>> customfields = (List<Map<String,Object>>) subTask.get("customfields");
|
|
|
- taskDetail.put("dept", "");
|
|
|
- taskDetail.put("part", "");
|
|
|
- taskDetail.put("area", "");
|
|
|
- taskDetail.put("file", "");
|
|
|
- taskDetail.put("file2", "");
|
|
|
- if (!customfields.isEmpty()){
|
|
|
- for (Map<String, Object> customfield : customfields) {
|
|
|
- String cfId = customfield.get("cfId").toString();
|
|
|
- List<Map<String, Object>> value = (List<Map<String, Object>>) customfield.get("value");
|
|
|
- if (!value.isEmpty()){
|
|
|
- String title = value.get(0).get("title").toString();
|
|
|
- switch (cfId){
|
|
|
- case "666feed723d86af4c9c9f3c6":taskDetail.put("dept", title);break;//责任部门/角色
|
|
|
- case "666fef0f5b836a19902b47bf":taskDetail.put("part", title);break;//评审要素
|
|
|
- case "666fef06cdcac0bbc164930e":taskDetail.put("area", title);break;//评审领域
|
|
|
- case "668def21d56d44adafe00d56":taskDetail.put("file", title);break;//交付件
|
|
|
- case "668df08b82ff76cefacfec99":taskDetail.put("file2", title);break;//交付件2
|
|
|
- }
|
|
|
+ public McR getTbStageDetails(String projectName,String stageName) {
|
|
|
+ Map<String,Object> stageDetail = new HashMap<>();
|
|
|
+ //根据项目名称获取项目id
|
|
|
+ if (Strings.isNullOrEmpty(projectName)){
|
|
|
+ return McR.errorParam("项目名称不能为空!");
|
|
|
+ }
|
|
|
+ TBR projectTbr = (TBR) UtilHttp.doGet("https://open.teambition.com/api/v3/project/query", initHeaderToken(), UtilMap.map("name", projectName), TBR.class);
|
|
|
+ List<Map> projectList = (List<Map>) projectTbr.getResult();
|
|
|
+ if (projectList.isEmpty()){
|
|
|
+ return McR.errorParam("项目名称不存在!");
|
|
|
+ }
|
|
|
+ Map projectMap = projectList.get(0);
|
|
|
+ String projectId = projectMap.get("id").toString();
|
|
|
+
|
|
|
+ //搜索项目自定义字段
|
|
|
+ TBR cfTbr = (TBR) UtilHttp.doGet("https://open.teambition.com/api/v3/project/"+projectId+"/customfield/search", initHeaderToken(), null, TBR.class);
|
|
|
+ List<Map> cfList = (List<Map>) cfTbr.getResult();
|
|
|
+ Map<String,String> cfMap = new HashMap<>();
|
|
|
+ cfList.forEach(cf -> {
|
|
|
+ String name = cf.get("name").toString();
|
|
|
+ switch (name){
|
|
|
+ case "责任部门/角色":
|
|
|
+ cfMap.put(cf.get("id").toString(),"dept");
|
|
|
+ break;
|
|
|
+ case "评审领域":
|
|
|
+ cfMap.put(cf.get("id").toString(),"area");
|
|
|
+ break;
|
|
|
+ case "评审要素":
|
|
|
+ cfMap.put(cf.get("id").toString(),"part");
|
|
|
+ break;
|
|
|
+ case "交付件":
|
|
|
+ cfMap.put(cf.get("id").toString(),"file");
|
|
|
+ break;
|
|
|
+ case "交付件2":
|
|
|
+ cfMap.put(cf.get("id").toString(),"file2");
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ //搜索项目标签
|
|
|
+ TBR tagTbr = (TBR) UtilHttp.doGet("https://open.teambition.com/api/v3/project/"+projectId+"/tag/search", initHeaderToken(), null, TBR.class);
|
|
|
+ List<Map> tagResult = (List<Map>) tagTbr.getResult();
|
|
|
+ Map<String,String> tagMap = new HashMap<>();
|
|
|
+ tagResult.forEach(tag -> tagMap.put(tag.get("id").toString(),tag.get("name").toString()));
|
|
|
+
|
|
|
+ //搜索任务列表
|
|
|
+ TBR stageTbr = (TBR) UtilHttp.doGet("https://open.teambition.com/api/v3/project/"+projectId+"/stage/search", initHeaderToken(), null, TBR.class);
|
|
|
+ List<Map> stageList = (List<Map>) stageTbr.getResult();
|
|
|
+ Map<String,String> stageMap = new HashMap<>();
|
|
|
+ for (Map stage : stageList) {
|
|
|
+ String name = stage.get("name").toString().replaceAll("\\s+","");
|
|
|
+ if (STAGES.contains(name)){
|
|
|
+ stageMap.put(stage.get("id").toString(),name);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //子任务工作流状态
|
|
|
+ Map<String,String> subTaskState = new HashMap<>();
|
|
|
+
|
|
|
+ //查询父任务详情
|
|
|
+ for (String stageId : stageMap.keySet()) {
|
|
|
+ TBR parentTaskTbr = (TBR) UtilHttp.doGet("https://open.teambition.com/api/v3/project/" + projectId + "/task/query", initHeaderToken(), UtilMap.map("q", "stageId = " + stageId + " AND taskLayer = onlyTopLevel"), TBR.class);
|
|
|
+ List<Map> parentTaskList = (List<Map>) parentTaskTbr.getResult();
|
|
|
+ for (Map parentTask : parentTaskList) {
|
|
|
+ String content = parentTask.get("content").toString();
|
|
|
+ String parentTaskId = "";
|
|
|
+ if (stageName.equals(content) || ("Tape Out评审".equals(content) && "TO评审".equals(stageName))){
|
|
|
+ parentTaskId = parentTask.get("id").toString();
|
|
|
+ //查询子任务信息
|
|
|
+
|
|
|
+ TBR tbr = (TBR) UtilHttp.doGet("https://open.teambition.com/api/v3/task/query", initHeaderToken(), UtilMap.map("parentTaskId", parentTaskId), TBR.class);
|
|
|
+ List<Map<String, Object>> task = (List<Map<String, Object>>) tbr.getResult();
|
|
|
+ List<Map<String, Object>> list = new ArrayList<>();
|
|
|
+ boolean flag = true;
|
|
|
+ for (Map<String,Object> subTask : task) {
|
|
|
+ //获取子任务工作流状态(一个项目同级子任务的工作流id一样 查询一次)
|
|
|
+ if (flag){
|
|
|
+ String sfcId = subTask.get("sfcId").toString();//任务类型id
|
|
|
+ //查询任务类型
|
|
|
+ TBR sfcTbr = (TBR) UtilHttp.doGet("https://open.teambition.com/api/v3/project/"+projectId+"/scenariofieldconfig/search", initHeaderToken(), UtilMap.map("sfcIds", sfcId), TBR.class);
|
|
|
+ List<Map> sfcList = (List<Map>) sfcTbr.getResult();
|
|
|
+ String taskFlowId = sfcList.get(0).get("taskflowId").toString();//工作流id
|
|
|
+ //获取工作流下所有状态节点信息
|
|
|
+ TBR tfTbr = (TBR) UtilHttp.doGet("https://open.teambition.com/api/v3/project/"+projectId+"/taskflowstatus/search", initHeaderToken(), UtilMap.map("tfIds", taskFlowId), TBR.class);
|
|
|
+ List<Map> tfList = (List<Map>) tfTbr.getResult();
|
|
|
+ for (Map tf : tfList) {
|
|
|
+ String name = tf.get("name").toString();
|
|
|
+ String tfsId = tf.get("id").toString();
|
|
|
+ subTaskState.put(tfsId, name);
|
|
|
}
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
|
|
|
+ Map<String,Object> taskDetail = new HashMap<>();
|
|
|
+ String content2 = subTask.get("content").toString();
|
|
|
+ taskDetail.put("content", content2);
|
|
|
+ taskDetail.put("url", TASK_URL_PREFIX + subTask.get("id"));
|
|
|
+
|
|
|
+ String tfsId = subTask.get("tfsId").toString();//工作流状态id
|
|
|
+ taskDetail.put("state", subTaskState.get(tfsId));//任务状态
|
|
|
+
|
|
|
+ List<Map<String,Object>> customfields = (List<Map<String,Object>>) subTask.get("customfields");
|
|
|
+ taskDetail.put("dept", "");
|
|
|
+ taskDetail.put("part", "");
|
|
|
+ taskDetail.put("area", "");
|
|
|
+ taskDetail.put("file", "");
|
|
|
+ taskDetail.put("file2", "");
|
|
|
+ if (!customfields.isEmpty()){
|
|
|
+ for (Map<String, Object> customfield : customfields) {
|
|
|
+ String cfId = customfield.get("cfId").toString();
|
|
|
+ if (cfMap.containsKey(cfId)){
|
|
|
+ String cfName = cfMap.get(cfId);
|
|
|
+ List<Map<String, Object>> value = (List<Map<String, Object>>) customfield.get("value");
|
|
|
+ if (!value.isEmpty()){
|
|
|
+ String title = value.get(0).get("title").toString();
|
|
|
+ taskDetail.put(cfName, title);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- taskDetail.put("carTag", "");
|
|
|
- taskDetail.put("payTag", "");
|
|
|
- List<String> tagIds = (List<String>) subTask.get("tagIds");
|
|
|
- if (!tagIds.isEmpty()){
|
|
|
- for (String tagId : tagIds) {
|
|
|
- if (TAGS.containsKey(tagId)) {
|
|
|
- if (TAGS.get(tagId).contains("车载")){
|
|
|
- taskDetail.put("carTag", TAGS.get(tagId).substring(3,5));
|
|
|
- }else if (TAGS.get(tagId).contains("消费")){
|
|
|
- taskDetail.put("payTag", TAGS.get(tagId).substring(3,5));
|
|
|
+ taskDetail.put("carTag", "");
|
|
|
+ taskDetail.put("payTag", "");
|
|
|
+ List<String> tagIds = (List<String>) subTask.get("tagIds");
|
|
|
+ if (!tagIds.isEmpty()){
|
|
|
+ for (String tagId : tagIds) {
|
|
|
+ if (tagMap.containsKey(tagId)) {
|
|
|
+ if (tagMap.get(tagId).contains("车载")){
|
|
|
+ taskDetail.put("carTag", tagMap.get(tagId).substring(3,5));
|
|
|
+ }else if (tagMap.get(tagId).contains("消费")){
|
|
|
+ taskDetail.put("payTag", tagMap.get(tagId).substring(3,5));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ list.add(taskDetail);
|
|
|
}
|
|
|
|
|
|
- list.add(taskDetail);
|
|
|
- }
|
|
|
+ //获取父任务工作流状态
|
|
|
+ TBR tbr2 = (TBR) UtilHttp.doGet("https://open.teambition.com/api/v3/task/query", initHeaderToken(), UtilMap.map("taskId", parentTaskId), TBR.class);
|
|
|
+ List<Map<String, Object>> result2 = (List<Map<String, Object>>) tbr2.getResult();
|
|
|
+ String sfcId = result2.get(0).get("sfcId").toString();
|
|
|
+ String tfsId = result2.get(0).get("tfsId").toString();
|
|
|
|
|
|
- //获取任务状态
|
|
|
- TBR tbr2 = (TBR) UtilHttp.doGet("https://open.teambition.com/api/v3/task/query", initHeaderToken(), UtilMap.map("taskId", stage), TBR.class);
|
|
|
- List<Map<String, Object>> result2 = (List<Map<String, Object>>) tbr2.getResult();
|
|
|
- String tfsId = result2.get(0).get("tfsId").toString();
|
|
|
+ TBR tbr3 = (TBR) UtilHttp.doGet("https://open.teambition.com/api/v3/project/"+projectId+"/scenariofieldconfig/search", initHeaderToken(), UtilMap.map("sfcIds", sfcId), TBR.class);
|
|
|
+ List<Map<String, Object>> result3 = (List<Map<String, Object>>) tbr3.getResult();
|
|
|
+ String taskflowId = result3.get(0).get("taskflowId").toString();
|
|
|
|
|
|
- TBR tbr3 = (TBR) UtilHttp.doGet("https://open.teambition.com/api/v3/project/65bb53546a74a42e2d608f05/taskflowstatus/search", initHeaderToken(), UtilMap.map("tfsIds", tfsId), TBR.class);
|
|
|
- List<Map<String, Object>> result3 = (List<Map<String, Object>>) tbr3.getResult();
|
|
|
- String state = result3.get(0).get("name").toString();
|
|
|
+ TBR tbr4 = (TBR) UtilHttp.doGet("https://open.teambition.com/api/v3/project/" + projectId + "/taskflowstatus/search", initHeaderToken(), UtilMap.map("tfIds", taskflowId), TBR.class);
|
|
|
+ List<Map<String, Object>> result4 = (List<Map<String, Object>>) tbr4.getResult();
|
|
|
+ result4.forEach(tf -> {
|
|
|
+ if (tf.get("id").toString().equals(tfsId)){
|
|
|
+ stageDetail.put("state", tf.get("name").toString());
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
- stageDetail.put("list",list);
|
|
|
- stageDetail.put("state", state);
|
|
|
- result.put(STAGES.get(stage), stageDetail);
|
|
|
+ stageDetail.put("list",list);
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- return McR.success(result);
|
|
|
+
|
|
|
+ return McR.success(stageDetail);
|
|
|
}
|
|
|
|
|
|
private Map<String, String> initHeaderToken() {
|