|
|
@ -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<RouteLineDto> 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<RouteLineDto> 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<RouteLineDto> 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<RouteLineDto> 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(); |
|
|
|