From 512b728579955a3c0560ce3e568cecd355306566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=B1=9F=E7=8E=AE?= Date: Sat, 8 Apr 2023 13:51:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agv/ndcone/AgvNdcOneDeviceDriver.java | 5 -- .../wms/service/impl/WmsToAcsServiceImpl.java | 12 +-- .../task/service/impl/TaskServiceImpl.java | 88 +------------------ .../modules/quartz/task/AutoCreateInst.java | 2 +- 4 files changed, 8 insertions(+), 99 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java index 83adf35..0347899 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java @@ -343,15 +343,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic if (StrUtil.equals(inst.getNext_device_code(), device_code)) { if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { - standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); -// standardOrdinarySiteDeviceDriver.setAgvphase(phase); -// standardOrdinarySiteDeviceDriver.setIndex(index); -// standardOrdinarySiteDeviceDriver.setInst(inst); data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); } if (device.getDeviceDriver() instanceof StandardStorageDeviceDriver) { - standardStorageDeviceDriver = (StandardStorageDeviceDriver) device.getDeviceDriver(); data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index 3be75c9..b3c5f53 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -65,11 +65,10 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class); // JSONArray datas = JSONArray.parseArray(param); CancelTaskResponse response = new CancelTaskResponse(); - CancelTaskRequest request = JsonUtl.format(param, CancelTaskRequest.class); + JSONObject request = JSONObject.parseObject(param); // String task_uuid = request.getExt_task_id(); - String task_code = request.getTASKCODE(); - String vehicle_code = request.getVehicle_code(); + String task_code = request.getString("TASKCODE"); // if (StrUtil.isEmpty(task_uuid)) { // throw new WDKException("任务标识不能为空"); @@ -461,10 +460,10 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { // String put_device_code = request.getPut_device_code(); String priority = "1"; String vehicle_code = request.getString("PODCODE"); - String vehicle_type = "1"; - String route_plan_code = "1"; + String vehicle_type = ""; + String route_plan_code = "normal"; String task_type = request.getString("TASKTYPE"); - String storage_task_type = "1"; + String storage_task_type = ""; String agv_system_type = "1"; String remark = ""; double oven_time = 0.00d; @@ -610,6 +609,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { jo.put("next_parent_code", next_point_code); jo.put("start_device_code", start_device_code); jo.put("next_device_code", next_device_code); + jo.put("route_plan_code", route_plan_code); // jo.put("start_device_code2", start_device_code2); // jo.put("next_device_code2", next_device_code2); // jo.put("put_device_code", put_device_code); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java index da79a29..a8666af 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java @@ -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 shortPathsList = routeLineService.getShortPathLines( entity.getStart_device_code(), diff --git a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java index f68170c..15e3caf 100644 --- a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java +++ b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java @@ -44,7 +44,7 @@ public class AutoCreateInst { } String taskid = acsTask.getTask_id(); String taskcode = acsTask.getTask_code(); - String task_type = acsTask.getTask_type(); + String task_type = "1"; String vehiclecode = acsTask.getVehicle_code(); String storage_task_type = acsTask.getStorage_task_type(); String priority = acsTask.getPriority();