Browse Source

rev 压机驱动 add码垛关联拆垛

master
周俊杰 1 year ago
parent
commit
4e2d8b3d35
  1. 6
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator/LnshPalletizingManipulatorDeviceDriver.java
  2. 4
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDefination.java
  3. 19
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDeviceDriver.java
  4. 58
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_press/ItemProtocol.java
  5. 28
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/AcsToWmsData/applyTask/ApplyDeviceDto.java
  6. 8
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/AcsToWmsData/applyTask/ApplyTaskRequest.java
  7. 43
      acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_press.vue

6
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() { public boolean apply_one_grab() {
GrabRequest request = new GrabRequest(); GrabRequest request = new GrabRequest();
request.setDevice_code(this.getDevice_code()); request.setDevice_code(this.getDevice_code());

4
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 @Override
public String getDriverName() { public String getDriverName() {
return "晟华-码垛机械手工位"; return "晟华-包装拆码垛机械手工位";
} }
@Override @Override
public String getDriverDescription() { public String getDriverDescription() {
return "晟华-码垛机械手工位"; return "晟华-包装拆码垛机械手工位";
} }
@Override @Override

19
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.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.device_driver.lnsh.lnsh_mixing_mill.LnshMixingMillDeviceDriver; 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.applyTask.ApplyTaskResponse;
import org.nl.acs.ext.wms.data.AcsToWmsData.getVehicle.GetPalletizeRequest; import org.nl.acs.ext.wms.data.AcsToWmsData.getVehicle.GetPalletizeRequest;
import org.nl.acs.ext.wms.data.AcsToWmsData.getVehicle.GetPalletizeResponse; 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 org.springframework.http.HttpStatus;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.Date; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* 晟华-码垛机械手工位 * 晟华-码垛机械手工位
@ -832,12 +830,14 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
public synchronized boolean apply_take_full_vehicle() { public synchronized boolean apply_take_full_vehicle() {
if(move > 0) { if(move > 0) {
ApplyTaskRequest request = new ApplyTaskRequest(); ApplyTaskRequest request = new ApplyTaskRequest();
ApplyDeviceDto applyDeviceDto=new ApplyDeviceDto();
request.setDevice_code(this.getDevice_code()); request.setDevice_code(this.getDevice_code());
request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName()); request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName());
request.setRequest_medthod_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName())); request.setRequest_medthod_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName()));
request.setMaterial_code(material); request.setMaterial_code(material);
request.setWeight(String.valueOf(weight)); request.setWeight(String.valueOf(weight));
request.setVehicle_code(String.valueOf(barcode)); request.setVehicle_code(String.valueOf(barcode));
List<ApplyDeviceDto> listDto = new ArrayList<>();
if(ObjectUtil.isNotEmpty(this.getDevice().getExtraValue().get("link_device_code"))){ if(ObjectUtil.isNotEmpty(this.getDevice().getExtraValue().get("link_device_code"))){
Device device = deviceAppService.findDeviceByCode(this.getDevice().getExtraValue().get("link_device_code").toString()); Device device = deviceAppService.findDeviceByCode(this.getDevice().getExtraValue().get("link_device_code").toString());
if(ObjectUtil.isNotEmpty(device)){ if(ObjectUtil.isNotEmpty(device)){
@ -847,6 +847,17 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
request.setMix_mum(String.valueOf(lnshMixingMillDeviceDriver.getMix_num())); request.setMix_mum(String.valueOf(lnshMixingMillDeviceDriver.getMix_num()));
} }
} }
List<String> 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); ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
message = RequestMethodEnum.getName("apply_take_full_vehicle") + "apply_take_full_vehicle 接口请求LMS..."; message = RequestMethodEnum.getName("apply_take_full_vehicle") + "apply_take_full_vehicle 接口请求LMS...";

58
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_order_No = "to_order_No";
public static String item_to_qty = "to_qty"; public static String item_to_qty = "to_qty";
public static String item_to_material_code = "to_material_code"; 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_product_code = "to_product_code";
public static String item_to_AlongSide = "to_AlongSide"; public static String item_to_AlongSide = "to_AlongSide";
public static String item_to_BshortSide = "to_BshortSide"; public static String item_to_BshortSide = "to_BshortSide";
public static String item_to_Htrapezoidal = "to_Htrapezoidal"; public static String item_to_Htrapezoidal = "to_Htrapezoidal";
public static String item_to_Wthickness = "to_Wthickness"; 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; private LnshPressDeviceDriver driver;
@ -121,6 +131,14 @@ public class ItemProtocol {
return this.getOpcStringValue(item_to_material_code); 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() { public int getTo_Product_code() {
return this.getOpcIntegerValue(item_to_product_code); return this.getOpcIntegerValue(item_to_product_code);
} }
@ -141,6 +159,23 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_to_Wthickness); 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) { public int hasGoods(int move) {
return 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_order_No, "工单号", "DB101.STRING4.50"));
list.add(new ItemDto(item_to_qty, "生产重量", "DB101.D56")); 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_material_code, "下发物料编号", "DB101.STRING60.50"));
list.add(new ItemDto(item_to_product_code, "产品编号", "DB101.W112")); list.add(new ItemDto(item_to_brick_code, "砖型代号", "DB101.STRING112.50"));
list.add(new ItemDto(item_to_AlongSide, "A长边", "DB101.W114")); list.add(new ItemDto(item_to_formula, "配方代号", "DB101.STRING164.50"));
list.add(new ItemDto(item_to_BshortSide, "B短边", "DB101.W116")); list.add(new ItemDto(item_to_product_code, "产品编号", "DB101.W216"));
list.add(new ItemDto(item_to_Htrapezoidal, "H梯形高", "DB101.W118")); list.add(new ItemDto(item_to_AlongSide, "A长边", "DB101.W218"));
list.add(new ItemDto(item_to_Wthickness, "W厚度", "DB101.W120")); 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; return list;
} }

28
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;
}

8
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; package org.nl.acs.ext.wms.data.AcsToWmsData.applyTask;
import lombok.Data; 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.BaseRequest;
import org.nl.acs.ext.wms.data.PalletizeDto; import org.nl.acs.ext.wms.data.PalletizeDto;
import java.util.List;
@Data @Data
public class ApplyTaskRequest extends BaseRequest { public class ApplyTaskRequest extends BaseRequest {
@ -47,4 +50,9 @@ public class ApplyTaskRequest extends BaseRequest {
*/ */
private PalletizeDto palletizeDto; private PalletizeDto palletizeDto;
/**
* 关联设备属性
*/
private List<ApplyDeviceDto> list;
} }

43
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) { if (this.data2[val].code.indexOf('to_material_code') !== -1) {
this.data2[val].db = beforeStr + '.STRING58.50' 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) { 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) { 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) { 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) { 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) { 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'
} }
} }
} }

Loading…
Cancel
Save