Compare commits
No commits in common. "4c0f84d742e7940b836b35ef276f219f849837cb" and "4c731348d451fa22d7fec29e14a4e45aed9fec38" have entirely different histories.
4c0f84d742
...
4c731348d4
@ -68,8 +68,6 @@ public class CurrTaskController extends BaseController {
|
||||
private CurrTaskServiceBiz currTaskServiceBiz;
|
||||
@Autowired
|
||||
private AutoExeTaskServiceBiz autoExeTaskServiceBiz;
|
||||
@Autowired
|
||||
private TaskDistanceUtils taskDistanceUtils;
|
||||
|
||||
|
||||
@PostMapping(value = "createProcessTask")
|
||||
@ -308,10 +306,9 @@ public class CurrTaskController extends BaseController {
|
||||
}
|
||||
@PostMapping(value = "testRgv")
|
||||
@ApiOperation(value = "测试rgv避让逻辑")
|
||||
private String testRgv(@RequestBody TestRgv testRgv) throws IOException {
|
||||
Long aLong = taskDistanceUtils.chooseVehicle(testRgv.getStartPoint(), testRgv.getEndPoint());
|
||||
Boolean aBoolean = taskDistanceUtils.conflictForVehicle(testRgv.getVehicleId(), testRgv.getStartPoint(), testRgv.getEndPoint(), testRgv.getOtherVehicle());
|
||||
return String.valueOf(aLong)+String.valueOf(aBoolean);
|
||||
private Boolean testRgv(@RequestBody TestRgv testRgv) throws IOException {
|
||||
TaskDistanceUtils taskDistanceUtils=new TaskDistanceUtils();
|
||||
return taskDistanceUtils.conflictForVehicle(testRgv.getVehicleId(),testRgv.getStartPoint(),testRgv.getEndPoint(),testRgv.getOtherVehicle());
|
||||
}
|
||||
private Integer sendTaskToRgv(Integer taskType,Long vehicleId, Long currTaskId, Long startPoint, Long endPoint, Integer processNumber) {
|
||||
Map<String, Object> json = new HashMap();
|
||||
|
@ -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,currTask.getStartPosition(),currTask.getTargetPosition());
|
||||
rgvStatus(vehicleId, currTask);
|
||||
//新建一条执行任务的关系表存放任务执行信息
|
||||
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,location.getCode(),currTask.getTargetPosition());
|
||||
rgvStatus(vehicleId, currTask);
|
||||
//新建一条执行任务的关系表存放任务执行信息
|
||||
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,currTask.getStartPosition(),location.getCode());
|
||||
rgvStatus(vehicleId, currTask);
|
||||
//新建一条执行任务的关系表存放任务执行信息,终点为缓存区空闲库位
|
||||
RunTask runTask = new RunTask();
|
||||
runTask.setTaskId(currTask.getId());
|
||||
@ -367,9 +367,8 @@ 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,currTask.getStartPosition(),location.getCode());
|
||||
rgvStatus(vehicleId, currTask);
|
||||
//新建一条执行任务的关系表存放任务执行信息,终点为缓存区空闲库位
|
||||
RunTask runTask = new RunTask();
|
||||
runTask.setTaskId(currTask.getId());
|
||||
@ -380,7 +379,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);
|
||||
@ -1338,7 +1337,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
* @param currTask
|
||||
* @throws IOException
|
||||
*/
|
||||
private void rgvStatus(Long vehicleId,CurrTask currTask,String startPosition,String targetPosition) throws IOException {
|
||||
private void rgvStatus(Long vehicleId,CurrTask currTask) throws IOException {
|
||||
Long currTaskId = currTask.getId();
|
||||
if (vehicleId==1){
|
||||
Long anotherVehicleId=2L;
|
||||
@ -1347,7 +1346,7 @@ public class AsynRunTaskService extends BaseService {
|
||||
//获取RGV2当前位置
|
||||
Double rgv2CurrPosition = RGVCurrPosition(2);
|
||||
//两辆小车是否冲突
|
||||
Boolean conflictBoolean = taskDistanceUtils.conflictForVehicle(vehicleId, startPosition, targetPosition, rgv2CurrPosition);
|
||||
Boolean conflictBoolean = taskDistanceUtils.conflictForVehicle(vehicleId, currTask.getStartPosition(), currTask.getTargetPosition(), rgv2CurrPosition);
|
||||
if (conflictBoolean){
|
||||
Integer status = moveRgv(2, currTaskId, 2,0);
|
||||
if (status!=1){
|
||||
|
Loading…
Reference in New Issue
Block a user