解决一个任务未完成导致后续任务不处理

This commit is contained in:
张江玮
2022-11-07 17:27:05 +08:00
parent 7f5bcce048
commit 4bf96ead04

View File

@@ -71,9 +71,12 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
try { try {
JSONArray errArr = new JSONArray(); JSONArray errArr = new JSONArray();
for (int i = 0; i < tasks.size(); i++) { for (int i = 0; i < tasks.size(); i++) {
String ext_task_uuid = null;
String task_code = null;
try {
JSONObject task = tasks.getJSONObject(i); JSONObject task = tasks.getJSONObject(i);
String ext_task_uuid = task.getString("ext_task_uuid"); ext_task_uuid = task.getString("ext_task_uuid");
String task_code = task.getString("task_code"); task_code = task.getString("task_code");
String start_point_code = task.getString("start_device_code"); String start_point_code = task.getString("start_device_code");
String next_point_code = task.getString("next_device_code"); String next_point_code = task.getString("next_device_code");
String start_device_code = ""; String start_device_code = "";
@@ -136,7 +139,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
} }
if (!StrUtil.isEmpty(vehicle_code)) { if (!StrUtil.isEmpty(vehicle_code)) {
TaskDto vehicle_dto = TaskService.findByContainer(vehicle_code); TaskDto vehicle_dto = TaskService.findByContainer(vehicle_code);
if (vehicle_dto != null) { if (vehicle_dto != null && !StrUtil.equals(vehicle_code, "999") && !StrUtil.equals(vehicle_code, "0000")) {
throw new WDKException("已存在该载具号的任务!"); throw new WDKException("已存在该载具号的任务!");
} }
} }
@@ -172,7 +175,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
nextjo.put("islock", "false"); nextjo.put("islock", "false");
DeviceService.changeDeviceStatus(nextjo); DeviceService.changeDeviceStatus(nextjo);
TaskDto task_dto = jo.toJavaObject(TaskDto.class); TaskDto task_dto = jo.toJavaObject(TaskDto.class);
try {
TaskService.create(task_dto); TaskService.create(task_dto);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();