add:新增拔前行架日志
This commit is contained in:
@@ -35,7 +35,7 @@ public class NDCAgvServiceImpl implements NDCAgvService {
|
||||
|
||||
private final DeviceAppService deviceAppService;
|
||||
private final ISysParamService paramService;
|
||||
private final AcsToWmsService acsToWmsService;
|
||||
// private final AcsToWmsService acsToWmsService;
|
||||
|
||||
private final DeviceExecuteLogService logServer;
|
||||
|
||||
|
||||
@@ -481,7 +481,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic
|
||||
.device_code(this.getDeviceCode())
|
||||
.content("agv地址参数有误,phase:" + phase)
|
||||
.build();
|
||||
logDto.setLog_level(2);
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -487,7 +487,7 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice
|
||||
.device_code(device_code)
|
||||
.content(device_code + "创建指令时出现异常:" + e.getMessage())
|
||||
.build();
|
||||
logDto.setLog_level(2);
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -380,16 +380,28 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
Device nextDevice = deviceAppService.findDeviceByCode(nextCode);
|
||||
if (startDevice.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
|
||||
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) startDevice.getDeviceDriver();
|
||||
if (plugPullDeviceSiteDeviceDriver.getAction() != 1) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->" + startCode + "工位状态为不允许取,无法生成指令";
|
||||
if (plugPullDeviceSiteDeviceDriver.getAction() != 1 && plugPullDeviceSiteDeviceDriver.getMove() != 1) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
if (nextDevice.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
|
||||
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) nextDevice.getDeviceDriver();
|
||||
if (plugPullDeviceSiteDeviceDriver.getAction() != 2) {
|
||||
notCreateInstMessage = "手动创建指令未下发电气信号原因->" + nextCode + "工位状态为不允许放,无法生成指令";
|
||||
if (plugPullDeviceSiteDeviceDriver.getAction() != 2 && plugPullDeviceSiteDeviceDriver.getMove() != 0) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -449,16 +461,28 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
Device startdevice = deviceAppService.findDeviceByCode(task.getStart_device_code());
|
||||
if (startdevice.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
|
||||
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) startdevice.getDeviceDriver();
|
||||
if (plugPullDeviceSiteDeviceDriver.getAction() != 1) {
|
||||
notCreateInstMessage = "就绪任务未创建指令原因->" + task.getStart_device_code() + "工位状态为不允许取,无法生成指令";
|
||||
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);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (nextdevice.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
|
||||
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) nextdevice.getDeviceDriver();
|
||||
if (plugPullDeviceSiteDeviceDriver.getAction() != 2) {
|
||||
notCreateInstMessage = "就绪任务未创建指令原因->" + task.getNext_device_code() + "工位状态为不允许放,无法生成指令";
|
||||
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);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -469,6 +493,35 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
}
|
||||
}
|
||||
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 taskCode = task.getTask_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) {
|
||||
// Map<String, Object> map = new LinkedHashMap<>();
|
||||
List list = new ArrayList();
|
||||
@@ -797,7 +848,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
|
||||
.device_code(device_code)
|
||||
.content("下发多个电气信号" + itemMap)
|
||||
.build();
|
||||
logDto.setLog_level(2);
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap);
|
||||
try {
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
|
||||
@@ -77,6 +77,7 @@ import org.nl.system.service.param.ISysParamService;
|
||||
import org.nl.common.utils.CodeUtil;
|
||||
import org.nl.config.SpringContextHolder;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
@@ -109,6 +110,7 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
|
||||
private TaskMapper taskMapper;
|
||||
@Autowired
|
||||
private DeviceAppService deviceAppService;
|
||||
@Lazy
|
||||
@Autowired
|
||||
private NDCAgvService ndcAgvService;
|
||||
@Autowired
|
||||
|
||||
@@ -208,7 +208,7 @@ public class AutoCreateInst {
|
||||
.device_code("定时创建指令失败")
|
||||
.content(e.getMessage())
|
||||
.build();
|
||||
logDto.setLog_level(2);
|
||||
logDto.setLog_level(4);
|
||||
luceneExecuteLogService.deviceExecuteLog(logDto);
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user