|
@@ -302,6 +302,10 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
|
|
|
Map<String, List<TTask>> taskMap = taskList.stream().collect(groupingBy(TTask::getCompleteBatchNo));
|
|
|
|
|
|
List<Long> procedureList = taskList.stream().map(p -> p.getProcedureId()).collect(Collectors.toList());
|
|
|
+ List<BomProcedure> bomProcedureList = bomProcedureService.list(Wraps.<BomProcedure>lbQ().in(BomProcedure::getId, procedureList));
|
|
|
+
|
|
|
+ Map<Long,BomProcedure> bpMap = bomProcedureList.stream().collect(Collectors.toMap(BomProcedure::getId, t->t));
|
|
|
+
|
|
|
//List<AutoNode>autoList = autoNodeService.list(Wraps.<AutoNode>lbQ().in(AutoNode::getProcedureId,procedureList));
|
|
|
//执行任务对应的自动化程序
|
|
|
// AutoNode model = new AutoNode();
|
|
@@ -319,15 +323,18 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
|
|
|
for (String key : taskMap.keySet()) {
|
|
|
int i = 1;
|
|
|
for (TTask t : taskList) {
|
|
|
+
|
|
|
//取出resrouceId
|
|
|
Long resourceBusinessId = t.getResourceBusinessId();
|
|
|
List<ResourceAutoCode> autoCodeList = resourceAutoCodeMap.get(resourceBusinessId);
|
|
|
|
|
|
//查询所有的父节点
|
|
|
- List<ResourceAutoCode>parentResourceAutoCodeList = autoCodeList.stream().filter(a->a.getParentId().longValue()==0L).collect(Collectors.toList());
|
|
|
- for (ResourceAutoCode pautoCode : parentResourceAutoCodeList) {//父节点
|
|
|
+ List<ResourceAutoCode> parentResourceAutoCodeList = autoCodeList.stream().filter(a->a.getParentId().longValue()==0L).collect(Collectors.toList());
|
|
|
+// for (ResourceAutoCode pautoCode : parentResourceAutoCodeList) {//父节点
|
|
|
+ for (int parentCount = 0; parentCount< parentResourceAutoCodeList.size(); parentCount++) { //父节点
|
|
|
+ ResourceAutoCode pautoCode =parentResourceAutoCodeList.get(parentCount);
|
|
|
List<ResourceAutoCode>childResourceAutoCodeList = autoCodeList.stream().filter(a->pautoCode.getId().toString().equals(a.getParentId().toString())).collect(Collectors.toList());
|
|
|
- for (int count = 0; count < childResourceAutoCodeList.size(); count++) {//子节点
|
|
|
+ for (int count = 0; count < childResourceAutoCodeList.size(); count++) { //子节点
|
|
|
ResourceAutoCode autoCode = childResourceAutoCodeList.get(count);
|
|
|
ResourceAutoCode nextAutoCode = null;
|
|
|
if(count < childResourceAutoCodeList.size() -1){
|
|
@@ -377,10 +384,24 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
|
|
|
taskNode.setInterfaceType(DictionaryKey.INTERFACETYPE_WMS);
|
|
|
}
|
|
|
taskNode.setCompleteBatchSort(i);
|
|
|
+
|
|
|
+ if(parentCount == parentResourceAutoCodeList.size() - 1
|
|
|
+ && count == childResourceAutoCodeList.size() - 1){
|
|
|
+ String taskType = bpMap.get(t.getProcedureId()).getType();
|
|
|
+ if("上料".equals(taskType)){
|
|
|
+ taskNode.setNodeType("1");
|
|
|
+ }else if("下料".equals(taskType)){
|
|
|
+ taskNode.setNodeType("2");
|
|
|
+ }else if("翻面".equals(taskType)){
|
|
|
+ taskNode.setNodeType("4");
|
|
|
+ }else{
|
|
|
+ taskNode.setNodeType("0");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
taskNodeList.add(taskNode);
|
|
|
i++;
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
|