From 818b88f70b4749f6328b73be21963c665bb44861 Mon Sep 17 00:00:00 2001 From: lishuai <1793460677@qq.com> Date: Tue, 2 Jul 2024 09:34:44 +0800 Subject: [PATCH 1/7] =?UTF-8?q?fix:=20=E6=97=A5=E5=BF=97=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BeltConveyorDeviceDriver.java | 2 +- .../BoxStorageOutConveyorDeviceDriver.java | 8 +------- .../BoxSubvolumesConveyorDeviceDriver.java | 14 ++++++-------- ...inishedProductOutBindLableDeviceDriver.java | 2 +- .../FoldDiscSiteDeviceDriver.java | 11 +++-------- .../ConveyorWithScannerWeightDeviceDriver.java | 8 ++++---- .../StandardStackerDeviceDriver.java | 18 +++++++++--------- 7 files changed, 25 insertions(+), 38 deletions(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java index 283793348..fd0baa6f1 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/conveyor/belt_conveyor/BeltConveyorDeviceDriver.java @@ -422,7 +422,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements } else { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) - .content("申请空托盘出入库,返回参数:" + jo.getString("body")) + .content("申请空托盘出入库,返回参数:" + response) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java index 1de443dc8..28809ae64 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java @@ -189,14 +189,8 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i heartbeat = this.itemProtocol.getHeartbeat(); material_barcode = this.itemProtocol.getMaterialBarcode(); if (mode != last_mode) { - JSONObject param = new JSONObject(); - param.put("device_code", this.device_code); - param.put("mode", Math.min(mode, 3)); - param.put("device_name", this.getDevice().getDevice_name()); - param.put("device_type", CommonFinalParam.ONE); requireSucess = false; - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记:" + requireSucess); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); + } if (move != 0 && task > 0) { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/BoxSubvolumesConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/BoxSubvolumesConveyorDeviceDriver.java index 95fbef8db..c7cbe6c35 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/BoxSubvolumesConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/BoxSubvolumesConveyorDeviceDriver.java @@ -187,14 +187,8 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i // 更新指令状态 if (mode != last_mode) { - JSONObject param = new JSONObject(); - param.put("device_code", this.device_code); - param.put("mode", Math.min(mode, 3)); - param.put("device_name", this.getDevice().getDevice_name()); - param.put("device_type", CommonFinalParam.ONE); + requireSucess = false; - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记:" + requireSucess); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); } if (move != 0 && task > 0) { if (null!=inst) { @@ -333,6 +327,7 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i .device_code(device_code) .content("申请AGV任务,请求参数:" + apply) .build(); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); String str = acsToWmsService.applySendOutTwo(apply); JSONObject jo = JSON.parseObject(str); @@ -340,6 +335,7 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i .device_code(device_code) .content("申请AGV任务,参数,接口返回:" + jo) .build(); + logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); message = "申请AGV任务,参数,接口返回:" + jo; @@ -352,7 +348,7 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i this.writing(list1); LuceneLogDto logDto1 = LuceneLogDto.builder() .device_code(device_code) - .content("申请AGV任务,返回参数:" + jo.getString("body")) + .content("申请AGV任务,返回参数:" + str) .build(); logDto1.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto1); @@ -369,6 +365,7 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i .device_code(device_code) .content("申请AGV任务,请求参数:" + apply) .build(); + logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); String str = acsToWmsService.applySendOutTwo(apply); logServer.deviceExecuteLog(this.device_code, "", "", "申请AGV任务,请求参数:" + apply + ",响应参数"); @@ -378,6 +375,7 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i .device_code(device_code) .content("申请AGV任务,参数,接口返回:" + jo) .build(); + logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); message = "申请AGV任务,参数,接口返回:" + jo; if (jo.getInteger("status") == 200) { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/FinishedProductOutBindLableDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/FinishedProductOutBindLableDeviceDriver.java index 01ee64eb8..b6beca382 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/FinishedProductOutBindLableDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/FinishedProductOutBindLableDeviceDriver.java @@ -371,7 +371,7 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr } else { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) - .content("申请捆扎失败,接口返回:" + jo.getString("body")) + .content("申请捆扎失败,接口返回:" + response) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/fold_disc_site/FoldDiscSiteDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/fold_disc_site/FoldDiscSiteDeviceDriver.java index ead7b4e15..02eec0ed5 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/fold_disc_site/FoldDiscSiteDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/fold_disc_site/FoldDiscSiteDeviceDriver.java @@ -189,14 +189,9 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements container_type = this.itemProtocol.getContainer_type(); carrier_direction = this.itemProtocol.getCarrier_direction(); if (mode != last_mode) { - JSONObject param = new JSONObject(); - param.put("device_code", this.device_code); - param.put("mode", Math.min(mode, 3)); - param.put("device_name", this.getDevice().getDevice_name()); - param.put("device_type", CommonFinalParam.ONE); + requireSucess = false; - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记:" + requireSucess); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); + } // 更新指令状态 if (move != 0 && task > 0) { @@ -617,7 +612,7 @@ public class FoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements } else { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) - .content("申请空托盘出入库,返回参数:" + jo.getString("body")) + .content("申请空托盘出入库,返回参数:" + response) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java index 49d3e1b78..a546a682a 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java @@ -446,7 +446,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv } else { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) - .content("申请高度等级,返回参数:" + jo.getString("body")) + .content("申请高度等级,返回参数:" + response) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); @@ -506,7 +506,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv } else { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) - .content("申请退货入库,返回参数:" + jo.getString("body")) + .content("申请退货入库,返回参数:" + response) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); @@ -615,7 +615,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv } else { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) - .content("申请空托盘出入库,返回参数:" + jo.getString("body")) + .content("申请空托盘出入库,返回参数:" + response) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); @@ -677,7 +677,7 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv } else { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) - .content("木箱、子卷入库申请入库任务,返回参数:" + jo.getString("body")) + .content("木箱、子卷入库申请入库任务,返回参数:" + response) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java index 2fa014db7..29830a0b3 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/stacker/standard_stacker/StandardStackerDeviceDriver.java @@ -365,7 +365,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme count = 0; } - if (mode == 0) { + if (mode == 0 || command == 9) { this.setIsonline(false); message = "universal_off"; }else { @@ -711,7 +711,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme luceneExecuteLogService.deviceExecuteLog(logDto1); String response = acsToWmsService.applyUpdatePointCode(param); JSONObject jo = JSON.parseObject(response); - if (StrUtil.isNotEmpty(jo.getString("body")) || jo.getInteger("status") == 200) { + if ( jo.getInteger("status") == 200) { try { //清警 cleanErro(); @@ -761,7 +761,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme } else { LuceneLogDto logDto2 = LuceneLogDto.builder() .device_code(device_code) - .content("申请更新点位,返回参数:" + jo.getString("body")) + .content("申请更新点位,返回参数:" + jo) .build(); logDto2.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto2); @@ -1254,12 +1254,12 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme //监控大屏下发作业命令清警-5、召回-7、急停-8 Integer toCommand = data.getInteger("toCommand"); if (toCommand != null) { - HashMap map1 = new HashMap(); - List list = new ArrayList<>(); - map1.put("code", "to_command"); - map1.put("value", toCommand); - list.add(map1); - this.writing(map1); + List list = new ArrayList<>(); + Map map4 = new HashMap<>(); + map4.put("code", "to_command"); + map4.put("value", toCommand); + list.add(map4); + writing(list); } //ACS监控大屏设置禁止入库、禁止出库、停止接收任务 Boolean prohibitInWarehouse = data.getBoolean("prohibitInWarehouse"); From 216cd5540f8e2ef5bd257abc5eee8b829fb0b660 Mon Sep 17 00:00:00 2001 From: tuqiang <437016993@qq.com> Date: Tue, 2 Jul 2024 09:59:19 +0800 Subject: [PATCH 2/7] =?UTF-8?q?rev:=E4=BC=98=E5=8C=96=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E9=97=A8=E5=86=99=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StandardAutodoorDeviceDriver.java | 17 +++++------- .../ToDoorCommandControl.java | 27 +++++++++++++++++++ 2 files changed, 33 insertions(+), 11 deletions(-) create mode 100644 acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/autodoor/standard_autodoor/ToDoorCommandControl.java diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/autodoor/standard_autodoor/StandardAutodoorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/autodoor/standard_autodoor/StandardAutodoorDeviceDriver.java index d7152a8fd..8314b69aa 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/autodoor/standard_autodoor/StandardAutodoorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/autodoor/standard_autodoor/StandardAutodoorDeviceDriver.java @@ -30,6 +30,7 @@ import java.util.Map; @RequiredArgsConstructor public class StandardAutodoorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, DeviceStageMonitor { protected ItemProtocol itemProtocol = new ItemProtocol(this); + protected ToDoorCommandControl toDoorCommandControl = new ToDoorCommandControl(this); DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); @Autowired LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class); @@ -85,22 +86,16 @@ public class StandardAutodoorDeviceDriver extends AbstractOpcDeviceDriver implem public void writing(String param, String value) { - String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() - + "." + param; - Map itemMap = new HashMap(); - itemMap.put(to_param, Integer.parseInt(value)); +// String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() +// + "." + param; +// Map itemMap = new HashMap(); +// itemMap.put(to_param, Integer.parseInt(value)); try { - this.checkcontrol(itemMap); + this.toDoorCommandControl.control(param,value); } catch (Exception e) { e.printStackTrace(); } - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("下发门信号:" + itemMap) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); } public void writing(String param, int command) { diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/autodoor/standard_autodoor/ToDoorCommandControl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/autodoor/standard_autodoor/ToDoorCommandControl.java new file mode 100644 index 000000000..48839fca8 --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/autodoor/standard_autodoor/ToDoorCommandControl.java @@ -0,0 +1,27 @@ +package org.nl.acs.device_driver.autodoor.standard_autodoor; + + +import java.util.HashMap; +import java.util.Map; + +public class ToDoorCommandControl { + + private StandardAutodoorDeviceDriver driver; + + public ToDoorCommandControl(StandardAutodoorDeviceDriver driver){ + this.driver = driver; + } + + public void control(String param, String value) throws Exception { +// ItemValue[] itemValues = new ItemValue[]{new ItemValue(this.driver.getItem(ItemProtocol.item_to_command), command)}; + Map itemMap = new HashMap(); + String to_param = this.driver.getDevice().getOpc_server_code() + "." + this.driver.getDevice().getOpc_plc_code() + "." + this.driver.getDevice().getDevice_code() + + "."+ param; + itemMap.put(to_param, Integer.parseInt(value)); + try { + this.driver.checkcontrol(itemMap); + } catch (Exception e) { + e.printStackTrace(); + } + } +} From d795315fe1abd650eda85002405f0610fc3fbabf Mon Sep 17 00:00:00 2001 From: yanps Date: Tue, 2 Jul 2024 11:21:13 +0800 Subject: [PATCH 3/7] =?UTF-8?q?opt:=20=E4=BB=99=E5=B7=A5=E6=9C=BA=E5=99=A8?= =?UTF-8?q?=E4=BA=BA=E4=BF=A1=E6=81=AF=E8=AE=BE=E5=A4=87=E7=9B=91=E6=8E=A7?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agv/xg_agv_car/XgAgvCarDeviceDriver.java | 98 +++++++++++++++---- .../src/views/system/monitor/device/index.vue | 39 ++++++++ 2 files changed, 119 insertions(+), 18 deletions(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/xg_agv_car/XgAgvCarDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/xg_agv_car/XgAgvCarDeviceDriver.java index 68dfce5ba..d3dd620a5 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/xg_agv_car/XgAgvCarDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/xg_agv_car/XgAgvCarDeviceDriver.java @@ -9,6 +9,7 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.acs.agv.server.NDCAgvService; import org.nl.acs.agv.server.XianGongAgvService; +import org.nl.acs.agv.server.impl.XianGongAgvServiceImpl; import org.nl.acs.common.base.CommonFinalParam; import org.nl.acs.device.service.DeviceService; import org.nl.acs.device_driver.DeviceDriver; @@ -28,6 +29,8 @@ import org.nl.config.SpringContextHolder; import org.springframework.beans.factory.annotation.Autowired; import java.util.Date; +import java.util.LinkedHashMap; +import java.util.Map; /** @@ -56,7 +59,7 @@ public class XgAgvCarDeviceDriver extends AbstractDeviceDriver implements Device @Autowired NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvService.class); @Autowired - private XianGongAgvService xianGongAgvService; + XianGongAgvService xianGongAgvService = SpringContextHolder.getBean(XianGongAgvService.class); Integer hasGoods = 0; int error = 0; @@ -127,27 +130,56 @@ public class XgAgvCarDeviceDriver extends AbstractDeviceDriver implements Device /** * 是否推送场景的状态 0=可推送 1=正在更新场景 2=正在执行运单 */ - private String upload_scene_status; + private String upload_scene_status = ""; /** * 机器人当前运单 */ - private String current_order; + private String current_order = ""; /** * 机器人连接状态 0表示断连 1表示连接上 */ - private String connection_status; + private String connection_status = ""; /** * 机器人可接单状态 true=可接单 false=不可接单 */ - private String dispatchable; + private boolean dispatchable = false; /** * core出错标识 */ - private boolean is_error; + private boolean is_error = false; /** * 是否正在执行用户下发的运单 */ - private boolean procBusiness; + private boolean procBusiness = false; + /** + * 机器人当前地图不在场景中 + */ + private boolean current_map_invalid = false; + /** + * 机器人是否断连 + */ + private boolean disconnect = false; + /** + * 1 = api 设置可接单,2 = api 设置不可接单(小车占用资源), 3 = api 设置不可接单(小车不占用资源) + */ + private int dispatchable_status = 0; + /** + * 低电量 + */ + private boolean low_battery = false; + /** + * 暂停运单 + */ + private boolean suspended = false; + /** + * 未确认定位 + */ + private boolean unconfirmed_reloc = false; + /** + * 0: 控制权在core手上 1; 控制权被其他人抢走; 2: 控制权没有被抢占 + */ + private int unlock = 0; + String device_code = null; String container; @@ -178,11 +210,15 @@ public class XgAgvCarDeviceDriver extends AbstractDeviceDriver implements Device @Override public JSONObject getDeviceStatusName() { - getAgvStatus(); - JSONObject jo = new JSONObject(); + Map map = new LinkedHashMap<>(); + try{ + getAgvStatus(); + }catch (Exception e){ + message = "获取机器人状态报错"; + } String isError; if (is_error) { - isError = "报错"; + isError = "出错,不执行任何运单"; } else { isError = "正常"; } @@ -193,12 +229,21 @@ public class XgAgvCarDeviceDriver extends AbstractDeviceDriver implements Device } else if (CommonFinalParam.DELETE.equals(upload_scene_status)) { upload_scene_status = "可推送"; } - jo.put("is_error", isError); - jo.put("upload_scene_status", upload_scene_status); - jo.put("procBusiness", procBusiness); - jo.put("current_order", current_order); - jo.put("connection_status", connection_status); - jo.put("dispatchable", dispatchable); + map.put("errors", isError); + map.put("upload_scene_status", upload_scene_status); + map.put("procBusiness", procBusiness ? "是": "否"); + map.put("current_order", current_order); + map.put("connection_status", "1".equals(connection_status) ? "连接上" : "断连"); + map.put("dispatchable", dispatchable ? "可接单" : "不可接单"); + map.put("dispatchable_status", dispatchable_status == 1?"设置可接单" : dispatchable_status == 2?"设置不可接单(小车占用资源)" : dispatchable_status == 3?"设置不可接单(小车不占用资源)" : "未知"); + map.put("current_map_invalid", !current_map_invalid ? "机器人不在地图场景中": "机器人在地图场景中"); + map.put("disconnect", !disconnect ? "机器人断连" : "机器人连接上"); + map.put("low_battery", !low_battery ? "低电量": "正常"); + map.put("suspended", !suspended ? "订单被暂停,需要人工手动恢复": "正常"); + map.put("message", message); + map.put("unconfirmed_reloc", !unconfirmed_reloc ? "未确认定位" : "正常"); + map.put("unlock", unlock == 0 ? "控制权在core手上" : unlock == 1 ? "控制权被其他人抢走" : unlock == 2 ?"控制权没有被抢占" : "未知"); + JSONObject jo = new JSONObject(map); return jo; } @@ -214,7 +259,7 @@ public class XgAgvCarDeviceDriver extends AbstractDeviceDriver implements Device */ private void getAgvStatus() { HttpResponse robotInfo = xianGongAgvService.getRobotInfo(this.getDevice().getDevice_name()); - if (robotInfo.getStatus() == 200) { + if (ObjectUtil.isNotEmpty(robotInfo) && robotInfo.getStatus() == 200) { JSONObject jsonObject = JSONObject.parseObject(robotInfo.body()); String report = jsonObject.getString("report"); //core出错标识 @@ -231,9 +276,26 @@ public class XgAgvCarDeviceDriver extends AbstractDeviceDriver implements Device //机器人连接状态 0表示断连 1表示连接上 connection_status = json.getString("connection_status"); //机器人可接单状态 true=可接单 false=不可接单 - dispatchable = json.getString("dispatchable"); + dispatchable = json.getBooleanValue("dispatchable"); + //机器人不可接单原因 + JSONObject undispatchableReason = json.getJSONObject("undispatchable_reason"); + //机器人当前地图不在场景中 + current_map_invalid = undispatchableReason.getBooleanValue("current_map_invalid"); + //网络断连 + disconnect = undispatchableReason.getBooleanValue("disconnect"); + //可接单状态: 0 = api 设置可接单, 1 = api 设置不可接单 + dispatchable_status = undispatchableReason.getIntValue("dispatchable_status"); + //低电量 + low_battery = undispatchableReason.getBooleanValue("low_battery"); + //当前车子的订单被暂停了,需要人为手动恢复 + suspended = undispatchableReason.getBooleanValue("suspended"); + //未确认定位 + unconfirmed_reloc = undispatchableReason.getBooleanValue("unconfirmed_reloc"); + //0: 控制权在core手上 , 1:控制权被其他人抢走 + unlock = undispatchableReason.getIntValue("unlock"); } } else { + message = "请求机器人状态失败"; log.info("请求{}机器人状态失败", this.getDevice().getDevice_name()); } } 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 920ba2fd1..a2b0e65d9 100644 --- a/acs2/nladmin-ui/src/views/system/monitor/device/index.vue +++ b/acs2/nladmin-ui/src/views/system/monitor/device/index.vue @@ -760,6 +760,45 @@ export default { } else if (val === 'inst_message') { const obj = { name: '当前指令信息', value: data[val] } this.arr.push(obj) + } else if (val === 'errors') { + const obj = { name: 'Core出错标识位', value: data[val] } + this.arr.push(obj) + } else if (val === 'upload_scene_status') { + const obj = { name: '是否推送场景运单', value: data[val] } + this.arr.push(obj) + } else if (val === 'procBusiness') { + const obj = { name: '是否在执行用户下的运单', value: data[val] } + this.arr.push(obj) + } else if (val === 'current_order') { + const obj = { name: '机器人当前运单', value: data[val] } + this.arr.push(obj) + } else if (val === 'connection_status') { + const obj = { name: '机器人连接状态', value: data[val] } + this.arr.push(obj) + } else if (val === 'dispatchable') { + const obj = { name: '机器人可接单状态', value: data[val] } + this.arr.push(obj) + } else if (val === 'dispatchable_status') { + const obj = { name: '是否可接单', value: data[val] } + this.arr.push(obj) + } else if (val === 'current_map_invalid') { + const obj = { name: '机器人是否在场景', value: data[val] } + this.arr.push(obj) + } else if (val === 'disconnect') { + const obj = { name: '机器人是否断连', value: data[val] } + this.arr.push(obj) + } else if (val === 'low_battery') { + const obj = { name: '机器人电量状态', value: data[val] } + this.arr.push(obj) + } else if (val === 'suspended') { + const obj = { name: '暂停运单', value: data[val] } + this.arr.push(obj) + } else if (val === 'unconfirmed_reloc') { + const obj = { name: '定位确认', value: data[val] } + this.arr.push(obj) + } else if (val === 'unlock') { + const obj = { name: '控制权', value: data[val] } + this.arr.push(obj) } } } From f9fc6e8a50cb0ab7e65060bdb85484bd64a6f0b8 Mon Sep 17 00:00:00 2001 From: yanps Date: Tue, 2 Jul 2024 17:24:26 +0800 Subject: [PATCH 4/7] =?UTF-8?q?opt:=20=E4=BB=99=E5=B7=A5=E9=A9=B1=E5=8A=A8?= =?UTF-8?q?=E7=9B=91=E6=8E=A7=E9=A1=B5=E9=9D=A2=E5=AE=9E=E7=8E=B0=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96,NDC=E5=8F=8D=E9=A6=88=E8=A1=8C=E6=9E=B6?= =?UTF-8?q?=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../siemens_conveyor/ItemProtocol.java | 21 ++++++ .../run/TwoNDCSocketConnectionAutoRun.java | 66 ---------------- .../service/impl/DeviceServiceImpl.java | 12 +-- .../agv/xg_agv_car/XgAgvCarDeviceDriver.java | 12 +-- .../InflatableShaftLibraryDeviceDriver.java | 2 + acs2/nladmin-ui/src/i18n/langs/monitor/en.js | 18 ++++- acs2/nladmin-ui/src/i18n/langs/monitor/in.js | 18 ++++- acs2/nladmin-ui/src/i18n/langs/monitor/zh.js | 17 ++++- .../device/driver/slit_two_manipulator.vue | 75 ++++++++++--------- .../src/views/system/monitor/device/index.vue | 42 +++++------ 10 files changed, 142 insertions(+), 141 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/ItemProtocol.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/ItemProtocol.java index 55d6d0c6a..924383bf3 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/ItemProtocol.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/ItemProtocol.java @@ -25,6 +25,12 @@ public class ItemProtocol { public static String item_error = "error"; //任务号 public static String item_task = "task"; + //货叉上叠盘数量 + public static String item_s_quantity = "s_quantity"; + //货叉下叠盘数量 + public static String item_x_quantity = "x_quantity"; + //叠盘总数量 + public static String item_quantity = "quantity"; //下发命令 public static String item_to_command = "to_command"; @@ -74,6 +80,18 @@ public class ItemProtocol { return this.getOpcIntegerValue(item_task); } + public int getS_quantity() { + return this.getOpcIntegerValue(item_s_quantity); + } + + public int getX_quantity() { + return this.getOpcIntegerValue(item_x_quantity); + } + + public int getQuantity() { + return this.getOpcIntegerValue(item_quantity); + } + public int getTo_command() { return this.getOpcIntegerValue(item_to_command); } @@ -142,6 +160,9 @@ public class ItemProtocol { list.add(new ItemDto(item_carrier_direction, "托盘方向", "DB600.B4")); list.add(new ItemDto(item_error, "报警信号", "DB600.B6")); list.add(new ItemDto(item_task, "任务号", "DB600.D10")); + list.add(new ItemDto(item_s_quantity, "货叉上叠盘数量", "DB600.D12")); + list.add(new ItemDto(item_x_quantity, "货叉下叠盘数量", "DB600.D14")); + list.add(new ItemDto(item_quantity, "叠盘总数量", "DB600.D16")); return list; } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java index af398b9e6..17a0384bd 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java @@ -243,34 +243,6 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { if (ObjectUtil.isNotEmpty(device)) { if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); -// String region = (String) standardAutodoorDeviceDriver.getDevice().getExtraValue().get("region"); -// if (StrUtil.isNotEmpty(region) && !(" ".equals(region))) { -// String linkDeviceCode = (String) standardAutodoorDeviceDriver.getDevice().getExtraValue().get("link_device_code"); -// Device deviceByCode = deviceAppService.findDeviceByCode(linkDeviceCode); -// if (ObjectUtil.isNotEmpty(deviceByCode) && deviceByCode.getDeviceDriver() instanceof OvenGantryManipulatorDeviceDriver) { -// OvenGantryManipulatorDeviceDriver hxhj = (OvenGantryManipulatorDeviceDriver) deviceByCode.getDeviceDriver(); -// String s = Integer.parseInt(region) == 1 ? "one" : Integer.parseInt(region) == 2 ? -// "two" : Integer.parseInt(region) == 3 ? "three" : null; -// Class aClass = hxhj.getClass(); -// String regionCode = "region_" + s; -// String s1 = Integer.parseInt(region) == 1 ? "2" : Integer.parseInt(region) == 2 ? -// "6" : Integer.parseInt(region) == 3 ? "8" : null; -// if (StrUtil.isNotEmpty(s) && ((Integer) aClass.getField(regionCode).get(hxhj) == 0)) { -// hxhj.writing("to_"+regionCode, s1); -// log.info("下发AGV进入区域{}信号值为:{}", region, s1); -// } else { -// log.info("区域{}信号{}未清除,导致不满足下发AGV进入区域信号", region, regionCode); -// } -// if (hxhj.getMode() == 2 && StrUtil.isNotEmpty(s1) && ((Integer) aClass.getField(regionCode).get(hxhj) == 2)) { -// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); -// requireSucessRegion = true; -// } else { -// log.error("AGV进入区域{}信号{}行架未接收{},请检查;或行架正在执行中:{}", region, regionCode,s1, hxhj.getMode()); -// } -// } else { -// log.error("未设置关联设备或关联的不是烘箱行架设备{}导致信号未反馈", linkDeviceCode); -// } -// } else { try { standardAutodoorDeviceDriver.writing("to_open", "1"); standardAutodoorDeviceDriver.writing("to_close", "0"); @@ -298,37 +270,6 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { if (ObjectUtil.isNotEmpty(device)) { if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); -// String region = (String) standardAutodoorDeviceDriver.getDevice().getExtraValue().get("region"); -// if (StrUtil.isNotEmpty(region) && !(" ".equals(region))) { -// String linkDeviceCode = (String) standardAutodoorDeviceDriver.getDevice().getExtraValue().get("link_device_code"); -// if(requireSucessTake || requireSucessPut){ -// Device deviceByCode = deviceAppService.findDeviceByCode(linkDeviceCode); -// if (ObjectUtil.isNotEmpty(deviceByCode) && deviceByCode.getDeviceDriver() instanceof OvenGantryManipulatorDeviceDriver) { -// OvenGantryManipulatorDeviceDriver hxhj = (OvenGantryManipulatorDeviceDriver) deviceByCode.getDeviceDriver(); -// String s = Integer.parseInt(region) == 1 ? "one" : Integer.parseInt(region) == 2 ? -// "two" : Integer.parseInt(region) == 3 ? "three" : null; -// Class aClass = hxhj.getClass(); -// String regionCode = "region_" + s; -// if (StrUtil.isNotEmpty(s) && ((Integer) aClass.getField(regionCode).get(hxhj) != 0)) { -// hxhj.writing("to_"+regionCode, "0"); -// log.info("下发AGV离开区域{}信号值为:{}", region, 0); -// } else { -// log.info("区域{}信号{}为0,不需要下发AGV离开区域信号", region, regionCode); -// } -// if (hxhj.getMode() == 2 && ((Integer) aClass.getField(regionCode).get(hxhj) == 0)) { -// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); -// requireSucessPut = false; -// requireSucessTake = false; -// } else { -// log.error("AGV离开区域{}信号{}行架未接收0,请检查;或行架正在执行中:{}", region, regionCode, hxhj.getMode()); -// } -// } else { -// log.error("未设置关联设备或关联的不是烘箱行架设备{}导致信号未反馈", linkDeviceCode); -// } -// }else{ -// data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); -// } -// } else { try { standardAutodoorDeviceDriver.writing("to_close", "1"); standardAutodoorDeviceDriver.writing("to_open", "0"); @@ -355,13 +296,6 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { if (device.getDeviceDriver() instanceof AgvNdcTwoDeviceDriver) { agvNdcTwoDeviceDriver = (AgvNdcTwoDeviceDriver) device.getDeviceDriver(); agvNdcTwoDeviceDriver.processSocket(arr); - if(phase == 0x05 && "3".equals(inst.getInstruction_type()) && requireSucessRegion){ - requireSucessPut = true; - requireSucessRegion = false; - }else if(phase == 0x0E && "8".equals(inst.getInstruction_type()) && requireSucessRegion){ - requireSucessTake = true; - requireSucessRegion = false; - } } else if (device.getDeviceDriver() instanceof AgvNdcOneDeviceDriver) { agvNdcOneDeviceDriver = (AgvNdcOneDeviceDriver) device.getDeviceDriver(); agvNdcOneDeviceDriver.processSocket(arr); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java index a9adea9fa..b0df8826d 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java @@ -867,9 +867,9 @@ public class DeviceServiceImpl extends CommonServiceImpl i celldto.setY("0"); celldto.setZ("0"); celldto.setAddress(Integer.parseInt(CodeUtil.getNewCode("NDCADDRESS_NO"))); - celldto.setCreate_by("init"); - celldto.setCreate_time(SecurityUtils.getCurrentNickName()); -// wo.insert((JSONObject) JSONObject.toJSON(celldto)); + celldto.setCreate_by(SecurityUtils.getCurrentNickName()); + String now = DateUtil.now(); + celldto.setCreate_time(now); StorageCell entity = ConvertUtil.convert(celldto, StorageCell.class); storageCellMapper.insert(entity); } @@ -888,9 +888,9 @@ public class DeviceServiceImpl extends CommonServiceImpl i celldto.setY("0"); celldto.setZ("0"); celldto.setAddress(Integer.parseInt(CodeUtil.getNewCode("NDCADDRESS_NO"))); - celldto.setCreate_by("init"); - celldto.setCreate_time(SecurityUtils.getCurrentNickName()); -// wo.insert((JSONObject) JSONObject.toJSON(celldto)); + celldto.setCreate_by(SecurityUtils.getCurrentNickName()); + String now = DateUtil.now(); + celldto.setCreate_time(now); StorageCell entity = ConvertUtil.convert(celldto, StorageCell.class); storageCellMapper.insert(entity); } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/xg_agv_car/XgAgvCarDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/xg_agv_car/XgAgvCarDeviceDriver.java index d3dd620a5..2a275b95a 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/xg_agv_car/XgAgvCarDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/xg_agv_car/XgAgvCarDeviceDriver.java @@ -232,16 +232,16 @@ public class XgAgvCarDeviceDriver extends AbstractDeviceDriver implements Device map.put("errors", isError); map.put("upload_scene_status", upload_scene_status); map.put("procBusiness", procBusiness ? "是": "否"); - map.put("current_order", current_order); + // map.put("current_order", current_order); map.put("connection_status", "1".equals(connection_status) ? "连接上" : "断连"); map.put("dispatchable", dispatchable ? "可接单" : "不可接单"); map.put("dispatchable_status", dispatchable_status == 1?"设置可接单" : dispatchable_status == 2?"设置不可接单(小车占用资源)" : dispatchable_status == 3?"设置不可接单(小车不占用资源)" : "未知"); - map.put("current_map_invalid", !current_map_invalid ? "机器人不在地图场景中": "机器人在地图场景中"); - map.put("disconnect", !disconnect ? "机器人断连" : "机器人连接上"); - map.put("low_battery", !low_battery ? "低电量": "正常"); - map.put("suspended", !suspended ? "订单被暂停,需要人工手动恢复": "正常"); + map.put("current_map_invalid", current_map_invalid ? "机器人不在地图场景中": "机器人在地图场景中"); + map.put("disconnect", disconnect ? "机器人断连" : "机器人连接上"); + map.put("low_battery", low_battery ? "低电量": "正常"); + map.put("suspended", suspended ? "订单被暂停,需要人工手动恢复": "正常"); map.put("message", message); - map.put("unconfirmed_reloc", !unconfirmed_reloc ? "未确认定位" : "正常"); + map.put("unconfirmed_reloc", unconfirmed_reloc ? "未确认定位" : "正常"); map.put("unlock", unlock == 0 ? "控制权在core手上" : unlock == 1 ? "控制权被其他人抢走" : unlock == 2 ?"控制权没有被抢占" : "未知"); JSONObject jo = new JSONObject(map); return jo; 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 df1e445fe..74fd1b629 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 @@ -223,6 +223,8 @@ public class InflatableShaftLibraryDeviceDriver extends AbstractOpcDeviceDriver jo.put("isOnline", this.getIsonline()); jo.put("error", ErrorUtil.getDictDetail("error_type", String.valueOf(this.getError()))); jo.put("isError", this.getIserror()); + jo.put("qty", this.getQty()); + jo.put("type", this.getType() == 3 ? "三寸": this.getType() == 6 ? "六寸" : "未知"); jo.put("driver_type", "siemens_conveyor"); jo.put("is_click", true); return jo; diff --git a/acs2/nladmin-ui/src/i18n/langs/monitor/en.js b/acs2/nladmin-ui/src/i18n/langs/monitor/en.js index 394d5e9c8..2b20df1bd 100644 --- a/acs2/nladmin-ui/src/i18n/langs/monitor/en.js +++ b/acs2/nladmin-ui/src/i18n/langs/monitor/en.js @@ -124,8 +124,22 @@ export default { 'barcode_length': 'Vehicle length', 'last_container': 'Last vehicle number', 'applySucess': 'Request task flag', - 'requireSucess': 'Request instruction mark' - + 'requireSucess': 'Request instruction mark', + 'number_of_air_shafts': 'Number of air shafts', + 'control': 'Control', + 'positioning_confirmation': 'Positioning confirmation', + 'The_status_of_the_waybill': 'The status of the waybill', + 'The_state_of_the_robots_battery_level': 'The state of the robots battery level', + 'Whether_or_not_the_connection_is_disconnected': 'Whether or not the connection is disconnected', + 'Whether_or_not_in_the_scene': 'Whether or not in the scene', + 'Whether_the_order_can_be_accepted': 'Whether the order can be accepted', + 'Connection_status': 'Connection status', + 'Whether_it_is_being_executed': 'Whether or not the waybill placed by the user is being executed', + 'Whether_to_push_the_scenario_waybill': 'Whether to push the scenario waybill', + 'Core_error_identifier': 'Core error identifier', + 'Current_command_information': 'Current command information', + 'The_signal_is_successfully_marked': 'The signal is successfully marked', + 'Complement_information': 'Complement information' } } } diff --git a/acs2/nladmin-ui/src/i18n/langs/monitor/in.js b/acs2/nladmin-ui/src/i18n/langs/monitor/in.js index 42388c80d..557e4f6f7 100644 --- a/acs2/nladmin-ui/src/i18n/langs/monitor/in.js +++ b/acs2/nladmin-ui/src/i18n/langs/monitor/in.js @@ -124,8 +124,22 @@ export default { 'barcode_length': 'Perjalanan panjang', 'last_container': 'Nomor muatan terakhir', 'applySucess': 'Meminta tanda tugas', - 'requireSucess': 'Kode aplikasicomment' - + 'requireSucess': 'Kode aplikasicomment', + 'number_of_air_shafts': 'Jumlah poros udara', + 'control': 'Menguasai', + 'positioning_confirmation': 'Konfirmasi posisi', + 'The_status_of_the_waybill': 'Status waybill', + 'The_state_of_the_robots_battery_level': 'Keadaan tingkat baterai robot', + 'Whether_or_not_the_connection_is_disconnected': 'Apakah koneksi terputus atau tidak', + 'Whether_or_not_in_the_scene': 'Apakah di tempat kejadian atau tidak', + 'Whether_the_order_can_be_accepted': 'Apakah pesanan dapat diterima', + 'Connection_status': 'Status koneksi', + 'Whether_it_is_being_executed': 'Apakah waybill yang ditempatkan oleh pengguna sedang dieksekusi atau tidak', + 'Whether_to_push_the_scenario_waybill': 'Apakah akan mendorong waybill skenario', + 'Core_error_identifier': 'Pengenal kesalahan inti', + 'Current_command_information': 'Informasi perintah saat ini', + 'The_signal_is_successfully_marked': 'Sinyal berhasil ditandai', + 'Complement_information': 'Informasi pelengkap' } } } diff --git a/acs2/nladmin-ui/src/i18n/langs/monitor/zh.js b/acs2/nladmin-ui/src/i18n/langs/monitor/zh.js index 3885b4a3b..092e435c3 100644 --- a/acs2/nladmin-ui/src/i18n/langs/monitor/zh.js +++ b/acs2/nladmin-ui/src/i18n/langs/monitor/zh.js @@ -124,7 +124,22 @@ export default { 'barcode_length': '载具长度', 'last_container': '上次载具号', 'applySucess': '请求任务标记', - 'requireSucess': '申请指令标记' + 'requireSucess': '申请指令标记', + 'number_of_air_shafts': '气涨轴数量', + 'control': '控制权', + 'positioning_confirmation': '定位确认', + 'The_status_of_the_waybill': '运单状态', + 'The_state_of_the_robots_battery_level': '机器人电量状态', + 'Whether_or_not_the_connection_is_disconnected': '是否断连', + 'Whether_or_not_in_the_scene': '是否在场景', + 'Whether_the_order_can_be_accepted': '是否可接单', + 'Connection_status': '连接状态', + 'Whether_it_is_being_executed': '是否在执行用户下的运单', + 'Whether_to_push_the_scenario_waybill': '是否推送场景运单', + 'Core_error_identifier': 'Core出错标识位', + 'Current_command_information': '当前指令信息', + 'The_signal_is_successfully_marked': '信号成功标记', + 'Complement_information': '补码信息' } } } diff --git a/acs2/nladmin-ui/src/views/acs/device/driver/slit_two_manipulator.vue b/acs2/nladmin-ui/src/views/acs/device/driver/slit_two_manipulator.vue index 7d167af7d..4439c0c9a 100644 --- a/acs2/nladmin-ui/src/views/acs/device/driver/slit_two_manipulator.vue +++ b/acs2/nladmin-ui/src/views/acs/device/driver/slit_two_manipulator.vue @@ -168,7 +168,7 @@ @@ -177,42 +177,43 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + 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 a2b0e65d9..57f44517e 100644 --- a/acs2/nladmin-ui/src/views/system/monitor/device/index.vue +++ b/acs2/nladmin-ui/src/views/system/monitor/device/index.vue @@ -698,7 +698,7 @@ export default { const obj = { name: i18n.t('monitor.click.request_success_flag'), value: data[val] } this.arr.push(obj) } else if (val === 'requireActionSucess') { - const obj = { name: '信号成功标记', value: data[val] } + const obj = { name: i18n.t('monitor.click.delivery_completed'), value: data[val] } this.arr.push(obj) } else if (val === 'applySucess') { const obj = { name: 'applySucess', value: data[val] } @@ -710,7 +710,7 @@ export default { const obj = { name: i18n.t('monitor.click.inventory_quantity'), value: data[val] } this.arr.push(obj) } else if (val === 'hand_barcode') { - const obj = { name: '补码信息', value: data[val] } + const obj = { name: i18n.t('monitor.click.Complement_information'), value: data[val] } this.arr.push(obj) } else if (val === 'hand_barcode1') { const obj = { name: i18n.t('monitor.click.the_subvolume_number'), value: data[val] } @@ -755,49 +755,49 @@ export default { const obj = { name: i18n.t('monitor.click.command'), value: data[val] } this.arr.push(obj) } else if (val === 'material_barcode') { - const obj = { name: '子卷编号', value: data[val] } + const obj = { name: i18n.t('monitor.click.the_subvolume_number'), value: data[val] } this.arr.push(obj) } else if (val === 'inst_message') { - const obj = { name: '当前指令信息', value: data[val] } + const obj = { name: i18n.t('monitor.click.Current_command_information'), value: data[val] } this.arr.push(obj) } else if (val === 'errors') { - const obj = { name: 'Core出错标识位', value: data[val] } + const obj = { name: i18n.t('monitor.click.Core_error_identifier'), value: data[val] } this.arr.push(obj) } else if (val === 'upload_scene_status') { - const obj = { name: '是否推送场景运单', value: data[val] } + const obj = { name: i18n.t('monitor.click.Whether_to_push_the_scenario_waybill'), value: data[val] } this.arr.push(obj) } else if (val === 'procBusiness') { - const obj = { name: '是否在执行用户下的运单', value: data[val] } - this.arr.push(obj) - } else if (val === 'current_order') { - const obj = { name: '机器人当前运单', value: data[val] } + const obj = { name: i18n.t('monitor.click.Whether_it_is_being_executed'), value: data[val] } this.arr.push(obj) } else if (val === 'connection_status') { - const obj = { name: '机器人连接状态', value: data[val] } - this.arr.push(obj) - } else if (val === 'dispatchable') { - const obj = { name: '机器人可接单状态', value: data[val] } + const obj = { name: i18n.t('monitor.click.Connection_status'), value: data[val] } this.arr.push(obj) } else if (val === 'dispatchable_status') { - const obj = { name: '是否可接单', value: data[val] } + const obj = { name: i18n.t('monitor.click.Whether_the_order_can_be_accepted'), value: data[val] } this.arr.push(obj) } else if (val === 'current_map_invalid') { - const obj = { name: '机器人是否在场景', value: data[val] } + const obj = { name: i18n.t('monitor.click.Whether_or_not_in_the_scene'), value: data[val] } this.arr.push(obj) } else if (val === 'disconnect') { - const obj = { name: '机器人是否断连', value: data[val] } + const obj = { name: i18n.t('monitor.click.Whether_or_not_the_connection_is_disconnected'), value: data[val] } this.arr.push(obj) } else if (val === 'low_battery') { - const obj = { name: '机器人电量状态', value: data[val] } + const obj = { name: i18n.t('monitor.click.The_state_of_the_robots_battery_level'), value: data[val] } this.arr.push(obj) } else if (val === 'suspended') { - const obj = { name: '暂停运单', value: data[val] } + const obj = { name: i18n.t('monitor.click.The_status_of_the_waybill'), value: data[val] } this.arr.push(obj) } else if (val === 'unconfirmed_reloc') { - const obj = { name: '定位确认', value: data[val] } + const obj = { name: i18n.t('monitor.click.positioning_confirmation'), value: data[val] } this.arr.push(obj) } else if (val === 'unlock') { - const obj = { name: '控制权', value: data[val] } + const obj = { name: i18n.t('monitor.click.control'), value: data[val] } + this.arr.push(obj) + } else if (val === 'qty') { + const obj = { name: i18n.t('monitor.click.number_of_air_shafts'), value: data[val] } + this.arr.push(obj) + } else if (val === 'type') { + const obj = { name: i18n.t('opc.table_title.type'), value: data[val] } this.arr.push(obj) } } From 72b6c48a55ee3f7df81227af4076dd043e30a5b4 Mon Sep 17 00:00:00 2001 From: lishuai <1793460677@qq.com> Date: Tue, 2 Jul 2024 19:38:09 +0800 Subject: [PATCH 5/7] =?UTF-8?q?fix:=20=E8=A1=8C=E6=9E=B6action=E5=8F=98?= =?UTF-8?q?=E6=88=905=E4=BF=AE=E6=94=B9=EF=BC=8C=E6=89=AB=E7=A0=81?= =?UTF-8?q?=E4=BD=8D=E7=BB=88=E7=82=B9=E4=B8=BA=E8=B4=A7=E4=BD=8D=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ConveyorWithScannerWeightDeviceDriver.java | 8 ++++++++ .../BoxStorageManipulatorDeviceDriver.java | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java index a546a682a..2d4969d73 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java @@ -16,6 +16,7 @@ import org.apache.commons.lang3.ObjectUtils; import org.nl.acs.AcsConfig; import org.nl.acs.common.base.CommonFinalParam; import org.nl.acs.device.domain.Device; +import org.nl.acs.device.enums.DeviceType; import org.nl.acs.device.service.DeviceExtraService; import org.nl.acs.device.service.impl.DeviceExtraServiceImpl; import org.nl.acs.device_driver.DeviceDriver; @@ -787,6 +788,13 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv //判断有无出入库任务是相同路线 //判断有没有DDJ对接位出入库的指令 List byCodeAndExcute = instructionService.findByCodeAndExcute(next_device_code); + if (CollUtil.isNotEmpty(byCodeAndExcute)){ + for (Instruction instruction : byCodeAndExcute) { + Device nextDevice = deviceAppService.findDeviceByCode(instruction.getNext_device_code()); + byCodeAndExcute.removeIf(item ->StrUtil.equals(nextDevice.getDevice_type(), DeviceType.storage.name())); + } + + } if (CollUtil.isNotEmpty(byCodeAndExcute)){ this.message="有DDJ对接位出入库的指令"; requireSucess = false; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java index 866f2ec9a..15c67264a 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java @@ -247,7 +247,7 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } //任务完成 - if (action == 4 && move == 0) { + if (action == 5 && move == 0) { if (inst != null) { try { logServer.deviceExecuteLog(this.device_code, "", "", "放货完成"); From 2bf7146c8790157137eecb0544de0a75c2163595 Mon Sep 17 00:00:00 2001 From: tuqiang <437016993@qq.com> Date: Tue, 2 Jul 2024 20:38:23 +0800 Subject: [PATCH 6/7] =?UTF-8?q?rev:=E4=BC=98=E5=8C=96agv=E4=B8=8B=E5=8F=91?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/nl/acs/agv/server/NDCAgvService.java | 2 +- .../agv/server/impl/NDCAgvServiceImpl.java | 4 +- .../run/TwoNDCSocketConnectionAutoRun.java | 7 +- .../agv/ndctwo/AgvNdcTwoDeviceDriver.java | 244 ++++++------------ ...ConveyorWithScannerWeightDeviceDriver.java | 9 +- .../OvenGantryManipulatorDeviceDriver.java | 6 +- .../wms/service/impl/WmsToAcsServiceImpl.java | 12 + 7 files changed, 113 insertions(+), 171 deletions(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/NDCAgvService.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/NDCAgvService.java index 59adfc9a8..1481f8572 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/NDCAgvService.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/NDCAgvService.java @@ -62,7 +62,7 @@ public interface NDCAgvService { * @param result * @return */ - /*public byte[] sendAgvTwoModeInst(int phase, int index, int result,int offset,int quantity);*/ + public byte[] sendAgvTwoModeInst(int phase, int index, int result,int offset,int quantity); /** * 下发一号agv指令 diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java index 4e96ed7b2..a28a12359 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/server/impl/NDCAgvServiceImpl.java @@ -336,7 +336,7 @@ public class NDCAgvServiceImpl implements NDCAgvService { return b; } - /*@Override + @Override public byte[] sendAgvTwoModeInst(int phase, int index, int result,int offset,int quantity) { if (phase < 0 || index < 0) return null; @@ -368,7 +368,7 @@ public class NDCAgvServiceImpl implements NDCAgvService { System.out.println("反馈agv动作数据:" + Bytes2HexString(b)); return b; - }*/ + } @Override diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java index 17a0384bd..5621b9ccf 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java @@ -191,7 +191,7 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { inst.setAgv_jobno(String.valueOf(index)); inst.setSend_status("1"); instructionService.update(inst); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); } flag = true; } @@ -219,12 +219,13 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { e.printStackTrace(); } } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); } //请求删除任务 //(需要WCS反馈) else if (phase == 0x30) { - data = ndcAgvService.sendAgvTwoModeInst(0x8F, index, 0); +// data = ndcAgvService.sendAgvTwoModeInst(0x8F, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(0x8F, index, 0,0,0); } //任务删除确认 //(需要WCS反馈) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java index be5499a15..2957b8233 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java @@ -1,13 +1,12 @@ package org.nl.acs.device_driver.agv.ndctwo; -import cn.hutool.core.util.NumberUtil; + import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.nl.acs.AcsConfig; import org.nl.acs.agv.server.NDCAgvService; import org.nl.acs.auto.run.TwoNDCSocketConnectionAutoRun; import org.nl.acs.common.base.CommonFinalParam; @@ -23,7 +22,6 @@ import org.nl.acs.device_driver.storage.standard_storage.StandardStorageDeviceDr import org.nl.acs.device_driver.driver.AbstractDeviceDriver; import org.nl.acs.device_driver.two_conveyor.hongxiang_conveyor.HongXiangStationDeviceDriver; import org.nl.acs.device_driver.two_conveyor.manipulator_agv_station.ManipulatorAgvStationDeviceDriver; -import org.nl.acs.device_driver.two_conveyor.oven_manipulator.OvenGantryManipulatorDeviceDriver; import org.nl.acs.device_driver.two_conveyor.ranging_stations.RangingStationsDeviceDriver; import org.nl.acs.device_driver.two_conveyor.waste_foil_weighing_station.WasteFoilWeighingStationDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; @@ -41,8 +39,6 @@ import org.nl.acs.opc.DeviceAppService; import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.dto.TaskDto; import org.nl.acs.task.service.impl.TaskServiceImpl; -import org.nl.config.language.LangProcess; -import org.nl.config.lucene.enums.LogTypeEnum; import org.nl.config.lucene.service.LuceneExecuteLogService; import org.nl.config.lucene.service.dto.LuceneLogDto; import org.nl.config.thread.ThreadPoolExecutorUtil; @@ -267,7 +263,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -287,7 +283,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic luceneExecuteLogService.deviceExecuteLog(logDto); } } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -305,47 +301,23 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if ((standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) { - String region = (String) standardInspectSiteDeviceDriver.getDevice().getExtraValue().get("region"); - if (StrUtil.isNotEmpty(region) && !(" ".equals(region))) { - String linkDeviceCode = (String) standardInspectSiteDeviceDriver.getDevice().getExtraValue().get("link_device_code"); - Device deviceByCode = deviceAppService.findDeviceByCode(linkDeviceCode); - if (ObjectUtil.isNotEmpty(deviceByCode) && deviceByCode.getDeviceDriver() instanceof OvenGantryManipulatorDeviceDriver) { - OvenGantryManipulatorDeviceDriver hxhj = (OvenGantryManipulatorDeviceDriver) deviceByCode.getDeviceDriver(); - String s = Integer.parseInt(region) == 2 ? "one" : Integer.parseInt(region) == 6 ? - "two" : Integer.parseInt(region) == 8 ? "three" : null; - Class aClass = hxhj.getClass(); - String regionCode = "region_" + s; - if (StrUtil.isNotEmpty(s) && ((Integer) aClass.getField(regionCode).get(hxhj) == 0)) { - hxhj.writing("to_" + regionCode, region); - log.info("下发AGV进入区域{}信号值为:{}", s, region); - } else { - log.info("区域{}信号{}未清除,导致不满足下发AGV进入区域信号", s, regionCode); - } - if (hxhj.getMode() == 2 && StrUtil.isNotEmpty(region) && ((Integer) aClass.getField(regionCode).get(hxhj) == Integer.parseInt(region))) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); - } else { - log.error("AGV进入区域{}信号{}行架未接收{},请检查;或行架正在执行中:{}", region, regionCode, Integer.parseInt(region), hxhj.getMode()); - } - } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - } else { - message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; - log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction() - , standardInspectSiteDeviceDriver.getError(), ikey); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content(message) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); + } else { + message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction() + , standardInspectSiteDeviceDriver.getError(), ikey); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content(message) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); @@ -356,7 +328,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -381,7 +353,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if (hongXiangStationDeviceDriver.getMove() > 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -408,7 +380,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if (paperTubePickSiteDeviceDriver.getAction() == 1 && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -491,7 +463,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic Map map = new LinkedHashMap<>(); map.put("to_command", "2"); wasteFoilWeighingStationDriver.writing(map); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -513,7 +485,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic luceneExecuteLogService.deviceExecuteLog(logDto); } } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -579,7 +551,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic && StrUtil.equals("true", this.device.getExtraValue().get("wait").toString()) && StrUtil.equals(task.getTask_type(), "1")) { standardOrdinarySiteDeviceDriver.setOption(0); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -587,7 +559,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -618,7 +590,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } catch (Exception e) { e.printStackTrace(); } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -648,7 +620,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if (hongXiangStationDeviceDriver.getMove() > 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -675,7 +647,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if (paperTubePickSiteDeviceDriver.getAction() == 1 && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -702,37 +674,13 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if ((standardInspectSiteDeviceDriver.getMove() != 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) { - String region = (String) standardInspectSiteDeviceDriver.getDevice().getExtraValue().get("region"); - if (StrUtil.isNotEmpty(region) && !(" ".equals(region))) { - String linkDeviceCode = (String) standardInspectSiteDeviceDriver.getDevice().getExtraValue().get("link_device_code"); - Device deviceByCode = deviceAppService.findDeviceByCode(linkDeviceCode); - if (ObjectUtil.isNotEmpty(deviceByCode) && deviceByCode.getDeviceDriver() instanceof OvenGantryManipulatorDeviceDriver) { - OvenGantryManipulatorDeviceDriver hxhj = (OvenGantryManipulatorDeviceDriver) deviceByCode.getDeviceDriver(); - String s = Integer.parseInt(region) == 2 ? "one" : Integer.parseInt(region) == 6 ? - "two" : Integer.parseInt(region) == 8 ? "three" : null; - Class aClass = hxhj.getClass(); - String regionCode = "region_" + s; - if (StrUtil.isNotEmpty(s) && ((Integer) aClass.getField(regionCode).get(hxhj) != 0)) { - hxhj.writing("to_"+regionCode, "0"); - log.info("下发AGV离开区域{}信号值为:{}", region, 0); - } else { - log.info("区域{}信号{}为0,不需要下发AGV离开区域信号", s, regionCode); - } - if (hxhj.getMode() == 2 && ((Integer) aClass.getField(regionCode).get(hxhj) == 0)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); - } else { - log.error("AGV离开区域{}信号{}行架未接收0,请检查;或行架正在执行中:{}", s, regionCode, hxhj.getMode()); - } - } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - } + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } else { message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction() @@ -752,7 +700,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic Map map = new LinkedHashMap<>(); map.put("to_command", "3"); wasteFoilWeighingStationDriver.writing(map); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -774,7 +722,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic luceneExecuteLogService.deviceExecuteLog(logDto); } } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -844,7 +792,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -864,7 +812,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic luceneExecuteLogService.deviceExecuteLog(logDto); } } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -881,7 +829,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -907,7 +855,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if (paperTubePickSiteDeviceDriver.getAction() == 1 && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -933,7 +881,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if (hongXiangStationDeviceDriver.getMove() > 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -960,7 +908,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if ((standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1030,7 +978,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic log.info("设备{},偏移数据出错导致未反馈{},指令号{}", device_code, rangingStationsDeviceDriver.getLength1() + "," + rangingStationsDeviceDriver.getLength2(), ikey); } }*/ else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1087,7 +1035,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic && StrUtil.equals("true", standardOrdinarySiteDeviceDriver.getDevice().getExtraValue().get("wait").toString())) { standardOrdinarySiteDeviceDriver.setOption(0); } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1095,7 +1043,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); standardOrdinarySiteDeviceDriver.setAgvphase(phase); standardOrdinarySiteDeviceDriver.setIndex(index); standardOrdinarySiteDeviceDriver.setInst(inst); @@ -1114,7 +1062,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if (hongXiangStationDeviceDriver.getMove() == 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1140,7 +1088,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } catch (Exception e) { e.printStackTrace(); } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1156,7 +1104,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if (paperTubePickSiteDeviceDriver.getAction() == 1 && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1183,7 +1131,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if ((standardInspectSiteDeviceDriver.getMove() == 1 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1202,7 +1150,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic luceneExecuteLogService.deviceExecuteLog(logDto); } } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1238,7 +1186,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic task.setCarno(this.device_code); taskService.update(task); } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1289,7 +1237,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1309,7 +1257,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if (paperTubePickSiteDeviceDriver.getAction() == 1 && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1336,7 +1284,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1361,7 +1309,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if (hongXiangStationDeviceDriver.getMove() == 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1383,7 +1331,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); standardInspectSiteDeviceDriver.writing(1); if ((standardInspectSiteDeviceDriver.getMove() == 0 && standardInspectSiteDeviceDriver.getAction() == 1 && standardInspectSiteDeviceDriver.getError() == 0)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1460,7 +1408,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic Map map = new LinkedHashMap<>(); map.put("to_command", "4"); wasteFoilWeighingStationDriver.writing(map); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1482,7 +1430,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic luceneExecuteLogService.deviceExecuteLog(logDto); } } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1546,7 +1494,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic // } else { // data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); // } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1562,7 +1510,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } catch (Exception e) { e.printStackTrace(); } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1577,7 +1525,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if (hongXiangStationDeviceDriver.getMove() > 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1620,7 +1568,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if (paperTubePickSiteDeviceDriver.getAction() == 1 && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1643,37 +1591,13 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); standardInspectSiteDeviceDriver.writing(0); if ((standardInspectSiteDeviceDriver.getMove() == 1)) { - String region = (String) standardInspectSiteDeviceDriver.getDevice().getExtraValue().get("region"); - if (StrUtil.isNotEmpty(region) && !(" ".equals(region))) { - String linkDeviceCode = (String) standardInspectSiteDeviceDriver.getDevice().getExtraValue().get("link_device_code"); - Device deviceByCode = deviceAppService.findDeviceByCode(linkDeviceCode); - if (ObjectUtil.isNotEmpty(deviceByCode) && deviceByCode.getDeviceDriver() instanceof OvenGantryManipulatorDeviceDriver) { - OvenGantryManipulatorDeviceDriver hxhj = (OvenGantryManipulatorDeviceDriver) deviceByCode.getDeviceDriver(); - String s = Integer.parseInt(region) == 2 ? "one" : Integer.parseInt(region) == 6 ? - "two" : Integer.parseInt(region) == 8 ? "three" : null; - Class aClass = hxhj.getClass(); - String regionCode = "region_" + s; - if (StrUtil.isNotEmpty(s) && ((Integer) aClass.getField(regionCode).get(hxhj) != 0)) { - hxhj.writing("to_"+ regionCode, "0"); - log.info("下发AGV离开区域{}信号值为:{}", region, 0); - } else { - log.info("区域{}信号{}为0,不需要下发AGV离开区域信号", s, regionCode); - } - if (hxhj.getMode() == 2 && ((Integer) aClass.getField(regionCode).get(hxhj) == 0)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); - } else { - log.error("AGV离开区域{}信号{}行架未接收0,请检查;或行架正在执行中:{}", s, regionCode, hxhj.getMode()); - } - } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); - LuceneLogDto logDto = LuceneLogDto.builder() - .device_code(device_code) - .content("agvphase:" + phase + "反馈:" + data) - .build(); - logDto.setLog_level(4); - luceneExecuteLogService.deviceExecuteLog(logDto); - } - } + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("agvphase:" + phase + "反馈:" + data) + .build(); + logDto.setLog_level(4); + luceneExecuteLogService.deviceExecuteLog(logDto); } } else if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) { wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver(); @@ -1683,7 +1607,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic Map map = new LinkedHashMap<>(); map.put("to_command", "5"); wasteFoilWeighingStationDriver.writing(map); - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1705,7 +1629,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic luceneExecuteLogService.deviceExecuteLog(logDto); } } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1771,7 +1695,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic // } else { // data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); // } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1789,7 +1713,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if ((manipulatorAgvStationDeviceDriver.getAction() == 1)) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1814,7 +1738,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if (hongXiangStationDeviceDriver.getMove() == 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1841,7 +1765,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if (paperTubePickSiteDeviceDriver.getAction() == 1 && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1917,7 +1841,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic log.info("设备{},偏移数据出错导致未反馈{},指令号{}", device_code, rangingStationsDeviceDriver.getLength1() + "," + rangingStationsDeviceDriver.getLength2(), ikey); } }*/ else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -1984,7 +1908,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic // } else { // data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); // } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -2000,7 +1924,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } catch (Exception e) { e.printStackTrace(); } - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -2016,7 +1940,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } if (paperTubePickSiteDeviceDriver.getAction() == 1 && paperTubePickSiteDeviceDriver.getError() == 0 && paperTubePickSiteDeviceDriver.getMode() == 2) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -2042,7 +1966,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic e.printStackTrace(); } if (hongXiangStationDeviceDriver.getMove() > 0) { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) @@ -2061,7 +1985,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic luceneExecuteLogService.deviceExecuteLog(logDto); } } else { - data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0); + data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0,0,0); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(device_code) .content("agvphase:" + phase + "反馈:" + data) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java index 2d4969d73..e9c00f1fe 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java @@ -789,11 +789,14 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv //判断有没有DDJ对接位出入库的指令 List byCodeAndExcute = instructionService.findByCodeAndExcute(next_device_code); if (CollUtil.isNotEmpty(byCodeAndExcute)){ - for (Instruction instruction : byCodeAndExcute) { + Iterator iterator = byCodeAndExcute.iterator(); + while (iterator.hasNext()) { + Instruction instruction = iterator.next(); Device nextDevice = deviceAppService.findDeviceByCode(instruction.getNext_device_code()); - byCodeAndExcute.removeIf(item ->StrUtil.equals(nextDevice.getDevice_type(), DeviceType.storage.name())); + if (StrUtil.equals(nextDevice.getDevice_type(), DeviceType.storage.name())){ + iterator.remove(); + } } - } if (CollUtil.isNotEmpty(byCodeAndExcute)){ this.message="有DDJ对接位出入库的指令"; diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java index 92bb217fb..1e5da9b03 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java @@ -21,6 +21,7 @@ import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.device_driver.two_conveyor.hongxiang_device.HongXiangConveyorDeviceDriver; import org.nl.acs.device_driver.two_conveyor.lamp_three_color.LampThreecolorDeviceDriver; +import org.nl.acs.device_driver.two_conveyor.manipulator_agv_station.ManipulatorAgvStationDeviceDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.service.DeviceErrorLogService; @@ -350,6 +351,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i Device startdevice = deviceAppService.findDeviceByCode(start_device_code); HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; + ManipulatorAgvStationDeviceDriver manipulatorAgvStationDeviceDriver; OvenInspectSiteDeviceDriver ovenInspectSiteDeviceDriver; /*if (startdevice.getDeviceDriver() instanceof OvenInspectSiteDeviceDriver && nextdevice.getDeviceDriver() instanceof RangingStationsDeviceDriver) { ovenInspectSiteDeviceDriver = (OvenInspectSiteDeviceDriver) startdevice.getDeviceDriver(); @@ -1034,6 +1036,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i Device nextDevice = deviceAppService.findDeviceByCode(next_device_code); HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; + ManipulatorAgvStationDeviceDriver manipulatorAgvStationDeviceDriver; LampThreecolorDeviceDriver lampThreecolorDeviceDriver; if (nextDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) nextDevice.getDeviceDriver(); @@ -1051,8 +1054,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i } } - if (nextDevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { - standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextDevice.getDeviceDriver(); + if (nextDevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver||nextDevice.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { if (!StrUtil.startWith(taskDto.getTask_code(), "-")) { if (ObjectUtil.isNotEmpty(nextDevice.getExtraValue().get("link_three_lamp"))) { String lamp = nextDevice.getExtraValue().get("link_three_lamp").toString(); 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 f7049e1dc..a87729ce2 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 @@ -695,6 +695,9 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { //拆叠盘位 FoldDiscSiteDeviceDriver foldDiscSiteDeviceDriver; + //气胀轴缓存库 + InflatableShaftLibraryDeviceDriver inflatableShaftLibraryDeviceDriver; + PlugPullDeviceSiteDeviceDriver plugPullDeviceSiteDeviceDriver; if (datas.size() == 0) { throw new BadRequestException("缺少输入参数!"); @@ -844,6 +847,15 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { jo.put("qty", foldDiscSiteDeviceDriver.getQty()); jo.put("container_type", foldDiscSiteDeviceDriver.getContainer_type()); jo.put("error", foldDiscSiteDeviceDriver.getError()); + } + else if (device.getDeviceDriver() instanceof InflatableShaftLibraryDeviceDriver) { + inflatableShaftLibraryDeviceDriver = (InflatableShaftLibraryDeviceDriver) device.getDeviceDriver(); + jo.put("device_code", parent_device_code); + jo.put("move", inflatableShaftLibraryDeviceDriver.getMove()); + jo.put("mode", inflatableShaftLibraryDeviceDriver.getMode()); + jo.put("qty", inflatableShaftLibraryDeviceDriver.getQty()); + jo.put("error", inflatableShaftLibraryDeviceDriver.getError()); + jo.put("type", inflatableShaftLibraryDeviceDriver.getError()); } else { jo.put("device_code", parent_device_code); } From 1f9ea990ecd9811e2002ef491e2fc57ae1848490 Mon Sep 17 00:00:00 2001 From: liuxy Date: Wed, 3 Jul 2024 16:01:24 +0800 Subject: [PATCH 7/7] =?UTF-8?q?rev=EF=BC=9Asap=E6=8E=A8=E9=80=81=E6=94=B9?= =?UTF-8?q?=E5=88=87=E8=AE=A1=E5=88=92=E6=A0=B9=E6=8D=AE=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E7=94=9F=E6=88=90=E5=A4=9A=E4=B8=AA=E5=8D=95=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sap/service/impl/SapToLmsServiceImpl.java | 128 ++++++++++-------- 1 file changed, 73 insertions(+), 55 deletions(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/ext/sap/service/impl/SapToLmsServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/ext/sap/service/impl/SapToLmsServiceImpl.java index b96fd7548..6284d6813 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/ext/sap/service/impl/SapToLmsServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/ext/sap/service/impl/SapToLmsServiceImpl.java @@ -18,6 +18,9 @@ import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; @Service @RequiredArgsConstructor @@ -128,73 +131,88 @@ public class SapToLmsServiceImpl implements SapToLmsService { public JSONObject getReCutInfo(JSONObject json) { log.info("getReCutInfo的输入参数为:------------------------" + json.toString()); - JSONObject jsonMst = new JSONObject(); - JSONObject result = new JSONObject(); - String msg = "改切出库单据推送成功!"; + try { - JSONArray dtl_ja = json.getJSONArray("ITEM"); - String LGORT = dtl_ja.getJSONObject(0).getString("LGORT"); - JSONObject stor_jo = WQLObject.getWQLObject("ST_IVT_BSRealStorAttr").query("ext_id = '" + LGORT + "'").uniqueResult(0); - if (ObjectUtil.isEmpty(stor_jo)) { - result.put("RTYPE", "E"); - result.put("RTMSG", "操作失败!" + "未查询到外部标识为:" + LGORT + "对应的仓库!"); - result.put("RTOAL", 1); - result.put("RTDAT", null); - return result; - } + // 需要插入分切计划的集合 + List needInsetIos = new ArrayList<>(); + // 子卷集合 + List dtl_ja = json.getJSONArray("ITEM").toJavaList(JSONObject.class); + // 根据仓库进行分类:一个仓库生成一个单据 + Map> storList = dtl_ja.stream() + .collect(Collectors.groupingBy(row -> row.getString("LGORT"))); - jsonMst.put("stor_id", stor_jo.getString("stor_id")); - jsonMst.put("stor_code", stor_jo.getString("stor_code")); - jsonMst.put("stor_name", stor_jo.getString("stor_name")); + for(String LGORT: storList.keySet()) { + // 查询仓库是否存在 + JSONObject stor_jo = WQLObject.getWQLObject("ST_IVT_BSRealStorAttr").query("ext_id = '" + LGORT + "'").uniqueResult(0); + if (ObjectUtil.isEmpty(stor_jo)) { + result.put("RTYPE", "E"); + result.put("RTMSG", "操作失败!" + "未查询到外部标识为:" + LGORT + "对应的仓库!"); + result.put("RTOAL", 1); + result.put("RTDAT", null); + return result; + } - JSONArray dtls = new JSONArray(); - for (int i = 0; i < dtl_ja.size(); i++) { - JSONObject jo = dtl_ja.getJSONObject(i); - String sap_pcsn = jo.getString("CHARG"); - if (StrUtil.isEmpty("sap_pcsn")) { - throw new BadRequestException("请求参数SAP批次不能为空!"); - } - JSONObject sub_jo = WQLObject.getWQLObject("PDM_BI_SubPackageRelation").query("sap_pcsn = '" + sap_pcsn + "'").uniqueResult(0); - if (ObjectUtil.isEmpty(sub_jo)) { - throw new BadRequestException("LMS中不存在SAP批次为【" + sap_pcsn + "】的包装关系"); - } - String container_name = sub_jo.getString("container_name"); - JSONObject struct_ivt = WQLObject.getWQLObject("st_ivt_structivt").query("pcsn = '" + container_name + "'").uniqueResult(0); - if (ObjectUtil.isEmpty(struct_ivt)) { - throw new BadRequestException("SAP批次为【" + sap_pcsn + "】的成品卷不存在或已经出库!"); - } else { - if (struct_ivt.getDoubleValue("frozen_qty") > 0) { - msg = "SAP批次为【" + sap_pcsn + "】的成品卷已经被分配或出库中"; + // 组织主表信息 + JSONObject jsonMst = new JSONObject(); + jsonMst.put("stor_id", stor_jo.getString("stor_id")); + jsonMst.put("stor_code", stor_jo.getString("stor_code")); + jsonMst.put("stor_name", stor_jo.getString("stor_name")); + + // 组织明细信息 + JSONArray dtls = new JSONArray(); + for (JSONObject jo : storList.get(LGORT)) { + String sap_pcsn = jo.getString("CHARG"); + if (StrUtil.isEmpty("sap_pcsn")) { + throw new BadRequestException("请求参数SAP批次不能为空!"); + } + JSONObject sub_jo = WQLObject.getWQLObject("PDM_BI_SubPackageRelation").query("sap_pcsn = '" + sap_pcsn + "'").uniqueResult(0); + if (ObjectUtil.isEmpty(sub_jo)) { + throw new BadRequestException("LMS中不存在SAP批次为【" + sap_pcsn + "】的包装关系"); + } + String container_name = sub_jo.getString("container_name"); + JSONObject struct_ivt = WQLObject.getWQLObject("st_ivt_structivt").query("pcsn = '" + container_name + "'").uniqueResult(0); + if (ObjectUtil.isEmpty(struct_ivt)) { + throw new BadRequestException("SAP批次为【" + sap_pcsn + "】的成品卷不存在或已经出库!"); } else { - JSONObject dtl = new JSONObject(); - //查询该物料 - JSONObject mater_jo = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + sub_jo.getString("product_name") + "'").uniqueResult(0); - if (ObjectUtil.isEmpty(mater_jo)) { - throw new BadRequestException("未查询到物料:" + sub_jo.getString("product_name") + ",信息!"); + if (struct_ivt.getDoubleValue("frozen_qty") > 0) { + msg = "SAP批次为【" + sap_pcsn + "】的成品卷已经被分配或出库中"; + } else { + JSONObject dtl = new JSONObject(); + //查询该物料 + JSONObject mater_jo = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + sub_jo.getString("product_name") + "'").uniqueResult(0); + if (ObjectUtil.isEmpty(mater_jo)) { + throw new BadRequestException("未查询到物料:" + sub_jo.getString("product_name") + ",信息!"); + } + dtl.put("material_id", mater_jo.getString("material_id")); + dtl.put("sap_pcsn", sap_pcsn); + JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id = '" + mater_jo.getString("base_unit_id") + "'").uniqueResult(0); + if (ObjectUtil.isEmpty(unit)) { + throw new BadRequestException("未查询到物料计量单位:" + mater_jo.getString("base_unit_id") + ",信息!"); + } + dtl.put("qty_unit_id", unit.getString("measure_unit_id")); + dtl.put("qty_unit_name", unit.getString("unit_name")); + dtl.put("package_box_sn", sub_jo.getString("package_box_sn")); + dtl.put("qty", sub_jo.getString("net_weight")); + dtls.add(dtl); } - dtl.put("material_id", mater_jo.getString("material_id")); - dtl.put("sap_pcsn", sap_pcsn); - JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("measure_unit_id = '" + mater_jo.getString("base_unit_id") + "'").uniqueResult(0); - if (ObjectUtil.isEmpty(unit)) { - throw new BadRequestException("未查询到物料计量单位:" + mater_jo.getString("base_unit_id") + ",信息!"); - } - dtl.put("qty_unit_id", unit.getString("measure_unit_id")); - dtl.put("qty_unit_name", unit.getString("unit_name")); - dtl.put("package_box_sn", sub_jo.getString("package_box_sn")); - dtl.put("qty", sub_jo.getString("net_weight")); - dtls.add(dtl); } } + + if (!dtls.isEmpty()) { + jsonMst.put("tableData", dtls); + needInsetIos.add(jsonMst); + } else { + throw new BadRequestException("推送失败!SAP推送的子卷明细不符合出库状态!"); + } } - if (!dtls.isEmpty()) { - jsonMst.put("tableData", dtls); - recutPlanService.insertDtl(jsonMst); - } else { - throw new BadRequestException("推送失败!SAP推送的子卷明细不符合出库状态!"); + // 生成单据 + for(JSONObject jsonIos : needInsetIos) { + recutPlanService.insertDtl(jsonIos); } + } catch (Exception exception) { result.put("TYPE", "E"); result.put("MESSAGE", "推送失败!" + exception.getMessage());