From 6d2ce1b20ad4ac863e2b7bddd3ba3923a37c14a1 Mon Sep 17 00:00:00 2001 From: gengby <858962040@qq.com> Date: Tue, 19 Mar 2024 09:01:57 +0800 Subject: [PATCH] =?UTF-8?q?rev:=E8=A7=A3=E9=99=A4=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/InstructionServiceImpl.java | 96 +++++++++---------- .../task/service/impl/TaskServiceImpl.java | 68 ++++++------- .../modules/quartz/task/AutoCreateInst.java | 48 +++++----- 3 files changed, 107 insertions(+), 105 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index 97bd083..6ffe24f 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -339,33 +339,33 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); Device startdevice = appService.findDeviceByCode(dto.getStart_device_code()); - HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; - StandardCoveyorControlWithScannerDeviceDriver standardCoveyorControlWithScannerDeviceDriver; +// HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; +// StandardCoveyorControlWithScannerDeviceDriver standardCoveyorControlWithScannerDeviceDriver; try { - String start_device_code = dto.getStart_device_code(); - String next_device_code = dto.getNext_device_code(); - String route_plan_code = task.getRoute_plan_code(); - List shortPathsList = - routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code); - RouteLineDto route = null; - for (int i = 0; i < shortPathsList.size(); i++) { - RouteLineDto routeLineDto = shortPathsList.get(i); - String route_device = routeLineDto.getDevice_code(); - String route_next_device = routeLineDto.getNext_device_code(); - if (route_device.equals(dto.getStart_device_code()) - && route_next_device.equals(dto.getNext_device_code())) { - route = routeLineDto; - break; - } - } - if (ObjectUtil.isEmpty(route)) { - throw new BadRequestException("未查询到相关路由!"); - } - if (StrUtil.equals(shortPathsList.get(0).getType(), "1")) { - NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class); - ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(), dto); - } +// String start_device_code = dto.getStart_device_code(); +// String next_device_code = dto.getNext_device_code(); +// String route_plan_code = task.getRoute_plan_code(); +// List shortPathsList = +// routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code); +// RouteLineDto route = null; +// for (int i = 0; i < shortPathsList.size(); i++) { +// RouteLineDto routeLineDto = shortPathsList.get(i); +// String route_device = routeLineDto.getDevice_code(); +// String route_next_device = routeLineDto.getNext_device_code(); +// if (route_device.equals(dto.getStart_device_code()) +// && route_next_device.equals(dto.getNext_device_code())) { +// route = routeLineDto; +// break; +// } +// } +// if (ObjectUtil.isEmpty(route)) { +// throw new BadRequestException("未查询到相关路由!"); +// } + //if (StrUtil.equals(shortPathsList.get(0).getType(), "1")) { + NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class); + ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(), dto); + // } } catch (Exception e) { dto.setSend_status("2"); e.printStackTrace(); @@ -447,29 +447,29 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu } try { - String start_device_code = dto.getStart_device_code(); - String next_device_code = dto.getNext_device_code(); - String route_plan_code = task.getRoute_plan_code(); - List shortPathsList = - routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code); - RouteLineDto route = null; - for (int i = 0; i < shortPathsList.size(); i++) { - RouteLineDto routeLineDto = shortPathsList.get(i); - String route_device = routeLineDto.getDevice_code(); - String route_next_device = routeLineDto.getNext_device_code(); - if (route_device.equals(dto.getStart_device_code()) - && route_next_device.equals(dto.getNext_device_code())) { - route = routeLineDto; - break; - } - } - if (ObjectUtil.isEmpty(route)) { - throw new BadRequestException("未查询到相关路由!"); - } - if (StrUtil.equals(shortPathsList.get(0).getType(), "1")) { - NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class); - ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(), dto); - } +// String start_device_code = dto.getStart_device_code(); +// String next_device_code = dto.getNext_device_code(); +// String route_plan_code = task.getRoute_plan_code(); +// List shortPathsList = +// routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code); +// RouteLineDto route = null; +// for (int i = 0; i < shortPathsList.size(); i++) { +// RouteLineDto routeLineDto = shortPathsList.get(i); +// String route_device = routeLineDto.getDevice_code(); +// String route_next_device = routeLineDto.getNext_device_code(); +// if (route_device.equals(dto.getStart_device_code()) +// && route_next_device.equals(dto.getNext_device_code())) { +// route = routeLineDto; +// break; +// } +// } +// if (ObjectUtil.isEmpty(route)) { +// throw new BadRequestException("未查询到相关路由!"); +// } + // if (StrUtil.equals(shortPathsList.get(0).getType(), "1")) { + NDCAgvService ndcAgvService = SpringContextHolder.getBean(NDCAgvService.class); + ndcAgvService.sendAgvInstToNDC(task.getAgv_system_type(), dto); + // } } catch (Exception e) { dto.setSend_status("2"); e.printStackTrace(); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java index e5f42b2..10cbca2 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java @@ -467,12 +467,12 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { // 判断起点终点设备类型 String startDeviceType = deviceAppService.findDeviceTypeByCode(dto.getStart_device_code()); String nextDeviceType = deviceAppService.findDeviceTypeByCode(dto.getNext_device_code()); - if (routelineserver - .getShortPathLines(dto.getStart_device_code(), dto.getNext_device_code(), plan_code) - .size() - == 0) { - throw new Exception(dto.getStart_point_code() + "->" + dto.getNext_point_code() + "路由不通!"); - } +// if (routelineserver +// .getShortPathLines(dto.getStart_device_code(), dto.getNext_device_code(), plan_code) +// .size() +// == 0) { +// throw new Exception(dto.getStart_point_code() + "->" + dto.getNext_point_code() + "路由不通!"); +// } String createTaskCheck = paramService.findByCode(AcsConfig.CREATETASKCHECK).getValue(); DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class); DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); @@ -965,11 +965,13 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { entity.getStart_device_code(), entity.getNext_device_code(), entity.getRoute_plan_code()); - String type = shortPathsList.get(0).getType(); - // != 0 为agv任务 - if (!StrUtil.equals(type, "0")) { - if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "3")) { - agvService.markComplete(entity.getTask_code()); + if (ObjectUtil.isNotEmpty(shortPathsList)){ + String type = shortPathsList.get(0).getType(); + // != 0 为agv任务 + if (!StrUtil.equals(type, "0")) { + if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "3")) { + agvService.markComplete(entity.getTask_code()); + } } } } @@ -1181,28 +1183,28 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { String agv_system_type = acsTask.getAgv_system_type(); String task_type = acsTask.getTask_type(); /** 开始平均分解校验 */ - String this_device_code = - this.queryAssignedByDevice(acsTask.getStart_device_code(), acsTask.getNext_device_code()); - if (StrUtil.isEmpty(this_device_code)) { - List shortPathsList = - routeLineService.getShortPathLines( - start_device_code, acsTask.getNext_device_code(), route_plan_code); - RouteLineDto routeLineDto = shortPathsList.get(0); - String path = routeLineDto.getPath(); - String type = routeLineDto.getType(); - String[] str = path.split("->"); - List pathlist = Arrays.asList(str); - int index = 0; - for (int m = 0; m < pathlist.size(); m++) { - if (pathlist.get(m).equals(start_device_code)) { - index = m + 1; - break; - } - } - next_device_code = pathlist.get(index); - } else { - next_device_code = this_device_code; - } +// String this_device_code = +// this.queryAssignedByDevice(acsTask.getStart_device_code(), acsTask.getNext_device_code()); +// if (StrUtil.isEmpty(this_device_code)) { +// List shortPathsList = +// routeLineService.getShortPathLines( +// start_device_code, acsTask.getNext_device_code(), route_plan_code); +// RouteLineDto routeLineDto = shortPathsList.get(0); +// String path = routeLineDto.getPath(); +// String type = routeLineDto.getType(); +// String[] str = path.split("->"); +// List pathlist = Arrays.asList(str); +// int index = 0; +// for (int m = 0; m < pathlist.size(); m++) { +// if (pathlist.get(m).equals(start_device_code)) { +// index = m + 1; +// break; +// } +// } +// next_device_code = pathlist.get(index); +// } else { +// next_device_code = this_device_code; +// } if (StrUtil.equals(appService.findDeviceTypeByCode(next_device_code), "storage")) { next_point_code = next_device_code + "-" + acsTask.getTo_y() + "-" + acsTask.getTo_z(); diff --git a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java index e575119..946e29e 100644 --- a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java +++ b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java @@ -76,30 +76,30 @@ public class AutoCreateInst { } //校验路由关系 - List shortPathsList = routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code); - if (ObjectUtils.isEmpty(shortPathsList)) { - acsTask.setRemark("路由不通无法生成指令"); - taskserver.updateByCodeFromCache(acsTask); - continue; - } - - if (!StrUtil.equals(shortPathsList.get(0).getType(), "1")) { - continue; - } - - RouteLineDto routeLineDto = shortPathsList.get(0); - String path = routeLineDto.getPath(); - String type = routeLineDto.getType(); - String[] str = path.split("->"); - List pathlist = Arrays.asList(str); - int index = 0; - for (int m = 0; m < pathlist.size(); m++) { - if (pathlist.get(m).equals(start_device_code)) { - index = m + 1; - break; - } - } - next_device_code = pathlist.get(index); +// List shortPathsList = routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code); +// if (ObjectUtils.isEmpty(shortPathsList)) { +// acsTask.setRemark("路由不通无法生成指令"); +// taskserver.updateByCodeFromCache(acsTask); +// continue; +// } + +// if (!StrUtil.equals(shortPathsList.get(0).getType(), "1")) { +// continue; +// } + +// RouteLineDto routeLineDto = shortPathsList.get(0); +// String path = routeLineDto.getPath(); +// String type = routeLineDto.getType(); +// String[] str = path.split("->"); +// List pathlist = Arrays.asList(str); +// int index = 0; +// for (int m = 0; m < pathlist.size(); m++) { +// if (pathlist.get(m).equals(start_device_code)) { +// index = m + 1; +// break; +// } +// } +// next_device_code = pathlist.get(index); if (StrUtil.equals(appService.findDeviceTypeByCode(next_device_code), "storage")) { next_point_code = next_device_code + "-" + acsTask.getTo_y() + "-" + acsTask.getTo_z();