diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java index 127fb79..ad7bbf6 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java @@ -122,16 +122,22 @@ public class CurrTaskDetServiceImpl extends BaseService implements CurrTaskDetSe while (iterator.hasNext()){ CurrTaskDet currTaskDet = iterator.next(); CurrTaskVo byId = currTaskService.getCurrTask(IdParam.builder().id(currTaskDet.getCurrTaskId()).build()); + if (byId.getStatus()==2){ + iterator.remove(); + continue; + } //如果加工类型是复加工,或者任务作废。移除对象 if (byId.getProcessType().equals(2) || byId.getValid() != 1) { iterator.remove(); + continue; } //如果是多步骤任务且不是第一步,移除对象 if (byId.getIsAuto()==1){ AutoExeTask autoExeTask = autoExeTaskServiceBiz.getById(byId.getAutoExeTaskId()); if (!byId.getId().equals(autoExeTask.getFTaskId())){ iterator.remove(); + continue; } } } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java index 40df0d4..37498f0 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/service/impl/CurrTaskServiceImpl.java @@ -473,6 +473,13 @@ public class CurrTaskServiceImpl extends BaseService implements CurrTaskService autoExeTaskServiceBiz.removeById(currTask.getAutoExeTaskId()); for (CurrTask currTask1:currTaskList ) { + InStockInfo inStockInfo = inStockInfoServiceBiz.getOne(new QueryWrapper().eq(InStockInfo.TASK_ID, currTask1.getId())); + if (inStockInfo!=null){ + Location location = locationServiceBiz.getById(inStockInfo.getLocationId()); + location.setStatus(0); + locationServiceBiz.updateById(location); + inStockInfoServiceBiz.removeById(inStockInfo); + } currTaskDetServiceBiz.remove(new QueryWrapper().eq(CurrTaskDet.CURR_TASK_ID,currTask1.getId())); currTaskServiceBiz.removeById(currTask1); } diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/AsynRunTaskService.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/AsynRunTaskService.java index cb99be1..07b421a 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/AsynRunTaskService.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/AsynRunTaskService.java @@ -203,7 +203,7 @@ public class AsynRunTaskService extends BaseService { Integer status = sendTaskToRgv(vehicleId, currTaskId, startPoint, endPoint, currTask.getPlcValue()); //执行成功,托盘进炉 if (status == 1) { - + logger.info(String.valueOf(status)); logger.info("===执行任务:" + currTaskId + " ,车辆搬运任务,车辆:" + vehicleId + " ,起点:" + startPoint + " ,终点:" + endPoint + "任务执行成功==="); //更新调度表状态为完成 runTask.setUpdateTime(LocalDateTime.now()); @@ -317,6 +317,7 @@ public class AsynRunTaskService extends BaseService { Long endPoint = pointInfoServiceBiz.getOne(new QueryWrapper().eq(PointInfo.NOTE, runTask.getEndPosition())).getCode(); Integer status = sendTaskToRgv(vehicleId, currTaskId, startPoint, endPoint, currTask.getPlcValue()); if (status == 1) { + logger.info(String.valueOf(status)); logger.info("===执行任务:" + currTaskId + " ,车辆搬运任务,车辆:" + vehicleId + " ,起点:" + startPoint + " ,终点:" + endPoint + "任务执行成功==="); //更新关系表状态为完成 runTask.setUpdateTime(LocalDateTime.now()); @@ -416,6 +417,7 @@ public class AsynRunTaskService extends BaseService { Long endPoint = pointInfoServiceBiz.getOne(new QueryWrapper().eq(PointInfo.NOTE, runTask.getEndPosition())).getCode(); Integer status = sendTaskToRgv(vehicleId, currTaskId, startPoint, endPoint, currTask.getPlcValue()); if (status == 1) { + logger.info(String.valueOf(status)); logger.info("===执行任务:" + currTaskId + " ,车辆搬运任务,车辆:" + vehicleId + " ,起点:" + startPoint + " ,终点:" + endPoint + "任务执行成功==="); //更新关系表状态为完成 runTask.setUpdateTime(LocalDateTime.now()); @@ -550,6 +552,7 @@ public class AsynRunTaskService extends BaseService { Integer status = sendTaskToRgv(vehicleId, 0L, startPoint, endPoint, 0); logger.info(status.toString()); if (status == 1) { + logger.info(String.valueOf(status)); logger.info("===执行任务出库任务,车辆搬运任务,车辆:" + vehicleId + " ,起点:" + startPoint + " ,终点:" + endPoint + "任务执行成功==="); //更新调度任务表状态为完成 runTask.setUpdateTime(LocalDateTime.now()); @@ -649,6 +652,7 @@ public class AsynRunTaskService extends BaseService { Long endPoint = pointInfoServiceBiz.getOne(new QueryWrapper().eq(PointInfo.NOTE, runTask.getEndPosition())).getCode(); Integer status = sendTaskToRgv(vehicleId, 0L, startPoint, endPoint, 0); if (status == 1) { + logger.info(String.valueOf(status)); logger.info("===执行任务出库任务,车辆搬运任务,车辆:" + vehicleId + " ,起点:" + startPoint + " ,终点:" + endPoint + "任务执行成功==="); //更新调度任务表状态为完成 runTask.setUpdateTime(LocalDateTime.now()); diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/ScheduledTask.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/ScheduledTask.java index 78dbb55..c31a751 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/ScheduledTask.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/ScheduledTask.java @@ -582,6 +582,10 @@ public class ScheduledTask extends BaseService { logger.info("加工炉"+kilnInfo.getCode()+"readyIn为"+kilnReadyIn.toString()+" allowIn为"+kilnAllowIn.toString()); logger.info("缓存区等待队列第一位:"+inStockInfo.toString()); CurrTask currTask = currTaskServiceBiz.getById(inStockInfo.getTaskId()); + if (currTask.getStatus()!=0){ + logger.info(inStockInfo.toString()+"该缓存对应的任务状态为:"+currTask.getStatus()+"不能发起任务。"); + webSocketServer.sendtoUser(inStockInfo.getLocationName()+"对应的缓存加工任务状态不为未加工,不能发起任务,请先确认任务状态!","1"); + } Location location = locationServiceBiz.getById(inStockInfo.getLocationId()); //是否有小车在运行 List vehicleInfoList = vehicleInfoServiceBiz.list(new QueryWrapper().eq(VehicleInfo.STATUS, 1)); diff --git a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/TaskDistanceUtils.java b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/TaskDistanceUtils.java index 5671384..d00341f 100644 --- a/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/TaskDistanceUtils.java +++ b/6.program/wms-empty/src/main/java/com/mt/wms/empty/task/TaskDistanceUtils.java @@ -121,10 +121,10 @@ public class TaskDistanceUtils { if (otherNowPosition>=minDistance&&otherNowPosition<=maxDistance){ return true; }else { - if (Math.abs(otherNowPosition-maxDistance)<2){ + if (Math.abs(otherNowPosition-maxDistance)<3.5){ return true; } - if (Math.abs(otherNowPosition-minDistance)<2){ + if (Math.abs(otherNowPosition-minDistance)<3.5){ return true; } return false;