From 4e2d8b3d35636c18a76bfb121181e762f91f28b4 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, 14 Aug 2023 16:02:25 +0800 Subject: [PATCH] =?UTF-8?q?rev=20=E5=8E=8B=E6=9C=BA=E9=A9=B1=E5=8A=A8=20ad?= =?UTF-8?q?d=E7=A0=81=E5=9E=9B=E5=85=B3=E8=81=94=E6=8B=86=E5=9E=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...nshPalletizingManipulatorDeviceDriver.java | 6 +- ...hPalletizingManipulatorSiteDefination.java | 4 +- ...alletizingManipulatorSiteDeviceDriver.java | 21 +++++-- .../lnsh/lnsh_press/ItemProtocol.java | 58 +++++++++++++++++-- .../applyTask/ApplyDeviceDto.java | 28 +++++++++ .../applyTask/ApplyTaskRequest.java | 8 +++ .../acs/device/driver/lnsh/lnsh_press.vue | 43 ++++++++++++-- 7 files changed, 148 insertions(+), 20 deletions(-) create mode 100644 acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/AcsToWmsData/applyTask/ApplyDeviceDto.java diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/LnshPalletizingManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/LnshPalletizingManipulatorDeviceDriver.java index cf45f04..47f15f4 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/LnshPalletizingManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/LnshPalletizingManipulatorDeviceDriver.java @@ -365,8 +365,10 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri } } - - + /** + * 单次放置完成 + * @return + */ public boolean apply_one_grab() { GrabRequest request = new GrabRequest(); request.setDevice_code(this.getDevice_code()); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDefination.java index 33fa62b..98bfe2f 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDefination.java @@ -24,12 +24,12 @@ public class LnshPalletizingManipulatorSiteDefination implements OpcDeviceDriver @Override public String getDriverName() { - return "晟华-码垛机械手工位"; + return "晟华-包装拆码垛机械手工位"; } @Override public String getDriverDescription() { - return "晟华-码垛机械手工位"; + return "晟华-包装拆码垛机械手工位"; } @Override 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 d233889..b0a12a5 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 @@ -20,6 +20,7 @@ import org.nl.acs.device_driver.StandardRequestMethod; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.device_driver.lnsh.lnsh_mixing_mill.LnshMixingMillDeviceDriver; +import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyDeviceDto; import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskResponse; import org.nl.acs.ext.wms.data.AcsToWmsData.getVehicle.GetPalletizeRequest; import org.nl.acs.ext.wms.data.AcsToWmsData.getVehicle.GetPalletizeResponse; @@ -43,10 +44,7 @@ import org.openscada.opc.lib.da.Server; import org.springframework.http.HttpStatus; import java.lang.reflect.Method; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** * 晟华-码垛机械手工位 @@ -832,12 +830,14 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic public synchronized boolean apply_take_full_vehicle() { if(move > 0) { ApplyTaskRequest request = new ApplyTaskRequest(); + ApplyDeviceDto applyDeviceDto=new ApplyDeviceDto(); request.setDevice_code(this.getDevice_code()); request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName()); request.setRequest_medthod_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName())); request.setMaterial_code(material); request.setWeight(String.valueOf(weight)); request.setVehicle_code(String.valueOf(barcode)); + List listDto = new ArrayList<>(); if(ObjectUtil.isNotEmpty(this.getDevice().getExtraValue().get("link_device_code"))){ Device device = deviceAppService.findDeviceByCode(this.getDevice().getExtraValue().get("link_device_code").toString()); if(ObjectUtil.isNotEmpty(device)){ @@ -847,7 +847,18 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic request.setMix_mum(String.valueOf(lnshMixingMillDeviceDriver.getMix_num())); } } - } + List getDeviceCodeList = this.getExtraDeviceCodes("link_device_code"); + LnshPalletizingManipulatorSiteDeviceDriver lnshPalletizingManipulatorSiteDeviceDriver; + for (int i = 0; i < getDeviceCodeList.size(); i++) { + if(device.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver){ + lnshPalletizingManipulatorSiteDeviceDriver=(LnshPalletizingManipulatorSiteDeviceDriver) getDevice().getDeviceDriver(); + applyDeviceDto.setQty(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getEncoder_qty())); + applyDeviceDto.setDevice_code(String.valueOf(lnshPalletizingManipulatorSiteDeviceDriver.getBarcode())); + } + } + listDto.add(applyDeviceDto); + request.setList(listDto); + } ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); message = RequestMethodEnum.getName("apply_take_full_vehicle") + "apply_take_full_vehicle 接口请求LMS..."; lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); 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 a7451d4..9e7bf77 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 @@ -32,12 +32,22 @@ public class ItemProtocol { public static String item_to_order_No = "to_order_No"; public static String item_to_qty = "to_qty"; public static String item_to_material_code = "to_material_code"; + public static String item_to_formula = "to_formula"; + public static String item_to_brick_code = "to_brick_code"; public static String item_to_product_code = "to_product_code"; public static String item_to_AlongSide = "to_AlongSide"; public static String item_to_BshortSide = "to_BshortSide"; public static String item_to_Htrapezoidal = "to_Htrapezoidal"; public static String item_to_Wthickness = "to_Wthickness"; - + public static String item_to_size_error = "to_size_error"; + public static String item_to_single_weight = "to_single_weight"; + public static String item_to_drawing_address = "to_drawing_address"; + public static String item_to_standard_weight = "to_standard_weight"; + public static String item_to_detection_error = "to_detection_error"; + public static String item_to_standard_size_height1 = "to_standard_size_height1"; + 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"; private LnshPressDeviceDriver driver; @@ -121,6 +131,14 @@ public class ItemProtocol { return this.getOpcStringValue(item_to_material_code); } + public String getTo_brick_code() { + return this.getOpcStringValue(item_to_brick_code); + } + + public String getTo_Formula() { + return this.getOpcStringValue(item_to_formula); + } + public int getTo_Product_code() { return this.getOpcIntegerValue(item_to_product_code); } @@ -141,6 +159,23 @@ public class ItemProtocol { return this.getOpcIntegerValue(item_to_Wthickness); } + public int getToSizeError() {return this.getOpcIntegerValue(item_to_size_error);} + + public int getToSingleWeight() {return this.getOpcIntegerValue(item_to_single_weight);} + + public int getToDrawingAddress() {return this.getOpcIntegerValue(item_to_drawing_address);} + + public int getToStandardWeight() {return this.getOpcIntegerValue(item_to_standard_weight);} + + public int getToDetectionError() {return this.getOpcIntegerValue(item_to_detection_error);} + + public int getToStandardSizeHeight1() {return this.getOpcIntegerValue(item_to_standard_size_height1);} + + public int getToStandardSizeHeight2() {return this.getOpcIntegerValue(item_to_standard_size_height2);} + + public int getToStandardSizeHeight3() {return this.getOpcIntegerValue(item_to_standard_size_height3);} + + public int getToStandardSizeHeight4() {return this.getOpcIntegerValue(item_to_standard_size_height4);} //是否有货 public int hasGoods(int move) { return move; @@ -196,11 +231,22 @@ public class ItemProtocol { list.add(new ItemDto(item_to_order_No, "工单号", "DB101.STRING4.50")); list.add(new ItemDto(item_to_qty, "生产重量", "DB101.D56")); list.add(new ItemDto(item_to_material_code, "下发物料编号", "DB101.STRING60.50")); - list.add(new ItemDto(item_to_product_code, "产品编号", "DB101.W112")); - list.add(new ItemDto(item_to_AlongSide, "A长边", "DB101.W114")); - list.add(new ItemDto(item_to_BshortSide, "B短边", "DB101.W116")); - list.add(new ItemDto(item_to_Htrapezoidal, "H梯形高", "DB101.W118")); - list.add(new ItemDto(item_to_Wthickness, "W厚度", "DB101.W120")); + list.add(new ItemDto(item_to_brick_code, "砖型代号", "DB101.STRING112.50")); + list.add(new ItemDto(item_to_formula, "配方代号", "DB101.STRING164.50")); + list.add(new ItemDto(item_to_product_code, "产品编号", "DB101.W216")); + list.add(new ItemDto(item_to_AlongSide, "A长边", "DB101.W218")); + list.add(new ItemDto(item_to_BshortSide, "B短边", "DB101.W220")); + list.add(new ItemDto(item_to_Htrapezoidal, "H梯形高", "DB101.W222")); + list.add(new ItemDto(item_to_Wthickness, "W厚度", "DB101.W224")); + list.add(new ItemDto(item_to_size_error, "尺寸允许误差", "DB101.W228")); + list.add(new ItemDto(item_to_single_weight, "单重允许误差", "DB101.W232")); + list.add(new ItemDto(item_to_drawing_address, "图纸地址", "DB101.W236")); + list.add(new ItemDto(item_to_standard_weight, "标准重量", "DB101.W240")); + list.add(new ItemDto(item_to_detection_error, "检测误差值", "DB101.W244")); + list.add(new ItemDto(item_to_standard_size_height1, "标准尺寸高度1", "DB101.W248")); + list.add(new ItemDto(item_to_standard_size_height2, "标准尺寸高度2", "DB101.W252")); + list.add(new ItemDto(item_to_standard_size_height3, "标准尺寸高度3", "DB101.W256")); + list.add(new ItemDto(item_to_standard_size_height4, "标准尺寸高度4", "DB101.W260")); return list; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/AcsToWmsData/applyTask/ApplyDeviceDto.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/AcsToWmsData/applyTask/ApplyDeviceDto.java new file mode 100644 index 0000000..059ffc1 --- /dev/null +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/AcsToWmsData/applyTask/ApplyDeviceDto.java @@ -0,0 +1,28 @@ +package org.nl.acs.ext.wms.data.AcsToWmsData.applyTask; + +import lombok.Data; + +@Data +public class ApplyDeviceDto { + + /** + * 设备编码 + */ + private String device_code; + + /** + * 数量 + */ + private String qty; + + /** + * 载具号 + */ + private String vehicle_code; + + /** + * 载具类型 + */ + private String vehicle_type; + +} 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 b68cf7c..3ef86eb 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 @@ -1,9 +1,12 @@ package org.nl.acs.ext.wms.data.AcsToWmsData.applyTask; import lombok.Data; +import org.nl.acs.device.service.dto.DeviceDto; import org.nl.acs.ext.wms.data.BaseRequest; import org.nl.acs.ext.wms.data.PalletizeDto; +import java.util.List; + @Data public class ApplyTaskRequest extends BaseRequest { @@ -47,4 +50,9 @@ public class ApplyTaskRequest extends BaseRequest { */ private PalletizeDto palletizeDto; + /** + * 关联设备属性 + */ + private List list; + } diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_press.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_press.vue index 6c1bc8c..cf81473 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_press.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_press.vue @@ -572,20 +572,53 @@ export default { if (this.data2[val].code.indexOf('to_material_code') !== -1) { this.data2[val].db = beforeStr + '.STRING58.50' } + if (this.data2[val].code.indexOf('to_brick_code') !== -1) { + this.data2[val].db = beforeStr + '.STRING112.50' + } + if (this.data2[val].code.indexOf('to_formula') !== -1) { + this.data2[val].db = beforeStr + '.STRING164.50' + } if (this.data2[val].code.indexOf('to_product_code') !== -1) { - this.data2[val].db = beforeStr + '.W108' + this.data2[val].db = beforeStr + '.W216' } if (this.data2[val].code.indexOf('to_AlongSide') !== -1) { - this.data2[val].db = beforeStr + '.W110' + this.data2[val].db = beforeStr + '.W218' } if (this.data2[val].code.indexOf('to_BshortSide') !== -1) { - this.data2[val].db = beforeStr + '.W112' + this.data2[val].db = beforeStr + '.W220' } if (this.data2[val].code.indexOf('to_Htrapezoidal') !== -1) { - this.data2[val].db = beforeStr + '.W114' + this.data2[val].db = beforeStr + '.W222' } if (this.data2[val].code.indexOf('to_Wthickness') !== -1) { - this.data2[val].db = beforeStr + '.W116' + this.data2[val].db = beforeStr + '.W224' + } + if (this.data2[val].code.indexOf('to_size_error') !== -1) { + this.data2[val].db = beforeStr + '.W228' + } + if (this.data2[val].code.indexOf('to_single_weight') !== -1) { + this.data2[val].db = beforeStr + '.W232' + } + if (this.data2[val].code.indexOf('to_drawing_address') !== -1) { + this.data2[val].db = beforeStr + '.W236' + } + if (this.data2[val].code.indexOf('to_standard_weight') !== -1) { + this.data2[val].db = beforeStr + '.W240' + } + if (this.data2[val].code.indexOf('to_detection_error') !== -1) { + this.data2[val].db = beforeStr + '.W244' + } + if (this.data2[val].code.indexOf('to_standard_size_height1') !== -1) { + this.data2[val].db = beforeStr + '.W248' + } + if (this.data2[val].code.indexOf('to_standard_size_height2') !== -1) { + this.data2[val].db = beforeStr + '.W252' + } + if (this.data2[val].code.indexOf('to_standard_size_height3') !== -1) { + this.data2[val].db = beforeStr + '.W256' + } + if (this.data2[val].code.indexOf('to_standard_size_height4') !== -1) { + this.data2[val].db = beforeStr + '.W260' } } }