|
|
@ -465,7 +465,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { |
|
|
|
for (int i = 0; i < datas.size(); i++) { |
|
|
|
String data = datas.get(i).toString(); |
|
|
|
CreateTaskRequest request = JsonUtl.format(data, CreateTaskRequest.class); |
|
|
|
String ext_task_id = request.getREQCODE(); |
|
|
|
// String ext_task_id = request.getREQCODE();
|
|
|
|
String task_code = request.getTASKCODE(); |
|
|
|
String start_device_code = request.getSTARTPOSITION(); |
|
|
|
// String start_device_code2 = request.getStart_device_code2();
|
|
|
@ -493,21 +493,21 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { |
|
|
|
String next_point_code2 = ""; |
|
|
|
String put_point_code = ""; |
|
|
|
if (StrUtil.isEmpty(task_code)) { |
|
|
|
response.setREQCODE(ext_task_id); |
|
|
|
response.setREQCODE(task_code); |
|
|
|
response.setREPLYTIME(DateUtil.now()); |
|
|
|
response.setREQCODE("1"); |
|
|
|
response.setRTMSG("任务号不能为空!"); |
|
|
|
return response; |
|
|
|
} |
|
|
|
if (StrUtil.isEmpty(start_device_code)) { |
|
|
|
response.setREQCODE(ext_task_id); |
|
|
|
response.setREQCODE(task_code); |
|
|
|
response.setREPLYTIME(DateUtil.now()); |
|
|
|
response.setREQCODE("1"); |
|
|
|
response.setRTMSG("起点不能为空!"); |
|
|
|
return response; |
|
|
|
} |
|
|
|
if (StrUtil.isEmpty(next_device_code)) { |
|
|
|
response.setREQCODE(ext_task_id); |
|
|
|
response.setREQCODE(task_code); |
|
|
|
response.setREPLYTIME(DateUtil.now()); |
|
|
|
response.setREQCODE("1"); |
|
|
|
response.setRTMSG("终点不能为空!"); |
|
|
@ -584,7 +584,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { |
|
|
|
// }
|
|
|
|
TaskDto taskDto = taskService.findByCodeFromCache(task_code); |
|
|
|
if (taskDto != null) { |
|
|
|
response.setREQCODE(ext_task_id); |
|
|
|
response.setREQCODE(task_code); |
|
|
|
response.setREPLYTIME(DateUtil.now()); |
|
|
|
response.setREQCODE("1"); |
|
|
|
response.setRTMSG("不能存在相同的任务号!"); |
|
|
@ -593,7 +593,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { |
|
|
|
if (!StrUtil.isEmpty(vehicle_code)) { |
|
|
|
TaskDto vehicle_dto = taskService.findByContainer(vehicle_code); |
|
|
|
if (vehicle_dto != null) { |
|
|
|
response.setREQCODE(ext_task_id); |
|
|
|
response.setREQCODE(task_code); |
|
|
|
response.setREPLYTIME(DateUtil.now()); |
|
|
|
response.setREQCODE("1"); |
|
|
|
response.setRTMSG("不能存在相同的料车号!"); |
|
|
@ -602,14 +602,14 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { |
|
|
|
} |
|
|
|
|
|
|
|
if (StrUtil.isEmpty(start_point_code)) { |
|
|
|
response.setREQCODE(ext_task_id); |
|
|
|
response.setREQCODE(task_code); |
|
|
|
response.setREPLYTIME(DateUtil.now()); |
|
|
|
response.setREQCODE("1"); |
|
|
|
response.setRTMSG(start_device_code + "未找到对应点位!"); |
|
|
|
return response; |
|
|
|
} |
|
|
|
if (StrUtil.isEmpty(next_point_code)) { |
|
|
|
response.setREQCODE(ext_task_id); |
|
|
|
response.setREQCODE(task_code); |
|
|
|
response.setREPLYTIME(DateUtil.now()); |
|
|
|
response.setREQCODE("1"); |
|
|
|
response.setRTMSG(next_device_code + "未找到对应点位!"); |
|
|
@ -618,7 +618,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { |
|
|
|
|
|
|
|
JSONObject jo = new JSONObject(); |
|
|
|
jo.put("task_code", task_code); |
|
|
|
jo.put("task_id", ext_task_id); |
|
|
|
jo.put("task_id", task_code); |
|
|
|
jo.put("start_point_code", start_point_code); |
|
|
|
jo.put("next_point_code", next_point_code); |
|
|
|
jo.put("start_point_code2", start_point_code2); |
|
|
@ -641,8 +641,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { |
|
|
|
jo.put("params", params); |
|
|
|
jo.put("task_type", task_type); |
|
|
|
|
|
|
|
if (!StrUtil.isEmpty(ext_task_id)) { |
|
|
|
jo.put("ext_task_id", ext_task_id); |
|
|
|
if (!StrUtil.isEmpty(task_code)) { |
|
|
|
jo.put("ext_task_id", task_code); |
|
|
|
} |
|
|
|
|
|
|
|
TaskDto task_dto = jo.toJavaObject(TaskDto.class); |
|
|
@ -675,7 +675,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { |
|
|
|
} else { |
|
|
|
JSONObject json = new JSONObject(); |
|
|
|
json.put("task_code", task_code); |
|
|
|
json.put("ext_task_id", ext_task_id); |
|
|
|
// json.put("ext_task_id", ext_task_id);
|
|
|
|
json.put("message", resp.getComment()); |
|
|
|
json.put("code", resp.code); |
|
|
|
json.put("data", data); |
|
|
@ -688,7 +688,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
// e.printStackTrace();
|
|
|
|
response.setREQCODE(ext_task_id); |
|
|
|
response.setREQCODE(task_code); |
|
|
|
response.setREPLYTIME(DateUtil.now()); |
|
|
|
response.setREQCODE("1"); |
|
|
|
response.setRTMSG(e.getMessage()); |
|
|
|