add:新增插拔机设备日志

This commit is contained in:
2025-02-21 11:05:07 +08:00
parent 2e0ce6f786
commit 4f71e50af7
4 changed files with 121 additions and 13 deletions

View File

@@ -1,5 +1,7 @@
package org.nl.acs.device_driver.conveyor.belt_conveyor;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
@@ -35,6 +37,7 @@ import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.log.service.DeviceExecuteLogService;
import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.opc.DeviceAppServiceImpl;
import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.route.service.dto.RouteLineDto;
import org.nl.acs.task.enums.TaskStatusEnum;
@@ -85,6 +88,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean("luceneExecuteLogServiceImpl");
ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class);
DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
private Date instruction_update_time = new Date();
private Date require_apply_strangulation_time = new Date();
@@ -210,6 +214,10 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
Boolean ignore_pickup_check = false;
List<String> getDeviceCodeList = null;
List<String> putDeviceCodeList = null;
/**
* led点阵屏信息
*/
@@ -607,6 +615,51 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
if (!taskdto.getStart_device_code().equals(device_code)) {
return false;
}
if ("RK1002".equals(taskdto.getStart_device_code())) {
String route_plan_code = taskdto.getRoute_plan_code();
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(taskdto.getStart_device_code(), taskdto.getNext_device_code(), route_plan_code);
if (CollectionUtil.isEmpty(shortPathsList)) {
return true;
}
RouteLineDto routeLineDto = shortPathsList.get(0);
String path = routeLineDto.getPath();
String[] str = path.split("->");
List<String> pathlist = Arrays.asList(str);
Integer start = 0;
String start_device_code = pathlist.get(start);
String next_device_code = pathlist.get(start + 1);
//判断有无出入库任务是相同路线
//判断有没有DDJ对接位出入库的指令
List<Instruction> byCodeAndExcute = instructionService.findByCodeAndExcute(next_device_code);
if (CollUtil.isNotEmpty(byCodeAndExcute)) {
this.message = "有DDJ对接位出入库的指令";
requireSucess = false;
return true;
}
//关联站点判断
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
BeltConveyorDeviceDriver beltConveyorDeviceDriver;
if (nextDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextDevice.getDeviceDriver();
//判断对接位和关联站点光电信号
getDeviceCodeList = beltConveyorDeviceDriver.getExtraDeviceCodes("link_device_code");
if (CollUtil.isNotEmpty(getDeviceCodeList)) {
String linkDeviceCode = getDeviceCodeList.get(0);
Device linkDevice = deviceAppService.findDeviceByCode(linkDeviceCode);
BeltConveyorDeviceDriver linkDeviceDriver;
if (linkDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
linkDeviceDriver = (BeltConveyorDeviceDriver) linkDevice.getDeviceDriver();
if ((beltConveyorDeviceDriver.getMode() == 0 || beltConveyorDeviceDriver.getMove() == 1) || (linkDeviceDriver.getMode() == 0 || linkDeviceDriver.getMove() == 1)) {
this.message = "DDJ对接位或关联输送线存在正在移动的货物或者未联机";
requireSucess = false;
return true;
}
}
}
}
}
//判断当前任务号是否存在指令
String taskid = taskdto.getTask_id();

View File

@@ -869,6 +869,19 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
int error = hongXiangConveyorDeviceDriver.getError();
int move = hongXiangConveyorDeviceDriver.getMove();
if (mode == 1 && door == 1 && action == 1 && error == 0 && error1 == 0 && move == 1) {
Map<String, Object> itemMap = new LinkedHashMap<>();
itemMap.put("mode", mode);
itemMap.put("action", action);
itemMap.put("door", door);
itemMap.put("move", move);
itemMap.put("error", error);
itemMap.put("error1", error1);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("下发行架允许取货满足条件:" + itemMap)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
map.put("code", "to_command");
map.put("value", "2");
list.add(map);
@@ -935,6 +948,19 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
int error = hongXiangConveyorDeviceDriver.getError();
int move = hongXiangConveyorDeviceDriver.getMove();
if (mode == 1 && door == 2 && action == 2 && error == 0 && error1 == 0 && move == 0) {
Map<String, Object> itemMap = new LinkedHashMap<>();
itemMap.put("mode", mode);
itemMap.put("action", action);
itemMap.put("door", door);
itemMap.put("move", move);
itemMap.put("error", error);
itemMap.put("error1", error1);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("下发行架取货完成满足条件:" + itemMap)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
map.put("code", "to_command");
map.put("value", "3");
list.add(map);
@@ -1001,6 +1027,19 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
int error = hongXiangConveyorDeviceDriver.getError();
int move = hongXiangConveyorDeviceDriver.getMove();
if (mode == 1 && door == 1 && action == 1 && error == 0 && error1 == 0 && move == 0) {
Map<String, Object> itemMap = new LinkedHashMap<>();
itemMap.put("mode", mode);
itemMap.put("action", action);
itemMap.put("door", door);
itemMap.put("move", move);
itemMap.put("error", error);
itemMap.put("error1", error1);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("下发行架允许放货满足条件:" + itemMap)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
map.put("code", "to_command");
map.put("value", "4");
list.add(map);
@@ -1080,6 +1119,19 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
int error = hongXiangConveyorDeviceDriver.getError();
int move = hongXiangConveyorDeviceDriver.getMove();
if (mode == 1 && door == 2 && action == 2 && error == 0 && error1 == 0 && move == 1) {
Map<String, Object> itemMap = new LinkedHashMap<>();
itemMap.put("mode", mode);
itemMap.put("action", action);
itemMap.put("door", door);
itemMap.put("move", move);
itemMap.put("error", error);
itemMap.put("error1", error1);
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("下发行架放货完成满足条件:" + itemMap)
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
map.put("code", "to_command");
map.put("value", "5");
list.add(map);

View File

@@ -351,7 +351,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
if (applyPlugPullSitResponse.getstatus() == CommonFinalParam.STATUS_OPEN) {
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code)
.content("申请套管任务,返回参数::" + applyPlugPullSitResponse.getData())
.content("申请套管任务,返回参数::" + applyPlugPullSitResponse.getData() + applyPlugPullSitResponse.getMessage())
.build();
logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2);
@@ -438,7 +438,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
message = "申请套管失败";
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code(device_code)
.content("申请套管反馈失败,返回参数:" + applyPlugPullSitResponse)
.content("申请套管反馈失败,返回参数:" + applyPlugPullSitResponse.getData() + applyPlugPullSitResponse.getMessage())
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
@@ -483,7 +483,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
if (applyPlugPullSitResponse.getstatus() == CommonFinalParam.STATUS_OPEN) {
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code)
.content("套管完成成功,返回参数:" + applyPlugPullSitResponse.getData())
.content("套管完成成功,返回参数:" + applyPlugPullSitResponse.getData() + applyPlugPullSitResponse.getMessage())
.build();
logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2);
@@ -499,7 +499,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
message = "套管完成失败";
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code)
.content("反馈套管完成失败,返回参数:" + applyPlugPullSitResponse.getData())
.content("反馈套管完成失败,返回参数:" + applyPlugPullSitResponse.getData() + applyPlugPullSitResponse.getMessage())
.build();
logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2);
@@ -544,7 +544,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
logServer.deviceExecuteLog(this.device_code, "", "", "申请拔轴完成任务,返回参数:" + applyPlugPullSitResponse.getData());
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code(device_code)
.content("申请拔轴完成,返回参数:" + applyPlugPullSitResponse.getData())
.content("申请拔轴完成,返回参数:" + applyPlugPullSitResponse.getData() + applyPlugPullSitResponse.getMessage())
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
@@ -558,7 +558,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
message = "拔轴完成失败";
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code(device_code)
.content("拔轴完成反馈失败,返回参数:" + applyPlugPullSitResponse.getData())
.content("拔轴完成反馈失败,返回参数:" + applyPlugPullSitResponse.getData() + applyPlugPullSitResponse.getMessage())
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
@@ -641,7 +641,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
message = "申请拔轴成功";
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code(device_code)
.content("申请拔轴任务,返回参数:" + applyPlugPullSitResponse.getData())
.content("申请拔轴任务,返回参数:" + applyPlugPullSitResponse.getData() + applyPlugPullSitResponse.getMessage())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
@@ -654,7 +654,7 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
message = "申请拔轴失败";
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code(device_code)
.content("申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse.getData())
.content("申请拔轴反馈失败,返回参数:" + applyPlugPullSitResponse.getData() + applyPlugPullSitResponse.getMessage())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
@@ -698,18 +698,21 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
message = "生成行架任务成功";
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code(device_code)
.content("申请行架任务,返回参数:" + applyPlugPullSitResponse.getMessage())
.content("申请行架任务,返回参数:" + applyPlugPullSitResponse.getData() + applyPlugPullSitResponse.getMessage())
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
requireSucess = true;
} else {
message = applyPlugPullSitResponse.getMessage();
// requireSucess = true;
Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 99);
this.writing(map);
requireSucess = true;
message = "申请行架任务失败";
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code(device_code)
.content("申请行架任务失败,返回参数:" + applyPlugPullSitResponse.getMessage())
.content("申请行架任务失败,返回参数:" + applyPlugPullSitResponse.getData() + applyPlugPullSitResponse.getMessage())
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);

View File

@@ -254,7 +254,7 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
this.writing(map);
LuceneLogDto logDto2 = LuceneLogDto.builder()
.device_code(device_code)
.content("反馈LMS子卷重量,返回参数:" + applyfeedbackSubVolumeWeightResponse.getData())
.content("反馈LMS子卷重量,返回参数:" + applyfeedbackSubVolumeWeightResponse.getData() + applyfeedbackSubVolumeWeightResponse.getMessage())
.build();
logDto2.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto2);
@@ -262,7 +262,7 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
} else {
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code(device_code)
.content("反馈LMS子卷重量失败:" + applyfeedbackSubVolumeWeightResponse.getData())
.content("反馈LMS子卷重量失败:" + applyfeedbackSubVolumeWeightResponse.getData() + applyfeedbackSubVolumeWeightResponse.getMessage())
.build();
logDto1.setLog_level(4);
message = "反馈LMS子卷重量失败:" + applyfeedbackSubVolumeWeightResponse.getMessage();