From 8352deaf228d5759152e80034f34f55f26d2c214 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E4=BF=8A=E6=9D=B0?= <9463626+zhou-junjiezjj@user.noreply.gitee.com> Date: Mon, 3 Jun 2024 14:21:49 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E7=BC=BA=E5=8F=A3=E4=BD=93=E7=A7=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agv/ndcone/AgvNdcOneDeviceDriver.java | 45 +++-- ...hPackagePalletManipulatorDeviceDriver.java | 186 +++++++++--------- .../ItemProtocol.java | 35 +++- ...alletizingManipulatorSiteDeviceDriver.java | 19 +- .../lnsh/lnsh_press/ItemProtocol.java | 19 +- .../lnsh_station/LnshStationDeviceDriver.java | 26 +-- .../package_site/PackageSiteDeviceDriver.java | 7 +- .../applyTask/ApplyTaskRequest.java | 30 +++ .../WmstoAcsData/createOrder/OrderDto.java | 3 +- .../wms/service/impl/WmsToAcsServiceImpl.java | 3 + .../service/impl/InstructionServiceImpl.java | 2 +- .../lucene/common/LogMessageConstant.java | 1 - .../modules/lucene/common/LuceneAppender.java | 2 +- .../modules/quartz/task/AutoCreateInst.java | 1 + .../nl/modules/quartz/utils/ExecutionJob.java | 2 + .../auto/run/NDCSocketConnectionAutoRun.java | 10 +- 16 files changed, 247 insertions(+), 144 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java index 69507ac..6db257e 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java @@ -315,9 +315,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic && conveyorPressStationDeviceDriver.getMove() != 0 && (conveyorPressStationDeviceDriver.getIo_action() == 3 || conveyorPressStationDeviceDriver.getIo_action() == 1) && (conveyorPressStationDeviceDriver.getAction() == 3 || conveyorPressStationDeviceDriver.getAction() == 1)) { - Map map = new LinkedHashMap<>(); - map.put("to_command",2); - conveyorPressStationDeviceDriver.writing(map); +// Map map = new LinkedHashMap<>(); +// map.put("to_command",2); +// conveyorPressStationDeviceDriver.writing(map); + conveyorPressStationDeviceDriver.writing(2); data = AgvService.sendAgvOneModeInst(phase, index, 0); conveyorPressStationDeviceDriver.setMessage(""); flag = true; @@ -368,8 +369,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic //标准版-下发条码输送线 if(device.getDeviceDriver() instanceof ConveyorBarcodeDeviceDriver){ conveyorBarcodeDeviceDriver = (ConveyorBarcodeDeviceDriver) device.getDeviceDriver(); - if (conveyorBarcodeDeviceDriver.getMode() == 2 - && conveyorBarcodeDeviceDriver.getMove() == 1 + if ( conveyorBarcodeDeviceDriver.getMove() == 1 ) { inst.setExecute_status("1"); instructionService.update(inst); @@ -585,9 +585,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic ) { inst.setExecute_status("5"); instructionService.update(inst); - Map map = new LinkedHashMap<>(); - map.put("to_command",3); - conveyorPressStationDeviceDriver.writing(map); +// Map map = new LinkedHashMap<>(); +// map.put("to_command",3); +// conveyorPressStationDeviceDriver.writing(map); + conveyorPressStationDeviceDriver.writing(3); data = AgvService.sendAgvOneModeInst(phase, index, 0); conveyorPressStationDeviceDriver.setMessage(""); flag = true; @@ -633,9 +634,10 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic conveyorBarcodeDeviceDriver = (ConveyorBarcodeDeviceDriver) device.getDeviceDriver(); if (conveyorBarcodeDeviceDriver.getMode() != 0) { inst.setExecute_status("5"); - Map map = new LinkedHashMap<>(); - map.put("to_command",3); - conveyorBarcodeDeviceDriver.writing(map); +// Map map = new LinkedHashMap<>(); +// map.put("to_command",3); +// conveyorBarcodeDeviceDriver.writing(map); + conveyorBarcodeDeviceDriver.writing(3); instructionService.update(inst); data = AgvService.sendAgvOneModeInst(phase, index, 0); conveyorBarcodeDeviceDriver.setMessage(""); @@ -865,10 +867,11 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic && (conveyorPressStationDeviceDriver.getIo_action() == 1 || conveyorPressStationDeviceDriver.getIo_action() == 3) && (conveyorPressStationDeviceDriver.getAction() == 2 || conveyorPressStationDeviceDriver.getAction() == 3)) { inst.setExecute_status("3"); - instructionService.update(inst); - Map map = new LinkedHashMap<>(); - map.put("to_command",4); - conveyorPressStationDeviceDriver.writing(map); + instructionService.update(inst) ; +// Map map = new LinkedHashMap<>(); +// map.put("to_command",4); +// conveyorPressStationDeviceDr/iver.writing(map); + conveyorPressStationDeviceDriver.writing(4); data = AgvService.sendAgvOneModeInst(phase, index, 0); conveyorPressStationDeviceDriver.setMessage(""); flag = true; @@ -1130,11 +1133,13 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic String direction=task.getDirection(); if(ObjectUtil.isNotEmpty(direction)){ Integer direction1=Integer.parseInt(direction); - Map map = new LinkedHashMap<>(); - map.put("to_command",5); - //困料位写入方向 - map.put("to_target",direction1); - conveyorPressStationDeviceDriver.writing(map); +// Map map = new LinkedHashMap<>(); +// map.put("to_command",5); +// //困料位写入方向 +// map.put("to_target",direction1); +// conveyorPressStationDeviceDriver.writing(map); + conveyorPressStationDeviceDriver.writing(5); + conveyorPressStationDeviceDriver.writing(2,direction1); }else{ log.info("未输入方向"); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/LnshPackagePalletManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/LnshPackagePalletManipulatorDeviceDriver.java index 939d678..996d41f 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/LnshPackagePalletManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/LnshPackagePalletManipulatorDeviceDriver.java @@ -244,99 +244,101 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD logServer.deviceItemValue(this.device_code,"Wthickness" ,String.valueOf(Wthickness)); logServer.deviceExecuteLog(this.device_code,"","","信号Wthickness:" + last_Wthickness + " -> " + Wthickness); } - if(grab_station != last_grab_station){ - if(grab_station>0) { - GrabPlaceStationRequest request = new GrabPlaceStationRequest(); - request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(RequestMethodEnum.apply_get_put_station.getCode()); - request.setRequest_medthod_name(RequestMethodEnum.apply_get_put_station.getName()); - List getDeviceCodeList = this.getExtraDeviceCodes("link_get_station"); - List putDeviceCodeList = this.getExtraDeviceCodes("link_put_station"); - request.setGet_station(getDeviceCodeList.get((grab_station)-1)); - request.setPut_station(putDeviceCodeList.get((place_station)-1)); - Device getDevice = deviceAppService.findDeviceByCode(getDeviceCodeList.get(grab_station).toString()); - Device putDevice = deviceAppService.findDeviceByCode(putDeviceCodeList.get(place_station).toString()); - - if (ObjectUtil.isEmpty(getDevice)) { - throw new Exception("抓取位未找到对应设备:" + getDeviceCodeList.get(grab_station)); - } - if (ObjectUtil.isEmpty(putDevice)) { - throw new Exception("放置位找到对应设备:" + putDeviceCodeList.get(grab_station)); - } - - LnshPalletizingManipulatorSiteDeviceDriver lnshPalletizingManipulatorSiteDeviceDriver; - if (getDevice.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) { - lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) getDevice.getDeviceDriver(); - request.setGet_station_vehicle_code(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getBarcode())); - request.setGet_station_qty(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getEncoder_qty())); - } - if (putDevice.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) { - lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) putDevice.getDeviceDriver(); - request.setPut_station_vehicle_code(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getBarcode())); - request.setPut_station_qty(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getEncoder_qty())); - } - - GrabPlaceStationResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)), GrabPlaceStationResponse.class); - message = RequestMethodEnum.getName("apply_get_put_station") + "apply_get_put_station 接口请求LMS..."; - lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); - - if (resp.getCode() == 200) { - message = RequestMethodEnum.getName("apply_get_put_station") + "apply_get_put_station 接口请求成功" + resp.getMessage(); - ; - } else { - message = RequestMethodEnum.getName("apply_get_put_station") + "apply_get_put_station 接口请求失败" + resp.getMessage(); - ; - } - } - - } - if(place_station != last_place_station){ - if(place_station>0) { - GrabPlaceStationRequest request = new GrabPlaceStationRequest(); - request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(RequestMethodEnum.apply_get_put_station.getCode()); - request.setRequest_medthod_name(RequestMethodEnum.apply_get_put_station.getName()); - List getDeviceCodeList = this.getExtraDeviceCodes("link_get_station"); - List putDeviceCodeList = this.getExtraDeviceCodes("link_put_station"); - request.setGet_station(getDeviceCodeList.get((grab_station)-1)); - request.setPut_station(putDeviceCodeList.get((place_station)-1)); - Device getDevice = deviceAppService.findDeviceByCode(getDeviceCodeList.get(grab_station).toString()); - Device putDevice = deviceAppService.findDeviceByCode(putDeviceCodeList.get(place_station).toString()); - - if (ObjectUtil.isEmpty(getDevice)) { - throw new Exception("抓取位未找到对应设备:" + getDeviceCodeList.get(grab_station)); - } - if (ObjectUtil.isEmpty(putDevice)) { - throw new Exception("放置位找到对应设备:" + putDeviceCodeList.get(grab_station)); - } - - LnshPalletizingManipulatorSiteDeviceDriver lnshPalletizingManipulatorSiteDeviceDriver; - if (getDevice.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) { - lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) getDevice.getDeviceDriver(); - request.setGet_station_vehicle_code(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getBarcode())); - request.setGet_station_qty(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getEncoder_qty())); - } - if (putDevice.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) { - lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) putDevice.getDeviceDriver(); - request.setPut_station_vehicle_code(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getBarcode())); - request.setPut_station_qty(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getEncoder_qty())); - } - - GrabPlaceStationResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)), GrabPlaceStationResponse.class); - message = RequestMethodEnum.getName("apply_get_put_station") + "apply_get_put_station 接口请求LMS..."; - lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); - - if (resp.getCode() == 200) { - message = RequestMethodEnum.getName("apply_get_put_station") + "apply_get_put_station 接口请求成功" + resp.getMessage(); - ; - } else { - message = RequestMethodEnum.getName("apply_get_put_station") + "apply_get_put_station 接口请求失败" + resp.getMessage(); - ; - } - } - } +// if(grab_station != last_grab_station){ +// if(grab_station>0) { +// GrabPlaceStationRequest request = new GrabPlaceStationRequest(); +// request.setDevice_code(this.getDevice_code()); +// request.setRequest_medthod_code(RequestMethodEnum.apply_get_put_station.getCode()); +// request.setRequest_medthod_name(RequestMethodEnum.apply_get_put_station.getName()); +// List getDeviceCodeList = this.getExtraDeviceCodes("link_get_station"); +// List putDeviceCodeList = this.getExtraDeviceCodes("link_put_station"); +// request.setGet_station(getDeviceCodeList.get((grab_station)-1)); +// request.setPut_station(putDeviceCodeList.get((place_station)-1)); +// Device getDevice = deviceAppService.findDeviceByCode(getDeviceCodeList.get(grab_station).toString()); +// Device putDevice = deviceAppService.findDeviceByCode(putDeviceCodeList.get(place_station).toString()); +// +// if (ObjectUtil.isEmpty(getDevice)) { +// throw new Exception("抓取位未找到对应设备:" + getDeviceCodeList.get(grab_station)); +// } +// if (ObjectUtil.isEmpty(putDevice)) { +// throw new Exception("放置位找到对应设备:" + putDeviceCodeList.get(grab_station)); +// } +// +// LnshPalletizingManipulatorSiteDeviceDriver lnshPalletizingManipulatorSiteDeviceDriver; +// if (getDevice.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) { +// lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) getDevice.getDeviceDriver(); +// request.setGet_station_vehicle_code(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getBarcode())); +// request.setGet_station_qty(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getEncoder_qty())); +// } +// if (putDevice.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) { +// lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) putDevice.getDeviceDriver(); +// request.setPut_station_vehicle_code(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getBarcode())); +// request.setPut_station_qty(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getEncoder_qty())); +// } +// +// GrabPlaceStationResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)), GrabPlaceStationResponse.class); +// message = RequestMethodEnum.getName("apply_get_put_station") + "apply_get_put_station 接口请求LMS..."; +// lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); +// +// if (resp.getCode() == 200) { +// message = RequestMethodEnum.getName("apply_get_put_station") + "apply_get_put_station 接口请求成功" + resp.getMessage(); +// ; +// } else { +// message = RequestMethodEnum.getName("apply_get_put_station") + "apply_get_put_station 接口请求失败" + resp.getMessage(); +// ; +// } +// } +// +// } +// if(place_station != last_place_station){ +// if(place_station>0) { +// GrabPlaceStationRequest request = new GrabPlaceStationRequest(); +// request.setDevice_code(this.getDevice_code()); +// request.setRequest_medthod_code(RequestMethodEnum.apply_get_put_station.getCode()); +// request.setRequest_medthod_name(RequestMethodEnum.apply_get_put_station.getName()); +// List getDeviceCodeList = this.getExtraDeviceCodes("link_get_station"); +// List putDeviceCodeList = this.getExtraDeviceCodes("link_put_station"); +// request.setGet_station(getDeviceCodeList.get((grab_station)-1)); +// request.setPut_station(putDeviceCodeList.get((place_station)-1)); +// Device getDevice = deviceAppService.findDeviceByCode(getDeviceCodeList.get(grab_station).toString()); +// Device putDevice = deviceAppService.findDeviceByCode(putDeviceCodeList.get(place_station).toString()); +// +// if (ObjectUtil.isEmpty(getDevice)) { +// throw new Exception("抓取位未找到对应设备:" + getDeviceCodeList.get(grab_station)); +// } +// if (ObjectUtil.isEmpty(putDevice)) { +// throw new Exception("放置位找到对应设备:" + putDeviceCodeList.get(grab_station)); +// } +// +// LnshPalletizingManipulatorSiteDeviceDriver lnshPalletizingManipulatorSiteDeviceDriver; +// if (getDevice.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) { +// lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) getDevice.getDeviceDriver(); +// request.setGet_station_vehicle_code(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getBarcode())); +// request.setGet_station_qty(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getEncoder_qty())); +// } +// if (putDevice.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) { +// lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) putDevice.getDeviceDriver(); +// request.setPut_station_vehicle_code(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getBarcode())); +// request.setPut_station_qty(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getEncoder_qty())); +// } +// +// GrabPlaceStationResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)), GrabPlaceStationResponse.class); +// message = RequestMethodEnum.getName("apply_get_put_station") + "apply_get_put_station 接口请求LMS..."; +// lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); +// +// if (resp.getCode() == 200) { +// message = RequestMethodEnum.getName("apply_get_put_station") + "apply_get_put_station 接口请求成功" + resp.getMessage(); +// ; +// } else { +// message = RequestMethodEnum.getName("apply_get_put_station") + "apply_get_put_station 接口请求失败" + resp.getMessage(); +// ; +// } +// } +// } } catch (Exception var17) { + log.info("分拣机械手驱动错误",var17.getMessage()); + message = "错误:" + var17.getMessage(); return; } @@ -357,8 +359,6 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD Instruction instruction = null; List toInstructions; - - if (mode > 2 && !requireSucess) { if (ObjectUtil.isNotEmpty(this.device.getExtraValue().get(String.valueOf(mode)))) { String modethod = this.device.getExtraValue().get(String.valueOf(mode)).toString(); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/ItemProtocol.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/ItemProtocol.java index cbb053c..9e9a70c 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/ItemProtocol.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/ItemProtocol.java @@ -24,6 +24,9 @@ public class ItemProtocol { public static String item_weight = "weight"; public static String item_material = "material"; public static String item_barcode = "barcode"; + public static String item_barcode1 = "barcode1"; + public static String item_barcode2 = "barcode2"; + public static String item_barcode3 = "barcode3"; public static String item_unqualified_qty = "unqualified_qty"; public static String item_encoder_qty = "encoder_qty"; public static String item_product_code = "product_code"; @@ -32,6 +35,9 @@ public class ItemProtocol { public static String item_Htrapezoidal = "Htrapezoidal"; public static String item_Wthickness = "Wthickness"; public static String item_tray_qty = "tray_qty"; + public static String item_encoder_qty1 = "encoder_qty1"; + public static String item_encoder_qty2 = "encoder_qty2"; + public static String item_encoder_qty3 = "encoder_qty3"; public static String item_tray_high = "tray_high"; public static String item_crib_category = "crib_category"; public static String item_palletX1_line = "palletX1_line"; @@ -189,6 +195,18 @@ public class ItemProtocol { return this.getOpcIntegerValue(item_barcode); } + public int getBarcode1() { + return this.getOpcIntegerValue(item_barcode1); + } + + public int getBarcode2() { + return this.getOpcIntegerValue(item_barcode2); + } + + public int getBarcode3() { + return this.getOpcIntegerValue(item_barcode3); + } + public int getProduct_code() { return this.getOpcIntegerValue(item_product_code); } @@ -405,9 +423,13 @@ public class ItemProtocol { return this.getOpcIntegerValue(item_tool_coordinate); } - public int getEncoder_qty() { - return this.getOpcIntegerValue(item_encoder_qty); - } + public int getEncoder_qty() { return this.getOpcIntegerValue(item_encoder_qty); } + + public int getEncoder_qty1() { return this.getOpcIntegerValue(item_encoder_qty1); } + + public int getEncoder_qty2() { return this.getOpcIntegerValue(item_encoder_qty2); } + + public int getEncoder_qty3() { return this.getOpcIntegerValue(item_encoder_qty3); } public int getUnqualified_qty() { return this.getOpcIntegerValue(item_unqualified_qty); @@ -734,7 +756,12 @@ public class ItemProtocol { list.add(new ItemDto(item_pressLayerY2_offset, "压层Y2偏移", "DB112.W172")); list.add(new ItemDto(item_pressLayerX3_offset, "压层X3偏移", "DB112.W174")); list.add(new ItemDto(item_pressLayerY3_offset, "压层Y3偏移", "DB112.W176")); - list.add(new ItemDto(item_tool_coordinate, "工具坐标", "DB112.W178")); + list.add(new ItemDto(item_barcode1, "条码1", "DB112.W180")); + list.add(new ItemDto(item_barcode2, "条码2", "DB112.W184")); + list.add(new ItemDto(item_barcode3, "条码3", "DB112.W188")); + list.add(new ItemDto(item_encoder_qty1, "当前垛盘数1", "DB112.W192")); + list.add(new ItemDto(item_encoder_qty2, "当前垛盘数2", "DB112.W196")); + list.add(new ItemDto(item_encoder_qty3, "当前垛盘数3", "DB112.W200")); return list; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDeviceDriver.java index 53c6074..90f8347 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDeviceDriver.java @@ -131,11 +131,17 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic String material; String last_material; int barcode; + int barcode1; + int barcode2; + int barcode3; int last_barcode; int unqualified_qty = 0; int last_unqualified_qty = 0; int encoder_qty = 0; + int encoder_qty1 = 0; + int encoder_qty2 = 0; + int encoder_qty3 = 0; int last_encoder_qty = 0; //垛型参数 @@ -270,13 +276,18 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic weight = this.itemProtocol.getWeight(); material = this.itemProtocol.getMaterial(); barcode = this.itemProtocol.getBarcode(); + barcode1 = this.itemProtocol.getBarcode1(); + barcode2 = this.itemProtocol.getBarcode2(); + barcode3 = this.itemProtocol.getBarcode3(); AlongSide = this.itemProtocol.getAlongSide(); BshortSide = this.itemProtocol.getBshortSide(); Htrapezoidal = this.itemProtocol.getHtrapezoidal(); Wthickness = this.itemProtocol.getWthickness(); encoder_qty = this.itemProtocol.getEncoder_qty(); + encoder_qty1 = this.itemProtocol.getEncoder_qty1(); + encoder_qty2 = this.itemProtocol.getEncoder_qty2(); + encoder_qty3 = this.itemProtocol.getEncoder_qty3(); unqualified_qty = this.itemProtocol.getUnqualified_qty(); - product_code = this.itemProtocol.getProduct_code(); AlongSide = this.itemProtocol.getAlongSide(); BshortSide = this.itemProtocol.getBshortSide(); @@ -881,8 +892,14 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic request.setRequest_medthod_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName())); request.setMaterial_code(material); request.setQty(String.valueOf(encoder_qty)); + request.setQty1(String.valueOf(encoder_qty1)); + request.setQty2(String.valueOf(encoder_qty2)); + request.setQty3(String.valueOf(encoder_qty3)); request.setWeight(String.valueOf(weight)); request.setVehicle_code(String.valueOf(barcode)); + request.setVehicle_code1(String.valueOf(barcode1)); + request.setVehicle_code2(String.valueOf(barcode2)); + request.setVehicle_code3(String.valueOf(barcode3)); List listDto = new ArrayList<>(); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_press/ItemProtocol.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_press/ItemProtocol.java index 738bc92..ca39819 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_press/ItemProtocol.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_press/ItemProtocol.java @@ -1,5 +1,6 @@ package org.nl.acs.device_driver.lnsh.lnsh_press; +import cn.hutool.core.util.ObjectUtil; import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; @@ -48,7 +49,7 @@ public class ItemProtocol { public static String item_to_standard_size_height2 = "to_standard_size_height2"; public static String item_to_standard_size_height3 = "to_standard_size_height3"; public static String item_to_standard_size_height4 = "to_standard_size_height4"; - + public static String item_to_reduce_volume = "to_reduce_volume"; private LnshPressDeviceDriver driver; public ItemProtocol(LnshPressDeviceDriver driver) { @@ -176,6 +177,10 @@ public class ItemProtocol { public int getToStandardSizeHeight3() {return this.getOpcIntegerValue(item_to_standard_size_height3);} public int getToStandardSizeHeight4() {return this.getOpcIntegerValue(item_to_standard_size_height4);} + + public float getReduceVolum() { + return this.getOpcFloatValue(item_to_reduce_volume); + } //是否有货 public int hasGoods(int move) { return move; @@ -205,6 +210,17 @@ public class ItemProtocol { return ""; } + public Float getOpcFloatValue(String protocol) { + Float value = this.driver.getFloatValue(protocol); + if (ObjectUtil.isEmpty(value)) { +// log.error("读取错误!"); + } else { + return value; + } + return 0f; + } + + public static List getReadableItemDtos() { ArrayList list = new ArrayList(); list.add(new ItemDto(item_heartbeat, "心跳", "DB112.B0")); @@ -247,6 +263,7 @@ public class ItemProtocol { list.add(new ItemDto(item_to_standard_size_height2, "标准尺寸高度2", "DB113.REAL252")); list.add(new ItemDto(item_to_standard_size_height3, "标准尺寸高度3", "DB113.REAL256")); list.add(new ItemDto(item_to_standard_size_height4, "标准尺寸高度4", "DB113.REAL260")); + list.add(new ItemDto(item_to_reduce_volume, "缺口体积", "DB113.REAL264")); return list; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java index d32d31b..4c8f4d0 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java @@ -156,11 +156,9 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "信号mode:" + last_mode + " -> " + mode)); } if (move != last_move && mode>0) { - logServer.deviceItemValue(this.device_code, "move", String.valueOf(move)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + " -> " + move); - lucene.deviceItemValue(this.device_code, "move", String.valueOf(move)); - lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "信号mode:" + last_move + " -> " + move)); if ("true".equals(this.device.getExtraValue().get("sendDeviceStatus"))) { + logServer.deviceExecuteLog(this.device_code,"","","开始反馈光电信号"+"mode:" + mode + ",move: " + move); + lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, "开始反馈光电信号:" + "mode:" + mode + ",move: " + move )); ApplySignalStatusRequest request = new ApplySignalStatusRequest(); request.setDevice_code(this.getDevice_code()); request.setRequest_medthod_code(RequestMethodEnum.real_time_set_point.getCode()); @@ -240,7 +238,18 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements } } catch (Exception var17) { + log.error("发生异常",var17); return; + }finally { + last_mode = mode; + last_error = error; + last_move = move; + last_task = task; + last_action = action; + last_ioaction = io_action; + last_weight = weight; + last_material = material; + last_barcode = barcode; } //急停 @@ -282,15 +291,6 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements } } - last_mode = mode; - last_error = error; - last_move = move; - last_task = task; - last_action = action; - last_ioaction = io_action; - last_weight = weight; - last_material = material; - last_barcode = barcode; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/package_site/PackageSiteDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/package_site/PackageSiteDeviceDriver.java index f592759..b793cbd 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/package_site/PackageSiteDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/package_site/PackageSiteDeviceDriver.java @@ -152,6 +152,8 @@ public class PackageSiteDeviceDriver extends AbstractOpcDeviceDriver implements if (mode != last_mode) { this.setRequireSucess(false); + this.writing("to_message","0"); + this.writing(0); logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode)); logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + " -> " + mode); } @@ -159,10 +161,7 @@ public class PackageSiteDeviceDriver extends AbstractOpcDeviceDriver implements logServer.deviceItemValue(this.device_code, "move", String.valueOf(move)); logServer.deviceExecuteLog(this.device_code, "", "", "信号move:" + last_move + " -> " + move); } - if (action != last_action) { - logServer.deviceItemValue(this.device_code, "action", String.valueOf(action)); - logServer.deviceExecuteLog(this.device_code, "", "", "信号action:" + last_action + " -> " + action); - } + if (action != last_action) if (ioaction != last_ioaction) { logServer.deviceItemValue(this.device_code, "ioaction", String.valueOf(ioaction)); logServer.deviceExecuteLog(this.device_code, "", "", "信号ioaction:" + last_ioaction + " -> " + ioaction); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/AcsToWmsData/applyTask/ApplyTaskRequest.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/AcsToWmsData/applyTask/ApplyTaskRequest.java index 3ef86eb..f29465e 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/AcsToWmsData/applyTask/ApplyTaskRequest.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/AcsToWmsData/applyTask/ApplyTaskRequest.java @@ -15,6 +15,21 @@ public class ApplyTaskRequest extends BaseRequest { */ private String vehicle_code; + /** + * 载具号 + */ + private String vehicle_code1; + + /** + * 载具号 + */ + private String vehicle_code2; + + /** + * 载具号 + */ + private String vehicle_code3; + /** * 载具类型 */ @@ -45,6 +60,21 @@ public class ApplyTaskRequest extends BaseRequest { */ private String qty; + /** + * 数量1 + */ + private String qty1; + + /** + * 数量2 + */ + private String qty2; + + /** + * 数量3 + */ + private String qty3; + /** * 砖型 */ diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/WmstoAcsData/createOrder/OrderDto.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/WmstoAcsData/createOrder/OrderDto.java index 144c1c4..94e6000 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/WmstoAcsData/createOrder/OrderDto.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/WmstoAcsData/createOrder/OrderDto.java @@ -25,7 +25,6 @@ public class OrderDto { private String standard_size_height4; // 标准尺寸4 private String standard_weight; // 标准重量 private String detection_error; // 检测误差值 - - + private String reduce_volume; // 缺口体积 } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index 76d1e70..309f519 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -375,6 +375,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { String standard_size_height4 = orderDto.getStandard_size_height4(); String standard_weight = orderDto.getStandard_weight(); String detection_error = orderDto.getDetection_error(); + String reduce_volume=orderDto.getReduce_volume(); + if (StrUtil.isEmpty(order_code)) { JSONObject json = new JSONObject(); json.put("order_code", order_code); @@ -478,6 +480,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { map.put("to_standard_size_height2", standard_size_height2); map.put("to_standard_size_height3", standard_size_height3); map.put("to_standard_size_height4", standard_size_height4); + map.put("to_reduce_volume",reduce_volume); map.put("to_command",100); // delayed(device_code,map); lnshPressDeviceDriver.writing(map); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index a28a6b9..383f918 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -859,7 +859,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu String currentUsername = SecurityUtils.getCurrentUsername(); String now = DateUtil.now(); entity.setUpdate_time(now); - entity.setUpdate_by(currentUsername); + entity.setUpdate_by("NDC"); entity.setInstruction_status("3"); WQLObject wo = WQLObject.getWQLObject("acs_instruction"); JSONObject json = (JSONObject) JSONObject.toJSON(entity); diff --git a/acs/nladmin-system/src/main/java/org/nl/modules/lucene/common/LogMessageConstant.java b/acs/nladmin-system/src/main/java/org/nl/modules/lucene/common/LogMessageConstant.java index ca7f941..86a4338 100644 --- a/acs/nladmin-system/src/main/java/org/nl/modules/lucene/common/LogMessageConstant.java +++ b/acs/nladmin-system/src/main/java/org/nl/modules/lucene/common/LogMessageConstant.java @@ -38,7 +38,6 @@ public class LogMessageConstant { public final static String COLOR_RESET = "\u001B[0m"; /** 背景颜色:黄色 */ public final static String BACKGROUND_YELLOW = "\u001B[43m"; - /** 索引路径 */ public final static String INDEX_DIR = "D:\\lucene\\index"; } diff --git a/acs/nladmin-system/src/main/java/org/nl/modules/lucene/common/LuceneAppender.java b/acs/nladmin-system/src/main/java/org/nl/modules/lucene/common/LuceneAppender.java index c3cb0d3..2972a2f 100644 --- a/acs/nladmin-system/src/main/java/org/nl/modules/lucene/common/LuceneAppender.java +++ b/acs/nladmin-system/src/main/java/org/nl/modules/lucene/common/LuceneAppender.java @@ -60,7 +60,7 @@ public class LuceneAppender extends AppenderBase { String message = event.getFormattedMessage(); try { String[] split = message.split("@"); - LuceneLogDto luceneLogDto = JSONObject.parseObject(split[1], LuceneLogDto.class); + LuceneLogDto luceneLogDto = JSONObject.parseObject(message, LuceneLogDto.class); Document document = new Document(); try { //向document对象中添加域。 diff --git a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java index cfc4380..a1bc4ba 100644 --- a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java +++ b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java @@ -33,6 +33,7 @@ import java.util.List; */ @Slf4j @Component + public class AutoCreateInst { /** * 根据任务状态创建指令、生成下一条指令 diff --git a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/utils/ExecutionJob.java b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/utils/ExecutionJob.java index ee4f685..2843083 100644 --- a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/utils/ExecutionJob.java +++ b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/utils/ExecutionJob.java @@ -25,6 +25,7 @@ import org.nl.modules.quartz.domain.QuartzLog; import org.nl.modules.quartz.repository.QuartzLogRepository; import org.nl.modules.quartz.service.QuartzJobService; import org.nl.modules.wql.util.SpringContextHolder; +import org.quartz.DisallowConcurrentExecution; import org.quartz.JobExecutionContext; import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.quartz.QuartzJobBean; @@ -41,6 +42,7 @@ import java.util.concurrent.ThreadPoolExecutor; @Async @SuppressWarnings({"unchecked", "all"}) @Slf4j +@DisallowConcurrentExecution public class ExecutionJob extends QuartzJobBean { /** diff --git a/acs/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java b/acs/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java index 36e047a..02128f3 100644 --- a/acs/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java +++ b/acs/nladmin-system/src/main/java/org/nl/start/auto/run/NDCSocketConnectionAutoRun.java @@ -28,6 +28,8 @@ import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.acs.log.service.impl.DeviceExecuteLogServiceImpl; import org.nl.acs.opc.Device; import org.nl.acs.opc.DeviceAppService; +import org.nl.modules.lucene.service.LuceneExecuteLogService; +import org.nl.modules.lucene.service.dto.LuceneLogDto; import org.nl.modules.system.service.ParamService; import org.nl.modules.system.service.impl.ParamServiceImpl; import org.nl.modules.wql.util.SpringContextHolder; @@ -218,6 +220,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable { if (!ObjectUtil.isEmpty(inst)) { if (!ObjectUtil.isEmpty(inst)) { instructionService.cancelNOSendAgv(inst.getInstruction_id()); + } } data = NDCAgvService.sendAgvOneModeInst(phase, index, 0); @@ -256,9 +259,10 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable { } } catch (Exception e) { - System.out.println("OneAgv链接异常"); - log.info("OneAgv链接异常"); - log.error("agv连接出现异常:{}", e); + ((LuceneExecuteLogService)SpringContextHolder.getBean("luceneExecuteLogServiceImpl")).deviceExecuteLog(new LuceneLogDto("sdfdsfsd", "sdfsdfsdfs")); +// System.out.println("OneAgv链接异常"); +// log.info("OneAgv链接异常"); +// log.error("agv连接出现异常:{}", e); logServer.deviceExecuteLog("1", "", "", "agv异常" + e.getMessage()); logServer.deviceExecuteLog("1", "", "", "agv异常" + e); if (ObjectUtil.isNotEmpty(s)) {