|
|
@ -825,9 +825,6 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { |
|
|
|
feed_jo.put("task_status", entity.getTask_status()); |
|
|
|
JSONArray ja = new JSONArray(); |
|
|
|
ja.add(feed_jo); |
|
|
|
String message = null; |
|
|
|
HttpResponse body = null; |
|
|
|
boolean flag = false; |
|
|
|
try { |
|
|
|
JSONObject request = new JSONObject(); |
|
|
|
request.put("REQCODE", entity.getExt_task_id()); |
|
|
@ -838,78 +835,8 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { |
|
|
|
request.put("REQTIME", DateUtil.now()); |
|
|
|
new RTMSAGVSERVICE().getBasicHttpBindingIRTMSAGVSERVICE().atrAgvCallback(request.toJSONString()); |
|
|
|
} catch (Exception e) { |
|
|
|
flag = true; |
|
|
|
message = e.getMessage(); |
|
|
|
e.printStackTrace(); |
|
|
|
} finally { |
|
|
|
|
|
|
|
} |
|
|
|
if (flag) { |
|
|
|
if (ObjectUtil.isEmpty(feefbackdto)) { |
|
|
|
feefbackdto = new TaskFeedbackDto(); |
|
|
|
feefbackdto.setTask_id(entity.getTask_id()); |
|
|
|
feefbackdto.setTask_code(entity.getTask_code()); |
|
|
|
feefbackdto.setTask_status(entity.getTask_status()); |
|
|
|
feefbackdto.setVehicle_type(entity.getVehicle_type()); |
|
|
|
feefbackdto.setVehicle_code(entity.getVehicle_code()); |
|
|
|
feefbackdto.setStart_device_code(entity.getStart_device_code()); |
|
|
|
feefbackdto.setStart_point_code(entity.getStart_point_code()); |
|
|
|
feefbackdto.setNext_device_code(entity.getNext_device_code()); |
|
|
|
feefbackdto.setNext_point_code(entity.getNext_point_code()); |
|
|
|
feefbackdto.setError_code("400"); |
|
|
|
feefbackdto.setIs_finished("0"); |
|
|
|
feefbackdto.setRemark(message); |
|
|
|
taskFeedbackService.create(feefbackdto); |
|
|
|
} else { |
|
|
|
feefbackdto.setTask_status(entity.getTask_status()); |
|
|
|
feefbackdto.setStart_device_code(entity.getStart_device_code()); |
|
|
|
feefbackdto.setStart_point_code(entity.getStart_point_code()); |
|
|
|
feefbackdto.setNext_device_code(entity.getNext_device_code()); |
|
|
|
feefbackdto.setNext_point_code(entity.getNext_point_code()); |
|
|
|
feefbackdto.setError_code("400"); |
|
|
|
feefbackdto.setRemark(message); |
|
|
|
taskFeedbackService.update(feefbackdto); |
|
|
|
} |
|
|
|
} else { |
|
|
|
int status = body.getStatus(); |
|
|
|
JSONObject jo = JSONObject.parseObject(body.body()); |
|
|
|
if (ObjectUtil.isEmpty(feefbackdto)) { |
|
|
|
feefbackdto = new TaskFeedbackDto(); |
|
|
|
feefbackdto.setTask_id(entity.getTask_id()); |
|
|
|
feefbackdto.setTask_code(entity.getTask_code()); |
|
|
|
feefbackdto.setTask_status(entity.getTask_status()); |
|
|
|
feefbackdto.setVehicle_type(entity.getVehicle_type()); |
|
|
|
feefbackdto.setVehicle_code(entity.getVehicle_code()); |
|
|
|
feefbackdto.setError_code(String.valueOf(body.getStatus())); |
|
|
|
feefbackdto.setStart_device_code(entity.getStart_device_code()); |
|
|
|
feefbackdto.setStart_point_code(entity.getNext_point_code()); |
|
|
|
feefbackdto.setNext_device_code(entity.getNext_device_code()); |
|
|
|
feefbackdto.setNext_point_code(entity.getNext_point_code()); |
|
|
|
if (status == 200) { |
|
|
|
if (StrUtil.equals(entity.getTask_status(), "2")) { |
|
|
|
feefbackdto.setIs_finished("1"); |
|
|
|
} else { |
|
|
|
feefbackdto.setIs_finished("0"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
feefbackdto.setIs_finished("0"); |
|
|
|
feefbackdto.setRemark(jo.getString("message")); |
|
|
|
} |
|
|
|
taskFeedbackService.create(feefbackdto); |
|
|
|
} else { |
|
|
|
feefbackdto.setTask_status(entity.getTask_status()); |
|
|
|
if (status == 200) { |
|
|
|
if (StrUtil.equals(entity.getTask_status(), "2")) { |
|
|
|
feefbackdto.setIs_finished("1"); |
|
|
|
} else { |
|
|
|
feefbackdto.setIs_finished("0"); |
|
|
|
} |
|
|
|
} else { |
|
|
|
feefbackdto.setIs_finished("0"); |
|
|
|
feefbackdto.setRemark(jo.getString("message")); |
|
|
|
} |
|
|
|
taskFeedbackService.update(feefbackdto); |
|
|
|
} |
|
|
|
throw new BadRequestException(e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
// 如果属于先知AGV,关闭运单序列
|
|
|
@ -954,19 +881,6 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { |
|
|
|
// }}
|
|
|
|
|
|
|
|
removeByCodeFromCache(entity.getTask_code()); |
|
|
|
|
|
|
|
// 判断是否为WMS下发的任务,如果是反馈任务状态给WMS
|
|
|
|
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue(); |
|
|
|
if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) { |
|
|
|
JSONObject feed_jo = new JSONObject(); |
|
|
|
feed_jo.put("task_id", entity.getTask_id()); |
|
|
|
feed_jo.put("task_code", entity.getTask_code()); |
|
|
|
feed_jo.put("task_status", entity.getTask_status()); |
|
|
|
JSONArray ja = new JSONArray(); |
|
|
|
ja.add(feed_jo); |
|
|
|
HttpResponse response = acstowmsService.feedbackTaskStatusToWms(ja); |
|
|
|
response.close(); |
|
|
|
} |
|
|
|
List<RouteLineDto> shortPathsList = |
|
|
|
routeLineService.getShortPathLines( |
|
|
|
entity.getStart_device_code(), |
|
|
|