|
|
@@ -11,10 +11,7 @@ import org.springframework.context.annotation.Primary;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Optional;
|
|
|
+import java.util.*;
|
|
|
|
|
|
@Primary
|
|
|
@Service
|
|
|
@@ -34,10 +31,10 @@ public class McTbEventImpl implements TBEvent {
|
|
|
String status = data.getString("status");
|
|
|
String nodeId = data.getString("nodeId");
|
|
|
String creatorId = data.getString("creatorId");
|
|
|
- Map task = tbClient.queryTaskDetail(taskId,null,null).get(0);
|
|
|
- if(!"6970a3ff4f887b90bfdbe7e3".equals(String.valueOf(task.get("projectId")))){
|
|
|
- return;
|
|
|
- }
|
|
|
+// Map task = tbClient.queryTaskDetail(taskId,null,null).get(0);
|
|
|
+// if(!"6970a3ff4f887b90bfdbe7e3".equals(String.valueOf(task.get("projectId")))){
|
|
|
+// return;
|
|
|
+// }
|
|
|
// if(!Arrays.asList("622ee3450cf3bb5e1a486f1f","61a9e8a36355609fb6383d40").contains(creatorId)){
|
|
|
// return;
|
|
|
// }
|
|
|
@@ -45,7 +42,7 @@ public class McTbEventImpl implements TBEvent {
|
|
|
List<Map> list=tbClient.queryNodeList(taskId);
|
|
|
Map node = _getNodeDetail(list,nodeId);
|
|
|
if(String.valueOf(node.get("name")).contains("接单")){
|
|
|
- List<String> assigneeIds = UtilMap.getList(node,"assigneeIds");
|
|
|
+ List<String> assigneeIds = UtilMap.getList(node,"assigneeIds");
|
|
|
String startDate = UtilMap.getString(node,"startDate");
|
|
|
String dueDate = UtilMap.getString(node,"dueDate");
|
|
|
Map nextMap=_getNextNode(list,nodeId);
|
|
|
@@ -54,10 +51,25 @@ public class McTbEventImpl implements TBEvent {
|
|
|
tbClient.updateNodeById(taskId,nextId,assigneeIds,startDate,dueDate,creatorId);
|
|
|
}
|
|
|
}
|
|
|
+ }else if(status.equals("begin")){
|
|
|
+ List<Map> list=tbClient.queryNodeList(taskId);
|
|
|
+// Map node = _getNodeDetail(list,nodeId);
|
|
|
+// if(String.valueOf(node.get("name")).contains("接单")){
|
|
|
+ nextNode(taskId,list,nodeId,creatorId);
|
|
|
+// }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void nextNode(String taskId,List<Map> list,String nodeId,String creatorId){
|
|
|
+ Map nextMap=_getNextNode(list,nodeId);
|
|
|
+ if(nextMap!=null){
|
|
|
+ String nextId = UtilMap.getString(nextMap,"id");
|
|
|
+ tbClient.updateNodeById(taskId,nextId,new ArrayList<>(),null,null,creatorId);
|
|
|
+ nextNode(taskId,list,nextId,creatorId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void callBackProject(JSONObject eventJson) {
|
|
|
|