|
@@ -2,9 +2,12 @@ package com.github.zuihou.business.util;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.github.zuihou.business.externalApi.dto.ManualInfo;
|
|
|
+import com.github.zuihou.business.productionResourceCenter.entity.ProductionresourcePosition;
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
+import static java.util.stream.Collectors.toList;
|
|
|
+
|
|
|
/**
|
|
|
* 手动模式下参数组装
|
|
|
*/
|
|
@@ -196,7 +199,7 @@ public class ManualTaskOperatorUtil {
|
|
|
* @param manualInfo
|
|
|
* @return
|
|
|
*/
|
|
|
- public static Map<String,Object> judgeProcessInfo(ArrayList<String> taskNodes, ManualInfo manualInfo){
|
|
|
+ public static Map<String,Object> judgeProcessInfo(ArrayList<String> taskNodes, ManualInfo manualInfo, List<ProductionresourcePosition> productionresourcePositions){
|
|
|
String unit = manualInfo.getDeviceUnit();
|
|
|
String manualType = manualInfo.getManualIdType();
|
|
|
Map<String,Object> processInfo = new HashMap<String,Object>();
|
|
@@ -230,23 +233,26 @@ public class ManualTaskOperatorUtil {
|
|
|
setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
|
|
|
}else if("put".equals(taskType) && currentIndex == 2){
|
|
|
String hostSyetemTaskUrl = hostSyetemUrl + "/api/SendIntelligenceUnit";
|
|
|
- String location = manualInfo.getStartpointId();
|
|
|
+ productionresourcePositions = productionresourcePositions.stream().filter(p->null == p.getGoodsId()).collect(toList());
|
|
|
+
|
|
|
+ String location = productionresourcePositions.get(0).getStorgeId().toString();
|
|
|
setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
|
|
|
}else if("move".equals(taskType) && currentIndex == 3){
|
|
|
String hostSyetemTaskUrl = hostSyetemUrl + "/api/MoveRobotPosition";
|
|
|
-
|
|
|
// 查找设备机器人
|
|
|
+ productionresourcePositions = productionresourcePositions.stream().filter(p->null == p.getGoodsId()).collect(toList());
|
|
|
|
|
|
-
|
|
|
- String location = manualInfo.getStartpointId();
|
|
|
+ String location = manualInfo.getEndpointId();
|
|
|
setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
|
|
|
}if("get".equals(taskType) && currentIndex == 4){
|
|
|
String hostSyetemTaskUrl = hostSyetemUrl + "/api/GetIntelligenceUnit";
|
|
|
- String location = manualInfo.getStartpointId();
|
|
|
+ productionresourcePositions = productionresourcePositions.stream().filter(p->null != p.getGoodsId()).collect(toList());
|
|
|
+
|
|
|
+ String location = productionresourcePositions.get(0).getStorgeId().toString();
|
|
|
setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
|
|
|
}else if("put".equals(taskType) && currentIndex == 5){
|
|
|
String hostSyetemTaskUrl = hostSyetemUrl + "/api/SendIntelligenceUnit";
|
|
|
- String location = manualInfo.getStartpointId();
|
|
|
+ String location = manualInfo.getEndpointId();
|
|
|
setProcessInfo(taskNodes, processInfo, hostSyetemTaskUrl, location, deviceUrl, devicePort);
|
|
|
}
|
|
|
manualInfo.setNextTaskNodeIndex(nextTaskNodeIndex);
|