|
|
|
|
@@ -91,7 +91,7 @@ public class AsynRunTaskService extends BaseService {
|
|
|
|
|
VehicleInfo vehicle = vehicleInfoServiceBiz.getById(vehicleId);
|
|
|
|
|
List<CurrTaskDet> currTaskDetList = currTaskDetServiceBiz.list(new QueryWrapper<CurrTaskDet>().eq(CurrTaskDet.CURR_TASK_ID, currTask));
|
|
|
|
|
//检查车辆是否冲突,冲突则避让
|
|
|
|
|
rgvStatus(vehicleId, currTask);
|
|
|
|
|
rgvStatus(vehicleId, currTask,currTask.getStartPosition(),currTask.getTargetPosition());
|
|
|
|
|
//新建一条执行任务的关系表存放任务执行信息
|
|
|
|
|
RunTask runTask = new RunTask();
|
|
|
|
|
runTask.setTaskId(currTask.getId());
|
|
|
|
|
@@ -180,7 +180,7 @@ public class AsynRunTaskService extends BaseService {
|
|
|
|
|
CurrTask currTask = currTaskServiceBiz.getById(currTaskId);
|
|
|
|
|
VehicleInfo vehicle = vehicleInfoServiceBiz.getById(vehicleId);List<CurrTaskDet> currTaskDetList = currTaskDetServiceBiz.list(new QueryWrapper<CurrTaskDet>().eq(CurrTaskDet.CURR_TASK_ID, currTask));
|
|
|
|
|
//检查车辆是否冲突,冲突则避让
|
|
|
|
|
rgvStatus(vehicleId, currTask);
|
|
|
|
|
rgvStatus(vehicleId, currTask,location.getCode(),currTask.getTargetPosition());
|
|
|
|
|
//新建一条执行任务的关系表存放任务执行信息
|
|
|
|
|
RunTask runTask = new RunTask();
|
|
|
|
|
runTask.setTaskId(currTask.getId());
|
|
|
|
|
@@ -280,7 +280,7 @@ public class AsynRunTaskService extends BaseService {
|
|
|
|
|
//Location location = locationServiceBiz.getById(currTask.getLocationId());
|
|
|
|
|
VehicleInfo vehicle = vehicleInfoServiceBiz.getById(vehicleId);
|
|
|
|
|
//检查车辆是否冲突,冲突则避让
|
|
|
|
|
rgvStatus(vehicleId, currTask);
|
|
|
|
|
rgvStatus(vehicleId, currTask,currTask.getStartPosition(),location.getCode());
|
|
|
|
|
//新建一条执行任务的关系表存放任务执行信息,终点为缓存区空闲库位
|
|
|
|
|
RunTask runTask = new RunTask();
|
|
|
|
|
runTask.setTaskId(currTask.getId());
|
|
|
|
|
@@ -367,8 +367,9 @@ public class AsynRunTaskService extends BaseService {
|
|
|
|
|
public void asynRunTaskForKilnToWarehouse(Long currTaskId, Long vehicleId) throws IOException {
|
|
|
|
|
CurrTask currTask = currTaskServiceBiz.getById(currTaskId);
|
|
|
|
|
VehicleInfo vehicle = vehicleInfoServiceBiz.getById(vehicleId);
|
|
|
|
|
Location location = locationServiceBiz.getOne(new QueryWrapper<Location>().eq(Location.CODE, currTask.getOutTargetPosition()));
|
|
|
|
|
//检查车辆是否冲突,冲突则避让
|
|
|
|
|
rgvStatus(vehicleId, currTask);
|
|
|
|
|
rgvStatus(vehicleId, currTask,currTask.getStartPosition(),location.getCode());
|
|
|
|
|
//新建一条执行任务的关系表存放任务执行信息,终点为缓存区空闲库位
|
|
|
|
|
RunTask runTask = new RunTask();
|
|
|
|
|
runTask.setTaskId(currTask.getId());
|
|
|
|
|
@@ -379,7 +380,7 @@ public class AsynRunTaskService extends BaseService {
|
|
|
|
|
runTask.setEndPosition(currTask.getOutTargetPosition());
|
|
|
|
|
runTaskServiceBiz.save(runTask);
|
|
|
|
|
//更新 location 表对应库位状态为占用
|
|
|
|
|
Location location = locationServiceBiz.getOne(new QueryWrapper<Location>().eq(Location.CODE, currTask.getOutTargetPosition()));
|
|
|
|
|
|
|
|
|
|
location.setStatus(1);
|
|
|
|
|
location.setUpdateTime(LocalDateTime.now());
|
|
|
|
|
locationServiceBiz.updateById(location);
|
|
|
|
|
@@ -1337,7 +1338,7 @@ public class AsynRunTaskService extends BaseService {
|
|
|
|
|
* @param currTask
|
|
|
|
|
* @throws IOException
|
|
|
|
|
*/
|
|
|
|
|
private void rgvStatus(Long vehicleId,CurrTask currTask) throws IOException {
|
|
|
|
|
private void rgvStatus(Long vehicleId,CurrTask currTask,String startPosition,String targetPosition) throws IOException {
|
|
|
|
|
Long currTaskId = currTask.getId();
|
|
|
|
|
if (vehicleId==1){
|
|
|
|
|
Long anotherVehicleId=2L;
|
|
|
|
|
@@ -1346,7 +1347,7 @@ public class AsynRunTaskService extends BaseService {
|
|
|
|
|
//获取RGV2当前位置
|
|
|
|
|
Double rgv2CurrPosition = RGVCurrPosition(2);
|
|
|
|
|
//两辆小车是否冲突
|
|
|
|
|
Boolean conflictBoolean = taskDistanceUtils.conflictForVehicle(vehicleId, currTask.getStartPosition(), currTask.getTargetPosition(), rgv2CurrPosition);
|
|
|
|
|
Boolean conflictBoolean = taskDistanceUtils.conflictForVehicle(vehicleId, startPosition, targetPosition, rgv2CurrPosition);
|
|
|
|
|
if (conflictBoolean){
|
|
|
|
|
Integer status = moveRgv(2, currTaskId, 2,0);
|
|
|
|
|
if (status!=1){
|
|
|
|
|
|