Merge remote-tracking branch 'origin/master'

This commit is contained in:
2024-06-24 08:57:21 +08:00
8 changed files with 725 additions and 44 deletions

View File

@@ -428,7 +428,7 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
Pattern compile = Pattern.compile(pattern);
Map<String, Object> map = new HashMap<>();
map.put("code", "to_y");
map.put("value", inst.getTo_z());
map.put("value", inst.getTo_z() );
list.add(map);
if (inst.getTo_x().length() > 1 && !compile.matcher(inst.getTo_x()).matches()) {
String substring = inst.getTo_x().substring(1);

View File

@@ -293,7 +293,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
this.inst = null;
}
}
if (requireSucess) {
if (!requireSucess) {
remark = "universal_remark5";
}
this.setNotCreateTaskMessage(remark);
@@ -348,17 +348,31 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
Device startPointDevice = deviceAppService.findDeviceByCode(startPoint);
if (startPointDevice.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) startPointDevice.getDeviceDriver();
if (plugPullDeviceSiteDeviceDriver.getAction() != 1&&plugPullDeviceSiteDeviceDriver.getAction() != 3)
notCreateInstMessage = "universal_notCreateInstMessage9";
return false;
if (plugPullDeviceSiteDeviceDriver.getAction() != 1) {
notCreateInstMessage = "universal_notCreateInstMessage12";
return false;
}
}
String nextDeviceCode = taskDto.getNext_device_code();
Device device = deviceAppService.findDeviceByCode(nextDeviceCode);
if (device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) device.getDeviceDriver();
if (plugPullDeviceSiteDeviceDriver.getMode() != 2 || plugPullDeviceSiteDeviceDriver.getMove() != 0 || plugPullDeviceSiteDeviceDriver.getAction() != 2&&plugPullDeviceSiteDeviceDriver.getAction() != 3)
notCreateInstMessage = "universal_notCreateInstMessage9";
String remark = "";
if (plugPullDeviceSiteDeviceDriver.getMode() != 2) {
remark = "universal_notCreateInstMessage9";
notCreateInstMessage = remark;
return false;
}
if (plugPullDeviceSiteDeviceDriver.getMove() != 0){
remark = "universal_notCreateInstMessage10";
notCreateInstMessage = remark;
return false;
}
if (plugPullDeviceSiteDeviceDriver.getAction() != 2){
remark = "universal_notCreateInstMessage11";
notCreateInstMessage = remark;
return false;
}
}
Instruction instruction = instructionService.findByTaskcode(taskDto.getTask_code());
String startCode = instruction.getStart_device_code();
@@ -400,17 +414,31 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
Device start_device = deviceAppService.findDeviceByCode(startDeviceCode);
if (start_device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) start_device.getDeviceDriver();
if (plugPullDeviceSiteDeviceDriver.getAction() != 1&&plugPullDeviceSiteDeviceDriver.getAction() != 3)
notCreateInstMessage = "universal_notCreateInstMessage9";
if (plugPullDeviceSiteDeviceDriver.getAction() != 1) {
notCreateInstMessage = "universal_notCreateInstMessage12";
return false;
}
}
String nextDeviceCode = task.getNext_device_code();
Device next_device = deviceAppService.findDeviceByCode(nextDeviceCode);
if (next_device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) next_device.getDeviceDriver();
if (plugPullDeviceSiteDeviceDriver.getMode() != 2 || plugPullDeviceSiteDeviceDriver.getMove() != 0 || plugPullDeviceSiteDeviceDriver.getAction() != 2 || plugPullDeviceSiteDeviceDriver.getAction() != 3)
notCreateInstMessage = "universal_notCreateInstMessage9";
String remark = "";
if (plugPullDeviceSiteDeviceDriver.getMode() != 2) {
remark = "universal_notCreateInstMessage9";
notCreateInstMessage = remark;
return false;
}
if (plugPullDeviceSiteDeviceDriver.getMove() != 0){
remark = "universal_notCreateInstMessage10";
notCreateInstMessage = remark;
return false;
}
if (plugPullDeviceSiteDeviceDriver.getAction() != 2){
remark = "universal_notCreateInstMessage11";
notCreateInstMessage = remark;
return false;
}
}
String taskId = task.getTask_id();
String taskCode = task.getTask_code();
@@ -458,12 +486,12 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
Device startDevice = deviceAppService.findDeviceByCode(instdto.getStart_device_code());
Device nextDevice = deviceAppService.findDeviceByCode(instdto.getNext_device_code());
if (ObjectUtil.isEmpty(startDevice.getExtraValue().get("address"))) {
notCreateInstMessage = "设备:" + startDevice.getDevice_code() + "未设置电气调度号!";
notCreateInstMessage = "universal_notCreateInstMessage1";
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "设备:" + startDevice.getDevice_code() + "未设置电气调度号!");
throw new BadRequestException(LangProcess.msg("device_checkAdd", startDevice.getDevice_code()));
}
if (ObjectUtil.isEmpty(nextDevice.getExtraValue().get("address"))) {
notCreateInstMessage = "设备:" + nextDevice.getDevice_code() + "未设置电气调度号!";
notCreateInstMessage = "universal_notCreateInstMessage1";
logServer.deviceExecuteLog(this.getDevice_code(), "", "", "设备:" + nextDevice.getDevice_code() + "未设置电气调度号!");
throw new BadRequestException(LangProcess.msg("device_checkAdd", nextDevice.getDevice_code()));

View File

@@ -475,6 +475,12 @@ public class InstructionServiceImpl extends CommonServiceImpl<InstructionMapper,
dto.setRemark(e.getMessage());
e.printStackTrace();
log.warn("下发AGV指令异常:" + e);
LuceneLogDto logDto1 = LuceneLogDto.builder()
.device_code(start_device_code)
.content("下发AGV指令异常")
.build();
logDto1.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto1);
}
} else {
// Boolean result = createLkInst(task.getStorage_task_type(),dto);