add:新增拔前行架日志

This commit is contained in:
2025-03-11 22:12:21 +08:00
parent a593e5e044
commit 8caf561afb
7 changed files with 69 additions and 15 deletions

View File

@@ -35,7 +35,7 @@ public class NDCAgvServiceImpl implements NDCAgvService {
private final DeviceAppService deviceAppService; private final DeviceAppService deviceAppService;
private final ISysParamService paramService; private final ISysParamService paramService;
private final AcsToWmsService acsToWmsService; // private final AcsToWmsService acsToWmsService;
private final DeviceExecuteLogService logServer; private final DeviceExecuteLogService logServer;

View File

@@ -481,7 +481,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
.device_code(this.getDeviceCode()) .device_code(this.getDeviceCode())
.content("agv地址参数有误,phase:" + phase) .content("agv地址参数有误,phase:" + phase)
.build(); .build();
logDto.setLog_level(2); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
return; return;
} }

View File

@@ -487,7 +487,7 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice
.device_code(device_code) .device_code(device_code)
.content(device_code + "创建指令时出现异常:" + e.getMessage()) .content(device_code + "创建指令时出现异常:" + e.getMessage())
.build(); .build();
logDto.setLog_level(2); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
return false; return false;
} }

View File

@@ -380,16 +380,28 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
Device nextDevice = deviceAppService.findDeviceByCode(nextCode); Device nextDevice = deviceAppService.findDeviceByCode(nextCode);
if (startDevice.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) { if (startDevice.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) startDevice.getDeviceDriver(); plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) startDevice.getDeviceDriver();
if (plugPullDeviceSiteDeviceDriver.getAction() != 1) { if (plugPullDeviceSiteDeviceDriver.getAction() != 1 && plugPullDeviceSiteDeviceDriver.getMove() != 1) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->" + startCode + "工位状态为不允许取,无法生成指令"; notCreateInstMessage = "手动创建指令未下发电气信号原因->" + startCode + "工位状态为不允许取或者无货,无法生成指令";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(notCreateInstMessage + task.getStart_device_code() + "工位action值:" + plugPullDeviceSiteDeviceDriver.getAction() + "move值:" + plugPullDeviceSiteDeviceDriver.getMove())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
return false; return false;
} }
} }
if (nextDevice.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) { if (nextDevice.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) nextDevice.getDeviceDriver(); plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) nextDevice.getDeviceDriver();
if (plugPullDeviceSiteDeviceDriver.getAction() != 2) { if (plugPullDeviceSiteDeviceDriver.getAction() != 2 && plugPullDeviceSiteDeviceDriver.getMove() != 0) {
notCreateInstMessage = "手动创建指令未下发电气信号原因->" + nextCode + "工位状态为不允许放,无法生成指令"; notCreateInstMessage = "手动创建指令未下发电气信号原因->" + nextCode + "工位状态为不允许放或者有货,无法生成指令";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(notCreateInstMessage + task.getStart_device_code() + "工位action值:" + plugPullDeviceSiteDeviceDriver.getAction() + "move值:" + plugPullDeviceSiteDeviceDriver.getMove())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
return false; return false;
} }
} }
@@ -449,16 +461,28 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
Device startdevice = deviceAppService.findDeviceByCode(task.getStart_device_code()); Device startdevice = deviceAppService.findDeviceByCode(task.getStart_device_code());
if (startdevice.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) { if (startdevice.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) startdevice.getDeviceDriver(); plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) startdevice.getDeviceDriver();
if (plugPullDeviceSiteDeviceDriver.getAction() != 1) { if (plugPullDeviceSiteDeviceDriver.getAction() != 1 && plugPullDeviceSiteDeviceDriver.getMove() != 1) {
notCreateInstMessage = "就绪任务未创建指令原因->" + task.getStart_device_code() + "工位状态为不允许取,无法生成指令"; notCreateInstMessage = "就绪任务未创建指令原因->" + task.getStart_device_code() + "工位状态为不允许取或者无货,无法生成指令";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(notCreateInstMessage + task.getStart_device_code() + "工位action值:" + plugPullDeviceSiteDeviceDriver.getAction() + "move值:" + plugPullDeviceSiteDeviceDriver.getMove())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
continue; continue;
} }
} }
if (nextdevice.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) { if (nextdevice.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) nextdevice.getDeviceDriver(); plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) nextdevice.getDeviceDriver();
if (plugPullDeviceSiteDeviceDriver.getAction() != 2) { if (plugPullDeviceSiteDeviceDriver.getAction() != 2 && plugPullDeviceSiteDeviceDriver.getMove() != 0) {
notCreateInstMessage = "就绪任务未创建指令原因->" + task.getNext_device_code() + "工位状态为不允许放,无法生成指令"; notCreateInstMessage = "就绪任务未创建指令原因->" + task.getNext_device_code() + "工位状态为不允许放或者有货,无法生成指令";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(notCreateInstMessage + task.getStart_device_code() + "工位action值:" + plugPullDeviceSiteDeviceDriver.getAction() + "move值:" + plugPullDeviceSiteDeviceDriver.getMove())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
continue; continue;
} }
} }
@@ -469,6 +493,35 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
} }
} }
if (!ObjectUtil.isEmpty(task)) { if (!ObjectUtil.isEmpty(task)) {
Device nextdevice = deviceAppService.findDeviceByCode(task.getNext_device_code());
Device startdevice = deviceAppService.findDeviceByCode(task.getStart_device_code());
if (startdevice.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) startdevice.getDeviceDriver();
if (plugPullDeviceSiteDeviceDriver.getAction() != 1 && plugPullDeviceSiteDeviceDriver.getMove() != 1) {
notCreateInstMessage = "就绪任务未创建指令原因->" + task.getStart_device_code() + "工位状态为不允许取或者无货,无法生成指令";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(notCreateInstMessage + task.getStart_device_code() + "工位action值:" + plugPullDeviceSiteDeviceDriver.getAction() + "move值:" + plugPullDeviceSiteDeviceDriver.getMove())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
return false;
}
}
if (nextdevice.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) nextdevice.getDeviceDriver();
if (plugPullDeviceSiteDeviceDriver.getAction() != 2 && plugPullDeviceSiteDeviceDriver.getMove() != 0) {
notCreateInstMessage = "就绪任务未创建指令原因->" + task.getNext_device_code() + "工位状态为不允许放或者有货,无法生成指令";
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content(notCreateInstMessage + task.getStart_device_code() + "工位action值:" + plugPullDeviceSiteDeviceDriver.getAction() + "move值:" + plugPullDeviceSiteDeviceDriver.getMove())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
return false;
}
}
String taskId = task.getTask_id(); String taskId = task.getTask_id();
String taskCode = task.getTask_code(); String taskCode = task.getTask_code();
String vehicleCode = task.getVehicle_code(); String vehicleCode = task.getVehicle_code();
@@ -553,8 +606,6 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
} }
private void pushPLC(Instruction instdto, String startAddr, String nextAddr, String interaction_json) { private void pushPLC(Instruction instdto, String startAddr, String nextAddr, String interaction_json) {
// Map<String, Object> map = new LinkedHashMap<>(); // Map<String, Object> map = new LinkedHashMap<>();
List list = new ArrayList(); List list = new ArrayList();
@@ -797,7 +848,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
.device_code(device_code) .device_code(device_code)
.content("下发多个电气信号" + itemMap) .content("下发多个电气信号" + itemMap)
.build(); .build();
logDto.setLog_level(2); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap); logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap);
try { try {

View File

@@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.springframework.context.annotation.Lazy;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.nl.common.logging.annotation.Log; import org.nl.common.logging.annotation.Log;

View File

@@ -77,6 +77,7 @@ import org.nl.system.service.param.ISysParamService;
import org.nl.common.utils.CodeUtil; import org.nl.common.utils.CodeUtil;
import org.nl.config.SpringContextHolder; import org.nl.config.SpringContextHolder;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@@ -109,6 +110,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
private TaskMapper taskMapper; private TaskMapper taskMapper;
@Autowired @Autowired
private DeviceAppService deviceAppService; private DeviceAppService deviceAppService;
@Lazy
@Autowired @Autowired
private NDCAgvService ndcAgvService; private NDCAgvService ndcAgvService;
@Autowired @Autowired

View File

@@ -208,7 +208,7 @@ public class AutoCreateInst {
.device_code("定时创建指令失败") .device_code("定时创建指令失败")
.content(e.getMessage()) .content(e.getMessage())
.build(); .build();
logDto.setLog_level(2); logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto); luceneExecuteLogService.deviceExecuteLog(logDto);
continue; continue;
} }