del:去掉路由校验
This commit is contained in:
@@ -181,7 +181,6 @@ public class MagicAgvServiceImpl implements MagicAgvService {
|
||||
agvurl = agvurl + ":" + agvport + "/v1/transportOrders/" + instno;
|
||||
|
||||
log.info("下发agv指令参数:{}", orderjo.toString());
|
||||
|
||||
HttpResponse result = null;
|
||||
try {
|
||||
result = HttpRequest.post(agvurl)
|
||||
|
||||
@@ -116,11 +116,11 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
||||
if (StrUtil.isEmpty(route_plan_code)) {
|
||||
route_plan_code = "normal";
|
||||
}
|
||||
List<RouteLineDto> list = RouteLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code);
|
||||
|
||||
if (ObjectUtil.isEmpty(list)) {
|
||||
throw new WDKException("路由不通!");
|
||||
}
|
||||
// List<RouteLineDto> list = RouteLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code);
|
||||
//
|
||||
// if (ObjectUtil.isEmpty(list)) {
|
||||
// throw new WDKException("路由不通!");
|
||||
// }
|
||||
TaskDto taskDto = TaskService.findByCodeFromCache(task_code);
|
||||
if (taskDto != null) {
|
||||
throw new WDKException("不能存在相同的任务号!");
|
||||
|
||||
@@ -261,17 +261,17 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
dto.setInstruction_id(IdUtil.simpleUUID());
|
||||
}
|
||||
dto.setInstruction_type(task.getTask_type());
|
||||
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(dto.getStart_device_code(), dto.getNext_device_code(), dto.getRoute_plan_code());
|
||||
if (ObjectUtils.isEmpty(shortPathsList)) {
|
||||
throw new Exception(dto.getStart_device_code() + "->" + dto.getNext_device_code() + "路由不通");
|
||||
}
|
||||
String type = shortPathsList.get(0).getType();
|
||||
if (!StrUtil.equals(type, "0")) {
|
||||
// List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(dto.getStart_device_code(), dto.getNext_device_code(), dto.getRoute_plan_code());
|
||||
// if (ObjectUtils.isEmpty(shortPathsList)) {
|
||||
// throw new Exception(dto.getStart_device_code() + "->" + dto.getNext_device_code() + "路由不通");
|
||||
// }
|
||||
// String type = shortPathsList.get(0).getType();
|
||||
// if (!StrUtil.equals(type, "0")) {
|
||||
JSONObject instcheckjson = instwo.query(" instruction_status <2 and next_point_code= '" + dto.getNext_point_code() + "'" + " and start_point_code = '" + dto.getStart_point_code() + "'" + " and task_id = '" + dto.getTask_id() + "'").uniqueResult(0);
|
||||
if (instcheckjson != null) {
|
||||
throw new Exception(dto.getTask_code() + ":该任务已存在待完成指令!");
|
||||
}
|
||||
}
|
||||
// }
|
||||
if (!StrUtil.isEmpty(dto.getVehicle_code())) {
|
||||
Instruction inst_dto = this.findByContainer(dto.getVehicle_code());
|
||||
if (ObjectUtils.isNotEmpty(inst_dto) && !StrUtil.equals(inst_dto.getTask_id(), dto.getTask_id())) {
|
||||
@@ -300,7 +300,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
try {
|
||||
// != 0 为agv任务
|
||||
if (!StrUtil.equals(type, "0")) {
|
||||
// if (!StrUtil.equals(type, "0")) {
|
||||
if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.AGVTYPE).toString(), "1")) {
|
||||
MagicAgvServiceImpl magicAgvService = SpringContextHolder.getBean(MagicAgvServiceImpl.class);
|
||||
HttpResponse result = magicAgvService.sendAgvInstToMagic(dto);
|
||||
@@ -335,7 +335,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
} catch (Exception e) {
|
||||
dto.setSend_status("2");
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -326,9 +326,9 @@ 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 = acsConfigService.findConfigFromCache().get(AcsConfig.CREATETASKCHECK);
|
||||
DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class);
|
||||
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
||||
@@ -778,25 +778,25 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
/**
|
||||
* 开始平均分解校验
|
||||
*/
|
||||
String this_device_code = this.queryAssignedByDevice(acsTask.getStart_device_code(), acsTask.getNext_device_code());
|
||||
if (StrUtil.isEmpty(this_device_code)) {
|
||||
List<RouteLineDto> 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<String> 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<RouteLineDto> 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<String> 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();
|
||||
|
||||
@@ -86,48 +86,48 @@ public class AutoCreateInst {
|
||||
/**
|
||||
* 开始平均分解校验
|
||||
*/
|
||||
String this_device_code = taskserver.queryAssignedByDevice(acsTask.getStart_device_code(), acsTask.getNext_device_code());
|
||||
if (StrUtil.isEmpty(this_device_code)) {
|
||||
List<RouteLineDto> 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<String> pathlist = Arrays.asList(str);
|
||||
if(StrUtil.equals(acsTask.getTask_type(),"2")){
|
||||
for (int j = 0; j < pathlist.size(); j++) {
|
||||
if (j == 0) {
|
||||
compound_task_data = pathlist.get(j).trim();
|
||||
} else {
|
||||
compound_task_data = compound_task_data + "->" + pathlist.get(j).trim();
|
||||
}
|
||||
}
|
||||
next_device_code = pathlist.get(pathlist.size()-1);
|
||||
|
||||
} else {
|
||||
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 = taskserver.queryAssignedByDevice(acsTask.getStart_device_code(), acsTask.getNext_device_code());
|
||||
// if (StrUtil.isEmpty(this_device_code)) {
|
||||
// List<RouteLineDto> 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<String> pathlist = Arrays.asList(str);
|
||||
// if(StrUtil.equals(acsTask.getTask_type(),"2")){
|
||||
// for (int j = 0; j < pathlist.size(); j++) {
|
||||
// if (j == 0) {
|
||||
// compound_task_data = pathlist.get(j).trim();
|
||||
// } else {
|
||||
// compound_task_data = compound_task_data + "->" + pathlist.get(j).trim();
|
||||
// }
|
||||
// }
|
||||
// next_device_code = pathlist.get(pathlist.size()-1);
|
||||
//
|
||||
// } else {
|
||||
// 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;
|
||||
// }
|
||||
//校验路由关系
|
||||
List<RouteLineDto> 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;
|
||||
}
|
||||
// List<RouteLineDto> 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;
|
||||
// }
|
||||
Device startdevice = appService.findDeviceByCode(start_device_code);
|
||||
Device nextdevice = appService.findDeviceByCode(next_device_code);
|
||||
if (StrUtil.equals(appService.findDeviceTypeByCode(next_device_code), "storage")) {
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user