|
|
@@ -49,7 +49,6 @@ public class ApiStockTask {
|
|
|
public static List<AgvThread> runAgvThread = new CopyOnWriteArrayList<>();
|
|
|
public static List<RailAgvThread> runRailAgvThread = new CopyOnWriteArrayList<>();
|
|
|
public static Map<String, RollerThread> runRollerThread = new ConcurrentHashMap<>();
|
|
|
- public static volatile boolean isStop = false;
|
|
|
public static Map<String, LiftPlcHelper> liftPlcHelpTask = new ConcurrentHashMap<>();
|
|
|
public static Map<String, RmsTaskPool> lastLiftTask = new ConcurrentHashMap<>();
|
|
|
public static Map<Long, Long> waitTaskTime = new ConcurrentHashMap<>();
|
|
|
@@ -80,7 +79,6 @@ public class ApiStockTask {
|
|
|
|
|
|
private boolean isLock = false;
|
|
|
private int checkLiftStatus = 1;
|
|
|
- private int stopWaitNum = 1;
|
|
|
private String erpSysOpen;
|
|
|
|
|
|
@PostConstruct
|
|
|
@@ -195,9 +193,6 @@ public class ApiStockTask {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(isStop){
|
|
|
- throw new Exception(rmsTaskPool.getTaskName() + "任务锁定");
|
|
|
- }
|
|
|
}catch (Exception ex){
|
|
|
log.error("AGV任务异常:" + ex.getMessage());
|
|
|
String msg = "AGV任务异常:" + ex.getMessage();
|
|
|
@@ -304,9 +299,6 @@ public class ApiStockTask {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(isStop){
|
|
|
- throw new Exception(rmsTaskPool.getTaskName() + "任务锁定");
|
|
|
- }
|
|
|
}catch (Exception ex){
|
|
|
log.error("轨道AGV任务异常:" + ex.getMessage());
|
|
|
String msg = "轨道AGV任务异常:" + ex.getMessage();
|
|
|
@@ -556,9 +548,6 @@ public class ApiStockTask {
|
|
|
}
|
|
|
//=========================debug================
|
|
|
|
|
|
- if(isStop){
|
|
|
- throw new Exception(taskPool.getTaskName() + "任务锁定");
|
|
|
- }
|
|
|
}catch (Exception e){
|
|
|
log.error("轨道车执行:" + e.getMessage());
|
|
|
String msg = "轨道车执行异常:" + e.getMessage();
|
|
|
@@ -971,37 +960,27 @@ public class ApiStockTask {
|
|
|
private boolean checkLockTaskPool(RmsTaskPool pool){
|
|
|
List<String> groupCodeList = apiCache.getOrSetRedis(ApiCache.ERROR_POOL, null, 0);
|
|
|
for(String groupCode:groupCodeList){
|
|
|
- List<String> errorLiftList = rmsTaskPoolService.getGroupDevice(groupCode);
|
|
|
- if(errorLiftList.contains(pool.getLiftCode())){
|
|
|
+ List<String> errorDeviceList = rmsTaskPoolService.getGroupDevice(groupCode);
|
|
|
+ if(errorDeviceList.contains(pool.getLiftCode())){
|
|
|
return false;
|
|
|
}
|
|
|
- if(errorLiftList.contains(DeviceTypeEnum.ROLLERAGV.getKey())
|
|
|
- && pool.getDeviceType().equals(String.valueOf(DeviceTypeEnum.ROLLERAGV.getValue()))){
|
|
|
- return false;
|
|
|
+ for(DeviceTypeEnum type : DeviceTypeEnum.values()){
|
|
|
+ if(errorDeviceList.contains(type.getKey())
|
|
|
+ && pool.getDeviceType().equals(String.valueOf(type.getValue()))){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
- if(groupCodeList.size() == 0){
|
|
|
- isStop = false;
|
|
|
- }
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
private int checkErrorTaskPool(RmsTaskPool taskPool, Queue<RmsTaskPool> queue) throws InterruptedException {
|
|
|
- if(isStop){
|
|
|
- log.info("锁定状态,需要手动处理");
|
|
|
- boolean rs = checkLockTaskPool(taskPool);
|
|
|
- if(!rs){
|
|
|
- stopWaitNum = 1;
|
|
|
- rmsWebSocketServer.sendToUI("lift",DateUtils.getTime() + " "+"异常中,等待处理!");
|
|
|
- log.info(taskPool.getTaskId() + "锁定");
|
|
|
- }else{
|
|
|
- stopWaitNum++;
|
|
|
- }
|
|
|
- if(stopWaitNum < 10){
|
|
|
- return 2;
|
|
|
- }
|
|
|
+ boolean rs = checkLockTaskPool(taskPool);
|
|
|
+ if(!rs){
|
|
|
+ rmsWebSocketServer.sendToUI("lift",DateUtils.getTime() + " "+"异常中,等待处理!");
|
|
|
+ log.info(taskPool.getTaskId() + " 所属设备异常中,等待处理");
|
|
|
+ return 2;
|
|
|
}
|
|
|
- stopWaitNum = 1;
|
|
|
return checkTaskPool(taskPool, queue);
|
|
|
}
|
|
|
|