diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/path/PathApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/path/PathApiImpl.java index 9c20ccb3a..f256e41dd 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/path/PathApiImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/path/PathApiImpl.java @@ -137,6 +137,7 @@ public class PathApiImpl implements PathApi { @Override public void graphMatchData(String message) { TenantContextHolder.setTenantId(1L); + log.info("匹配路网的消息 :{}",message); pathPlanningService.graphMatchData(message); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/robot/RobotReactiveStatusApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/robot/RobotReactiveStatusApiImpl.java index e6f255804..a77363d5d 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/robot/RobotReactiveStatusApiImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/robot/RobotReactiveStatusApiImpl.java @@ -64,7 +64,7 @@ public class RobotReactiveStatusApiImpl implements RobotReactiveStatusApi { @Override public void robotReactiveStatus(String message) { TenantContextHolder.setTenantId(1L); - log.info("切换地图 :{}",message); + log.info("车辆所在楼层和异常信息 :{}",message); RobotReactiveStatusDTO data = JSON.parseObject(message, RobotReactiveStatusDTO.class); String floorAreaKey = RobotTaskChcheConstant.ROBOT_FLOOR_AREA + data.getMac(); String robotNo = robotInformationService.getRobotNoByMac(data.getMac()); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/robot/RobotTaskServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/robot/RobotTaskServiceImpl.java index 5701b79af..dc4460ced 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/robot/RobotTaskServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/robot/RobotTaskServiceImpl.java @@ -144,7 +144,7 @@ public class RobotTaskServiceImpl extends ServiceImpl logs, List taskDetailDOS, List robots) { @@ -424,7 +424,7 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService { pathPlanning.setWaitIds(waitIds); i++; } else if (RobotTaskTypeEnum.MOVE_TO_POINT.getType().equals(taskDetailDO.getTaskType())) { - moveToPoint(pathPlanning,taskDetailDO); + moveToPoint(pathPlanning, taskDetailDO); } if (ObjectUtil.isNotEmpty(robotDoTake) && ObjectUtil.isNotEmpty(taskDetailDO.getRobotNo()) @@ -454,9 +454,8 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService { if (ObjectUtil.isNotEmpty(taskDetailDO.getFromLocationId())) { pathPlanning.setTakeLocationNumber(Math.abs(locationNumberReduce - taskDetailDO.getFromLocationNumber())); pathPlanning.setTakePointId(fromLocation.getMapItemId()); - if (ObjectUtil.isNotEmpty(fromLocation.getLocationTotalHeight())) { - pathPlanning.setTakeHeight(Double.valueOf(fromLocation.getLocationTotalHeight() + "")); - } + + pathPlanningSetTakeHeight(pathPlanning, fromLocation); pathPlanning.setTakeLevel(fromLocation.getLocationStorey()); pathPlanning.setTakeOffsetHeight(offsetHeight); if (ObjectUtil.isNotEmpty(taskDetailDO.getFromLaneId())) { @@ -469,11 +468,8 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService { if (ObjectUtil.isNotEmpty(taskDetailDO.getToLocationId())) { pathPlanning.setReleaseLocationNumber(taskDetailDO.getToLocationNumber()); pathPlanning.setReleasePointId(toLocation.getMapItemId()); - if (ObjectUtil.isNotEmpty(toLocation.getLocationStorey()) && ZeroOneEnum.ONE.getType().equals(toLocation.getLocationStorey())) { - pathPlanning.setReleaseHeight(0.0); - }else if (ObjectUtil.isNotEmpty(toLocation.getLocationTrayHeight())) { - pathPlanning.setReleaseHeight(Double.valueOf(toLocation.getLocationTrayHeight() + "")); - } + + pathPlanningSetReleaseHeight(pathPlanning,toLocation); pathPlanning.setReleaseLevel(toLocation.getLocationStorey()); pathPlanning.setReleaseOffsetHeight(offsetHeight); if (ObjectUtil.isNotEmpty(taskDetailDO.getToLaneId())) { @@ -495,8 +491,52 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService { } } + /** + * 设置放货高度 + * @param pathPlanning + * @param toLocation + */ + private void pathPlanningSetReleaseHeight(TaskToPathPlanningDTO pathPlanning, WareHouseLocationDO toLocation) { + if ( ZeroOneEnum.ONE.getType().equals(toLocation.getLocationStorey())) { + pathPlanning.setReleaseHeight(0.0); + return; + } + + WareHouseLocationDO nextLocation = locationMapper.selectOne(new LambdaQueryWrapperX() + .eq(WareHouseLocationDO::getId, toLocation.getMapItemId()) + .eq(WareHouseLocationDO::getLocationStorey, toLocation.getLocationStorey()-1) + .last("limit 1")); + if (ObjectUtil.isNotEmpty(nextLocation) && ObjectUtil.isNotEmpty(nextLocation.getLocationTotalHeight())) { + pathPlanning.setReleaseHeight(Double.valueOf(nextLocation.getLocationTotalHeight() + "")); + return; + } + + Integer locationStorey = toLocation.getLocationStorey() - 1; + double height = locationStorey * defaultTrayHeight; + log.info("放货设置默认高度 :{}",pathPlanning.getReleaseHeight()); + pathPlanning.setReleaseHeight(height); + } + + /** + * 设置取货高度 + * + * @param pathPlanning + * @param fromLocation + */ + private void pathPlanningSetTakeHeight(TaskToPathPlanningDTO pathPlanning, WareHouseLocationDO fromLocation) { + if (ObjectUtil.isNotEmpty(fromLocation.getLocationTotalHeight())) { + pathPlanning.setTakeHeight(Double.valueOf(fromLocation.getLocationTotalHeight() + "")); + return; + } + Integer locationStorey = fromLocation.getLocationStorey(); + double height = locationStorey * defaultTrayHeight; + log.info("取货设置默认取货高度 :{}",height); + pathPlanning.setTakeHeight(height); + } + /** * 移动到路径点 + * * @param pathPlanning * @param taskDetailDO */ @@ -692,7 +732,7 @@ public class RobotPathPlanningServiceImpl implements RobotPathPlanningService { //仅取货 takeSetTask(list, v, fromLane, toLane, fromLocation, toLocation, toHaveFrom, fromHaveTo); } else if (RobotTaskTypeEnum.PARK.getType().equals(v.getTaskType()) - || RobotTaskTypeEnum.MOVE_TO_POINT.getType().equals(v.getTaskType())) { + || RobotTaskTypeEnum.MOVE_TO_POINT.getType().equals(v.getTaskType())) { list.add(v); } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/resources/application-local.yaml b/yudao-module-system/yudao-module-system-biz/src/main/resources/application-local.yaml index 4fe7c8781..9c8ca5b2e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/resources/application-local.yaml +++ b/yudao-module-system/yudao-module-system-biz/src/main/resources/application-local.yaml @@ -226,7 +226,7 @@ zn: camera_secret_key: A2C4rv7DY012c9ef #摄像头秘钥 do_cycle: true #是否开启循环 lane_auto_move: true #线库是否自动移库 true:线库执行自动移库 、false:线库关闭执行自动移库 - robot_position_cache_time: 10 #机器人上报点位存储时间(秒) + robot_position_cache_time: 10000000 #机器人上报点位存储时间(秒) cycle_do_auto_move: true #存在循环的任务,是否开启自动移库. true:存在循环任务,开启自动移库; false:有循环任务不自动移库 full_electricity: 100 #机器人充满电的电量 task_need_single: true #机器人对同一线库/点位是不是只能有一台机器人做任务 (true:一个点位/线库,只有一台机器人) @@ -240,7 +240,7 @@ zn: check_sku_info: true #校验物料信息 robot_config: #机器人取放货默认配置 offset_height: 0.1 #叉起货需要在原来高度基础上偏移的高度 - default_tray_height: 1.1 #默认每层高度 + default_tray_height: 0.82 #默认每层高度 open_rate_limiter: true #是否开启限流 path_planning: task_chche_time: 1209600 #任务缓存的时间, 默认一星期