From 0b7945a149dfad504badc53a5e0f02f89ad1712e Mon Sep 17 00:00:00 2001 From: tuqiang <437016993@qq.com> Date: Thu, 7 Mar 2024 18:12:53 +0800 Subject: [PATCH] =?UTF-8?q?rev:=E6=96=B0=E5=A2=9E=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=8C=E9=A9=B1=E5=8A=A8=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SiemensConveyorCkkDeviceDriver.java | 3 +- .../acs/device_driver/rgv/ItemProtocol.java | 29 ++-- .../device_driver/rgv/RgvDeviceDriver.java | 51 +++--- .../BlankManipulatorDeviceDriver.java | 38 ++-- .../blanking_button/BlankingButtonDriver.java | 87 +++++++--- .../GreenFoilMachineButtonDriver.java | 67 +++++-- .../InflatableShaftLibraryDeviceDriver.java | 53 +++++- .../plug_pull_device_site/ItemProtocol.java | 16 +- .../PlugPullDeviceSiteDeviceDriver.java | 69 +++++--- .../pull_head_manipulator/ItemProtocol.java | 7 + .../SlitTwoManipulatorDeviceDriver.java | 83 +++++---- .../SubRollConveyorSiteDeviceDriver.java | 15 +- .../SubvolumeWeighingStationDriver.java | 50 +++++- .../ItemProtocol.java | 21 ++- .../WasteFoilWeighingStationDriver.java | 163 +++++++++++++++++- .../data/ApplyManipulatorActionRequest.java | 19 +- .../data/ApplyManipulatorActionResponse.java | 9 + .../wms/data/ApplyPlugPullSitResponse.java | 1 + .../acs/ext/wms/data/CreateTaskRequest.java | 2 +- .../wms/data/GetWasteFoilWeightRequest.java | 35 ++++ .../wms/data/GetWasteFoilWeightResponse.java | 4 + .../acs/ext/wms/data/PutActionResponse.java | 4 + .../ext/wms/data/PutWeightActionRequest.java | 28 +++ .../ext/wms/data/PutWeightActionResponse.java | 4 + .../acs/ext/wms/rest/AcsToWmsController.java | 2 + .../acs/ext/wms/rest/WmsToAcsController.java | 8 + .../acs/ext/wms/service/AcsToWmsService.java | 8 + .../acs/ext/wms/service/WmsToAcsService.java | 9 + .../wms/service/impl/AcsToWmsServiceImpl.java | 38 ++++ .../wms/service/impl/WmsToAcsServiceImpl.java | 54 +++++- .../service/impl/InstructionServiceImpl.java | 22 +-- .../org/nl/acs/task/service/dto/TaskDto.java | 5 + .../monitor/two_device/two_device.properties | 8 + .../two_device/two_device_en_US.properties | 8 + .../two_device/two_device_in_ID.properties | 8 + .../two_device/two_device_zh_CN.properties | 9 +- .../monitor/universal/universal.properties | 7 +- .../universal/universal_en_US.properties | 8 +- .../universal/universal_in_ID.properties | 8 +- .../universal/universal_zh_CN.properties | 8 +- .../src/views/acs/monitor/device/index.vue | 5 + .../src/views/system/monitor/device/index.vue | 6 + 42 files changed, 862 insertions(+), 217 deletions(-) create mode 100644 acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/GetWasteFoilWeightRequest.java create mode 100644 acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/GetWasteFoilWeightResponse.java create mode 100644 acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/PutWeightActionRequest.java create mode 100644 acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/PutWeightActionResponse.java diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/siemens_conveyor_ckk/SiemensConveyorCkkDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/siemens_conveyor_ckk/SiemensConveyorCkkDeviceDriver.java index 0d6a391e4..0b924a987 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/siemens_conveyor_ckk/SiemensConveyorCkkDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/siemens_conveyor_ckk/SiemensConveyorCkkDeviceDriver.java @@ -38,7 +38,6 @@ import org.nl.acs.storage_cell.service.mapper.StorageCellMapper; import org.nl.acs.task.enums.TaskStatusEnum; import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.dto.TaskDto; -import org.nl.common.utils.SecurityUtils; import org.nl.config.language.LangProcess; import org.nl.system.service.param.ISysParamService; import org.nl.config.SpringContextHolder; @@ -631,7 +630,7 @@ public class SiemensConveyorCkkDeviceDriver extends AbstractOpcDeviceDriver impl instdto.setVehicle_code(vehiclecode); String now = DateUtil.now(); instdto.setCreate_time(now); - instdto.setCreate_by(SecurityUtils.getCurrentNickName()); + instdto.setCreate_by("auto"); instdto.setStart_device_code(start_device_code); instdto.setNext_device_code(next_device_code); instdto.setStart_point_code(start_point_code); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/ItemProtocol.java index 824ee20dd..566aaae5c 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/ItemProtocol.java @@ -26,19 +26,17 @@ ItemProtocol { public static String item_task = "task"; //报警 public static String item_error = "error"; - //托盘类型 - public static String item_container_type="container_type"; + //气涨轴编号 + public static String item_barcode = "barcode"; //下发命令 public static String item_to_command = "to_command"; - //下发起始站 - public static String item_to_onset = "to_onset"; //下发目标站 public static String item_to_target = "to_target"; //下发任务号 public static String item_to_task = "to_task"; - //下发托盘类型 - public static String item_to_container_type = "to_container_type"; + //下发子卷号 + public static String item_to_sub_volume_no = "to_sub_volume_no"; private RgvDeviceDriver driver; @@ -70,6 +68,10 @@ ItemProtocol { return this.getOpcIntegerValue(item_error); } + public int getBarcode() { + return this.getOpcIntegerValue(item_barcode); + } + public int getTask() { return this.getOpcIntegerValue(item_task); } @@ -78,9 +80,6 @@ ItemProtocol { return this.getOpcIntegerValue(item_to_task); } - public int getTo_onset() { - return this.getOpcIntegerValue(item_to_onset); - } public int getTo_command() { return this.getOpcIntegerValue(item_to_command); @@ -90,12 +89,9 @@ ItemProtocol { return this.getOpcIntegerValue(item_to_target); } - public int getContainer_type(){ - return this.getOpcIntegerValue(item_container_type); - } - public int getTo_container_type(){ - return this.getOpcIntegerValue(item_to_container_type); + public int getTo_sub_volume_no(){ + return this.getOpcIntegerValue(item_to_sub_volume_no); } Boolean isonline; @@ -121,17 +117,16 @@ ItemProtocol { list.add(new ItemDto(item_walk_y, "行走列", "DB1.B4")); list.add(new ItemDto(item_error, "报警信号", "DB1.B5")); list.add(new ItemDto(item_task, "任务号", "DB1.D6")); - list.add(new ItemDto(item_container_type, "托盘类型", "DB1.D6")); + list.add(new ItemDto(item_barcode, "任务号", "DB1.B7")); return list; } public static List getWriteableItemDtos() { ArrayList list = new ArrayList<>(); list.add(new ItemDto(item_to_command, "下发命令", "DB2.W0")); - list.add(new ItemDto(item_to_onset, "下发起始站", "DB2.W2")); list.add(new ItemDto(item_to_target, "下发目标站", "DB2.W4")); list.add(new ItemDto(item_to_task, "下发任务号", "DB2.D6")); - list.add(new ItemDto(item_to_container_type, "下发托盘类型", "DB2.W8")); + list.add(new ItemDto(item_to_sub_volume_no, "下发子卷号", "DB2.W8")); return list; } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/RgvDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/RgvDeviceDriver.java index 18b019807..dee4f387f 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/RgvDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/rgv/RgvDeviceDriver.java @@ -1,5 +1,6 @@ package org.nl.acs.device_driver.rgv; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; @@ -33,6 +34,7 @@ import org.nl.acs.opc.DeviceAppServiceImpl; import org.nl.acs.route.service.RouteLineService; import org.nl.acs.route.service.impl.RouteLineServiceImpl; import org.nl.acs.task.service.TaskService; +import org.nl.acs.task.service.dto.TaskDto; import org.nl.config.SpringContextHolder; import org.nl.config.language.LangProcess; import org.springframework.beans.factory.annotation.Autowired; @@ -86,6 +88,9 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr //任务号 int task = 0; int last_task = 0; + //气涨轴条码 + int barcode = 0; + int last_barcode = 0; int heartbeat = 0; @@ -99,15 +104,9 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr int to_task = 0; int last_to_task = 0; - int to_onset = 0; - int last_to_onset = 0; - //托盘类型 - int container_type = 0; - int last_container_type = 0; - - int to_container_type = 0; - int last_to_container_type = 0; + int to_sub_volume_no = 0; + int last_to_sub_volume_no = 0; Boolean isonline = true; int hasGoods = 0; @@ -132,6 +131,9 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr String device_code; + String left = "1"; + String right = "2"; + //当前指令 Instruction inst = null; @@ -163,23 +165,17 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr walk_y = this.itemProtocol.getWalk_y(); error = this.itemProtocol.getError(); task = this.itemProtocol.getTask(); + barcode = this.itemProtocol.getBarcode(); heartbeat = this.itemProtocol.getHeartbeat(); to_command = this.itemProtocol.getTo_command(); to_target = this.itemProtocol.getTo_target(); to_task = this.itemProtocol.getTo_task(); - to_onset = this.itemProtocol.getTo_onset(); - to_container_type = this.itemProtocol.getTo_container_type(); - container_type = this.itemProtocol.getContainer_type(); + to_sub_volume_no = this.itemProtocol.getTo_sub_volume_no(); - if (to_container_type != last_to_container_type) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_container_type:" + last_to_container_type + "->" + to_container_type); - } - if (container_type != last_container_type) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号container_type:" + last_container_type + "->" + container_type); - } - if (to_onset != last_to_onset) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_onset:" + last_to_onset + "->" + to_onset); + if (to_sub_volume_no != last_to_sub_volume_no) { + logServer.deviceExecuteLog(this.device_code, "", "", "信号to_sub_volume_no:" + last_to_sub_volume_no + "->" + to_sub_volume_no); } + if (to_command != last_to_command) { logServer.deviceExecuteLog(this.device_code, "", "", "信号to_command:" + last_to_command + "->" + to_command); } @@ -274,12 +270,11 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr last_error = error; last_task = task; last_heartbeat = heartbeat; + last_barcode = barcode; last_to_task = to_task; last_to_command = to_command; last_to_target = to_target; - last_to_onset = to_onset; - last_to_container_type = to_container_type; - last_container_type = container_type; + last_to_sub_volume_no = to_sub_volume_no; } /** @@ -291,15 +286,17 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr public synchronized void applyTask() { ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); ApplyManipulatorActionResponse applyManipulatorActionResponse; - Instruction inst1 = instructionService.findByCode(String.valueOf(task)); - String task_code1 = inst1.getTask_code(); applyManipulatorActionRequest.setDevice_code(device_code); - applyManipulatorActionRequest.setTask_code(task_code1); + applyManipulatorActionRequest.setLocation("1"); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); Map map = new LinkedHashMap<>(); if (applyManipulatorActionResponse.getCode() == 200) { - String barcode = applyManipulatorActionRequest.getBarcode(); - map.put("to_barcode", barcode); + map.put("to_target",applyManipulatorActionResponse.getNext_point()); + if (StrUtil.isEmpty(left)){ + map.put("to_sub_volume_no", right); + } else { + map.put("to_sub_volume_no", left); + } this.writing(map); logServer.deviceExecuteLog(this.device_code, "", "", "申请行架任务,返回参数:" + applyManipulatorActionResponse); message = "申请行架任务成功"; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blank_manipulator/BlankManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blank_manipulator/BlankManipulatorDeviceDriver.java index 285636210..d9cbce488 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blank_manipulator/BlankManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blank_manipulator/BlankManipulatorDeviceDriver.java @@ -198,7 +198,7 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem if (mode == 3 && task > 0) { Date date = new Date(); if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) { - log.trace(LangProcess.msg("universal_feedMessage6"), this.instruction_update_time_out); + log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out); } else { this.instruction_update_time = date; @@ -232,29 +232,29 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem ja.add(jo); HttpResponse body = acsToWmsService.feedbackTaskStatusToWms(ja); if (body.getStatus() == 200) { - message = LangProcess.msg("two_message1"); + message = "two_message1"; requireSucess = true; LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) - .content(LangProcess.msg("two_message3") + JSON.toJSONString(body)) + .content("反馈请求成功,响应参数:" + JSON.toJSONString(body)) .build(); luceneExecuteLogService.deviceExecuteLog(logDto); Map map = new LinkedHashMap<>(); map.put("to_command", "5"); this.writing(map); } else { - message = LangProcess.msg("two_message2"); + message = "two_message2"; requireSucess = false; LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) - .content(LangProcess.msg("two_message2")) + .content("反馈重量以及收卷轴LMS失败...") .build(); luceneExecuteLogService.deviceExecuteLog(logDto); } } else { LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) - .content(LangProcess.msg("universal_message6")) + .content("当前指令号为空") .build(); luceneExecuteLogService.deviceExecuteLog(logDto); } @@ -264,13 +264,13 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem feedMessage = feedMessage + "universal_feedMessage1"; } if (action != 5) { - feedMessage = feedMessage + LangProcess.msg("two_message4"); + feedMessage = feedMessage + "two_message4"; } if (move != 1) { - feedMessage = feedMessage + LangProcess.msg("universal_feedMessage7"); + feedMessage = feedMessage + "universal_feedMessage7"; } if (task == 0) { - feedMessage = feedMessage + LangProcess.msg("universal_feedMessage8"); + feedMessage = feedMessage + "universal_feedMessage8"; } } @@ -281,7 +281,7 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem if (StrUtil.equals(inst2.getInstruction_status(), InstructionStatusEnum.BUSY.getIndex())) { try { requireSucess = true; - message = LangProcess.msg("universal_message7"); + message = "universal_message7"; finish_instruction(inst2); Map map = new LinkedHashMap<>(); map.put("to_command", "6"); @@ -299,7 +299,7 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem feedMessage = var17.getMessage(); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) - .content(LangProcess.msg("universal_message8") + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)) + .content("读取信号值时出现异常:" + var17.getMessage() + ",this.itemProtocol is null:" + ObjectUtil.isEmpty(this.itemProtocol)) .build(); luceneExecuteLogService.deviceExecuteLog(logDto); @@ -307,11 +307,11 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem if (mode == 0) { this.setIsonline(false); - message = LangProcess.msg("universal_off-line"); + message = "universal_off-line"; //有报警 } else if (error != 0) { this.setIserror(true); - message = LangProcess.msg("universal_message3"); + message = "universal_message3"; //无报警 } else { this.setIsonline(true); @@ -331,21 +331,21 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem } else { if (mode == 2) { //if (!requireSucess) { - String remark = "";; + String remark = "未查找任务原因为:"; if (mode != 2) { - remark = remark + "universal_remark2"; + remark = remark + "工作模式(mode)不是待机状态"; } if (move != 0) { - remark = remark + "universal_remark3"; + remark = remark + "光电信号(move)为有货状态"; } if (task != 0) { - remark = remark + LangProcess.msg("universal_remark4"); + remark = remark + "当前上报任务号(task)应该为0"; if (ObjectUtil.isNotEmpty(this.inst)) { this.inst = null; } } if (requireSucess) { - remark = remark + LangProcess.msg("universal_remark5"); + remark = remark + "右击该图标,将请求任务复位标记(requireSucess)改为否。"; } this.setNotCreateTaskMessage(remark); //} @@ -378,7 +378,7 @@ public class BlankManipulatorDeviceDriver extends AbstractOpcDeviceDriver implem public synchronized boolean applyTask() { Date date = new Date(); if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { - log.trace(LangProcess.msg("universal_feedMessage6"), this.instruction_require_time_out); + log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); return false; } else { this.instruction_require_time = date; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blanking_button/BlankingButtonDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blanking_button/BlankingButtonDriver.java index 31528cf86..f43ee62c9 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blanking_button/BlankingButtonDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/blanking_button/BlankingButtonDriver.java @@ -143,7 +143,7 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev if (mode == 0) { this.setIsonline(false); - message = LangProcess.msg("universal_off-line"); + message = "universal_off-line"; // 有报警 // } else if (error != 0) { // this.setIsonline(false); @@ -155,7 +155,7 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev this.setIserror(false); if (error != 0) { this.setIserror(true); - message = LangProcess.msg("universal_message3"); + message = "universal_message3"; } message = ""; Instruction instruction = null; @@ -163,10 +163,10 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev switch (mode) { case 2: - log.debug(LangProcess.msg("universal_standby")); + log.debug("待机"); break; case 3: - log.debug(LangProcess.msg("universal_operation")); + log.debug("运行中"); break; case 9: // 表处下满料请求 @@ -206,26 +206,26 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev Date date = new Date(); if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { - log.trace(LangProcess.msg("universal_feedMessage6"), this.instruction_require_time_out); + log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); return; } else { this.instruction_require_time = date; if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), CommonFinalParam.ONE)) { - message = LangProcess.msg("two_message5"); + message = "two_message5"; BlankingButtonRequest blankingButtonRequest = new BlankingButtonRequest(); blankingButtonRequest.setDevice_code(device_code); blankingButtonRequest.setType("1"); BlankingButtonResponse response = acsToWmsService.applyBlankButtonTask(blankingButtonRequest); if (ObjectUtil.isEmpty(response)) { - message = LangProcess.msg("two_message6"); + message = "two_message6"; } else { if (response.getCode()== 200) { this.writing("to_command","9"); - message = LangProcess.msg("two_message7"); + message = "two_message7"; requireSucess = true; } else { requireSucess = false; - message = LangProcess.msg("two_message8") + response.getMessage(); + message = "two_message8" + response.getMessage(); this.writing("to_command","99"); } } @@ -240,26 +240,26 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev Date date = new Date(); if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { - log.trace(LangProcess.msg("universal_feedMessage6"), this.instruction_require_time_out); + log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); return; } else { this.instruction_require_time = date; if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), CommonFinalParam.ONE)) { - message = LangProcess.msg("two_message9"); + message = "two_message9"; BlankingButtonRequest blankingButtonRequest = new BlankingButtonRequest(); blankingButtonRequest.setDevice_code(device_code); blankingButtonRequest.setType("2"); BlankingButtonResponse response = acsToWmsService.applyBlankButtonTask(blankingButtonRequest); if (ObjectUtil.isEmpty(response)) { - message = LangProcess.msg("two_message10"); + message = "two_message10"; } else { if (response.getCode()== 200) { this.writing("to_command","10"); - message = LangProcess.msg("two_message11"); + message = "two_message11"; requireSucess = true; } else { requireSucess = false; - message = LangProcess.msg("two_message12") + response.getMessage(); + message = "two_message12" + response.getMessage(); this.writing("to_command","99"); } } @@ -274,26 +274,26 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev Date date = new Date(); if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { - log.trace(LangProcess.msg("universal_feedMessage6"), this.instruction_require_time_out); + log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); return; } else { this.instruction_require_time = date; if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), CommonFinalParam.ONE)) { - message = LangProcess.msg("two_message13"); + message = "two_message13"; BlankingButtonRequest blankingButtonRequest = new BlankingButtonRequest(); blankingButtonRequest.setDevice_code(device_code); blankingButtonRequest.setType("2"); BlankingButtonResponse response = acsToWmsService.applyBlankButtonTask(blankingButtonRequest); if (ObjectUtil.isEmpty(response)) { - message = LangProcess.msg("two_message14"); + message = "two_message14"; } else { if (response.getCode()== 200) { this.writing("to_command","10"); - message = LangProcess.msg("two_message15"); + message = "two_message15"; requireSucess = true; } else { requireSucess = false; - message = LangProcess.msg("two_message16") + response.getMessage(); + message = "two_message16" + response.getMessage(); this.writing("to_command","99"); } } @@ -321,7 +321,54 @@ public class BlankingButtonDriver extends AbstractOpcDeviceDriver implements Dev @Override public JSONObject getDeviceStatusName() throws Exception { - return null; + JSONObject jo = new JSONObject(); + String mode = ""; + String move = ""; + String action = ""; + String walk_y = ""; + if (this.getMode() == 0) { + mode = "脱机"; + } else if (this.getMode() == 1) { + mode = "单机"; + } else if (this.getMode() == 2) { + mode = "待机"; + } else if (this.getMode() == 3) { + mode = "运行中"; + } + + if (this.getMove() == 0) { + move = "无货"; + } else if (this.getMove() == 1) { + move = "有货"; + } + + String requireSucess = "0"; + if (this.requireSucess) { + requireSucess = "1"; + } + jo.put("requireSucess", requireSucess); + if (this.getAction() == 1) { + action = "取货中"; + } else if (this.getAction() == 2) { + action = "取货完成"; + } else if (this.getAction() == 3) { + action = "放货中"; + } else if (this.getAction() == 4) { + action = "放货完成"; + } + + jo.put("device_name", this.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("move", move); + jo.put("action", action); + jo.put("walk_y", walk_y); + jo.put("isOnline", this.getIsonline()); + jo.put("error", this.getError()); + jo.put("isError", this.getIserror()); + jo.put("message", LangProcess.msg(message)); + jo.put("driver_type", "siemens_conveyor"); + jo.put("is_click", true); + return jo; } @Override diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/green_foil_machine_button/GreenFoilMachineButtonDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/green_foil_machine_button/GreenFoilMachineButtonDriver.java index 6b621f27c..904e44bee 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/green_foil_machine_button/GreenFoilMachineButtonDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/green_foil_machine_button/GreenFoilMachineButtonDriver.java @@ -137,7 +137,7 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem if (mode == 0) { this.setIsonline(false); - message = LangProcess.msg("universal_off-line"); + message = "universal_off-line"; // 有报警 // } else if (error != 0) { // this.setIsonline(false); @@ -146,7 +146,7 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem // //无报警 } else if (error != 0) { this.setIserror(true); - message = LangProcess.msg("universal_message3"); + message = "universal_message3"; }else { this.setIsonline(true); this.setIserror(false); @@ -156,10 +156,10 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem switch (mode) { case 2: - log.debug(LangProcess.msg("universal_standby")); + log.debug("待机"); break; case 3: - log.debug(LangProcess.msg("universal_operation")); + log.debug("运行中"); break; case 4: // 申请AGV取空取满放空放满任务 @@ -208,18 +208,18 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem Date date = new Date(); if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { - log.trace(LangProcess.msg("universal_feedMessage6"), this.instruction_require_time_out); + log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); return; } else { this.instruction_require_time = date; if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), CommonFinalParam.ONE)) { - message = LangProcess.msg("two_message17"); + message = "two_message17"; ApplyGreenFoilButtonRequest applyGreenFoilButtonRequest = new ApplyGreenFoilButtonRequest(); applyGreenFoilButtonRequest.setDevice_code(device_code); applyGreenFoilButtonRequest.setType(String.valueOf(mode)); ApplyGreenFoilButtonResponse response = acsToWmsService.applyGreenFoilButtonTask(applyGreenFoilButtonRequest); if (ObjectUtil.isEmpty(response)) { - message = LangProcess.msg("two_message18"); + message = "two_message18"; } else { if (response.getCode()== 200) { if (mode==4){ @@ -229,11 +229,11 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem }else if (mode==9){ this.writing("to_command","9"); } - message = LangProcess.msg("two_message19"); + message = "two_message19"; requireSucess = true; } else { requireSucess = false; - message = LangProcess.msg("two_message20") + response.getMessage(); + message = "two_message20" + response.getMessage(); this.writing("to_command","99"); } } @@ -264,7 +264,54 @@ public class GreenFoilMachineButtonDriver extends AbstractOpcDeviceDriver implem @Override public JSONObject getDeviceStatusName() throws Exception { - return null; + JSONObject jo = new JSONObject(); + String mode = ""; + String move = ""; + String action = ""; + String walk_y = ""; + if (this.getMode() == 0) { + mode = "脱机"; + } else if (this.getMode() == 1) { + mode = "单机"; + } else if (this.getMode() == 2) { + mode = "待机"; + } else if (this.getMode() == 3) { + mode = "运行中"; + } + + if (this.getMove() == 0) { + move = "无货"; + } else if (this.getMove() == 1) { + move = "有货"; + } + + String requireSucess = "0"; + if (this.requireSucess) { + requireSucess = "1"; + } + jo.put("requireSucess", requireSucess); + if (this.getAction() == 1) { + action = "取货中"; + } else if (this.getAction() == 2) { + action = "取货完成"; + } else if (this.getAction() == 3) { + action = "放货中"; + } else if (this.getAction() == 4) { + action = "放货完成"; + } + + jo.put("device_name", this.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("move", move); + jo.put("action", action); + jo.put("walk_y", walk_y); + jo.put("isOnline", this.getIsonline()); + jo.put("error", this.getError()); + jo.put("isError", this.getIserror()); + jo.put("message", LangProcess.msg(message)); + jo.put("driver_type", "siemens_conveyor"); + jo.put("is_click", true); + return jo; } @Override diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/inflatable_shaft_library/InflatableShaftLibraryDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/inflatable_shaft_library/InflatableShaftLibraryDeviceDriver.java index dd5060edd..236900090 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/inflatable_shaft_library/InflatableShaftLibraryDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/inflatable_shaft_library/InflatableShaftLibraryDeviceDriver.java @@ -23,6 +23,7 @@ import org.nl.acs.route.service.RouteLineService; import org.nl.acs.route.service.impl.RouteLineServiceImpl; import org.nl.acs.task.service.TaskService; import org.nl.config.SpringContextHolder; +import org.nl.config.language.LangProcess; import org.springframework.beans.factory.annotation.Autowired; import java.util.HashMap; @@ -133,9 +134,6 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver logServer.deviceExecuteLog(this.device_code, "", "", "信号type:" + last_type + "->" + type); } - if (move==1&&!requireSucess){ - this.writing("to_command","1"); - } last_mode = mode; @@ -167,7 +165,54 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver @Override public JSONObject getDeviceStatusName() throws Exception { - return null; + JSONObject jo = new JSONObject(); + String mode = ""; + String move = ""; + String action = ""; + String walk_y = ""; + if (this.getMode() == 0) { + mode = "脱机"; + } else if (this.getMode() == 1) { + mode = "单机"; + } else if (this.getMode() == 2) { + mode = "待机"; + } else if (this.getMode() == 3) { + mode = "运行中"; + } + + if (this.getMove() == 0) { + move = "无货"; + } else if (this.getMove() == 1) { + move = "有货"; + } + + String requireSucess = "0"; + if (this.requireSucess) { + requireSucess = "1"; + } + jo.put("requireSucess", requireSucess); + if (this.getAction() == 1) { + action = "取货中"; + } else if (this.getAction() == 2) { + action = "取货完成"; + } else if (this.getAction() == 3) { + action = "放货中"; + } else if (this.getAction() == 4) { + action = "放货完成"; + } + + jo.put("device_name", this.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("move", move); + jo.put("action", action); + jo.put("walk_y", walk_y); + jo.put("isOnline", this.getIsonline()); + jo.put("error", this.getError()); + jo.put("isError", this.getIserror()); + jo.put("message", LangProcess.msg(message)); + jo.put("driver_type", "siemens_conveyor"); + jo.put("is_click", true); + return jo; } @Override diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/ItemProtocol.java index 411ada24f..c62d95b89 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/ItemProtocol.java @@ -46,11 +46,11 @@ public class ItemProtocol { //气涨轴类型 public static String item_to_qzz_type = "to_qzz_type"; //是否换轴 - public static String item_to_is_changeShaft = "to_is_changeShaft"; + public static String item_to_weight1 = "to_weight1"; //尺寸 public static String item_to_size = "to_size"; //存储位置 - public static String item_to_location = "to_location"; + public static String item_to_weight2 = "to_weight2"; private PlugPullDeviceSiteDeviceDriver driver; @@ -112,16 +112,16 @@ public class ItemProtocol { return this.getOpcIntegerValue(item_to_qzz_type); } - public int getTo_is_changeShaft() { - return this.getOpcIntegerValue(item_to_is_changeShaft); + public int getTo_weight2() { + return this.getOpcIntegerValue(item_to_weight2); } public int getTo_size() { return this.getOpcIntegerValue(item_to_size); } - public int getTo_location() { - return this.getOpcIntegerValue(item_to_location); + public int getTo_weight1() { + return this.getOpcIntegerValue(item_to_weight1); } Boolean isonline; @@ -180,8 +180,8 @@ public class ItemProtocol { list.add(new ItemDto(item_to_material2, "纸管2规格", "DB10.W4")); list.add(new ItemDto(item_to_qty, "纸管数量", "DB10.W6")); list.add(new ItemDto(item_to_qzz_type, "气胀轴类型", "DB10.W8")); - list.add(new ItemDto(item_to_is_changeShaft, "是否换轴", "DB10.W10")); - list.add(new ItemDto(item_to_location, "存储位置", "DB10.W12")); + list.add(new ItemDto(item_to_weight1, "纸管1标准重量", "DB10.W10")); + list.add(new ItemDto(item_to_weight2, "纸管2标准重量", "DB10.W12")); list.add(new ItemDto(item_to_size, "尺寸", "DB10.W14")); return list; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java index 10c404a79..58ca5dcff 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/plug_pull_device_site/PlugPullDeviceSiteDeviceDriver.java @@ -90,20 +90,20 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl int last_to_command = 0; //气胀轴条码 - int barcode =0; - int last_barcode =0; + int barcode = 0; + int last_barcode = 0; //纸管1重量 - int weight1 =0; - int last_weight1 =0; + int weight1 = 0; + int last_weight1 = 0; //纸管1规格 - int material1 =0; - int last_material1 =0; + int material1 = 0; + int last_material1 = 0; //纸管2重量 - int weight2 =0; - int last_weight2 =0; + int weight2 = 0; + int last_weight2 = 0; //纸管2规格 - int material2 =0; - int last_material2 =0; + int material2 = 0; + int last_material2 = 0; int to_size = 0; int last_to_size = 0; @@ -120,11 +120,11 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl int to_qzz_type = 0; int last_to_qzz_type = 0; - int to_is_changeShaft = 0; - int last_to_is_changeShaft = 0; + int to_weight1 = 0; + int last_to_weight1 = 0; - int to_location = 0; - int last_to_location = 0; + int to_weight2 = 0; + int last_to_weight2 = 0; Boolean isonline = true; @@ -147,7 +147,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl return this.device; } - /** + /** * 请求成功标记 */ Boolean requireSucess = false; @@ -171,9 +171,9 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl to_material1 = this.itemProtocol.getTo_material1(); to_material2 = this.itemProtocol.getTo_material2(); to_qty = this.itemProtocol.getTo_qty(); - to_qzz_type=this.itemProtocol.getTo_qzz_type(); - to_is_changeShaft=this.itemProtocol.getTo_is_changeShaft(); - to_location=this.itemProtocol.getTo_location(); + to_qzz_type = this.itemProtocol.getTo_qzz_type(); + to_weight1 = this.itemProtocol.getTo_weight1(); + to_weight2 = this.itemProtocol.getTo_weight2(); to_size = this.itemProtocol.getTo_size(); if (mode != last_mode) { @@ -232,11 +232,11 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl if (to_qzz_type != last_to_qzz_type) { logServer.deviceExecuteLog(this.device_code, "", "", "信号to_qzz_type:" + last_to_qzz_type + "->" + to_qzz_type); } - if (to_is_changeShaft != last_to_is_changeShaft) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_is_changeShaft:" + last_to_is_changeShaft + "->" + to_is_changeShaft); + if (to_weight1 != last_to_weight1) { + logServer.deviceExecuteLog(this.device_code, "", "", "to_weight1:" + last_to_weight1 + "->" + to_weight1); } - if (to_location != last_to_location) { - logServer.deviceExecuteLog(this.device_code, "", "", "信号to_location:" + last_to_location + "->" + to_location); + if (to_weight2 != last_to_weight2) { + logServer.deviceExecuteLog(this.device_code, "", "", "信号to_weight2:" + last_to_weight2 + "->" + to_weight2); } if (to_size != last_to_size) { logServer.deviceExecuteLog(this.device_code, "", "", "信号to_size:" + last_to_size + "->" + to_size); @@ -270,9 +270,20 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl log.info(LangProcess.msg("universal_operation")); break; case 4: - Instruction inst = instructionService.findByCode(String.valueOf(task)); - TaskDto taskDto = taskserver.findByCode(inst.getTask_code()); - if (StrUtil.equals("1", taskDto.getIs_bushing())) { + if (task > 0) { + Instruction inst = instructionService.findByCode(String.valueOf(task)); + TaskDto taskDto = taskserver.findByCode(inst.getTask_code()); + if (StrUtil.equals("1", taskDto.getIs_bushing())) { + if (move == 1 && !requireSucess) { + //申请套管 + apply_casing(mode); + } + } else { + Map map = new LinkedHashMap<>(); + map.put("to_size", taskDto.getSize()); + this.writing(map); + } + } else { if (move == 1 && !requireSucess) { //申请套管 apply_casing(mode); @@ -324,8 +335,8 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl last_to_material2 = to_material2; last_to_qty = to_qty; last_to_qzz_type = to_qzz_type; - last_to_is_changeShaft = to_is_changeShaft; - last_to_location = to_location; + last_to_weight2 = to_weight2; + last_to_weight1 = to_weight1; last_to_size = to_size; } @@ -404,6 +415,10 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl ApplyPlugPullSitResponse applyPlugPullSitResponse; Instruction inst1 = instructionService.findByCode(String.valueOf(task)); String task_code1 = inst1.getTask_code(); + TaskDto taskDto = taskserver.findByCode(task_code1); + if (ObjectUtil.isNotEmpty(taskDto)){ + + } applyPlugPullSiteRequest.setDevice_code(device_code); applyPlugPullSiteRequest.setTask_code(task_code1); applyPlugPullSiteRequest.setBarcode(String.valueOf(barcode)); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/ItemProtocol.java index 4203afac0..1f0c5c3f5 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/pull_head_manipulator/ItemProtocol.java @@ -54,6 +54,8 @@ public class ItemProtocol { //子卷2长度 public static String item_to_length2 = "to_length2"; + public static String item_to_barcode = "to_barcode"; + private PullHeadManipulatorDeviceDriver driver; @@ -113,6 +115,10 @@ public class ItemProtocol { return this.getOpcIntegerValue(item_to_qty); } + public int getTo_barcode() { + return this.getOpcIntegerValue(item_to_barcode); + } + public int getTo_onset() { return this.getOpcIntegerValue(item_to_onset); } @@ -203,6 +209,7 @@ public class ItemProtocol { list.add(new ItemDto(item_to_command, "下发命令", "DB12.W0")); list.add(new ItemDto(item_to_onset, "下发起始站", "DB12.W2")); list.add(new ItemDto(item_to_target, "下发目标站", "DB12.W4")); + list.add(new ItemDto(item_to_barcode, "下发气涨轴条码", "DB12.W4")); list.add(new ItemDto(item_to_task, "下发任务号", "DB12.D6")); list.add(new ItemDto(item_to_pull, "是否拔轴", "DB12.W8")); list.add(new ItemDto(item_to_sleeve, "是否套轴", "DB12.W10")); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java index 641616d7c..6f13ce098 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java @@ -186,16 +186,16 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl // } else if (mode == 0) { this.setIsonline(false); - message = "未联机"; + message = "universal_off-line"; //有报警 } else if (error != 0) { this.setIserror(true); - message = "有报警"; + message = "universal_message3"; //无报警 } else { this.setIsonline(true); this.setIserror(false); - message = "运行中"; + message = "universal_operation"; switch (mode) { case 1: log.debug("设备运转模式:等待工作"); @@ -218,19 +218,16 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl if (!requireSucess) { String remark = ""; if (mode != 2) { - remark = remark + "行架工作模式不为待机(mode != 2),"; + remark = remark + "universal_remark2"; } if (move1 != 0) { - remark = remark + "前工位有货(move1 != 0),"; + remark = remark + "universal_remark6"; } if (move2 != 0) { - remark = remark + "后工位有货(move2 != 0),"; - } - if (action != 0) { - remark = remark + "动作信号不为0(action != 0),"; + remark = remark + "universal_remark7"; } if (task != 0) { - remark = remark + "存在任务(task != 0),"; + remark = remark + "universal_remark4"; } this.setNotCreateTaskMessage(remark); } @@ -289,23 +286,22 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl } catch (Exception e) { e.printStackTrace(); } - feedMessage = "任务完成"; + feedMessage = "universal_feedMessage6"; } else { - feedMessage = "任务完成后未反馈原因-->"; if (mode != 3) { - feedMessage += "行架工作模式不为运行中(mode != 3),"; + feedMessage += "universal_feedMessage1"; } if (action != 9) { - feedMessage += "动作信号不是任务完成(action != 9),"; + feedMessage += "universal_feedMessage9"; } if (move1 != 0) { - feedMessage += "前工位光电信号不应该为有货状态(move2 != 0),"; + feedMessage += "universal_feedMessage10"; } if (move2 != 0) { - feedMessage += "后工位光电信号不应该为有货状态(move2 != 0),"; + feedMessage += "universal_feedMessage11"; } if (task == 0) { - feedMessage += "没有任务号(task == 0),"; + feedMessage += "universal_feedMessage4"; } } } @@ -388,6 +384,14 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl this.isSetAddress(nextDevice); String start_addr = startDevice.getExtraValue().get("address").toString(); String next_addr = nextDevice.getExtraValue().get("address").toString(); + if (ObjectUtil.isEmpty(start_addr)) { + notCreateInstMessage = "universal_notCreateInstMessage1"; + throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!"); + } + if (ObjectUtil.isEmpty(next_addr)) { + notCreateInstMessage = "universal_notCreateInstMessage1"; + throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); + } //下发电气信号 Map map = new LinkedHashMap<>(); map.put("to_onset1", start_addr); @@ -436,6 +440,14 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl this.isSetAddress(nextDevice); String start_addr = startDevice.getExtraValue().get("address").toString(); String next_addr = nextDevice.getExtraValue().get("address").toString(); + if (ObjectUtil.isEmpty(start_addr)) { + notCreateInstMessage = "universal_notCreateInstMessage1"; + throw new BadRequestException("设备:" + startDevice.getDevice_code() + "未设置电气调度号!"); + } + if (ObjectUtil.isEmpty(next_addr)) { + notCreateInstMessage = "universal_notCreateInstMessage1"; + throw new BadRequestException("设备:" + nextDevice.getDevice_code() + "未设置电气调度号!"); + } //下发电气信号 Map map = new LinkedHashMap<>(); map.put("to_onset1", start_addr); @@ -656,51 +668,46 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl if (this.getMode() == 0) { - mode = "脱机"; + mode = LangProcess.msg("universal_off-line"); } else if (this.getMode() == 1) { - mode = "单机"; + mode = LangProcess.msg("universal_stand-alone"); } else if (this.getMode() == 2) { - mode = "待机"; + mode = LangProcess.msg("universal_standby"); } else if (this.getMode() == 3) { - mode = "运行中"; + mode = LangProcess.msg("universal_operation"); } if (this.getMove1() == 0) { - move_1 = "无货"; + move_1 = LangProcess.msg("universal_no"); } else if (this.getMove1() == 1) { - move_1 = "有货"; + move_1 = LangProcess.msg("universal_yes"); } if (this.getMove2() == 0) { - move_2 = "无货"; + move_2 = LangProcess.msg("universal_no"); } else if (this.getMove2() == 1) { - move_2 = "有货"; + move_2 = LangProcess.msg("universal_yes"); } if (this.getAction() == 1) { - action = "前工位取货中"; + action = LangProcess.msg("two_action1"); } else if (this.getAction() == 2) { - action = "前工位取货完成"; + action = LangProcess.msg("two_action2"); } else if (this.getAction() == 3) { - action = "前工位放货中"; + action = LangProcess.msg("two_action3"); } else if (this.getAction() == 4) { - action = "前工位放货完成"; + action = LangProcess.msg("two_action4"); } else if (this.getAction() == 5) { - action = "后工位取货中"; + action = LangProcess.msg("two_action5"); } else if (this.getAction() == 6) { - action = "后工位取货完成"; + action = LangProcess.msg("two_action6"); } else if (this.getAction() == 7) { - action = "后工位取货中"; + action = LangProcess.msg("two_action7"); } else if (this.getAction() == 8) { - action = "后工位放货完成"; + action = LangProcess.msg("two_action8"); } - if (this.getWalk_y() == 0) { - walk_y = "原位"; - } else if (this.getWalk_y() == 2) { - walk_y = "非原位"; - } if (this.getIs_disable() == 0) { is_disable = "正常"; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/sub_roll_conveyor_site/SubRollConveyorSiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/sub_roll_conveyor_site/SubRollConveyorSiteDeviceDriver.java index 5827cff73..46860e7d1 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/sub_roll_conveyor_site/SubRollConveyorSiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/sub_roll_conveyor_site/SubRollConveyorSiteDeviceDriver.java @@ -23,6 +23,7 @@ import org.nl.acs.opc.DeviceAppService; import org.nl.acs.route.service.RouteLineService; import org.nl.acs.task.service.TaskService; import org.nl.config.SpringContextHolder; +import org.nl.config.language.LangProcess; import org.nl.system.service.param.ISysParamService; import org.springframework.beans.factory.annotation.Autowired; @@ -224,26 +225,25 @@ public class SubRollConveyorSiteDeviceDriver extends AbstractOpcDeviceDriver imp String action = ""; String move = ""; if (this.getMode() == 0) { - mode = "未联机"; + mode = LangProcess.msg("universal_off-line"); } else if (this.getMode() == 1) { - mode = "单机"; + mode = LangProcess.msg("universal_stand-alone"); } else if (this.getMode() == 2) { - mode = "联机"; + mode = LangProcess.msg("universal_standby"); } else if (this.getMode() == 3) { - mode = "运行中"; + mode = LangProcess.msg("universal_operation"); } if (this.getMove() == 0) { - move = "无货"; + move = LangProcess.msg("universal_no"); jo.put("hasGoods", false); } else if (this.getMove() == 1) { - move = "有货"; + move = LangProcess.msg("universal_yes"); jo.put("hasGoods", true); } if(error == 0){ if(this.itemProtocol.isError){ iserror = true; - message = "信号连接异常!"; }else{ iserror = false; } @@ -251,7 +251,6 @@ public class SubRollConveyorSiteDeviceDriver extends AbstractOpcDeviceDriver imp jo.put("device_name", this.getDevice().getDevice_name()); jo.put("mode", mode); jo.put("move", move); - jo.put("action", action); jo.put("isOnline", this.getIsonline()); jo.put("isError", this.getIserror()); return jo; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/subvolume_weighing_station/SubvolumeWeighingStationDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/subvolume_weighing_station/SubvolumeWeighingStationDriver.java index 1ae918237..6c7cf3a2d 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/subvolume_weighing_station/SubvolumeWeighingStationDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/subvolume_weighing_station/SubvolumeWeighingStationDriver.java @@ -15,6 +15,7 @@ import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl; import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.acs.monitor.DeviceStageMonitor; import org.nl.config.SpringContextHolder; +import org.nl.config.language.LangProcess; import java.util.Date; import java.util.HashMap; @@ -136,7 +137,54 @@ public class SubvolumeWeighingStationDriver extends AbstractOpcDeviceDriver impl @Override public JSONObject getDeviceStatusName() throws Exception { - return null; + JSONObject jo = new JSONObject(); + String mode = ""; + String move = ""; + String action = ""; + String walk_y = ""; + if (this.getMode() == 0) { + mode = "脱机"; + } else if (this.getMode() == 1) { + mode = "单机"; + } else if (this.getMode() == 2) { + mode = "待机"; + } else if (this.getMode() == 3) { + mode = "运行中"; + } + + if (this.getMove() == 0) { + move = "无货"; + } else if (this.getMove() == 1) { + move = "有货"; + } + + String requireSucess = "0"; + if (this.requireSucess) { + requireSucess = "1"; + } + jo.put("requireSucess", requireSucess); + if (this.getAction() == 1) { + action = "取货中"; + } else if (this.getAction() == 2) { + action = "取货完成"; + } else if (this.getAction() == 3) { + action = "放货中"; + } else if (this.getAction() == 4) { + action = "放货完成"; + } + + jo.put("device_name", this.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("move", move); + jo.put("action", action); + jo.put("walk_y", walk_y); + jo.put("isOnline", this.getIsonline()); + jo.put("error", this.getError()); + jo.put("isError", this.getIserror()); + jo.put("message", LangProcess.msg(message)); + jo.put("driver_type", "siemens_conveyor"); + jo.put("is_click", true); + return jo; } @Override diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/waste_foil_weighing_station/ItemProtocol.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/waste_foil_weighing_station/ItemProtocol.java index cb678f0f9..4d5714a83 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/waste_foil_weighing_station/ItemProtocol.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/waste_foil_weighing_station/ItemProtocol.java @@ -18,9 +18,11 @@ public class ItemProtocol { public static String item_error = "error"; public static String item_weight = "weight"; public static String item_old_weight = "old_weight"; + public static String item_gap_weight = "gap_weight"; public static String item_to_command = "to_command"; + public static String item_to_error = "to_error"; private WasteFoilWeighingStationDriver driver; @@ -31,25 +33,28 @@ public class ItemProtocol { public int getItem_heartbeat(){ return this.getOpcIntegerValue(item_heartbeat); - } ; + } public int getItem_mode(){ return this.getOpcIntegerValue(item_mode); - } ; + } public int getItem_move(){ return this.getOpcIntegerValue(item_move); - } ; + } public int getItem_action(){ return this.getOpcIntegerValue(item_action); - }; + } public int getItem_error(){ return this.getOpcIntegerValue(item_error); - } ; + } public float getItem_weight(){ return this.getOpcFloatValue(item_weight); - } ; + } public float getItem_old_weight(){ return this.getOpcFloatValue(item_old_weight); - } ; + } + public float getItem_gap_weight(){ + return this.getOpcFloatValue(item_gap_weight); + } Boolean isonline; @@ -86,12 +91,14 @@ public class ItemProtocol { list.add(new ItemDto(item_error, "故障", "DB19.B4")); list.add(new ItemDto(item_weight, "重量", "DB19.B5")); list.add(new ItemDto(item_old_weight, "上次重量", "DB19.B6")); + list.add(new ItemDto(item_gap_weight, "差异重量", "DB19.B8")); return list; } public static List getWriteableItemDtos() { ArrayList list = new ArrayList(); list.add(new ItemDto(item_to_command, "下发命令", "DB20.W0")); + list.add(new ItemDto(item_to_error, "下发命令", "DB20.W1")); return list; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/waste_foil_weighing_station/WasteFoilWeighingStationDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/waste_foil_weighing_station/WasteFoilWeighingStationDriver.java index beaac4f88..09201cac7 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/waste_foil_weighing_station/WasteFoilWeighingStationDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/waste_foil_weighing_station/WasteFoilWeighingStationDriver.java @@ -11,12 +11,17 @@ import org.nl.acs.device_driver.FeedLmsRealFailed; import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; +import org.nl.acs.ext.wms.data.GetWasteFoilWeightRequest; +import org.nl.acs.ext.wms.data.GetWasteFoilWeightResponse; +import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.history.service.DeviceErrorLogService; import org.nl.acs.history.service.impl.DeviceErrorLogServiceImpl; import org.nl.acs.instruction.domain.Instruction; import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.acs.monitor.DeviceStageMonitor; import org.nl.config.SpringContextHolder; +import org.nl.config.language.LangProcess; +import org.springframework.beans.factory.annotation.Autowired; import java.util.*; @@ -29,6 +34,8 @@ import java.util.*; public class WasteFoilWeighingStationDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, FeedLmsRealFailed { protected ItemProtocol itemProtocol = new ItemProtocol(this); + @Autowired + AcsToWmsService acsToWmsService; DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class); @@ -48,6 +55,7 @@ public class WasteFoilWeighingStationDriver extends AbstractOpcDeviceDriver impl public int error = 0; public Float weight = 0f; public Float old_weight = 0f; + public Float gap_weight = 0f; public int last_heartbeat = 0; public int last_mode = 0; @@ -56,10 +64,13 @@ public class WasteFoilWeighingStationDriver extends AbstractOpcDeviceDriver impl public int last_error = 0; public float last_weight = 0f; public float last_old_weight = 0f; + public float last_gap_weight = 0f; Boolean isonline = true; Boolean iserror = false; + //反馈成功表示 + boolean feedbackSucess = false; String device_code; @@ -76,7 +87,7 @@ public class WasteFoilWeighingStationDriver extends AbstractOpcDeviceDriver impl Boolean requireSucess = false; @Override - public void execute() { + public void execute() throws InterruptedException { device_code = this.getDeviceCode(); heartbeat = this.itemProtocol.getItem_heartbeat(); @@ -86,8 +97,10 @@ public class WasteFoilWeighingStationDriver extends AbstractOpcDeviceDriver impl error = this.itemProtocol.getItem_error(); weight = this.itemProtocol.getItem_weight(); old_weight = this.itemProtocol.getItem_old_weight(); + gap_weight = this.itemProtocol.getItem_gap_weight(); if (mode != last_mode) { requireSucess = false; + this.setFeedbackSucess(false); logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode)); logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); } @@ -139,12 +152,30 @@ public class WasteFoilWeighingStationDriver extends AbstractOpcDeviceDriver impl case 3: log.debug("设备运转模式:等待工作"); break; + case 6: + // 称重完成 + if (move > 0 && !requireSucess) { + weightSuccess(); + } + break; case 7: // 称重确认完成 if (move > 0 && !requireSucess) { weightConfirmSuccess(); } break; + case 8: + // 取消称重 + if (move > 0 && !requireSucess) { + cancelWeight(); + } + break; + case 9: + // 申请任务 + if (move > 0 && !requireSucess) { + applyTask(); + } + break; default: break; } @@ -161,11 +192,91 @@ public class WasteFoilWeighingStationDriver extends AbstractOpcDeviceDriver impl * 称重确认完成 */ public synchronized void weightConfirmSuccess() { - Map map = new LinkedHashMap<>(); - map.put("to_command", "7"); - this.writing(map); + GetWasteFoilWeightRequest getWasteFoilWeightRequest = new GetWasteFoilWeightRequest(); + GetWasteFoilWeightResponse getWasteFoilWeightResponse; + getWasteFoilWeightRequest.setDevice_code(device_code); + getWasteFoilWeightRequest.setType("2"); + getWasteFoilWeightRequest.setLastWeight(String.valueOf(old_weight)); + getWasteFoilWeightRequest.setCurrentWeight(String.valueOf(weight)); + getWasteFoilWeightRequest.setWeightGap(String.valueOf(gap_weight)); + getWasteFoilWeightResponse = acsToWmsService.feedbackWeight(getWasteFoilWeightRequest); + if (getWasteFoilWeightResponse.getstatus()==200){ + feedbackSucess = true; + message = "反馈重量确认成功..."; + Map map = new LinkedHashMap<>(); + map.put("to_command", "8"); + this.writing(map); + }else { + feedbackSucess = false; + message = "反馈重量确认失败"; + } + } + /** + * 称重完成 + */ + public synchronized void weightSuccess() { + GetWasteFoilWeightRequest getWasteFoilWeightRequest = new GetWasteFoilWeightRequest(); + GetWasteFoilWeightResponse getWasteFoilWeightResponse; + getWasteFoilWeightRequest.setDevice_code(device_code); + getWasteFoilWeightRequest.setType("1"); + getWasteFoilWeightRequest.setLastWeight(String.valueOf(old_weight)); + getWasteFoilWeightRequest.setCurrentWeight(String.valueOf(weight)); + getWasteFoilWeightRequest.setWeightGap(String.valueOf(gap_weight)); + getWasteFoilWeightResponse = acsToWmsService.feedbackWeight(getWasteFoilWeightRequest); + if (getWasteFoilWeightResponse.getstatus()==200){ + feedbackSucess = true; + message = "反馈重量成功..."; + Map map = new LinkedHashMap<>(); + map.put("to_command", "7"); + this.writing(map); + }else { + feedbackSucess = false; + message = "反馈重量确认失败"; + } + } + + /** + * 取消称重 + */ + public synchronized void cancelWeight() { + GetWasteFoilWeightRequest getWasteFoilWeightRequest = new GetWasteFoilWeightRequest(); + GetWasteFoilWeightResponse getWasteFoilWeightResponse; + getWasteFoilWeightRequest.setDevice_code(device_code); + getWasteFoilWeightRequest.setType("3"); + getWasteFoilWeightRequest.setLastWeight(String.valueOf(old_weight)); + getWasteFoilWeightRequest.setCurrentWeight(String.valueOf(weight)); + getWasteFoilWeightRequest.setWeightGap(String.valueOf(gap_weight)); + getWasteFoilWeightResponse = acsToWmsService.feedbackWeight(getWasteFoilWeightRequest); + if (getWasteFoilWeightResponse.getstatus()==200){ + feedbackSucess = true; + message = "取消称重成功..."; + }else { + feedbackSucess = false; + message = "取消称重失败"; + } + } + + /** + * 申请任务 + */ + public synchronized void applyTask() { + GetWasteFoilWeightRequest getWasteFoilWeightRequest = new GetWasteFoilWeightRequest(); + GetWasteFoilWeightResponse getWasteFoilWeightResponse; + getWasteFoilWeightRequest.setDevice_code(device_code); + getWasteFoilWeightRequest.setType("4"); + getWasteFoilWeightResponse = acsToWmsService.feedbackWeight(getWasteFoilWeightRequest); + if (getWasteFoilWeightResponse.getstatus()==200){ + feedbackSucess = true; + message = "申请任务成功..."; + }else { + feedbackSucess = false; + message = "申请任务失败"; + } + } + + @@ -212,7 +323,49 @@ public class WasteFoilWeighingStationDriver extends AbstractOpcDeviceDriver impl @Override public JSONObject getDeviceStatusName() throws Exception { - return null; + JSONObject jo = new JSONObject(); + String mode = ""; + String move = ""; + String action = ""; + String walk_y = ""; + if (this.getMode() == 0) { + mode = LangProcess.msg("universal_off-line"); + } else if (this.getMode() == 1) { + mode = LangProcess.msg("universal_stand-alone"); + } else if (this.getMode() == 2) { + mode = LangProcess.msg("universal_standby"); + } else if (this.getMode() == 3) { + mode = LangProcess.msg("universal_operation"); + } + + if (this.getMove() == 0) { + move = LangProcess.msg("universal_no"); + jo.put("hasGoods", false); + } else if (this.getMove() == 1) { + move = LangProcess.msg("universal_yes"); + jo.put("hasGoods", true); + } + + String requireSucess = "0"; + if (this.requireSucess) { + requireSucess = "1"; + } + jo.put("requireSucess", requireSucess); + + + jo.put("device_name", this.getDevice().getDevice_name()); + jo.put("mode", mode); + jo.put("move", move); + jo.put("isOnline", this.getIsonline()); + jo.put("error", this.getError()); + jo.put("isError", this.getIserror()); + jo.put("weight", this.getWeight()); + jo.put("old_weight", this.getOld_weight()); + jo.put("isError", this.getIserror()); + jo.put("gap_weight", this.getGap_weight()); + jo.put("driver_type", "siemens_conveyor"); + jo.put("is_click", true); + return jo; } @Override diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/ApplyManipulatorActionRequest.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/ApplyManipulatorActionRequest.java index 7aa96e4bb..7abf5847f 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/ApplyManipulatorActionRequest.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/ApplyManipulatorActionRequest.java @@ -22,13 +22,28 @@ public class ApplyManipulatorActionRequest extends BaseRequest { */ private String task_code; + /** + * 任务id + */ + private String task_id; + /** * 重量 */ private String weight; /** - * 条码 + * 位置 1-左 2-右 */ - private String barcode; + private String location; + + /** + * 左子卷号 + */ + private String left; + + /** + * 右子卷号 + */ + private String right; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/ApplyManipulatorActionResponse.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/ApplyManipulatorActionResponse.java index 59ed81914..09bf24dd4 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/ApplyManipulatorActionResponse.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/ApplyManipulatorActionResponse.java @@ -8,4 +8,13 @@ import java.util.Map; @Data public class ApplyManipulatorActionResponse extends BaseResponse{ private Map data = new HashMap(); + /** + * 子卷号 + */ + private String barcode; + + /** + * 终点 + */ + private String next_point; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/ApplyPlugPullSitResponse.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/ApplyPlugPullSitResponse.java index eeae4520d..40e7e628c 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/ApplyPlugPullSitResponse.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/ApplyPlugPullSitResponse.java @@ -8,4 +8,5 @@ import java.util.Map; @Data public class ApplyPlugPullSitResponse extends BaseResponse { private Map data = new HashMap(); + } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java index 45d3c45af..3c7f2c67e 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/CreateTaskRequest.java @@ -47,7 +47,7 @@ public class CreateTaskRequest extends BaseRequest { String vehicle_type; /** - * 载具类型 + * 扩展属性 */ String params2; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/GetWasteFoilWeightRequest.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/GetWasteFoilWeightRequest.java new file mode 100644 index 000000000..e76b1b63f --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/GetWasteFoilWeightRequest.java @@ -0,0 +1,35 @@ +package org.nl.acs.ext.wms.data; + +import lombok.Data; + +@Data +public class GetWasteFoilWeightRequest extends BaseRequest { + private String device_code; + + /** + * 1-称重完成 + * 2-称重确认完成 + * 3-取消称重 + * 4-申请任务 + */ + private String type; + + + /** + * 当前重量 + */ + private String currentWeight; + + /** + * 上次重量 + */ + private String lastWeight; + + /** + * 重量差 + */ + private String weightGap; + + + +} diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/GetWasteFoilWeightResponse.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/GetWasteFoilWeightResponse.java new file mode 100644 index 000000000..0b124b736 --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/GetWasteFoilWeightResponse.java @@ -0,0 +1,4 @@ +package org.nl.acs.ext.wms.data; + +public class GetWasteFoilWeightResponse extends BaseResponse{ +} diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/PutActionResponse.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/PutActionResponse.java index c15a8d1dd..4ade8e87b 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/PutActionResponse.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/PutActionResponse.java @@ -2,5 +2,9 @@ package org.nl.acs.ext.wms.data; public class PutActionResponse extends BaseResponse { + /** + * 结果 200成功 + */ + private int status; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/PutWeightActionRequest.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/PutWeightActionRequest.java new file mode 100644 index 000000000..adedf770b --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/PutWeightActionRequest.java @@ -0,0 +1,28 @@ +package org.nl.acs.ext.wms.data; + +import lombok.Data; + +import java.util.Map; + +@Data +public class PutWeightActionRequest extends BaseRequest { + /** + * 设备号 + */ + String device_code; + + /** + * + */ + String code; + + /** + * + */ + String value; + + /** + * 扩展属性 + */ + Map params; +} diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/PutWeightActionResponse.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/PutWeightActionResponse.java new file mode 100644 index 000000000..0c6045c95 --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/data/PutWeightActionResponse.java @@ -0,0 +1,4 @@ +package org.nl.acs.ext.wms.data; + +public class PutWeightActionResponse extends BaseResponse{ +} diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/rest/AcsToWmsController.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/rest/AcsToWmsController.java index bf0a01110..51cd40a02 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/rest/AcsToWmsController.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/rest/AcsToWmsController.java @@ -58,4 +58,6 @@ public class AcsToWmsController { return new ResponseEntity<>(acstowmsService.feedbackAgv(from), HttpStatus.OK); } + + } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java index d17a81dbf..13b11b14b 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/rest/WmsToAcsController.java @@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.nl.acs.ext.wms.data.PutWeightActionRequest; import org.nl.acs.ext.wms.data.one.CancelTaskRequest; import org.nl.acs.ext.wms.data.one.CreateTaskRequest; import org.nl.acs.ext.wms.service.WmsToAcsService; @@ -95,4 +96,11 @@ public class WmsToAcsController { return new ResponseEntity<>(wmstoacsService.notifyAcs(param), HttpStatus.OK); } + @PostMapping("/getWeight") + @Log("wms下发废箔重量") + @SaIgnore + public ResponseEntity getWeight(@RequestBody String whereJson) throws Exception { + return new ResponseEntity<>(wmstoacsService.putWeightAction(whereJson), HttpStatus.OK); + } + } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java index 742dacd66..13097c791 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java @@ -48,6 +48,7 @@ public interface AcsToWmsService { */ HttpResponse feedbackAgv(JSONArray from); + /** * 请求开门或关门 * @@ -175,4 +176,11 @@ public interface AcsToWmsService { String applyUpdatePointCode(JSONObject param); + + /** + * 向lms反馈废箔重量 + * @param param + * @return + */ + GetWasteFoilWeightResponse feedbackWeight(GetWasteFoilWeightRequest param); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java index 5ee30a29a..7a843672b 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/WmsToAcsService.java @@ -2,6 +2,8 @@ package org.nl.acs.ext.wms.service; import com.alibaba.fastjson.JSONObject; +import org.nl.acs.ext.wms.data.PutWeightActionRequest; +import org.nl.acs.ext.wms.data.PutWeightActionResponse; import org.nl.acs.ext.wms.data.one.*; import java.util.List; @@ -99,5 +101,12 @@ public interface WmsToAcsService { */ JSONObject notifyAcs(JSONObject param); + /** + * 下发废箔称重动作 + * + * @param jsonObject + * @return + */ + PutWeightActionResponse putWeightAction(String jsonObject) throws Exception; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java index 1a794ad62..ac4bfe2e7 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java @@ -133,6 +133,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { return null; } + @Override public HttpResponse applyOpenOrCloseDoor(String device_code, String status) { return null; @@ -521,6 +522,43 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } } + @Override + public GetWasteFoilWeightResponse feedbackWeight(GetWasteFoilWeightRequest param) { + log.info("向LMS申请反馈,请求参数{}", param); + try { + MDC.put(log_file_type, log_type); + GetWasteFoilWeightResponse getWasteFoilWeightResponse = new GetWasteFoilWeightResponse(); + if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { + String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); + AddressDto addressDto = addressService.findByCode("feedbackWeight"); + String methods_url = addressDto.getMethods_url(); + String url = wmsUrl + methods_url; + log.info("GetWasteFoilWeightRequest----请求参数:{}", JSONObject.toJSONString(param)); + try { +// String result = ""; + String result = HttpRequest.post(url) + .body(JSON.toJSONString(param)) + .execute().body(); + JSONObject jsonObject = JSONObject.parseObject(result); + log.info("GetWasteFoilWeightResponse----返回参数{}", result); + getWasteFoilWeightResponse = JSONObject.toJavaObject(jsonObject, GetWasteFoilWeightResponse.class); + } catch (Exception e) { + JSONObject map = new JSONObject(); + map.put("status", 400); + map.put("message", e.getMessage()); + return JSONObject.toJavaObject(map, GetWasteFoilWeightResponse.class); + } + LuceneLogDto luceneLogDto = new LuceneLogDto("GetWasteFoilWeightRequest", String.valueOf(getWasteFoilWeightResponse.getCode()), + JSON.toJSONString(param), String.valueOf(getWasteFoilWeightResponse), "ACS向LMS申请反馈"); + luceneLogService.interfaceExecuteLog(luceneLogDto); + } + return getWasteFoilWeightResponse; + } finally { + MDC.remove(log_file_type); + + } + } + @Override public JSONObject queryStationState(Instruction inst) { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index 5cc899c95..282c2a579 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -424,6 +424,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { HongXiangStationDeviceDriver hongXiangStationDeviceDriver; LampThreecolorDeviceDriver lampThreecolorDeviceDriver; SiemensConveyorDeviceDriver siemensConveyorDeviceDriver; + WasteFoilWeighingStationDriver wasteFoilWeighingStationDriver; if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); hongXiangStationDeviceDriver.writing(code, value); @@ -440,9 +441,17 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { inflatableShaftLibraryDeviceDriver = (InflatableShaftLibraryDeviceDriver) device.getDeviceDriver(); inflatableShaftLibraryDeviceDriver.writing(code, value); } - + if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) { + wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver(); + wasteFoilWeighingStationDriver.writing(code, value); + try { + Thread.sleep(1000); //休眠1秒 + } catch (InterruptedException e) { + e.printStackTrace(); + } + } } - response.setCode(200); + response.setStatus(200); response.setMessage("success"); LuceneLogDto luceneLogDto = new LuceneLogDto("putAction", String.valueOf(response.getCode()), jsonObject, String.valueOf(response), "LMS下发动作"); @@ -454,6 +463,47 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { } } + @Override + public PutWeightActionResponse putWeightAction(String jsonObject) throws Exception { + try { + MDC.put(log_file_type, log_type); + log.info("putWeightAction--------------:输入参数" + jsonObject); + JSONArray datas = JSONArray.parseArray(jsonObject); + PutWeightActionResponse response = new PutWeightActionResponse(); + JSONArray errArr = new JSONArray(); + for (int i = 0; i < datas.size(); i++) { + String data = datas.get(i).toString(); + PutWeightActionRequest request = JsonUtl.format(data, PutWeightActionRequest.class); + String device_code = request.getDevice_code(); + String code = request.getCode(); + String value = request.getValue(); + Device device = deviceAppService.findDeviceByCode(device_code); + if (ObjectUtil.isEmpty(device)) { + throw new Exception("未找到对应设备:" + device_code); + } + WasteFoilWeighingStationDriver wasteFoilWeighingStationDriver; + if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) { + wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver(); + wasteFoilWeighingStationDriver.writing(code, value); + try { + Thread.sleep(1000); //休眠1秒 + } catch (InterruptedException e) { + e.printStackTrace(); + } + } + } + response.setCode(200); + response.setMessage("success"); + LuceneLogDto luceneLogDto = new LuceneLogDto("putWeightAction", String.valueOf(response.getCode()), + jsonObject, String.valueOf(response), "LMS下发动作"); + luceneExecuteLogService.interfaceExecuteLog(luceneLogDto); + log.info("putWeightAction--------------:输出参数:" + response); + return response; + } finally { + MDC.remove(log_file_type); + } + } + @Override public Map queryDevice(String jsonObject) throws Exception { try { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index 43629f3e9..2a33b4ba4 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -347,20 +347,20 @@ public class InstructionServiceImpl extends CommonServiceImpl wrapper = new LambdaQueryWrapper<>(); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(InstructionMybatis::getTask_id, id); wrapper.apply(StringUtils.isNotBlank(wherecaluse), wherecaluse); InstructionMybatis ins = instructionMapper.selectOne(wrapper); if (ObjectUtil.isNotEmpty(ins)) { return ConvertUtil.convert(ins, Instruction.class); - }*/ - if(instructions.size() > 0){ - List collect = instructions.stream().filter(instruction -> instruction.getTask_id().equals(id) - && Integer.parseInt(instruction.getInstruction_status()) < 2).collect(Collectors.toList()); - if(collect.size() > 0){ - return collect.get(0); - } } +// if(instructions.size() > 0){ +// List collect = instructions.stream().filter(instruction -> instruction.getTask_id().equals(id) +// && Integer.parseInt(instruction.getInstruction_status()) < 2).collect(Collectors.toList()); +// if(collect.size() > 0){ +// return collect.get(0); +// } +// } return null; } @@ -625,8 +625,7 @@ public class InstructionServiceImpl extends CommonServiceImpl { this.dialogFormVisible = false this.dialogFormVisible3 = false this.dialogFormVisible4 = false + this.dialogFormVisible6 = false console.log(err.response.data.message) }) }, diff --git a/acs2/nladmin-ui/src/views/system/monitor/device/index.vue b/acs2/nladmin-ui/src/views/system/monitor/device/index.vue index 00a7ccf90..232cb8ce9 100644 --- a/acs2/nladmin-ui/src/views/system/monitor/device/index.vue +++ b/acs2/nladmin-ui/src/views/system/monitor/device/index.vue @@ -255,6 +255,8 @@ export default { dialogFormVisible6: false, dialogFormVisible7: false, dialogFormVisible8: false, + dialogFormVisible9: false, + dialogFormVisible10: false, stageParam: [{// 舞台参数 value: 'age', label: 'age' @@ -413,6 +415,8 @@ export default { this.dialogFormVisible6 = true } else if (clickObj.data.driver_type === 'standard_stacker') { this.dialogFormVisible8 = true + } else if (clickObj.data.driver_type === 'pull_head_manipulator') { + this.dialogFormVisible9 = true } else { this.dialogFormVisible = true } @@ -711,6 +715,7 @@ export default { this.dialogFormVisible6 = false this.dialogFormVisible7 = false this.dialogFormVisible8 = false + this.dialogFormVisible9 = false this.initStageData() }).catch(err => { this.dialogFormVisible = false @@ -719,6 +724,7 @@ export default { this.dialogFormVisible5 = false this.dialogFormVisible7 = false this.dialogFormVisible8 = false + this.dialogFormVisible9 = false console.log(err.response.data.message) }) },