出库bug修改
This commit is contained in:
李广豪 2022-08-04 15:11:22 +08:00
parent 4c731348d4
commit 5d9ce09137

View File

@ -484,13 +484,15 @@ public class AsynRunTaskService extends BaseService {
Boolean conflictBoolean = taskDistanceUtils.conflictForVehicle(vehicleId, kilnInfo.getCode(), yeyaTaiCode, rgv2CurrPosition); Boolean conflictBoolean = taskDistanceUtils.conflictForVehicle(vehicleId, kilnInfo.getCode(), yeyaTaiCode, rgv2CurrPosition);
if (conflictBoolean) { if (conflictBoolean) {
Integer status = moveRgv(2, 1L, 2, 0); Integer status = moveRgv(2, 1L, 2, 0);
logger.info(status.toString());
if (status != 1) { if (status != 1) {
logger.info("===执行出库任务时车辆位置冲突,执行车辆位移任务,车辆" + vehicleId + "移动到点位39,执行失败==="); logger.info("===执行出库任务时车辆位置冲突,执行车辆位移任务,车辆" + anotherVehicleId + "移动到点位2,执行失败===");
// 2022/3/6 websocket通知页面 // 2022/3/6 websocket通知页面
webSocketServer.sendtoAll(LocalDateTime.now() + "执行出库任务时车辆位置冲突,执行车辆位移任务,车辆" + vehicleId + "移动到点位39执行失败"); webSocketServer.sendtoAll(LocalDateTime.now() + "执行出库任务时车辆位置冲突,执行车辆位移任务,车辆" + anotherVehicleId + "移动到点位2执行失败");
return; }else {
logger.info("===执行任务出库任务时车辆位置冲突,执行车辆位移任务,车辆" + anotherVehicleId + "移动到点位2执行成功===");
} }
logger.info("===执行任务出库任务时车辆位置冲突,执行车辆位移任务,车辆" + vehicleId + "移动到点位39执行成功===");
} }
} else { } else {
logger.info("RGV2不在线跳过检测是否避让。"); logger.info("RGV2不在线跳过检测是否避让。");
@ -502,16 +504,17 @@ public class AsynRunTaskService extends BaseService {
//获取RGV1当前位置 //获取RGV1当前位置
Double rgv1CurrPosition = RGVCurrPosition(1); Double rgv1CurrPosition = RGVCurrPosition(1);
//两辆小车是否冲突 //两辆小车是否冲突
Boolean conflictBoolean = taskDistanceUtils.conflictForVehicle(vehicleId, kilnInfo.getCode(), yeyaTaiCode, rgv1CurrPosition); Boolean conflictBoolean = taskDistanceUtils.conflictForVehicle(2L, kilnInfo.getCode(), yeyaTaiCode, rgv1CurrPosition);
if (conflictBoolean) { if (conflictBoolean) {
Integer status = moveRgv(1, 1L, 12, 0); Integer status = moveRgv(1, 1L, 12, 0);
logger.info(status.toString());
if (status != 1) { if (status != 1) {
logger.info("===执行任务出库任务时车辆位置冲突,执行车辆位移任务,车辆" + vehicleId + "移动到点位1,执行失败==="); logger.info("===执行任务出库任务时车辆位置冲突,执行车辆位移任务,车辆" + 1 + "移动到点位12,执行失败===");
// 2022/3/6 websocket通知页面 // 2022/3/6 websocket通知页面
webSocketServer.sendtoAll(LocalDateTime.now() + "执行出库任务时车辆位置冲突,执行车辆位移任务,车辆" + vehicleId + "移动到点位1执行失败"); webSocketServer.sendtoAll(LocalDateTime.now() + "执行出库任务时车辆位置冲突,执行车辆位移任务,车辆" + 1 + "移动到点位12执行失败");
return; }else {
logger.info("===执行任务出库任务时车辆位置冲突,执行车辆位移任务,车辆" + 1 + "移动到点位12执行成功===");
} }
logger.info("===执行任务出库任务时车辆位置冲突,执行车辆位移任务,车辆" + vehicleId + "移动到点位1执行成功===");
} }
} else { } else {
logger.info("RGV1不在线跳过检测是否避让。"); logger.info("RGV1不在线跳过检测是否避让。");
@ -528,6 +531,7 @@ public class AsynRunTaskService extends BaseService {
Long startPoint = pointInfoServiceBiz.getOne(new QueryWrapper<PointInfo>().eq(PointInfo.NOTE, runTask.getStartPosition())).getCode(); Long startPoint = pointInfoServiceBiz.getOne(new QueryWrapper<PointInfo>().eq(PointInfo.NOTE, runTask.getStartPosition())).getCode();
Long endPoint = pointInfoServiceBiz.getOne(new QueryWrapper<PointInfo>().eq(PointInfo.NOTE, runTask.getEndPosition())).getCode(); Long endPoint = pointInfoServiceBiz.getOne(new QueryWrapper<PointInfo>().eq(PointInfo.NOTE, runTask.getEndPosition())).getCode();
Integer status = sendTaskToRgv(vehicleId, 0L, startPoint, endPoint, 0); Integer status = sendTaskToRgv(vehicleId, 0L, startPoint, endPoint, 0);
logger.info(status.toString());
if (status == 1) { if (status == 1) {
logger.info("===执行任务出库任务,车辆搬运任务,车辆:" + vehicleId + " ,起点:" + startPoint + " ,终点:" + endPoint + "任务执行成功==="); logger.info("===执行任务出库任务,车辆搬运任务,车辆:" + vehicleId + " ,起点:" + startPoint + " ,终点:" + endPoint + "任务执行成功===");
//更新调度任务表状态为完成 //更新调度任务表状态为完成
@ -556,7 +560,6 @@ public class AsynRunTaskService extends BaseService {
runTaskServiceBiz.updateById(runTask); runTaskServiceBiz.updateById(runTask);
logger.info("任务 " + runTask.getTaskCode() + " 车辆从加工炉到提升平台过程中失败。"); logger.info("任务 " + runTask.getTaskCode() + " 车辆从加工炉到提升平台过程中失败。");
logger.info("===执行任务出库任务,车辆搬运任务,车辆:" + vehicleId + " ,起点:" + startPoint + " ,终点:" + endPoint + "任务执行失败==="); logger.info("===执行任务出库任务,车辆搬运任务,车辆:" + vehicleId + " ,起点:" + startPoint + " ,终点:" + endPoint + "任务执行失败===");
System.out.println("===执行任务出库任务,车辆搬运任务,车辆:" + vehicleId + " ,起点:" + startPoint + " ,终点:" + endPoint + "任务执行失败===");
// 2021/12/14 websocket推送到前端 // 2021/12/14 websocket推送到前端
webSocketServer.sendtoAll("出库任务车辆从加工炉到提升平台过程中失败。"); webSocketServer.sendtoAll("出库任务车辆从加工炉到提升平台过程中失败。");
} }