From 120f48a0c5aa4c16c290c2e9e8427ef72f13633b Mon Sep 17 00:00:00 2001 From: "USER-20220102CG\\noblelift" <546428999@qq.com> Date: Fri, 4 Aug 2023 18:01:38 +0800 Subject: [PATCH] =?UTF-8?q?rev=20=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../acs/device_driver/RequestMethodEnum.java | 2 +- .../ConveyorBarcodeDefination.java | 4 +- ....java => ConveyorBarcodeDeviceDriver.java} | 126 ++- .../lnsh/converor_barcode/ItemProtocol.java | 4 +- .../ConveyorPressStationDeviceDriver.java | 114 ++- .../LnshLaminatingMachineDeviceDriver.java | 2 +- .../LnshFoldDiscSiteDeviceDriver.java | 4 +- .../LnshMixingMillDeviceDriver.java | 11 +- .../LnshPackageLineDeviceDriver.java | 4 +- ...nshPalletizingManipulatorDeviceDriver.java | 8 +- ...alletizingManipulatorSiteDeviceDriver.java | 738 +++++++++--------- .../lnsh_press/LnshPressDeviceDriver.java | 13 +- .../LnshSplitManipulatorDeviceDriver.java | 10 +- .../lnsh_station/LnshStationDeviceDriver.java | 110 ++- .../applyTask/ApplyTaskRequest.java | 5 + .../applyTask/ApplyTaskResponse.java | 8 + .../acs/ext/wms/service/AcsToWmsService.java | 2 +- .../wms/service/impl/AcsToWmsServiceImpl.java | 4 +- .../task/service/impl/TaskServiceImpl.java | 202 +---- .../acs/device/driver/agv/agv_ndc_one.vue | 2 +- .../acs/device/driver/agv/agv_ndc_two.vue | 2 +- .../acs/device/driver/cargo_lift_conveyor.vue | 2 +- .../empty_vehicle_stacking_position.vue | 2 +- .../device/driver/hailiang_smart_plc_test.vue | 2 +- .../device/driver/haokai_auto_conveyor.vue | 2 +- .../acs/device/driver/lamp_three_color.vue | 2 +- .../driver/lnsh/lnsh_Laminating_machine.vue | 2 +- .../acs/device/driver/lnsh/lnsh_crusher.vue | 2 +- .../driver/lnsh/lnsh_fold_disc_site.vue | 2 +- .../acs/device/driver/lnsh/lnsh_kiln_lane.vue | 2 +- .../device/driver/lnsh/lnsh_kiln_truss.vue | 2 +- .../driver/lnsh/lnsh_labeling_machine.vue | 2 +- .../driver/lnsh/lnsh_out_kiln_truss.vue | 2 +- .../device/driver/lnsh/lnsh_package_line.vue | 2 +- .../lnsh/lnsh_package_pallet_manipulator.vue | 2 +- .../device/driver/lnsh/lnsh_package_site.vue | 2 +- .../driver/lnsh/lnsh_pallet_storage.vue | 2 +- .../lnsh/lnsh_palletizing_manipulator.vue | 2 +- .../lnsh_palletizing_manipulator_site.vue | 56 +- .../views/acs/device/driver/lnsh/lnsh_rgv.vue | 2 +- .../driver/lnsh/lnsh_split_manipulator.vue | 2 +- .../acs/device/driver/lnsh/lnsh_station.vue | 19 +- .../acs/device/driver/paint_conveyor.vue | 2 +- .../driver/standard_conveyor_control.vue | 2 +- ...standard_conveyor_control_with_scanner.vue | 2 +- .../driver/standard_conveyor_monitor.vue | 2 +- .../device/driver/standard_inspect_site.vue | 2 +- .../acs/device/driver/standard_scanner.vue | 2 +- .../acs/device/driver/standard_storage.vue | 2 +- 49 files changed, 751 insertions(+), 751 deletions(-) rename acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/converor_barcode/{LnshStationDeviceDriver.java => ConveyorBarcodeDeviceDriver.java} (84%) 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 378cf6d..303dfa6 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_sucess_apply", "扫码成功申请","0"), + barcode_sucess_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/lnsh/converor_barcode/ConveyorBarcodeDefination.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/converor_barcode/ConveyorBarcodeDefination.java index e0ab026..27962d6 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/converor_barcode/ConveyorBarcodeDefination.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/converor_barcode/ConveyorBarcodeDefination.java @@ -33,13 +33,13 @@ public class ConveyorBarcodeDefination implements OpcDeviceDriverDefination { @Override public DeviceDriver getDriverInstance(Device device) { - return (new LnshStationDeviceDriver()).setDevice(device).setDriverDefination(this); + return (new ConveyorBarcodeDeviceDriver()).setDevice(device).setDriverDefination(this); } @Override public Class getDeviceDriverType() { - return LnshStationDeviceDriver.class; + return ConveyorBarcodeDeviceDriver.class; } @Override diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/converor_barcode/LnshStationDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/converor_barcode/ConveyorBarcodeDeviceDriver.java similarity index 84% rename from acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/converor_barcode/LnshStationDeviceDriver.java rename to acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/converor_barcode/ConveyorBarcodeDeviceDriver.java index 2740de8..ae127f4 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/converor_barcode/LnshStationDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/converor_barcode/ConveyorBarcodeDeviceDriver.java @@ -16,7 +16,10 @@ import org.nl.acs.device_driver.RouteableDeviceDriver; 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_Laminating_machine.LnshLaminatingMachineDeviceDriver; +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.data.Resp; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.instruction.service.InstructionService; @@ -24,6 +27,7 @@ import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.acs.monitor.DeviceStageMonitor; 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; @@ -44,7 +48,7 @@ import java.util.Map; @Getter @Setter @RequiredArgsConstructor -public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, StandardRequestMethod { +public class ConveyorBarcodeDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, StandardRequestMethod { protected ItemProtocol itemProtocol = new ItemProtocol(this); LuceneExecuteLogService lucene = SpringContextHolder.getBean("luceneExecuteLogServiceImpl"); @@ -61,6 +65,8 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements AcsToWmsService acsToWmsService = SpringContextHolder.getBean("acsToWmsServiceImpl"); + DeviceAppService deviceAppService = SpringContextHolder.getBean("deviceAppServiceImpl"); + String device_code; int mode = 0; int error = 0; @@ -202,7 +208,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements List toInstructions; - if (mode > 2) { + if (mode > 2 && !requireSucess) { if (ObjectUtil.isNotEmpty(this.device.getExtraValue().get(String.valueOf(mode)))) { String modethod = this.device.getExtraValue().get(String.valueOf(mode)).toString(); try { @@ -485,9 +491,10 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements 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))); - Resp resp = acsToWmsService.applyTask(request); + ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); + if (resp.getCode() == 200) { - this.writing(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -511,16 +518,17 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements if(move == 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + 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(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -543,16 +551,17 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements if(move == 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + 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(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -576,16 +585,30 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements if(move > 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + + 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(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -599,6 +622,23 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements } } + public void writing(String param, String value) { + + String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + + "." + param; + String opcservcerid = this.getDevice().getOpc_server_id(); + Server server = ReadUtil.getServer(opcservcerid); + Map itemMap = new HashMap(); + if (value instanceof String) { + itemMap.put(to_param, value); + } else { + itemMap.put(to_param, value); + } + ReadUtil.write(itemMap, server); + server.disconnect(); + logServer.deviceExecuteLog(this.device_code, "", "", param + " 写入 " + value); + } + /** * 申请强制取走满料盅托盘 * @@ -608,16 +648,17 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements if(move > 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + 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(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -640,16 +681,17 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements if(move > 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + 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(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -672,16 +714,17 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements if(move > 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); + message = RequestMethodEnum.getName("barcode_sucess_apply") + "barcode_sucess_apply 接口请求LMS..."; lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); if (resp.getCode() == 200) { - this.writing(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -704,16 +747,17 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements if(move > 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + 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(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -735,16 +779,17 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements if(move > 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + 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(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -766,16 +811,17 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements if(move > 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + 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(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/converor_barcode/ItemProtocol.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/converor_barcode/ItemProtocol.java index cce3af7..dc9636a 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/converor_barcode/ItemProtocol.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/converor_barcode/ItemProtocol.java @@ -32,9 +32,9 @@ public class ItemProtocol { Boolean isonline; - private LnshStationDeviceDriver driver; + private ConveyorBarcodeDeviceDriver driver; - public ItemProtocol(LnshStationDeviceDriver driver) { + public ItemProtocol(ConveyorBarcodeDeviceDriver driver) { this.driver = driver; } 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 a28cbd5..9b9b4d0 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 @@ -17,6 +17,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.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskRequest; +import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskResponse; import org.nl.acs.ext.wms.data.Resp; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.instruction.service.InstructionService; @@ -202,7 +203,7 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im List toInstructions; - if (mode > 2) { + if (mode > 2 && !requireSucess) { if (ObjectUtil.isNotEmpty(this.device.getExtraValue().get(String.valueOf(mode)))) { String modethod = this.device.getExtraValue().get(String.valueOf(mode)).toString(); try { @@ -248,6 +249,25 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im return true; } + + public void writing(String param, String value) { + + String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + + "." + param; + String opcservcerid = this.getDevice().getOpc_server_id(); + Server server = ReadUtil.getServer(opcservcerid); + Map itemMap = new HashMap(); + if (value instanceof String) { + itemMap.put(to_param, value); + } else { + itemMap.put(to_param, value); + } + ReadUtil.write(itemMap, server); + server.disconnect(); + logServer.deviceExecuteLog(this.device_code, "", "", param + " 写入 " + value); + } + + protected void executing(Instruction instruction) { this.executing(1, instruction, ""); } @@ -485,9 +505,10 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im 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))); - Resp resp = acsToWmsService.applyTask(request); + ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); + if (resp.getCode() == 200) { - this.writing(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -511,16 +532,17 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im if(move == 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + 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(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -540,19 +562,20 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im * @param */ public synchronized boolean apply_take_empty_vehicle() { - if(move == 0) { + if(move == 1) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + 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(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -576,16 +599,17 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im if(move > 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + 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(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -608,16 +632,17 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im if(move > 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + 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(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -640,16 +665,17 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im if(move > 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + 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(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -668,20 +694,23 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im * * @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()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); + message = RequestMethodEnum.getName("barcode_sucess_apply") + "barcode_sucess_apply 接口请求LMS..."; lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); if (resp.getCode() == 200) { - this.writing(this.mode); + this.writing(200); + this.writing("to_command",resp.getIs_standing_finish()); + this.writing("to_mix_num",resp.getMix_num()); this.setRequireSucess(true); } else { this.writing(400); @@ -704,16 +733,17 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im if(move > 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + 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(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -735,16 +765,17 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im if(move > 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + 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(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -766,16 +797,17 @@ public class ConveyorPressStationDeviceDriver extends AbstractOpcDeviceDriver im if(move > 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + 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(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_Laminating_machine/LnshLaminatingMachineDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_Laminating_machine/LnshLaminatingMachineDeviceDriver.java index 8e5be2e..c7f007e 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_Laminating_machine/LnshLaminatingMachineDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_Laminating_machine/LnshLaminatingMachineDeviceDriver.java @@ -251,7 +251,7 @@ public class LnshLaminatingMachineDeviceDriver extends AbstractOpcDeviceDriver i if (jo.getInteger("status") == 200) { String vehicle_code = jo.getString("vehicle_code"); this.writing("to_barcode", vehicle_code); - this.writing(this.mode); + this.writing(200); requireSucess = true; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_fold_disc_site/LnshFoldDiscSiteDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_fold_disc_site/LnshFoldDiscSiteDeviceDriver.java index 3121fc0..f454ac2 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_fold_disc_site/LnshFoldDiscSiteDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_fold_disc_site/LnshFoldDiscSiteDeviceDriver.java @@ -235,7 +235,7 @@ public class LnshFoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implem if (result.getStatus() == HttpStatus.OK.value()) { JSONObject jsonObject = JSONObject.parseObject(result.body()); if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { - this.writing(this.mode); + this.writing(200); requireSucess = true; } } @@ -301,7 +301,7 @@ public class LnshFoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implem if (result.getStatus() == HttpStatus.OK.value()) { JSONObject jsonObject = JSONObject.parseObject(result.body()); if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { - this.writing(this.mode); + this.writing(200); this.setRequireSucess(true); } } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_mixing_mill/LnshMixingMillDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_mixing_mill/LnshMixingMillDeviceDriver.java index 0e709c8..df35fc3 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_mixing_mill/LnshMixingMillDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_mixing_mill/LnshMixingMillDeviceDriver.java @@ -16,6 +16,7 @@ import org.nl.acs.device_driver.RouteableDeviceDriver; 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.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskResponse; import org.nl.acs.ext.wms.data.Resp; import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskRequest; import org.nl.acs.ext.wms.service.AcsToWmsService; @@ -396,9 +397,10 @@ public class LnshMixingMillDeviceDriver extends AbstractOpcDeviceDriver implemen request.setOrder_code(this.getOrder_No()); message = RequestMethodEnum.getName("order_verify") + "order_verify 接口请求LMS..."; lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); - Resp resp = acsToWmsService.applyTask(request); + ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); + if (resp.getCode() == 200) { - this.writing(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -418,9 +420,10 @@ public class LnshMixingMillDeviceDriver extends AbstractOpcDeviceDriver implemen request.setOrder_code(this.getOrder_No()); message = RequestMethodEnum.getName("order_finish") + "order_finish 接口请求LMS..."; lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); - Resp resp = acsToWmsService.applyTask(request); + ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); + if (resp.getCode() == 200) { - this.writing(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_line/LnshPackageLineDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_line/LnshPackageLineDeviceDriver.java index 6f43b97..5786346 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_line/LnshPackageLineDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_line/LnshPackageLineDeviceDriver.java @@ -345,8 +345,8 @@ public class LnshPackageLineDeviceDriver extends AbstractOpcDeviceDriver impleme this.writing("to_brick_type", data.getString("brick_type")); this.writing("to_brick_type", data.getString("brick_type")); - this.writing(this.mode); - this.writing(this.mode); + this.writing(200); + this.writing(200); this.setRequireSucess(true); } 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 79da20f..1479c15 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 @@ -16,6 +16,7 @@ import org.nl.acs.device_driver.RouteableDeviceDriver; 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.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskResponse; import org.nl.acs.ext.wms.data.Resp; import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskRequest; import org.nl.acs.ext.wms.data.AcsToWmsData.grab.GrabRequest; @@ -375,9 +376,10 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri request.setUnqualified_qty(unqualified_qty); message = RequestMethodEnum.getName("apply_one_grab") + "apply_one_grab 接口请求LMS..."; lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); - Resp resp = acsToWmsService.applyTask(request); + ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); + if (resp.getCode() == 200) { - this.writing(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -467,7 +469,7 @@ public class LnshPalletizingManipulatorDeviceDriver extends AbstractOpcDeviceDri String two_qty = content.getString("two_qty"); String tool_coordinate = content.getString("tool_coordinate"); - this.writing(this.mode); + this.writing(200); this.writing("to_materialQty", qty); this.writing("to_material_code", material_code); this.writing("to_AlongSide", AlongSide); 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 cb0ab22..4c96416 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 @@ -4,6 +4,7 @@ import cn.hutool.core.util.IdUtil; 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; @@ -18,6 +19,8 @@ import org.nl.acs.device_driver.RouteableDeviceDriver; 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.ApplyTaskResponse; import org.nl.acs.ext.wms.data.Resp; import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskRequest; import org.nl.acs.ext.wms.service.AcsToWmsService; @@ -26,10 +29,12 @@ import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.acs.monitor.DeviceStageMonitor; import org.nl.acs.opc.Device; +import org.nl.acs.opc.DeviceAppService; import org.nl.acs.order.service.ProduceshiftorderService; 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.http.HttpStatus; @@ -66,6 +71,9 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic ProduceshiftorderService produceshiftorderService = SpringContextHolder.getBean("produceshiftorderServiceImpl"); + DeviceAppService deviceAppService = SpringContextHolder.getBean("deviceAppServiceImpl"); + + String device_code; int mode = 0; int error = 0; @@ -587,117 +595,114 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic return; } - //急停 - if (this.isStop()) { - - //未在线无心跳 - if (mode == 0) { - this.setIsonline(false); - this.setIserror(true); - message = "未联机"; - //有报警 - } else if (error != 0) { - this.setIsonline(false); - this.setIserror(true); - message = "有报警"; - //无报警 - } else { - this.setIsonline(true); - this.setIserror(false); - message = ""; - Instruction instruction = null; - List toInstructions; - - - if (mode > 2) { - if (ObjectUtil.isNotEmpty(this.device.getExtraValue().get(String.valueOf(mode)))) { - String modethod = this.device.getExtraValue().get(String.valueOf(mode)).toString(); - try { - applyRequest(modethod); - } catch (Exception e) { - message = "错误:" + e.getMessage(); - this.setIserror(true); - } - } else { - message = "无效模式请求,驱动未配置此请求方法"; + //未在线无心跳 + if (mode == 0) { + this.setIsonline(false); + this.setIserror(true); + message = "未联机"; + //有报警 + } else if (error != 0) { + this.setIsonline(false); + this.setIserror(true); + message = "有报警"; + //无报警 + } else { + this.setIsonline(true); + this.setIserror(false); + message = ""; + 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(); + try { + applyRequest(modethod); + } catch (Exception e) { + message = "错误:" + e.getMessage(); + this.setIserror(true); } } else { - message = "无请求"; + message = "无效模式请求,驱动未配置此请求方法"; } - - Object ignore_pickup_check = this.getExtraValue().get("ignore_pickup_check"); - + } else { + message = "无请求"; } - 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; - last_encoder_qty = encoder_qty; - last_unqualified_qty = unqualified_qty; - - last_product_code = product_code; - last_AlongSide = AlongSide; - last_BshortSide = BshortSide; - last_Htrapezoidal = Htrapezoidal; - last_Wthickness = Wthickness; - last_tray_qty = tray_qty; - last_tray_high = tray_high; - last_crib_category = crib_category; - last_palletX1_line = palletX1_line; - last_palletY1_row = palletY1_row; - last_palletA1_angle = palletA1_angle; - last_palletX2_line = palletX2_line; - last_palletY2_row = palletY2_row; - last_palletA2_angle = palletA2_angle; - last_palletX3_line = palletX3_line; - last_palletY3_row = palletY3_row; - last_palletA3_angle = palletA3_angle; - last_pressCribX1_line = pressCribX1_line; - last_pressCribY1_row = pressCribY1_row; - last_pressCribA1_angle = pressCribA1_angle; - last_pressCribX2_line = pressCribX2_line; - last_pressCribY2_row = pressCribY2_row; - last_pressCribA2_angle = pressCribA2_angle; - last_pressCribX3_line = pressCribX3_line; - last_pressCribY3_row = pressCribY3_row; - last_pressCribA3_angle = pressCribA3_angle; - last_Zoffset = Zoffset; - last_pallet_layerQty = pallet_layerQty; - last_pressCrib_layerQty = pressCrib_layerQty; - last_codeLayerX1_interval = codeLayerX1_interval; - last_codeLayerY1_interval = codeLayerY1_interval; - last_codeLayerX2_interval = codeLayerX2_interval; - last_codeLayerY2_interval = codeLayerY2_interval; - last_codeLayerX3_interval = codeLayerX3_interval; - last_codeLayerY3_interval = codeLayerY3_interval; - last_codeLayerX1_offset = codeLayerX1_offset; - last_codeLayerY1_offset = codeLayerY1_offset; - last_codeLayerX2_offset = codeLayerX2_offset; - last_codeLayerY2_offset = codeLayerY2_offset; - last_codeLayerX3_offset = codeLayerX3_offset; - last_codeLayerY3_offset = codeLayerY3_offset; - last_pressLayerX1_interval = pressLayerX1_interval; - last_pressLayerY1_interval = pressLayerY1_interval; - last_pressLayerX2_interval = pressLayerX2_interval; - last_pressLayerY2_interval = pressLayerY2_interval; - last_pressLayerX3_interval = pressLayerX3_interval; - last_pressLayerY3_interval = pressLayerY3_interval; - last_pressLayerX1_offset = pressLayerX1_offset; - last_pressLayerY1_offset = pressLayerY1_offset; - last_pressLayerX2_offset = pressLayerX2_offset; - last_pressLayerY2_offset = pressLayerY2_offset; - last_pressLayerX3_offset = pressLayerX3_offset; - last_pressLayerY3_offset = pressLayerY3_offset; - last_tool_coordinate = tool_coordinate; + Object ignore_pickup_check = this.getExtraValue().get("ignore_pickup_check"); + } + + 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; + last_encoder_qty = encoder_qty; + last_unqualified_qty = unqualified_qty; + + last_product_code = product_code; + last_AlongSide = AlongSide; + last_BshortSide = BshortSide; + last_Htrapezoidal = Htrapezoidal; + last_Wthickness = Wthickness; + last_tray_qty = tray_qty; + last_tray_high = tray_high; + last_crib_category = crib_category; + last_palletX1_line = palletX1_line; + last_palletY1_row = palletY1_row; + last_palletA1_angle = palletA1_angle; + last_palletX2_line = palletX2_line; + last_palletY2_row = palletY2_row; + last_palletA2_angle = palletA2_angle; + last_palletX3_line = palletX3_line; + last_palletY3_row = palletY3_row; + last_palletA3_angle = palletA3_angle; + last_pressCribX1_line = pressCribX1_line; + last_pressCribY1_row = pressCribY1_row; + last_pressCribA1_angle = pressCribA1_angle; + last_pressCribX2_line = pressCribX2_line; + last_pressCribY2_row = pressCribY2_row; + last_pressCribA2_angle = pressCribA2_angle; + last_pressCribX3_line = pressCribX3_line; + last_pressCribY3_row = pressCribY3_row; + last_pressCribA3_angle = pressCribA3_angle; + last_Zoffset = Zoffset; + last_pallet_layerQty = pallet_layerQty; + last_pressCrib_layerQty = pressCrib_layerQty; + last_codeLayerX1_interval = codeLayerX1_interval; + last_codeLayerY1_interval = codeLayerY1_interval; + last_codeLayerX2_interval = codeLayerX2_interval; + last_codeLayerY2_interval = codeLayerY2_interval; + last_codeLayerX3_interval = codeLayerX3_interval; + last_codeLayerY3_interval = codeLayerY3_interval; + last_codeLayerX1_offset = codeLayerX1_offset; + last_codeLayerY1_offset = codeLayerY1_offset; + last_codeLayerX2_offset = codeLayerX2_offset; + last_codeLayerY2_offset = codeLayerY2_offset; + last_codeLayerX3_offset = codeLayerX3_offset; + last_codeLayerY3_offset = codeLayerY3_offset; + last_pressLayerX1_interval = pressLayerX1_interval; + last_pressLayerY1_interval = pressLayerY1_interval; + last_pressLayerX2_interval = pressLayerX2_interval; + last_pressLayerY2_interval = pressLayerY2_interval; + last_pressLayerX3_interval = pressLayerX3_interval; + last_pressLayerY3_interval = pressLayerY3_interval; + last_pressLayerX1_offset = pressLayerX1_offset; + last_pressLayerY1_offset = pressLayerY1_offset; + last_pressLayerX2_offset = pressLayerX2_offset; + last_pressLayerY2_offset = pressLayerY2_offset; + last_pressLayerX3_offset = pressLayerX3_offset; + last_pressLayerY3_offset = pressLayerY3_offset; + last_tool_coordinate = tool_coordinate; } + /** * 请求 * @@ -718,238 +723,177 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic } } + /** - * 码垛完成 - * 申请取走满料盅托盘 + * 申请补满料盅托盘 + * * @param */ - public synchronized boolean apply_take_full_vehicle() { - JSONObject json = new JSONObject(); - json.put("type", "1"); - json.put("device_code", device_code); - json.put("qty", encoder_qty); - json.put("weight", weight); - json.put("vehicle_code", barcode); - json.put("is_full", "1"); - json.put("is_package", "1"); - json.put("product_code", product_code); - json.put("AlongSide", AlongSide); - json.put("BshortSide", BshortSide); - json.put("Htrapezoidal", Htrapezoidal); - json.put("Wthickness", Wthickness); - json.put("tray_qty", tray_qty); - json.put("tray_high", tray_high); - json.put("crib_category", crib_category); - json.put("palletX1_line", palletX1_line); - json.put("palletY1_row", palletY1_row); - json.put("palletA1_angle", palletA1_angle); - json.put("palletX2_line", palletX2_line); - json.put("palletY2_row", palletY2_row); - json.put("palletA2_angle", palletA2_angle); - json.put("palletX3_line", palletX3_line); - json.put("palletY3_row", palletY3_row); - json.put("palletA3_angle", palletA3_angle); - json.put("pressCribX1_line", pressCribX1_line); - json.put("pressCribY1_row", pressCribY1_row); - json.put("pressCribA1_angle", pressCribA1_angle); - json.put("pressCribX2_line", pressCribX2_line); - json.put("pressCribY2_row", pressCribY2_row); - json.put("pressCribA2_angle", pressCribA2_angle); - json.put("pressCribX3_line", pressCribX3_line); - json.put("pressCribY3_row", pressCribY3_row); - json.put("pressCribA3_angle", pressCribA3_angle); - json.put("Zoffset", Zoffset); - json.put("pallet_layerQty", pallet_layerQty); - json.put("pressCrib_layerQty", pressCrib_layerQty); - json.put("codeLayerX1_interval", codeLayerX1_interval); - json.put("codeLayerY1_interval", codeLayerY1_interval); - json.put("codeLayerX2_interval", codeLayerX2_interval); - json.put("codeLayerY2_interval", codeLayerY2_interval); - json.put("codeLayerX3_interval", codeLayerX3_interval); - json.put("codeLayerY3_interval", codeLayerY3_interval); - json.put("codeLayerX1_offset", codeLayerX1_offset); - json.put("codeLayerY1_offset", codeLayerY1_offset); - json.put("codeLayerX2_offset", codeLayerX2_offset); - json.put("codeLayerY2_offset", codeLayerY2_offset); - json.put("codeLayerX3_offset", codeLayerX3_offset); - json.put("codeLayerY3_offset", codeLayerY3_offset); - json.put("pressLayerX1_interval", pressLayerX1_interval); - json.put("pressLayerY1_interval", pressLayerY1_interval); - json.put("pressLayerX2_interval", pressLayerX2_interval); - json.put("pressLayerY2_interval", pressLayerY2_interval); - json.put("pressLayerX3_interval", pressLayerX3_interval); - json.put("pressLayerY3_interval", pressLayerY3_interval); - json.put("pressLayerX1_offset", pressLayerX1_offset); - json.put("pressLayerY1_offset", pressLayerY1_offset); - json.put("pressLayerX2_offset", pressLayerX2_offset); - json.put("pressLayerY2_offset", pressLayerY2_offset); - json.put("pressLayerX3_offset", pressLayerX3_offset); - json.put("pressLayerY3_offset", pressLayerY3_offset); - json.put("tool_coordinate", tool_coordinate); - HttpResponse result = acsToWmsService.applyTaskManipulatorToWms(json); - if (ObjectUtil.isNotEmpty(result)) { - if (result.getStatus() == HttpStatus.OK.value()) { - JSONObject jsonObject = JSONObject.parseObject(result.body()); - if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { - this.writing(this.mode); - this.setRequireSucess(true); - } + 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; } - return true; } /** - * 码垛强制完成 - * 申请强制取走满料盅托盘 + * 申请补空料盅托盘 + * * @param */ - public synchronized boolean apply_force_take_full_vehicle() { - JSONObject json = new JSONObject(); - json.put("type", "1"); - json.put("device_code", device_code); - json.put("qty", encoder_qty); - json.put("weight", weight); - json.put("vehicle_code", barcode); - json.put("is_full", "0"); - json.put("is_package", "1"); - json.put("product_code", product_code); - json.put("AlongSide", AlongSide); - json.put("BshortSide", BshortSide); - json.put("Htrapezoidal", Htrapezoidal); - json.put("Wthickness", Wthickness); - json.put("tray_qty", tray_qty); - json.put("tray_high", tray_high); - json.put("crib_category", crib_category); - json.put("palletX1_line", palletX1_line); - json.put("palletY1_row", palletY1_row); - json.put("palletA1_angle", palletA1_angle); - json.put("palletX2_line", palletX2_line); - json.put("palletY2_row", palletY2_row); - json.put("palletA2_angle", palletA2_angle); - json.put("palletX3_line", palletX3_line); - json.put("palletY3_row", palletY3_row); - json.put("palletA3_angle", palletA3_angle); - json.put("pressCribX1_line", pressCribX1_line); - json.put("pressCribY1_row", pressCribY1_row); - json.put("pressCribA1_angle", pressCribA1_angle); - json.put("pressCribX2_line", pressCribX2_line); - json.put("pressCribY2_row", pressCribY2_row); - json.put("pressCribA2_angle", pressCribA2_angle); - json.put("pressCribX3_line", pressCribX3_line); - json.put("pressCribY3_row", pressCribY3_row); - json.put("pressCribA3_angle", pressCribA3_angle); - json.put("Zoffset", Zoffset); - json.put("pallet_layerQty", pallet_layerQty); - json.put("pressCrib_layerQty", pressCrib_layerQty); - json.put("codeLayerX1_interval", codeLayerX1_interval); - json.put("codeLayerY1_interval", codeLayerY1_interval); - json.put("codeLayerX2_interval", codeLayerX2_interval); - json.put("codeLayerY2_interval", codeLayerY2_interval); - json.put("codeLayerX3_interval", codeLayerX3_interval); - json.put("codeLayerY3_interval", codeLayerY3_interval); - json.put("codeLayerX1_offset", codeLayerX1_offset); - json.put("codeLayerY1_offset", codeLayerY1_offset); - json.put("codeLayerX2_offset", codeLayerX2_offset); - json.put("codeLayerY2_offset", codeLayerY2_offset); - json.put("codeLayerX3_offset", codeLayerX3_offset); - json.put("codeLayerY3_offset", codeLayerY3_offset); - json.put("pressLayerX1_interval", pressLayerX1_interval); - json.put("pressLayerY1_interval", pressLayerY1_interval); - json.put("pressLayerX2_interval", pressLayerX2_interval); - json.put("pressLayerY2_interval", pressLayerY2_interval); - json.put("pressLayerX3_interval", pressLayerX3_interval); - json.put("pressLayerY3_interval", pressLayerY3_interval); - json.put("pressLayerX1_offset", pressLayerX1_offset); - json.put("pressLayerY1_offset", pressLayerY1_offset); - json.put("pressLayerX2_offset", pressLayerX2_offset); - json.put("pressLayerY2_offset", pressLayerY2_offset); - json.put("pressLayerX3_offset", pressLayerX3_offset); - json.put("pressLayerY3_offset", pressLayerY3_offset); - json.put("tool_coordinate", tool_coordinate); - HttpResponse result = acsToWmsService.applyTaskManipulatorToWms(json); - if (ObjectUtil.isNotEmpty(result)) { - if (result.getStatus() == HttpStatus.OK.value()) { - JSONObject jsonObject = JSONObject.parseObject(result.body()); - if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { - this.writing(this.mode); - this.setRequireSucess(true); - } + 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; } - return true; } - /** - * 申请补满料盅托盘 + * 申请取走空料盅托盘 * * @param */ - public synchronized boolean apply_put_full_vehicle() { - JSONObject json = new JSONObject(); - json.put("device_code", this.device_code); - json.put("type", "2"); - json.put("qty", weight); - json.put("vehicle_code", barcode); - json.put("is_full", "1"); - HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); - if (ObjectUtil.isNotEmpty(result)) { - if (result.getStatus() == HttpStatus.OK.value()) { - JSONObject jsonObject = JSONObject.parseObject(result.body()); - if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { - this.writing(this.mode); - this.setRequireSucess(true); - } + 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; } - return true; } + /** - * 申请补空料盅托盘 + * 申请取走满料盅托盘 * * @param */ - public synchronized boolean apply_put_empty_vehicle() { - ApplyTaskRequest request = new ApplyTaskRequest(); - request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); - request.setRequestNo(IdUtil.simpleUUID()); - request.setRequestDate(AgvUtil.getDate()); - Resp resp = acsToWmsService.applyTask(request); - if (resp.getCode() == 200) { - this.writing(this.mode); - this.setRequireSucess(true); + 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 { - this.writing(400); + message = RequestMethodEnum.getName("apply_take_full_vehicle") + "apply_take_full_vehicle 设备无货未请求LMS..."; + lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); + return false; } - return true; - } /** - * 申请取走空料盅托盘 + * 申请强制取走满料盅托盘 * * @param */ - public synchronized boolean apply_take_empty_vehicle() { - JSONObject json = new JSONObject(); - json.put("device_code", this.device_code); - json.put("type", "2"); - json.put("is_full", "1"); - HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); - if (ObjectUtil.isNotEmpty(result)) { - if (result.getStatus() == HttpStatus.OK.value()) { - JSONObject jsonObject = JSONObject.parseObject(result.body()); - if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { - this.writing(this.mode); - this.setRequireSucess(true); - } + 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; } - return true; } /** @@ -958,23 +902,30 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic * @param */ public synchronized boolean apply_force_take_full_vehicle_in_storage() { - JSONObject json = new JSONObject(); - json.put("device_code", this.device_code); - json.put("type", "1"); - json.put("weight", weight); - json.put("vehicle_code", barcode); - json.put("is_full", "1"); - HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); - if (ObjectUtil.isNotEmpty(result)) { - if (result.getStatus() == HttpStatus.OK.value()) { - JSONObject jsonObject = JSONObject.parseObject(result.body()); - if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { - this.writing(this.mode); - this.setRequireSucess(true); - } + 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; } - return true; } /** @@ -983,25 +934,31 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic * @param */ public synchronized boolean barcode_sucess_apply() { - JSONObject json = new JSONObject(); - json.put("device_code", this.device_code); - json.put("type", "1"); - json.put("weight", weight); - json.put("vehicle_code", barcode); - json.put("is_full", "1"); - HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); - if (ObjectUtil.isNotEmpty(result)) { - if (result.getStatus() == HttpStatus.OK.value()) { - JSONObject jsonObject = JSONObject.parseObject(result.body()); - if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { - this.writing(this.mode); - this.setRequireSucess(true); - } + 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_sucess_apply") + "barcode_sucess_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();; } + return true; + } else { + message = RequestMethodEnum.getName("barcode_sucess_apply") + "barcode_sucess_apply 设备无货未请求LMS..."; + lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); + return false; } - - return true; - } /** @@ -1010,71 +967,94 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic * @param */ public synchronized boolean get_vehicle_info() { - JSONObject json = new JSONObject(); - json.put("device_code", this.device_code); - json.put("type", "1"); - json.put("weight", weight); - json.put("vehicle_code", barcode); - json.put("is_full", "1"); - HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); - if (ObjectUtil.isNotEmpty(result)) { - if (result.getStatus() == HttpStatus.OK.value()) { - JSONObject jsonObject = JSONObject.parseObject(result.body()); - if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { - this.writing(this.mode); - this.setRequireSucess(true); - } + 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; } - return true; - } /** * 强制去包装-不包装 */ public synchronized boolean force_no_package() { - JSONObject json = new JSONObject(); - json.put("type", "5"); - json.put("device_code", device_code); - - HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); - if (ObjectUtil.isNotEmpty(result)) { - if (result.getStatus() == HttpStatus.OK.value()) { - JSONObject jsonObject = JSONObject.parseObject(result.body()); - if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { - this.writing(this.mode); - this.setRequireSucess(true); - } + 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; } - return true; } /** * 申请贴标 */ - public synchronized boolean apply_labelling() { - JSONObject json = new JSONObject(); - json.put("type", "5"); - json.put("device_code", device_code); - - HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); - if (ObjectUtil.isNotEmpty(result)) { - if (result.getStatus() == HttpStatus.OK.value()) { - JSONObject jsonObject = JSONObject.parseObject(result.body()); - if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { - this.writing(this.mode); - this.setRequireSucess(true); - } + 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; } - return true; } - public boolean exe_error() { if (this.error == 0) { return true; @@ -1428,7 +1408,7 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic this.writing("to_pressLayerX3_offset", StrUtil.isBlank(pressLayerX3_offset) ? "0" : pressLayerX3_offset); this.writing("to_pressLayerY3_offset", StrUtil.isBlank(pressLayerY3_offset) ? "0" : pressLayerY3_offset); this.writing("to_tool_coordinate", StrUtil.isBlank(tool_coordinate) ? "0" : tool_coordinate); - this.writing(this.mode); + this.writing(200); } this.setRequireSucess(true); } @@ -1527,7 +1507,7 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic if (result.getStatus() == HttpStatus.OK.value()) { JSONObject jsonObject = JSONObject.parseObject(result.body()); if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { - this.writing(this.mode); + this.writing(200); this.setRequireSucess(true); } } @@ -1556,7 +1536,7 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic if (result.getStatus() == HttpStatus.OK.value()) { JSONObject jsonObject = JSONObject.parseObject(result.body()); if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { - this.writing(this.mode); + this.writing(200); this.setRequireSucess(true); } } @@ -1585,7 +1565,7 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic if (result.getStatus() == HttpStatus.OK.value()) { JSONObject jsonObject = JSONObject.parseObject(result.body()); if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) { - this.writing(this.mode); + this.writing(200); this.setRequireSucess(true); } } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_press/LnshPressDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_press/LnshPressDeviceDriver.java index 09ee1fb..9e96b69 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_press/LnshPressDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_press/LnshPressDeviceDriver.java @@ -17,6 +17,7 @@ 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.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskRequest; +import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskResponse; import org.nl.acs.ext.wms.data.Resp; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.instruction.service.InstructionService; @@ -297,9 +298,10 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De request.setOrder_code(this.getOrder_No()); message = RequestMethodEnum.getName("order_verify") + "order_verify 接口请求LMS..."; lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); - Resp resp = acsToWmsService.applyTask(request); + ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); + if (resp.getCode() == 200) { - this.writing(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -319,9 +321,10 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De request.setOrder_code(this.getOrder_No()); message = RequestMethodEnum.getName("order_finish") + "order_finish 接口请求LMS..."; lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); - Resp resp = acsToWmsService.applyTask(request); + ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); + if (resp.getCode() == 200) { - this.writing(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -356,7 +359,7 @@ public class LnshPressDeviceDriver extends AbstractOpcDeviceDriver implements De // dto.setOrder_status("2"); // } // produceshiftorderService.update(dto); - this.writing(this.mode); + this.writing(200); this.setRequireSucess(true); } } 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 58c24c7..8f743fd 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 @@ -729,7 +729,7 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im } else { this.instruction_require_time = date; JSONObject json = new JSONObject(); - String linkobj = (String) this.getDevice().getExtraValue().get("link_device_code"); + String linkobj = (String) this.getDevice().getExtraValue().get("resp.getMessage()vice_code"); String demosub = linkobj.substring(1, linkobj.length() - 1); String demoArray[] = demosub.split(","); List demoList = Arrays.asList(demoArray); @@ -859,7 +859,7 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im this.writing("to_one_qty", one_qty); this.writing("to_two_qty", two_qty); this.writing("to_tool_coordinate", tool_coordinate); - this.writing(this.mode); + this.writing(200); requireSucess = true; } return true; @@ -890,7 +890,7 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); if (ObjectUtil.isNotEmpty(result)) { if (result.getStatus() == 200) { - this.writing(this.mode); + this.writing(200); requireSucess = true; } } @@ -921,7 +921,7 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); if (ObjectUtil.isNotEmpty(result)) { if (result.getStatus() == 200) { - this.writing(this.mode); + this.writing(200); requireSucess = true; } } @@ -953,7 +953,7 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); if (ObjectUtil.isNotEmpty(result)) { if (result.getStatus() == 200) { - this.writing(this.mode); + this.writing(200); } } 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 4efbe9e..449f0aa 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 @@ -16,6 +16,8 @@ import org.nl.acs.device_driver.RouteableDeviceDriver; 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.ApplyTaskResponse; import org.nl.acs.ext.wms.data.Resp; import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskRequest; import org.nl.acs.ext.wms.service.AcsToWmsService; @@ -24,6 +26,7 @@ import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.log.service.DeviceExecuteLogService; import org.nl.acs.monitor.DeviceStageMonitor; 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; @@ -59,6 +62,8 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); + DeviceAppService deviceAppService = SpringContextHolder.getBean("deviceAppServiceImpl"); + AcsToWmsService acsToWmsService = SpringContextHolder.getBean("acsToWmsServiceImpl"); String device_code; @@ -305,6 +310,23 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements } + public void writing(String param, String value) { + + String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + + "." + param; + String opcservcerid = this.getDevice().getOpc_server_id(); + Server server = ReadUtil.getServer(opcservcerid); + Map itemMap = new HashMap(); + if (value instanceof String) { + itemMap.put(to_param, value); + } else { + itemMap.put(to_param, value); + } + ReadUtil.write(itemMap, server); + server.disconnect(); + logServer.deviceExecuteLog(this.device_code, "", "", param + " 写入 " + value); + } + public void writing(int command) { String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() + "." + ItemProtocol.item_to_command; @@ -485,9 +507,9 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements 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))); - Resp resp = acsToWmsService.applyTask(request); + ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); if (resp.getCode() == 200) { - this.writing(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -511,16 +533,16 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements if(move == 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + 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(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -543,16 +565,16 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements if(move == 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + 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(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -576,16 +598,27 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements if(move > 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + 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(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -608,16 +641,16 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements if(move > 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + 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(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -640,16 +673,16 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements if(move > 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + 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(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -672,16 +705,17 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements if(move > 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); message = RequestMethodEnum.getName("barcode_sucess_apply") + "barcode_sucess_apply 接口请求LMS..."; lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); if (resp.getCode() == 200) { - this.writing(this.mode); + this.writing(200); + this.writing(resp.getIs_standing_finish(),"1"); this.setRequireSucess(true); } else { this.writing(400); @@ -704,16 +738,16 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements if(move > 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + 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(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -735,16 +769,16 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements if(move > 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + 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(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); @@ -766,16 +800,16 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements if(move > 0) { ApplyTaskRequest request = new ApplyTaskRequest(); request.setDevice_code(this.getDevice_code()); - request.setRequest_medthod_code(this.getClass().getName()); - request.setRequest_medthod_name(RequestMethodEnum.getName(this.getClass().getName())); + 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)); - Resp resp = acsToWmsService.applyTask(request); + 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(this.mode); + this.writing(200); this.setRequireSucess(true); } else { this.writing(400); 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 10f0657..b68cf7c 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 @@ -22,6 +22,11 @@ public class ApplyTaskRequest extends BaseRequest { */ private String weight; + /** + * 碾次 + */ + private String mix_mum; + /** * 工单号 */ diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/AcsToWmsData/applyTask/ApplyTaskResponse.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/AcsToWmsData/applyTask/ApplyTaskResponse.java index c693c1d..e49a70a 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/AcsToWmsData/applyTask/ApplyTaskResponse.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/AcsToWmsData/applyTask/ApplyTaskResponse.java @@ -1,7 +1,9 @@ package org.nl.acs.ext.wms.data.AcsToWmsData.applyTask; +import lombok.Data; import org.nl.acs.ext.wms.data.BaseResponse; +@Data public class ApplyTaskResponse extends BaseResponse { /** @@ -14,4 +16,10 @@ public class ApplyTaskResponse extends BaseResponse { */ private String is_package; + /** + * 碾次 + */ + private String mix_num; + + } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java index 5bb5de8..c8a151a 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java @@ -27,7 +27,7 @@ public interface AcsToWmsService { /** * ACS向WMS申请晟华任务 */ - public Resp applyTask(BaseRequest request); + public String applyTask(BaseRequest request); /** * ACS向WMS申请贴标 diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java index ed089a9..0bc5ab8 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java @@ -277,14 +277,14 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { @Override - public Resp applyTask(BaseRequest requestParam) { + public String applyTask(BaseRequest requestParam) { try { MDC.put(log_file_type, log_type); String api = addressService.findByCode("lnshApplyTaskToWms").getMethods_url(); log.info("lnshApplyTaskToWms-----输入参数{}", JSON.toJSONString(requestParam)); String result = LmsUtil.notifyAcs(api, requestParam); log.info("lnshApplyTaskToWms-----输出参数{}", result); - return RespUtil.getResp(result, new BaseResponse()); + return result; } finally { MDC.remove(log_file_type); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java index 8ba0454..9c5a6f9 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java @@ -21,12 +21,16 @@ import org.nl.acs.device.service.DeviceService; import org.nl.acs.device.service.StorageCellService; import org.nl.acs.device.service.dto.DeviceAssignedDto; import org.nl.acs.device.service.impl.DeviceServiceImpl; +import org.nl.acs.device_driver.RequestMethodEnum; import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver; import org.nl.acs.device_driver.lamp_three_color.LampThreecolorDeviceDriver; import org.nl.acs.device_driver.lnsh.lnsh_fold_disc_site.LnshFoldDiscSiteDeviceDriver; import org.nl.acs.device_driver.lnsh.lnsh_station.LnshStationDeviceDriver; import org.nl.acs.device_driver.standard_emptypallet_site.StandardEmptyPalletSiteDeviceDriver; +import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskResponse; +import org.nl.acs.ext.wms.data.AcsToWmsData.feedBackTaskStatus.FeedBackTaskStatusRequest; +import org.nl.acs.ext.wms.data.Resp; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; @@ -491,90 +495,22 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { //判断是否为WMS下发的任务,如果是反馈任务状态给WMS String hasWms = acsConfigService.findByCode(AcsConfig.HASWMS).getValue(); if (!StrUtil.startWith(dto.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) { - TaskFeedbackDto feefbackdto = taskFeedbackService.findByCode(entity.getTask_code()); - JSONObject feed_jo = new JSONObject(); - feed_jo.put("ext_task_uuid", entity.getExt_task_uuid()); - feed_jo.put("task_code", dto.getTask_code()); - feed_jo.put("task_status", dto.getTask_status()); - JSONArray ja = new JSONArray(); - ja.add(feed_jo); - String message = null; - HttpResponse body = null; + FeedBackTaskStatusRequest request = new FeedBackTaskStatusRequest(); + request.setTask_id(entity.getExt_task_uuid()); + request.setTask_code(dto.getTask_code()); + request.setTask_status(dto.getTask_status()); + request.setRequest_medthod_code(RequestMethodEnum.feedback_task_status.getCode()); + request.setRequest_medthod_name(RequestMethodEnum.feedback_task_status.getName()); boolean flag = false; + String resp = null; try { - body = acstowmsService.feedbackTaskStatusToWms(ja); + resp = acstowmsService.applyTask(request); } catch (Exception e) { flag = true; - message = e.getMessage(); e.printStackTrace(); } finally { } - if (flag) { - if (ObjectUtil.isEmpty(feefbackdto)) { - feefbackdto = new TaskFeedbackDto(); - feefbackdto.setTask_id(entity.getTask_id()); - feefbackdto.setTask_code(entity.getTask_code()); - feefbackdto.setTask_status(entity.getTask_status()); - feefbackdto.setVehicle_type(entity.getVehicle_type()); - feefbackdto.setVehicle_code(entity.getVehicle_code()); - feefbackdto.setStart_device_code(entity.getStart_device_code()); - feefbackdto.setStart_point_code(entity.getStart_point_code()); - feefbackdto.setNext_device_code(entity.getNext_device_code()); - feefbackdto.setNext_point_code(entity.getNext_point_code()); - feefbackdto.setError_code("400"); - feefbackdto.setIs_finished("0"); - feefbackdto.setRemark(message); - taskFeedbackService.create(feefbackdto); - } else { - feefbackdto.setTask_status(entity.getTask_status()); - feefbackdto.setStart_device_code(entity.getStart_device_code()); - feefbackdto.setStart_point_code(entity.getStart_point_code()); - feefbackdto.setNext_device_code(entity.getNext_device_code()); - feefbackdto.setNext_point_code(entity.getNext_point_code()); - feefbackdto.setError_code("400"); - feefbackdto.setRemark(message); - taskFeedbackService.update(feefbackdto); - } - } else { - int status = body.getStatus(); - JSONObject jo = JSONObject.parseObject(body.body()); - if (ObjectUtil.isEmpty(feefbackdto)) { - feefbackdto = new TaskFeedbackDto(); - feefbackdto.setTask_id(entity.getTask_id()); - feefbackdto.setTask_code(entity.getTask_code()); - feefbackdto.setTask_status(entity.getTask_status()); - feefbackdto.setVehicle_type(entity.getVehicle_type()); - feefbackdto.setVehicle_code(entity.getVehicle_code()); - feefbackdto.setError_code(String.valueOf(body.getStatus())); - feefbackdto.setStart_device_code(entity.getStart_device_code()); - feefbackdto.setStart_point_code(entity.getNext_point_code()); - feefbackdto.setNext_device_code(entity.getNext_device_code()); - feefbackdto.setNext_point_code(entity.getNext_point_code()); - if (status == 200) { - if (StrUtil.equals(entity.getTask_status(), "2")) { - feefbackdto.setIs_finished("1"); - } else { - feefbackdto.setIs_finished("0"); - } - } else { - feefbackdto.setIs_finished("0"); - feefbackdto.setRemark(jo.getString("message")); - } - taskFeedbackService.create(feefbackdto); - } else { - feefbackdto.setTask_status(entity.getTask_status()); - if (status == 200) { - } else { - if (StrUtil.equals(entity.getTask_status(), "2")) { - feefbackdto.setIs_finished("1"); - } else { - feefbackdto.setIs_finished("0"); - } - } - taskFeedbackService.update(feefbackdto); - } - } } } @@ -607,97 +543,22 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { //判断是否为WMS下发的任务,如果是反馈任务状态给WMS String hasWms = acsConfigService.findByCode(AcsConfig.HASWMS).getValue(); if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) { - TaskFeedbackDto feefbackdto = taskFeedbackService.findByCode(entity.getTask_code()); - JSONObject feed_jo = new JSONObject(); - Instruction inst = instructionservice.findByTaskcodeToWms(entity.getTask_code()); - feed_jo.put("ext_task_uuid", entity.getExt_task_uuid()); - feed_jo.put("task_code", entity.getTask_code()); - feed_jo.put("task_status", entity.getTask_status()); - if (ObjectUtil.isNotEmpty(inst)) { - feed_jo.put("car_no", inst.getCarno()); - } - JSONArray ja = new JSONArray(); - ja.add(feed_jo); - String message = null; - HttpResponse body = null; + FeedBackTaskStatusRequest request = new FeedBackTaskStatusRequest(); + request.setTask_id(entity.getExt_task_uuid()); + request.setTask_code(entity.getTask_code()); + request.setTask_status(entity.getTask_status()); + request.setRequest_medthod_code(RequestMethodEnum.feedback_task_status.getCode()); + request.setRequest_medthod_name(RequestMethodEnum.feedback_task_status.getName()); boolean flag = false; + String resp = null; try { - body = acstowmsService.feedbackTaskStatusToWms(ja); + resp = acstowmsService.applyTask(request); } catch (Exception e) { flag = true; - message = e.getMessage(); e.printStackTrace(); } finally { } - if (flag) { - if (ObjectUtil.isEmpty(feefbackdto)) { - feefbackdto = new TaskFeedbackDto(); - feefbackdto.setTask_id(entity.getTask_id()); - feefbackdto.setTask_code(entity.getTask_code()); - feefbackdto.setTask_status(entity.getTask_status()); - feefbackdto.setVehicle_type(entity.getVehicle_type()); - feefbackdto.setVehicle_code(entity.getVehicle_code()); - feefbackdto.setStart_device_code(entity.getStart_device_code()); - feefbackdto.setStart_point_code(entity.getStart_point_code()); - feefbackdto.setNext_device_code(entity.getNext_device_code()); - feefbackdto.setNext_point_code(entity.getNext_point_code()); - feefbackdto.setError_code("400"); - feefbackdto.setIs_finished("0"); - feefbackdto.setRemark(message); - taskFeedbackService.create(feefbackdto); - } else { - feefbackdto.setTask_status(entity.getTask_status()); - feefbackdto.setStart_device_code(entity.getStart_device_code()); - feefbackdto.setStart_point_code(entity.getStart_point_code()); - feefbackdto.setNext_device_code(entity.getNext_device_code()); - feefbackdto.setNext_point_code(entity.getNext_point_code()); - feefbackdto.setError_code("400"); - feefbackdto.setRemark(message); - taskFeedbackService.update(feefbackdto); - } - } else { - int status = body.getStatus(); - JSONObject jo = JSONObject.parseObject(body.body()); - if (ObjectUtil.isEmpty(feefbackdto)) { - feefbackdto = new TaskFeedbackDto(); - feefbackdto.setTask_id(entity.getTask_id()); - feefbackdto.setTask_code(entity.getTask_code()); - feefbackdto.setTask_status(entity.getTask_status()); - feefbackdto.setVehicle_type(entity.getVehicle_type()); - feefbackdto.setVehicle_code(entity.getVehicle_code()); - feefbackdto.setError_code(String.valueOf(body.getStatus())); - feefbackdto.setStart_device_code(entity.getStart_device_code()); - feefbackdto.setStart_point_code(entity.getNext_point_code()); - feefbackdto.setNext_device_code(entity.getNext_device_code()); - feefbackdto.setNext_point_code(entity.getNext_point_code()); - if (status == 200) { - if (StrUtil.equals(entity.getTask_status(), "2")) { - feefbackdto.setIs_finished("1"); - } else { - feefbackdto.setIs_finished("0"); - } - } else { - feefbackdto.setIs_finished("0"); - feefbackdto.setRemark(jo.getString("message")); - } - taskFeedbackService.create(feefbackdto); - } else { - feefbackdto.setTask_status(entity.getTask_status()); - if (status == 200) { - if (StrUtil.equals(entity.getTask_status(), "2")) { - feefbackdto.setIs_finished("1"); - } else { - feefbackdto.setIs_finished("0"); - } - } else { - feefbackdto.setIs_finished("0"); - feefbackdto.setRemark(jo.getString("message")); - } - taskFeedbackService.update(feefbackdto); - } - } - } //如果属于先知AGV,关闭运单序列 if (StrUtil.equals(acsConfigService.findByCode(AcsConfig.AGVTYPE).getValue(), "3")) { @@ -736,13 +597,22 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { //判断是否为WMS下发的任务,如果是反馈任务状态给WMS String hasWms = acsConfigService.findByCode(AcsConfig.HASWMS).getValue(); if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) { - JSONObject feed_jo = new JSONObject(); - feed_jo.put("ext_task_uuid", entity.getExt_task_uuid()); - feed_jo.put("task_code", entity.getTask_code()); - feed_jo.put("task_status", entity.getTask_status()); - JSONArray ja = new JSONArray(); - ja.add(feed_jo); - acstowmsService.feedbackTaskStatusToWms(ja); + FeedBackTaskStatusRequest request = new FeedBackTaskStatusRequest(); + request.setTask_id(entity.getExt_task_uuid()); + request.setTask_code(entity.getTask_code()); + request.setTask_status(entity.getTask_status()); + request.setRequest_medthod_code(RequestMethodEnum.feedback_task_status.getCode()); + request.setRequest_medthod_name(RequestMethodEnum.feedback_task_status.getName()); + boolean flag = false; + String resp = null; + try { + resp = acstowmsService.applyTask(request); + } catch (Exception e) { + flag = true; + e.printStackTrace(); + } finally { + + } } List shortPathsList = routeLineService.getShortPathLines(entity.getStart_device_code(), entity.getNext_device_code(), entity.getRoute_plan_code()); String type = shortPathsList.get(0).getType(); diff --git a/acs/nladmin-ui/src/views/acs/device/driver/agv/agv_ndc_one.vue b/acs/nladmin-ui/src/views/acs/device/driver/agv/agv_ndc_one.vue index b1240a5..4fd5981 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/agv/agv_ndc_one.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/agv/agv_ndc_one.vue @@ -83,7 +83,7 @@ export default { // 根据驱动类型判断是否为路由设备 const parentForm = this.parentForm parentForm.is_route = true - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/agv/agv_ndc_two.vue b/acs/nladmin-ui/src/views/acs/device/driver/agv/agv_ndc_two.vue index aaf2c47..e795d06 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/agv/agv_ndc_two.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/agv/agv_ndc_two.vue @@ -95,7 +95,7 @@ export default { this.configLoading = true // 根据驱动类型判断是否为路由设备 const parentForm = this.parentForm - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/cargo_lift_conveyor.vue b/acs/nladmin-ui/src/views/acs/device/driver/cargo_lift_conveyor.vue index 572e625..1c33964 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/cargo_lift_conveyor.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/cargo_lift_conveyor.vue @@ -464,7 +464,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/empty_vehicle_stacking_position.vue b/acs/nladmin-ui/src/views/acs/device/driver/empty_vehicle_stacking_position.vue index 626fd66..5e1054b 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/empty_vehicle_stacking_position.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/empty_vehicle_stacking_position.vue @@ -464,7 +464,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/hailiang_smart_plc_test.vue b/acs/nladmin-ui/src/views/acs/device/driver/hailiang_smart_plc_test.vue index dde7369..fd53939 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/hailiang_smart_plc_test.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/hailiang_smart_plc_test.vue @@ -455,7 +455,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/haokai_auto_conveyor.vue b/acs/nladmin-ui/src/views/acs/device/driver/haokai_auto_conveyor.vue index 1176e65..1e541a9 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/haokai_auto_conveyor.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/haokai_auto_conveyor.vue @@ -435,7 +435,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lamp_three_color.vue b/acs/nladmin-ui/src/views/acs/device/driver/lamp_three_color.vue index 79ba2cd..d866428 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/lamp_three_color.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/lamp_three_color.vue @@ -318,7 +318,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_Laminating_machine.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_Laminating_machine.vue index 020d737..5b9f0b6 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_Laminating_machine.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_Laminating_machine.vue @@ -473,7 +473,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_crusher.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_crusher.vue index df4ce75..2ba711f 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_crusher.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_crusher.vue @@ -464,7 +464,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_fold_disc_site.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_fold_disc_site.vue index 8a5fe31..9dc2b0a 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_fold_disc_site.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_fold_disc_site.vue @@ -493,7 +493,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_kiln_lane.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_kiln_lane.vue index e4e88aa..8e4e4f3 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_kiln_lane.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_kiln_lane.vue @@ -464,7 +464,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_kiln_truss.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_kiln_truss.vue index d648849..023e580 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_kiln_truss.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_kiln_truss.vue @@ -464,7 +464,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_labeling_machine.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_labeling_machine.vue index 847bd25..c58a163 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_labeling_machine.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_labeling_machine.vue @@ -540,7 +540,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_out_kiln_truss.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_out_kiln_truss.vue index ffbfb61..e46939d 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_out_kiln_truss.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_out_kiln_truss.vue @@ -464,7 +464,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_package_line.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_package_line.vue index c6ce80d..2d08171 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_package_line.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_package_line.vue @@ -464,7 +464,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_package_pallet_manipulator.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_package_pallet_manipulator.vue index a22d6f0..8b9620f 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_package_pallet_manipulator.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_package_pallet_manipulator.vue @@ -464,7 +464,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_package_site.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_package_site.vue index 895ba8d..1fc21f2 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_package_site.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_package_site.vue @@ -450,7 +450,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_pallet_storage.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_pallet_storage.vue index 5449285..4fc9e74 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_pallet_storage.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_pallet_storage.vue @@ -464,7 +464,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_palletizing_manipulator.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_palletizing_manipulator.vue index 052ca19..7b9d861 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_palletizing_manipulator.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_palletizing_manipulator.vue @@ -500,7 +500,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { 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 3867326..534bd61 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 @@ -612,85 +612,85 @@ export default { } if (this.data1[val].code.indexOf('pallet_layerQty') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 125) - } + } if (this.data1[val].code.indexOf('pressCrib_layerQty') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 127) - } + } if (this.data1[val].code.indexOf('codeLayerX1_interval') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 129) - } + } if (this.data1[val].code.indexOf('codeLayerY1_interval') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 131) - } + } if (this.data1[val].code.indexOf('codeLayerX2_interval') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 133) - } + } if (this.data1[val].code.indexOf('codeLayerY2_interval') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 135) - } + } if (this.data1[val].code.indexOf('codeLayerX3_interval') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 137) - } + } if (this.data1[val].code.indexOf('codeLayerY3_interval') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 139) - } + } if (this.data1[val].code.indexOf('codeLayerX1_offset') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 141) - } + } if (this.data1[val].code.indexOf('codeLayerY1_offset') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 143) - } + } if (this.data1[val].code.indexOf('codeLayerX2_offset') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 145) - } + } if (this.data1[val].code.indexOf('codeLayerY2_offset') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 147) - } + } if (this.data1[val].code.indexOf('codeLayerX3_offset') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 149) - } + } if (this.data1[val].code.indexOf('codeLayerY3_offset') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 151) - } + } if (this.data1[val].code.indexOf('pressLayerX1_interval') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 153) - } + } if (this.data1[val].code.indexOf('pressLayerY1_interval') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 155) - } + } if (this.data1[val].code.indexOf('pressLayerX2_interval') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 157) - } + } if (this.data1[val].code.indexOf('pressLayerY2_interval') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 159) - } + } if (this.data1[val].code.indexOf('pressLayerX3_interval') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 161) - } + } if (this.data1[val].code.indexOf('pressLayerY3_interval') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 163) - } + } if (this.data1[val].code.indexOf('pressLayerX1_offset') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 165) - } + } if (this.data1[val].code.indexOf('pressLayerY1_offset') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 167) - } + } if (this.data1[val].code.indexOf('pressLayerX2_offset') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 169) - } + } if (this.data1[val].code.indexOf('pressLayerX3_offset') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 171) - } + } if (this.data1[val].code.indexOf('pressLayerX3_offset') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 173) - } + } if (this.data1[val].code.indexOf('pressLayerY3_offset') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 175) - } + } if (this.data1[val].code.indexOf('tool_coordinate') !== -1) { this.data1[val].db = beforeStr + '.' + 'W' + (parseInt(endNumber) + 177) - } + } } } }, @@ -940,7 +940,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_rgv.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_rgv.vue index e676dd0..2048f06 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_rgv.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_rgv.vue @@ -567,7 +567,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { 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 f810bc3..979a9eb 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 @@ -464,7 +464,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_station.vue b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_station.vue index cbce1fd..8c92948 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_station.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_station.vue @@ -66,6 +66,23 @@ + + + + + + + @@ -365,7 +382,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/paint_conveyor.vue b/acs/nladmin-ui/src/views/acs/device/driver/paint_conveyor.vue index e5c089f..db05f68 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/paint_conveyor.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/paint_conveyor.vue @@ -471,7 +471,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/standard_conveyor_control.vue b/acs/nladmin-ui/src/views/acs/device/driver/standard_conveyor_control.vue index cca6417..7f7984a 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/standard_conveyor_control.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/standard_conveyor_control.vue @@ -478,7 +478,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/standard_conveyor_control_with_scanner.vue b/acs/nladmin-ui/src/views/acs/device/driver/standard_conveyor_control_with_scanner.vue index 82a0b2c..cf46f9d 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/standard_conveyor_control_with_scanner.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/standard_conveyor_control_with_scanner.vue @@ -522,7 +522,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/standard_conveyor_monitor.vue b/acs/nladmin-ui/src/views/acs/device/driver/standard_conveyor_monitor.vue index 5752011..e64241e 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/standard_conveyor_monitor.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/standard_conveyor_monitor.vue @@ -453,7 +453,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/standard_inspect_site.vue b/acs/nladmin-ui/src/views/acs/device/driver/standard_inspect_site.vue index f4f0267..3accbdf 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/standard_inspect_site.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/standard_inspect_site.vue @@ -466,7 +466,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/standard_scanner.vue b/acs/nladmin-ui/src/views/acs/device/driver/standard_scanner.vue index 079667d..be67180 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/standard_scanner.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/standard_scanner.vue @@ -98,7 +98,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => { diff --git a/acs/nladmin-ui/src/views/acs/device/driver/standard_storage.vue b/acs/nladmin-ui/src/views/acs/device/driver/standard_storage.vue index 56935e4..25aad39 100644 --- a/acs/nladmin-ui/src/views/acs/device/driver/standard_storage.vue +++ b/acs/nladmin-ui/src/views/acs/device/driver/standard_storage.vue @@ -268,7 +268,7 @@ export default { parentForm.is_route = true parentForm.plc_id = this.plc_id parentForm.opc_id = this.opc_id - updateConfig(parentForm, this.form, null, this.data1, this.data2).then(res => { + updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { this.notify('保存成功', 'success') this.configLoading = false }).catch(err => {