diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java index 68fb0a3e7..ed2173932 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java @@ -243,6 +243,7 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme // acsToWmsService.sendDeviceStatus(param); sendDeviceStatus(param); } + message = ""; logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记:" + requireSucess); logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); } @@ -358,7 +359,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme Instruction instruction = null; List toInstructions; if(mode > 0) { - message = ""; switch (mode) { case 1: log.debug("设备运转模式:等待工作"); @@ -1070,18 +1070,20 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme apply.put("device_code", device_code); apply.put("type", "2"); String str = acsToWmsService.applyTaskToWms(apply); - logServer.deviceExecuteLog(this.device_code, "", "", "申请空盘入库,请求参数:" + apply); - message = "申请空盘入库任务,请求参数:" + apply; + logServer.deviceExecuteLog(this.device_code, "", "", "申请空盘入库,请求参数:" + apply + ",响应参数:" + JSON.toJSONString(str)); + message = "申请空盘入库任务,请求参数:" + apply + "响应参数: "+ str; JSONObject jo = JSON.parseObject(str); if (ObjectUtil.isEmpty(jo)) { message = "申请空盘入库接口不通"; + logServer.deviceExecuteLog(this.device_code, "", "", "申请空盘入库接口不通"); } else { if (jo.getInteger("status") == 200) { message = "申请空盘入库成功"; requireEmptyInSuccess = true; } else { message = "申请空盘入库失败," + jo.get("message").toString(); + logServer.deviceExecuteLog(this.device_code, "", "", message); } } } diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java index 93ce55e46..51a5f2cab 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_storage_out_conveyor/BoxStorageOutConveyorDeviceDriver.java @@ -652,6 +652,11 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i itemMap.put(to_param, json.getString("value")); } } + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap); try { this.checkcontrol(itemMap); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/BoxSubvolumesConveyorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/BoxSubvolumesConveyorDeviceDriver.java index 14c415133..cc63f472b 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/BoxSubvolumesConveyorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/box_subvolumes_conveyor/BoxSubvolumesConveyorDeviceDriver.java @@ -35,6 +35,8 @@ import org.nl.acs.task.service.dto.TaskDto; import org.nl.common.utils.SecurityUtils; import org.nl.config.SpringContextHolder; import org.nl.config.language.LangProcess; +import org.nl.config.lucene.service.LuceneExecuteLogService; +import org.nl.config.lucene.service.dto.LuceneLogDto; import org.nl.config.thread.ThreadPoolExecutorUtil; import org.openscada.opc.lib.da.Server; @@ -71,6 +73,7 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i NDCAgvService agvService = SpringContextHolder.getBean(NDCAgvService.class); DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class); + LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean("luceneExecuteLogServiceImpl"); //当前指令 Instruction inst = null; @@ -355,6 +358,11 @@ public class BoxSubvolumesConveyorDeviceDriver extends AbstractOpcDeviceDriver i itemMap.put(to_param, json.getString("value")); } } + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap); try { this.checkcontrol(itemMap); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/FinishedProductOutBindLableDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/FinishedProductOutBindLableDeviceDriver.java index a2411a907..a552a445f 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/FinishedProductOutBindLableDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/finished_product_out_with_bind_lable_conveyor/FinishedProductOutBindLableDeviceDriver.java @@ -504,6 +504,11 @@ public class FinishedProductOutBindLableDeviceDriver extends AbstractOpcDeviceDr itemMap.put(to_param, json.getString("value")); } } + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap); try { this.checkcontrol(itemMap); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java index b16795c61..904a7348d 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_conveyor/scanner_weight_conveyor/ConveyorWithScannerWeightDeviceDriver.java @@ -648,6 +648,11 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv itemMap.put(to_param, json.getString("value")); } } + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap); try { this.checkcontrol(itemMap); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java index 4f9a66f48..474d7fe3f 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_package_manipulator/BoxPackageManipulatorDeviceDriver.java @@ -40,6 +40,8 @@ import org.nl.common.exception.BadRequestException; import org.nl.common.utils.SecurityUtils; import org.nl.config.SpringContextHolder; import org.nl.config.language.LangProcess; +import org.nl.config.lucene.service.LuceneExecuteLogService; +import org.nl.config.lucene.service.dto.LuceneLogDto; import java.util.*; @@ -59,6 +61,7 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineServiceImpl.class); DeviceExtraService deviceExtraService = SpringContextHolder.getBean(DeviceExtraServiceImpl.class); DeviceErrorLogService errorLogServer = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class); + LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class); //工作模式 int mode = 0; @@ -544,6 +547,11 @@ public class BoxPackageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i itemMap.put(to_param, json.getString("value")); } } + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap); try { this.checkcontrol(itemMap); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java index 700cc05e3..50c93df67 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/box_storage_manipulator/BoxStorageManipulatorDeviceDriver.java @@ -488,6 +488,11 @@ public class BoxStorageManipulatorDeviceDriver extends AbstractOpcDeviceDriver i itemMap.put(to_param, json.getString("value")); } } + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap); try { this.checkcontrol(itemMap); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ReturnGoodManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ReturnGoodManipulatorDeviceDriver.java index 5c413a60e..535df786b 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ReturnGoodManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/return_good_manipulator/ReturnGoodManipulatorDeviceDriver.java @@ -43,6 +43,8 @@ import org.nl.common.exception.BadRequestException; import org.nl.common.utils.SecurityUtils; import org.nl.config.SpringContextHolder; import org.nl.config.language.LangProcess; +import org.nl.config.lucene.service.LuceneExecuteLogService; +import org.nl.config.lucene.service.dto.LuceneLogDto; import java.util.*; @@ -70,6 +72,8 @@ public class ReturnGoodManipulatorDeviceDriver extends AbstractOpcDeviceDriver i DeviceErrorLogService errorLogServer = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class); + LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean("luceneExecuteLogServiceImpl"); + int mode = 0; int last_mode = 0; @@ -505,6 +509,11 @@ public class ReturnGoodManipulatorDeviceDriver extends AbstractOpcDeviceDriver i itemMap.put(to_param, json.getString("value")); } } + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap); try { this.checkcontrol(itemMap); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/trapped_manipulator/TrappedManipulatorManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/trapped_manipulator/TrappedManipulatorManipulatorDeviceDriver.java index ce6240336..56efda3c7 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/trapped_manipulator/TrappedManipulatorManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/trapped_manipulator/TrappedManipulatorManipulatorDeviceDriver.java @@ -41,6 +41,8 @@ import org.nl.common.exception.BadRequestException; import org.nl.common.utils.SecurityUtils; import org.nl.config.SpringContextHolder; import org.nl.config.language.LangProcess; +import org.nl.config.lucene.service.LuceneExecuteLogService; +import org.nl.config.lucene.service.dto.LuceneLogDto; import java.util.*; @@ -67,6 +69,7 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice DeviceExtraService deviceExtraService = SpringContextHolder.getBean(DeviceExtraServiceImpl.class); DeviceErrorLogService errorLogServer = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class); + LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean("luceneExecuteLogServiceImpl"); int mode = 0; @@ -521,6 +524,11 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice itemMap.put(to_param, json.getString("value")); } } + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap); try { this.checkcontrol(itemMap); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java index 3066521e8..8d65d2482 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/one_manipulator/volume_two_manipulator/VolumeTwoManipulatorManipulatorDeviceDriver.java @@ -42,6 +42,8 @@ import org.nl.common.exception.BadRequestException; import org.nl.common.utils.SecurityUtils; import org.nl.config.SpringContextHolder; import org.nl.config.language.LangProcess; +import org.nl.config.lucene.service.LuceneExecuteLogService; +import org.nl.config.lucene.service.dto.LuceneLogDto; import java.util.*; @@ -69,6 +71,8 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi DeviceErrorLogService errorLogServer = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class); + LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean("luceneExecuteLogServiceImpl"); + int mode = 0; int last_mode = 0; @@ -553,6 +557,11 @@ public class VolumeTwoManipulatorManipulatorDeviceDriver extends AbstractOpcDevi itemMap.put(to_param, json.getString("value")); } } + LuceneLogDto logDto = LuceneLogDto.builder() + .device_code(device_code) + .content("下发多个电气信号" + itemMap) + .build(); + luceneExecuteLogService.deviceExecuteLog(logDto); logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap); try { this.checkcontrol(itemMap); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java index 39343de36..f81c4d666 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/two_conveyor/oven_manipulator/OvenGantryManipulatorDeviceDriver.java @@ -318,7 +318,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; OvenInspectSiteDeviceDriver ovenInspectSiteDeviceDriver; - if (startdevice.getDeviceDriver() instanceof OvenInspectSiteDeviceDriver && nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { + /*if (startdevice.getDeviceDriver() instanceof OvenInspectSiteDeviceDriver && nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { ovenInspectSiteDeviceDriver = (OvenInspectSiteDeviceDriver) startdevice.getDeviceDriver(); standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver(); if (ovenInspectSiteDeviceDriver.getMove() != 1 || standardInspectSiteDeviceDriver.getMove() == 1) { @@ -347,7 +347,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + start_device_code + ",放货位:" + next_device_code + ",存在关联的同一列烘箱设备未关门!指令号:" + instruction.getInstruction_code(); return false; } - } + }*/ if (startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver(); if (standardInspectSiteDeviceDriver.getMove() != 1) { @@ -459,7 +459,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver; StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver; OvenInspectSiteDeviceDriver ovenInspectSiteDeviceDriver; - if (startdevice.getDeviceDriver() instanceof OvenInspectSiteDeviceDriver && nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { + /*if (startdevice.getDeviceDriver() instanceof OvenInspectSiteDeviceDriver && nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { ovenInspectSiteDeviceDriver = (OvenInspectSiteDeviceDriver) startdevice.getDeviceDriver(); standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver(); if (ovenInspectSiteDeviceDriver.getMove() != 1 || standardInspectSiteDeviceDriver.getMove() == 1) { @@ -477,7 +477,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i if (nextdevice.getDeviceDriver() instanceof OvenInspectSiteDeviceDriver && startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { ovenInspectSiteDeviceDriver = (OvenInspectSiteDeviceDriver) nextdevice.getDeviceDriver(); standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver(); - if (ovenInspectSiteDeviceDriver.getMove() != 1 || standardInspectSiteDeviceDriver.getMove() == 1) { + if (ovenInspectSiteDeviceDriver.getMove() == 1 || standardInspectSiteDeviceDriver.getMove() != 1) { notCreateInstMessage = "手动创建指令未下发电气信号原因->烘箱检测站点-普通检测站点:" + ovenInspectSiteDeviceDriver.getDevicecode() + "无货,无法下发指令或" + standardInspectSiteDeviceDriver.getDevicecode() + "有货,无法下发指令!" + "!任务号:" + task.getTask_code(); return false; @@ -488,7 +488,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i notCreateInstMessage = "手动创建指令未下发电气信号原因->取货位:" + task.getStart_device_code() + ",放货位:" + task.getNext_device_code() + ",存在关联的同一列烘箱设备未关门!任务号:" + task.getTask_code(); return false; } - } + }*/ if (startdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) startdevice.getDeviceDriver(); if (standardInspectSiteDeviceDriver.getMove() != 1) { @@ -668,7 +668,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i if (device.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) device.getDeviceDriver(); //判断关联设备是否开门 - if (hongXiangConveyorDeviceDriver.getDoor() == 1) { + if (hongXiangConveyorDeviceDriver.getDoor() != 2) { notCreateInstMessage = "关联设备->" + device + "烘箱门未关闭!"; flag = false; break; @@ -707,7 +707,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i if (linkDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) linkDevice.getDeviceDriver(); //判断关联设备是否开门 - if (hongXiangConveyorDeviceDriver.getDoor() == 1 || hongXiangConveyorDeviceDriver.getError1() != 0 + if (hongXiangConveyorDeviceDriver.getDoor() != 2 || hongXiangConveyorDeviceDriver.getError1() != 0 || hongXiangConveyorDeviceDriver.getError() != 0) { isClose = true; notCreateInstMessage = start_device_code + "关联设备->" + deviceCode + "烘箱门未关闭!"; @@ -733,7 +733,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i if (linkDevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) { hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) linkDevice.getDeviceDriver(); //判断关联设备是否开门 - if (hongXiangConveyorDeviceDriver.getDoor() == 1 || hongXiangConveyorDeviceDriver.getError1() != 0 + if (hongXiangConveyorDeviceDriver.getDoor() != 2 || hongXiangConveyorDeviceDriver.getError1() != 0 || hongXiangConveyorDeviceDriver.getError() != 0) { isClose = true; notCreateInstMessage = next_device_code + "关联设备->" + deviceCode + "烘箱门未关闭!"; @@ -1125,7 +1125,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i jo.put("message", message); jo.put("notCreateTaskMessage", notCreateTaskMessage); jo.put("notCreateInstMessage", notCreateInstMessage); - jo.put("feedMessage", LangProcess.msg(feedMessage)); + jo.put("feedMessage", feedMessage); jo.put("driver_type", "siemens_conveyor"); jo.put("is_click", true); jo.put("x", x_position); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/impl/HandServiceImpl.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/impl/HandServiceImpl.java index a10743649..614f900ac 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/impl/HandServiceImpl.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/impl/HandServiceImpl.java @@ -24,6 +24,8 @@ import org.nl.acs.instruction.domain.Instruction; import org.nl.acs.instruction.domain.InstructionMybatis; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.InstructionDto; +import org.nl.acs.opc.DeviceAppService; +import org.nl.acs.opc.DeviceAppServiceImpl; import org.nl.acs.task.domain.Task; import org.nl.acs.task.enums.TaskStatusEnum; import org.nl.acs.task.service.TaskService; @@ -31,6 +33,7 @@ import org.nl.acs.task.service.dto.TaskDto; import org.nl.acs.task.service.dto.TaskIdAndStatusDTO; import org.nl.common.exception.BadRequestException; import org.nl.common.utils.CodeUtil; +import org.nl.config.SpringContextHolder; import org.nl.hand.dto.HeadDto; import org.nl.hand.dto.HeadInstDto; import org.nl.hand.dto.HeadTaskDto; @@ -66,6 +69,8 @@ public class HandServiceImpl implements HandService { private InstructionService instructionService; @Autowired NDCAgvService ndcAgvService; + @Autowired + DeviceAppService deviceAppService; @@ -129,22 +134,42 @@ public class HandServiceImpl implements HandService { String next_device_code2 = ""; JSONObject jo = new JSONObject(); if (StrUtil.equals(task_type, CommonFinalParam.TYPE_ONE)) { - String s = start_device_code.substring(9); + String s = start_device_code.substring(start_device_code.length() - 1); if (StrUtil.equals("K", s)) { - start_device_code2 = next_device_code.substring(0, 10) + "M"; - next_device_code2 = start_device_code.substring(0, 9) + "M"; + start_device_code2 = next_device_code.substring(0, next_device_code.length() - 1) + "M"; + next_device_code2 = start_device_code.substring(0, start_device_code.length() - 1) + "M"; jo.put("start_device_code2", start_device_code2); jo.put("next_device_code2", next_device_code2); jo.put("start_point_code2", start_device_code2); jo.put("next_point_code2", next_device_code2); + }else{ + throw new BadRequestException("起点设备名称不符"); } } else if (StrUtil.equals(task_type, CommonFinalParam.TYPE_TWO)) { - start_device_code2 = next_device_code.substring(0, 9) + "K"; - next_device_code2 = start_device_code.substring(0, 9) + "K"; - jo.put("start_device_code2", start_device_code2); - jo.put("next_device_code2", next_device_code2); - jo.put("start_point_code2", start_device_code2); - jo.put("next_point_code2", next_device_code2); + String s = start_device_code.substring(start_device_code.length() - 1); + String n = next_device_code.substring(next_device_code.length() - 1); + if (StrUtil.equals("M", s) && StrUtil.equals("M", n)) { + start_device_code2 = next_device_code.substring(0, next_device_code.length() - 1) + "K"; + next_device_code2 = start_device_code.substring(0, start_device_code.length() - 1) + "K"; + jo.put("start_device_code2", start_device_code2); + jo.put("next_device_code2", next_device_code2); + jo.put("start_point_code2", start_device_code2); + jo.put("next_point_code2", next_device_code2); + }else if(StrUtil.equals("S", n) && StrUtil.equals("M", s)){ + start_device_code2 = next_device_code.substring(0, next_device_code.length() - 1) + "X"; + next_device_code2 = start_device_code.substring(0, start_device_code.length() - 1) + "K"; + jo.put("start_device_code2", start_device_code2); + jo.put("next_device_code2", next_device_code2); + jo.put("start_point_code2", start_device_code2); + jo.put("next_point_code2", next_device_code2); + }else{ + throw new BadRequestException("起点设备名称不符"); + } + } + Device startDevice = deviceAppService.findDeviceByCode(start_device_code2); + Device nextDevice = deviceAppService.findDeviceByCode(next_device_code2); + if(StrUtil.isAllNotEmpty(start_device_code2,next_device_code2) && ObjectUtil.isAllEmpty(startDevice,nextDevice)){ + throw new BadRequestException("起点终点设备不存在"); } jo.put("start_device_code", start_device_code); jo.put("next_device_code", next_device_code); @@ -162,6 +187,7 @@ public class HandServiceImpl implements HandService { JSONObject json = new JSONObject(); json.put("message", e.getMessage()); errArr.add(json); + throw new RuntimeException(e.getMessage()); } JSONArray data = new JSONArray(); JSONObject resultJson = new JSONObject(); diff --git a/acs2/nladmin-ui/src/views/acs/device/index.vue b/acs2/nladmin-ui/src/views/acs/device/index.vue index b2b9686bc..56548d747 100644 --- a/acs2/nladmin-ui/src/views/acs/device/index.vue +++ b/acs2/nladmin-ui/src/views/acs/device/index.vue @@ -268,11 +268,7 @@ export default { ], device_type: [ { required: true, message: '设备类型不能为空', trigger: 'blur' } - ], - region: [ - { required: true, message: '所属区域不能为空', trigger: 'blur' } ] - } } },