From 2def9c889f5ab5d9f1fcaebe16746dbab3778518 Mon Sep 17 00:00:00 2001 From: lgh Date: Wed, 21 Sep 2022 10:56:32 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E5=AE=89=E5=85=A8=E8=B7=9D=E7=A6=BB?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9B=20=E7=BC=93=E5=AD=98=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E8=BF=9B=E7=82=89=E5=89=8D=E6=A0=A1=E9=AA=8C=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E7=8A=B6=E6=80=81=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mt/wms/empty/service/impl/CurrTaskDetServiceImpl.java | 6 ++++++ .../main/java/com/mt/wms/empty/task/AsynRunTaskService.java | 6 +++++- .../src/main/java/com/mt/wms/empty/task/ScheduledTask.java | 4 ++++ .../main/java/com/mt/wms/empty/task/TaskDistanceUtils.java | 4 ++-- 4 files changed, 17 insertions(+), 3 deletions(-) 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/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;