From 4f613bfb28a77452e3b6329d79be2c2112457837 Mon Sep 17 00:00:00 2001 From: gengby <858962040@qq.com> Date: Sun, 11 Dec 2022 16:40:39 +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 --- .../maGang/MaGangConveyorDeviceDriver.java | 21 ++++++++----- .../wms/service/impl/AgvToAcsServiceImpl.java | 6 ++-- .../amb/service/impl/HFHandServiceImpl.java | 13 +++++++- acs/nladmin-ui/.env.production | 4 +-- .../device/driver/magang_conveyor_control.vue | 31 +++++++++++++++---- .../src/views/acs/instruction/index.vue | 13 +++++--- acs/nladmin-ui/src/views/acs/task/index.vue | 15 +++++---- 7 files changed, 72 insertions(+), 31 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/maGang/MaGangConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/maGang/MaGangConveyorDeviceDriver.java index 4a69f90..cc50f44 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/maGang/MaGangConveyorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/maGang/MaGangConveyorDeviceDriver.java @@ -181,32 +181,37 @@ public class MaGangConveyorDeviceDriver extends AbstractOpcDeviceDriver implemen } } } + String taskType = String.valueOf(this.getExtraValue().get("taskType")); + String start_device_code = this.getDevice().getDevice_code(); if (StrUtil.isEmpty(next_device_code)) { return false; } + if (StrUtil.equals(taskType, "null") || StrUtil.isEmpty(taskType)) { + taskType = "0"; + } TaskDto taskDto = new TaskDto(); String now = DateUtil.now(); taskDto.setTask_id(IdUtil.simpleUUID()); taskDto.setTask_code("-" + CodeUtil.getNewCode("TASK_NO")); - taskDto.setTask_type("1"); + taskDto.setTask_type(taskType); taskDto.setRoute_plan_code("normal"); taskDto.setTask_status("0"); taskDto.setPriority("101"); taskDto.setAgv_system_type("1"); - taskDto.setStart_device_code(this.getDevice().getDevice_code()); - taskDto.setStart_point_code(this.getDevice().getDevice_code()); + taskDto.setStart_device_code(start_device_code); + taskDto.setStart_point_code(start_device_code); taskDto.setNext_point_code(next_device_code); taskDto.setNext_point_code(next_device_code); - taskDto.setCreate_by(this.getDevice().getDevice_code()); - taskDto.setUpdate_by(this.getDevice().getDevice_code()); + taskDto.setCreate_by(start_device_code); + taskDto.setUpdate_by(start_device_code); taskDto.setUpdate_time(now); taskDto.setCreate_time(now); try { taskserver.create(taskDto); } catch (Exception e) { - logServer.deviceExecuteLog(this.device_code, "", "", device_code + ":创建任务失败," + String.valueOf(e.getMessage())); + logServer.deviceExecuteLog(this.device_code, "", "", this.device_code + ":创建任务失败," + String.valueOf(e.getMessage())); } - logServer.deviceExecuteLog(this.device_code, "", "", device_code + ":创建任务成功"); + logServer.deviceExecuteLog(this.device_code, "", "", this.device_code + ":创建任务成功"); this.writing(1); this.setRequireSucess(true); return true; @@ -220,7 +225,7 @@ public class MaGangConveyorDeviceDriver extends AbstractOpcDeviceDriver implemen //将扩展表中的字符串数据转换成集合 public List getExtraDeviceCodes(String extraName) { String extraValue = (String) this.getDevice().getExtraValue().get(extraName); - if (StrUtil.isEmpty(extraValue)){ + if (StrUtil.isEmpty(extraValue)) { return new ArrayList<>(); } String devicesString = extraValue.substring(1, extraValue.length() - 1); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AgvToAcsServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AgvToAcsServiceImpl.java index 4c80bbb..113a59b 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AgvToAcsServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AgvToAcsServiceImpl.java @@ -47,7 +47,8 @@ public class AgvToAcsServiceImpl implements AgvToAcsService { map.put("status", 200); map.put("message", "操作成功"); if (address.contains("INGET")) { - if (maGangConveyorDeviceDriver.getMove() == 1) { + maGangConveyorDeviceDriver.writing(4); + if (maGangConveyorDeviceDriver.getMove() == 1 && maGangConveyorDeviceDriver.getAction() == 1) { logService.deviceExecuteLog(deviceCode, vehicle_code, inst_code, "请求路径:api/agv/waitpointRequest,请求参数:" + param.toString() + ",请求成功-响应参数:" + map.toString()); return map; } else { @@ -64,7 +65,8 @@ public class AgvToAcsServiceImpl implements AgvToAcsService { throw new BadRequestException("请求失败,取货完成后-取货点有货!"); } } else if (address.contains("INPUT")) { - if (maGangConveyorDeviceDriver.getMove() == 0) { + maGangConveyorDeviceDriver.writing(5); + if (maGangConveyorDeviceDriver.getMove() == 0 && maGangConveyorDeviceDriver.getAction() == 2) { logService.deviceExecuteLog(deviceCode, vehicle_code, inst_code, "请求路径:api/agv/waitpointRequest,请求参数:" + param.toString() + ",请求成功-响应参数:" + map.toString()); return map; } else { diff --git a/acs/nladmin-system/src/main/java/org/nl/hand/amb/service/impl/HFHandServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/hand/amb/service/impl/HFHandServiceImpl.java index 9d94d1c..f90fa6a 100644 --- a/acs/nladmin-system/src/main/java/org/nl/hand/amb/service/impl/HFHandServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/hand/amb/service/impl/HFHandServiceImpl.java @@ -17,6 +17,7 @@ import org.nl.acs.device.service.dto.DeviceDto; import org.nl.acs.device.service.impl.DeviceServiceImpl; import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; +import org.nl.acs.device_driver.maGang.MaGangConveyorDeviceDriver; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.instruction.service.dto.InstructionDto; @@ -345,7 +346,17 @@ public class HFHandServiceImpl implements HFHandService { resultJson.put("result", ""); return resultJson; } - + Device device = deviceAppService.findDeviceByCode(start_devicecode); + if (device.getDeviceDriver() instanceof MaGangConveyorDeviceDriver){ + MaGangConveyorDeviceDriver maGangConveyorDeviceDriver = + (MaGangConveyorDeviceDriver) device.getDeviceDriver(); + String taskType = String.valueOf(maGangConveyorDeviceDriver.getExtraValue().get("taskType")); + if (StrUtil.equals(taskType,"null") || StrUtil.isEmpty(taskType)){ + task_type = "0"; + }else { + task_type = taskType; + } + } TaskService taskService = SpringContextHolder.getBean(TaskServiceImpl.class); TaskDto dto = new TaskDto(); dto.setIs_active("1"); diff --git a/acs/nladmin-ui/.env.production b/acs/nladmin-ui/.env.production index 786bd42..762ac12 100644 --- a/acs/nladmin-ui/.env.production +++ b/acs/nladmin-ui/.env.production @@ -2,6 +2,6 @@ ENV = 'production' # 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置 # 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http -VUE_APP_BASE_API = 'http://47.97.157.227:8010' +VUE_APP_BASE_API = 'http://127.0.0.1:8010' # 如果接口是 http 形式, wss 需要改为 ws -VUE_APP_WS_API = 'ws://47.97.157.227:8010' +VUE_APP_WS_API = 'ws://127.0.0.1:8010' diff --git a/acs/nladmin-ui/src/views/acs/device/driver/magang_conveyor_control.vue b/acs/nladmin-ui/src/views/acs/device/driver/magang_conveyor_control.vue index 825e925..2bc0f38 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/magang_conveyor_control.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/magang_conveyor_control.vue @@ -92,6 +92,11 @@ + + + + + @@ -112,6 +117,23 @@ + + + + + + + - - - - - @@ -266,6 +283,7 @@ import deviceCrud from '@/api/acs/device/device' export default { name: 'StandardConveyorControl', + dicts: ['task_type'], mixins: [crud], props: { parentForm: { @@ -297,7 +315,8 @@ export default { manual_create_task: true, is_pickup: true, is_release: true, - link_device_code: [] + link_device_code: [], + taskType: '' }, rules: {} } diff --git a/acs/nladmin-ui/src/views/acs/instruction/index.vue b/acs/nladmin-ui/src/views/acs/instruction/index.vue index 7e82e25..9130599 100644 --- a/acs/nladmin-ui/src/views/acs/instruction/index.vue +++ b/acs/nladmin-ui/src/views/acs/instruction/index.vue @@ -109,10 +109,14 @@ - - + + + + - +