diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/RequestMethodEnum.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/RequestMethodEnum.java index 303dfa6..e7910e1 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/RequestMethodEnum.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/RequestMethodEnum.java @@ -26,7 +26,7 @@ public enum RequestMethodEnum { apply_force_take_full_vehicle_in_storage(8, "apply_force_take_full_vehicle_in_storage", "申请强制满托入缓存","0"), - barcode_sucess_apply(9, "barcode_success_apply", "扫码成功申请","0"), + barcode_success_apply(9, "barcode_success_apply", "扫码成功申请","0"), get_vehicle_info(10, "get_vehicle_info", "获取组盘信息","0"), diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/StandardRequestMethod.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/StandardRequestMethod.java index 8659b4a..4c805f0 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/StandardRequestMethod.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/StandardRequestMethod.java @@ -70,7 +70,7 @@ public interface StandardRequestMethod { * 扫码成功申请 * @return */ - public default boolean barcode_sucess_apply() { + public default boolean barcode_success_apply() { throw new RuntimeException("未实现"); }; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/converor_barcode/ConveyorBarcodeDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/converor_barcode/ConveyorBarcodeDeviceDriver.java index ae127f4..e813ddc 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/converor_barcode/ConveyorBarcodeDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/converor_barcode/ConveyorBarcodeDeviceDriver.java @@ -710,7 +710,7 @@ public class ConveyorBarcodeDeviceDriver extends AbstractOpcDeviceDriver impleme * * @param */ - public synchronized boolean barcode_sucess_apply() { + public synchronized boolean barcode_success_apply() { if(move > 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); @@ -720,7 +720,7 @@ public class ConveyorBarcodeDeviceDriver extends AbstractOpcDeviceDriver impleme request.setVehicle_code(String.valueOf(barcode)); ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); - message = RequestMethodEnum.getName("barcode_sucess_apply") + "barcode_sucess_apply 接口请求LMS..."; + message = RequestMethodEnum.getName("barcode_success_apply") + "barcode_success_apply 接口请求LMS..."; lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); if (resp.getCode() == 200) { @@ -728,11 +728,11 @@ public class ConveyorBarcodeDeviceDriver extends AbstractOpcDeviceDriver impleme this.setRequireSucess(true); } else { this.writing(400); - message = RequestMethodEnum.getName("barcode_sucess_apply") + "barcode_sucess_apply 接口请求失败" + resp.getMessage();; + message = RequestMethodEnum.getName("barcode_success_apply") + "barcode_success_apply 接口请求失败" + resp.getMessage();; } return true; } else { - message = RequestMethodEnum.getName("barcode_sucess_apply") + "barcode_sucess_apply 设备无货未请求LMS..."; + message = RequestMethodEnum.getName("barcode_success_apply") + "barcode_success_apply 设备无货未请求LMS..."; lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); return false; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/conveyor_press_station/ConveyorPressStationDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/conveyor_press_station/ConveyorPressStationDeviceDriver.java index 9b9b4d0..d352326 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/conveyor_press_station/ConveyorPressStationDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/conveyor_press_station/ConveyorPressStationDeviceDriver.java @@ -704,7 +704,7 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im request.setVehicle_code(String.valueOf(barcode)); ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); - message = RequestMethodEnum.getName("barcode_sucess_apply") + "barcode_sucess_apply 接口请求LMS..."; + message = RequestMethodEnum.getName("barcode_success_apply") + "barcode_success_apply 接口请求LMS..."; lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); if (resp.getCode() == 200) { @@ -714,11 +714,11 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im this.setRequireSucess(true); } else { this.writing(400); - message = RequestMethodEnum.getName("barcode_sucess_apply") + "barcode_sucess_apply 接口请求失败" + resp.getMessage();; + message = RequestMethodEnum.getName("barcode_success_apply") + "barcode_success_apply 接口请求失败" + resp.getMessage();; } return true; } else { - message = RequestMethodEnum.getName("barcode_sucess_apply") + "barcode_sucess_apply 设备无货未请求LMS..."; + message = RequestMethodEnum.getName("barcode_success_apply") + "barcode_success_apply 设备无货未请求LMS..."; lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); return false; } 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 22d6147..c5299cb 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 @@ -26,7 +26,6 @@ public class ItemProtocol { public static String item_barcode = "barcode"; public static String item_unqualified_qty = "unqualified_qty"; public static String item_encoder_qty = "encoder_qty"; - public static String item_product_code = "product_code"; public static String item_AlongSide = "AlongSide"; public static String item_BshortSide = "BshortSide"; 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 4c96416..e5e3ba4 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 @@ -933,7 +933,7 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic * * @param */ - public synchronized boolean barcode_sucess_apply() { + public synchronized boolean barcode_success_apply() { if(move > 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); @@ -942,7 +942,7 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic request.setWeight(String.valueOf(weight)); request.setVehicle_code(String.valueOf(barcode)); ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); - message = RequestMethodEnum.getName("barcode_sucess_apply") + "barcode_sucess_apply 接口请求LMS..."; + message = RequestMethodEnum.getName("barcode_success_apply") + "barcode_success_apply 接口请求LMS..."; lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); if (resp.getCode() == 200) { @@ -951,11 +951,11 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic this.setRequireSucess(true); } else { this.writing(400); - message = RequestMethodEnum.getName("barcode_sucess_apply") + "barcode_sucess_apply 接口请求失败" + resp.getMessage();; + message = RequestMethodEnum.getName("barcode_success_apply") + "barcode_success_apply 接口请求失败" + resp.getMessage();; } return true; } else { - message = RequestMethodEnum.getName("barcode_sucess_apply") + "barcode_sucess_apply 设备无货未请求LMS..."; + message = RequestMethodEnum.getName("barcode_success_apply") + "barcode_success_apply 设备无货未请求LMS..."; lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); return false; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/LnshSplitManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/LnshSplitManipulatorDeviceDriver.java index 8f743fd..efe7570 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/LnshSplitManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/LnshSplitManipulatorDeviceDriver.java @@ -3,6 +3,7 @@ package org.nl.acs.device_driver.lnsh.lnsh_split_manipulator; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpResponse; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import lombok.Getter; import lombok.Setter; @@ -11,20 +12,28 @@ import lombok.extern.slf4j.Slf4j; import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; import org.nl.acs.device.service.DeviceService; import org.nl.acs.device_driver.DeviceDriver; +import org.nl.acs.device_driver.RequestMethodEnum; import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; +import org.nl.acs.device_driver.lnsh.lnsh_mixing_mill.LnshMixingMillDeviceDriver; +import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskRequest; +import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskResponse; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.acs.opc.Device; +import org.nl.acs.opc.DeviceAppService; import org.nl.acs.route.service.RouteLineService; import org.nl.acs.task.service.TaskService; +import org.nl.modules.lucene.service.LuceneExecuteLogService; +import org.nl.modules.lucene.service.dto.LuceneLogDto; import org.nl.modules.wql.util.SpringContextHolder; import org.openscada.opc.lib.da.Server; import org.springframework.beans.factory.annotation.Autowired; +import java.lang.reflect.Method; import java.util.*; /** @@ -39,6 +48,8 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); + LuceneExecuteLogService lucene = SpringContextHolder.getBean("luceneExecuteLogServiceImpl"); + DeviceService deviceservice = SpringContextHolder.getBean("deviceServiceImpl"); RouteLineService routelineserver = SpringContextHolder.getBean("routeLineServiceImpl"); @@ -49,7 +60,11 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im AcsToWmsService acsToWmsService = SpringContextHolder.getBean("acsToWmsServiceImpl"); + DeviceAppService deviceAppService = SpringContextHolder.getBean("deviceAppServiceImpl"); + int mode = 0; + int move = 0; + int weight = 0; int error = 0; int last_mode = 0; int last_error = 0; @@ -705,6 +720,358 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im last_two_qty = two_qty; last_tool_coordinate = tool_coordinate; } + /** + * 请求 + * + * @param + */ + public synchronized boolean applyRequest(String modethod) throws Exception { + Object obj1 = this; + Date date = new Date(); + if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); + return false; + } else { + this.instruction_require_time = date; + Object obj = this.getClass().getDeclaredConstructor().newInstance(); + Method method1 = this.getClass().getMethod(modethod, null); + method1.invoke(this, null); + return true; + } + } + + + /** + * 申请补满料盅托盘 + * + * @param + */ + public synchronized boolean apply_put_full_vehicle() { + if(move == 0) { + ApplyTaskRequest request = new ApplyTaskRequest(); + 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.setWeight(String.valueOf(weight)); + request.setVehicle_code(String.valueOf(barcode)); + message = RequestMethodEnum.getName("apply_put_full_vehicle") + "apply_put_full_vehicle 接口请求LMS..."; + lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); + ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); + if (resp.getCode() == 200) { + this.writing(200); + this.setRequireSucess(true); + } else { + this.writing(400); + message = RequestMethodEnum.getName("apply_put_full_vehicle") + "apply_put_full_vehicle 接口请求失败" + resp.getMessage();; + } + lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); + return true; + } else { + message = RequestMethodEnum.getName("apply_put_full_vehicle") + "apply_put_full_vehicle 设备有货未请求LMS..."; + lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); + return false; + } + } + + /** + * 申请补空料盅托盘 + * + * @param + */ + public synchronized boolean apply_put_empty_vehicle() { + if(move == 0) { + ApplyTaskRequest request = new ApplyTaskRequest(); + 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.setWeight(String.valueOf(weight)); + request.setVehicle_code(String.valueOf(barcode)); + ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); + message = RequestMethodEnum.getName("apply_put_empty_vehicle") + "apply_put_empty_vehicle 接口请求LMS..."; + lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); + + if (resp.getCode() == 200) { + this.writing(200); + this.setRequireSucess(true); + } else { + this.writing(400); + message = RequestMethodEnum.getName("apply_put_empty_vehicle") + "apply_put_empty_vehicle 接口请求失败" + resp.getMessage();; + } + return true; + } else { + message = RequestMethodEnum.getName("apply_put_empty_vehicle") + "apply_put_empty_vehicle 设备有货未请求LMS..."; + lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); + return false; + } + } + + /** + * 申请取走空料盅托盘 + * + * @param + */ + public synchronized boolean apply_take_empty_vehicle() { + if(move == 0) { + ApplyTaskRequest request = new ApplyTaskRequest(); + 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.setWeight(String.valueOf(weight)); + request.setVehicle_code(String.valueOf(barcode)); + ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); + message = RequestMethodEnum.getName("apply_take_empty_vehicle") + "apply_take_empty_vehicle 接口请求LMS..."; + lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); + + if (resp.getCode() == 200) { + this.writing(200); + this.setRequireSucess(true); + } else { + this.writing(400); + message = RequestMethodEnum.getName("apply_take_empty_vehicle") + "apply_take_empty_vehicle 接口请求失败" + resp.getMessage();; + } + return true; + } else { + message = RequestMethodEnum.getName("apply_take_empty_vehicle") + "apply_take_empty_vehicle 设备有货未请求LMS..."; + lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); + return false; + } + } + + + /** + * 申请取走满料盅托盘 + * + * @param + */ + public synchronized boolean apply_take_full_vehicle() { + if(move > 0) { + ApplyTaskRequest request = new ApplyTaskRequest(); + 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)); + 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)){ + LnshMixingMillDeviceDriver lnshMixingMillDeviceDriver; + if(device.getDeviceDriver() instanceof LnshMixingMillDeviceDriver){ + lnshMixingMillDeviceDriver = (LnshMixingMillDeviceDriver) device.getDeviceDriver(); + request.setMix_mum(String.valueOf(lnshMixingMillDeviceDriver.getMix_num())); + } + } + } + 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))); + + if (resp.getCode() == 200) { + this.writing(200); + this.setRequireSucess(true); + } else { + this.writing(400); + message = RequestMethodEnum.getName("apply_take_full_vehicle") + "apply_take_full_vehicle 接口请求失败" + resp.getMessage();; + } + return true; + } else { + message = RequestMethodEnum.getName("apply_take_full_vehicle") + "apply_take_full_vehicle 设备无货未请求LMS..."; + lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); + return false; + } + } + + /** + * 申请强制取走满料盅托盘 + * + * @param + */ + public synchronized boolean apply_force_take_full_vehicle() { + if(move > 0) { + ApplyTaskRequest request = new ApplyTaskRequest(); + 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.setWeight(String.valueOf(weight)); + request.setVehicle_code(String.valueOf(barcode)); + ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); + message = RequestMethodEnum.getName("apply_force_take_full_vehicle") + "apply_force_take_full_vehicle 接口请求LMS..."; + lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); + + if (resp.getCode() == 200) { + this.writing(200); + this.setRequireSucess(true); + } else { + this.writing(400); + message = RequestMethodEnum.getName("apply_force_take_full_vehicle") + "apply_force_take_full_vehicle 接口请求失败" + resp.getMessage();; + } + return true; + } else { + message = RequestMethodEnum.getName("apply_force_take_full_vehicle") + "apply_force_take_full_vehicle 设备无货未请求LMS..."; + lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); + return false; + } + } + + /** + * 申请强制满托入缓存 + * + * @param + */ + public synchronized boolean apply_force_take_full_vehicle_in_storage() { + if(move > 0) { + ApplyTaskRequest request = new ApplyTaskRequest(); + 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.setWeight(String.valueOf(weight)); + request.setVehicle_code(String.valueOf(barcode)); + ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); + message = RequestMethodEnum.getName("apply_force_take_full_vehicle_in_storage") + "apply_force_take_full_vehicle_in_storage 接口请求LMS..."; + lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); + + if (resp.getCode() == 200) { + this.writing(200); + this.setRequireSucess(true); + } else { + this.writing(400); + message = RequestMethodEnum.getName("apply_force_take_full_vehicle_in_storage") + "apply_force_take_full_vehicle_in_storage 接口请求失败" + resp.getMessage();; + } + return true; + } else { + message = RequestMethodEnum.getName("apply_force_take_full_vehicle_in_storage") + "apply_force_take_full_vehicle_in_storage 设备无货未请求LMS..."; + lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); + return false; + } + } + + /** + * 扫码成功申请 + * + * @param + */ + public synchronized boolean barcode_success_apply() { + if(move > 0) { + ApplyTaskRequest request = new ApplyTaskRequest(); + 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.setWeight(String.valueOf(weight)); + request.setVehicle_code(String.valueOf(barcode)); + ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); + message = RequestMethodEnum.getName("barcode_success_apply") + "barcode_success_apply 接口请求LMS..."; + lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); + + if (resp.getCode() == 200) { + this.writing(200); + this.writing(resp.getIs_standing_finish(),"1"); + this.setRequireSucess(true); + } else { + this.writing(400); + message = RequestMethodEnum.getName("barcode_success_apply") + "barcode_success_apply 接口请求失败" + resp.getMessage();; + } + return true; + } else { + message = RequestMethodEnum.getName("barcode_success_apply") + "barcode_success_apply 设备无货未请求LMS..."; + lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); + return false; + } + } + + /** + * 获取组盘信息 + * + * @param + */ + public synchronized boolean get_vehicle_info() { + if(move > 0) { + ApplyTaskRequest request = new ApplyTaskRequest(); + 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.setWeight(String.valueOf(weight)); + request.setVehicle_code(String.valueOf(barcode)); + ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); + message = RequestMethodEnum.getName("get_vehicle_info") + "get_vehicle_info 接口请求LMS..."; + lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); + + if (resp.getCode() == 200) { + this.writing(200); + this.setRequireSucess(true); + } else { + this.writing(400); + message = RequestMethodEnum.getName("get_vehicle_info") + "get_vehicle_info 接口请求失败" + resp.getMessage();; + } + return true; + } else { + message = RequestMethodEnum.getName("get_vehicle_info") + "get_vehicle_info 设备无货未请求LMS..."; + lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); + return false; + } + + } + + /** + * 强制去包装-不包装 + */ + public synchronized boolean force_no_package() { + if(move > 0) { + ApplyTaskRequest request = new ApplyTaskRequest(); + 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.setWeight(String.valueOf(weight)); + request.setVehicle_code(String.valueOf(barcode)); + ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); + message = RequestMethodEnum.getName("force_no_package") + "force_no_package 接口请求LMS..."; + lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); + + if (resp.getCode() == 200) { + this.writing(200); + this.setRequireSucess(true); + } else { + this.writing(400); + message = RequestMethodEnum.getName("force_no_package") + "force_no_package 接口请求失败" + resp.getMessage();; + } + return true; + } else { + message = RequestMethodEnum.getName("force_no_package") + "force_no_package 设备无货未请求LMS..."; + lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); + return false; + } + } + + + /** + * 申请贴标 + */ + public synchronized boolean apply_labelling() { + if(move > 0) { + ApplyTaskRequest request = new ApplyTaskRequest(); + 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.setWeight(String.valueOf(weight)); + request.setVehicle_code(String.valueOf(barcode)); + ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); + message = RequestMethodEnum.getName("apply_labelling") + "apply_labelling 接口请求LMS..."; + lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); + + if (resp.getCode() == 200) { + this.writing(200); + this.setRequireSucess(true); + } else { + this.writing(400); + message = RequestMethodEnum.getName("apply_labelling") + "apply_labelling 接口请求失败" + resp.getMessage();; + } + return true; + } else { + message = RequestMethodEnum.getName("apply_labelling") + "apply_labelling 设备无货未请求LMS..."; + lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); + return false; + } + } + public boolean exe_error() { 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 449f0aa..a9c5449 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 @@ -701,7 +701,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements * * @param */ - public synchronized boolean barcode_sucess_apply() { + public synchronized boolean barcode_success_apply() { if(move > 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); @@ -710,20 +710,19 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements request.setWeight(String.valueOf(weight)); request.setVehicle_code(String.valueOf(barcode)); ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); - message = RequestMethodEnum.getName("barcode_sucess_apply") + "barcode_sucess_apply 接口请求LMS..."; + message = RequestMethodEnum.getName("barcode_success_apply") + "barcode_success_apply 接口请求LMS..."; lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); if (resp.getCode() == 200) { this.writing(200); - this.writing(resp.getIs_standing_finish(),"1"); this.setRequireSucess(true); } else { this.writing(400); - message = RequestMethodEnum.getName("barcode_sucess_apply") + "barcode_sucess_apply 接口请求失败" + resp.getMessage();; + message = RequestMethodEnum.getName("barcode_success_apply") + "barcode_success_apply 接口请求失败" + resp.getMessage();; } return true; } else { - message = RequestMethodEnum.getName("barcode_sucess_apply") + "barcode_sucess_apply 设备无货未请求LMS..."; + message = RequestMethodEnum.getName("barcode_success_apply") + "barcode_success_apply 设备无货未请求LMS..."; lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); return false; } diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/conveyor_press_station.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/conveyor_press_station.vue index c4699f8..235b9d7 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/conveyor_press_station.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/conveyor_press_station.vue @@ -365,7 +365,7 @@ export default { }, { mode: '11', - request: 'barcode_sucess_apply' + request: 'barcode_success_apply' }, { mode: '12', diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/conveyor_ssx_barcode.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/conveyor_ssx_barcode.vue index 2ed71c7..294fcf9 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/conveyor_ssx_barcode.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/conveyor_ssx_barcode.vue @@ -365,7 +365,7 @@ export default { }, { mode: '11', - request: 'barcode_sucess_apply' + request: 'barcode_success_apply' }, { mode: '12', diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_mixing_mill.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_mixing_mill.vue index c55ec32..f715e16 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_mixing_mill.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_mixing_mill.vue @@ -394,7 +394,7 @@ export default { }, { mode: '11', - request: 'barcode_sucess_apply' + request: 'barcode_success_apply' }, { mode: '12', diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_palletizing_manipulator_site.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_palletizing_manipulator_site.vue index 534bd61..9e29662 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_palletizing_manipulator_site.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_palletizing_manipulator_site.vue @@ -392,7 +392,7 @@ export default { }, { mode: '11', - request: 'barcode_sucess_apply' + request: 'barcode_success_apply' }, { mode: '12', 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 abb8258..1713a72 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 @@ -394,7 +394,7 @@ export default { }, { mode: '11', - request: 'barcode_sucess_apply' + request: 'barcode_success_apply' }, { mode: '12', diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_split_manipulator.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_split_manipulator.vue index 979a9eb..3f7cfdb 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_split_manipulator.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_split_manipulator.vue @@ -158,7 +158,66 @@ + +
+ 交互相关: +
+
+ + + + + 新增一行 + + +
+
+ + + + + + + + + + + +
+
PLC读取字段: @@ -296,6 +355,59 @@ export default { deviceList: [], data1: [], data2: [], + requestMethodList: [], + modeform: { + tableData: [ + // { + // mode: '3', + // request: 'order_verify' + // }, + // { + // mode: '4', + // request: 'order_finish' + // }, + { + mode: '5', + request: 'apply_put_full_vehicle' + }, + { + mode: '6', + request: 'apply_put_empty_vehicle' + }, + { + mode: '7', + request: 'apply_take_empty_vehicle' + }, + { + mode: '8', + request: 'apply_take_full_vehicle' + }, + { + mode: '9', + request: 'apply_force_take_full_vehicle' + }, + { + mode: '10', + request: 'apply_force_take_full_vehicle_in_storage' + }, + { + mode: '11', + request: 'barcode_success_apply' + }, + { + mode: '12', + request: 'get_vehicle_info' + }, + { + mode: '13', + request: 'force_no_package' + }, + { + mode: '14', + request: 'apply_labelling' + } + ] + }, form: { inspect_in_stocck: true, ignore_pickup_check: true, @@ -349,9 +461,18 @@ export default { deviceCrud.selectDeviceList().then(data => { this.deviceList = data }) + deviceCrud.selectRequestMethodList().then(data => { + this.requestMethodList = data + }) }) }, methods: { + insertdtl() { + this.modeform.tableData.push({mode: '', request: '' }) + }, + deleteRow(index, rows) { + rows.splice(index, 1) + }, finishReadEdit(data) { // 编辑的是code列,并且值包含mode if (data.code.indexOf('mode') !== -1) {