rev:解决监控页面报错以及优化堆叠行架任务下发逻辑

This commit is contained in:
2024-08-28 09:49:02 +08:00
parent ca8c658cd7
commit 9b2c62f920
16 changed files with 150 additions and 46 deletions

View File

@@ -210,17 +210,21 @@ public class XgAgvCarDeviceDriver extends AbstractDeviceDriver implements Device
@Override
public void execute() {
}
@Override
public JSONObject getDeviceStatusName() {
Map<String, Object> map = new LinkedHashMap<>();
try {
getAgvStatus();
} catch (Exception e) {
message = "获取机器人状态报错";
}
}
@Override
public JSONObject getDeviceStatusName() {
Map<String, Object> map = new LinkedHashMap<>();
// try {
// getAgvStatus();
// } catch (Exception e) {
// message = "获取机器人状态报错";
// }
String isError;
if (is_error) {
isError = "出错,不执行任何运单";

View File

@@ -656,6 +656,7 @@ public class BoxStorageOutConveyorDeviceDriver extends AbstractOpcDeviceDriver i
map.put("isOnline", this.getIsonline());
map.put("isError", this.getIserror());
map.put("hand_barcode", hand_barcode);
map.put("material_barcode", this.material_barcode);
map.put("barcode", this.getMove() == 0 ? null : checkInst() == null ? vehicle_code : checkInst().getVehicle_code());
map.put("is_click", true);
map.put("error", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(this.getError())));

View File

@@ -382,8 +382,46 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice
}
}
if (CollUtil.isNotEmpty(taskDtosReady)) {
List<TaskDto> taskDtoList = taskDtosReady.stream().sorted(Comparator.comparing(TaskDto::getCreate_time)).collect(Collectors.toList());
taskDto = taskDtoList.get(0);
for (TaskDto dto : taskDtosReady) {
String start_device_code = dto.getStart_device_code();
String next_device_code = dto.getNext_device_code();
Device startDevice = deviceAppService.findDeviceByCode(start_device_code);
Device nextDevice = deviceAppService.findDeviceByCode(next_device_code);
BeltConveyorDeviceDriver beltConveyorDeviceDriverStart;
BeltConveyorDeviceDriver beltConveyorDeviceDriverEnd;
if (startDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
beltConveyorDeviceDriverStart = (BeltConveyorDeviceDriver) startDevice.getDeviceDriver();
if (beltConveyorDeviceDriverStart.getMove() != 1) {
notCreateInstMessage = "universal_notCreateInstMessage2";
continue;
}
}
if (nextDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
beltConveyorDeviceDriverEnd = (BeltConveyorDeviceDriver) nextDevice.getDeviceDriver();
if (beltConveyorDeviceDriverEnd.getMove() == 1 && beltConveyorDeviceDriverEnd.getMode() == 2) {
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("当前任务号:" + dto.getTask_code() + " " + next_device_code + "当前move值为" + beltConveyorDeviceDriverEnd.getMove() + "当前mode值为"+beltConveyorDeviceDriverEnd.getMode())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
taskDto = dto;
}else {
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("当前任务号:" + dto.getTask_code() + " " + next_device_code + "当前move值为" + beltConveyorDeviceDriverEnd.getMove() + "当前mode值为"+beltConveyorDeviceDriverEnd.getMode())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
notCreateInstMessage = "universal_notCreateInstMessage2";
continue;
}
}
if (ObjectUtil.isNotEmpty(taskDto)){
break;
}
}
}
if (ObjectUtil.isNotEmpty(taskDto)) {
String interactionJson = taskDto.getInteraction_json();
@@ -404,37 +442,6 @@ public class TrappedManipulatorManipulatorDeviceDriver extends AbstractOpcDevice
}
BeltConveyorDeviceDriver beltConveyorDeviceDriverStart;
BeltConveyorDeviceDriver beltConveyorDeviceDriverEnd;
if (startDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
beltConveyorDeviceDriverStart = (BeltConveyorDeviceDriver) startDevice.getDeviceDriver();
if (beltConveyorDeviceDriverStart.getMove() != 1 && beltConveyorDeviceDriverStart.getMode() != 2) {
notCreateInstMessage = "universal_notCreateInstMessage2";
return false;
}
}
if (nextDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
beltConveyorDeviceDriverEnd = (BeltConveyorDeviceDriver) nextDevice.getDeviceDriver();
if (beltConveyorDeviceDriverEnd.getMove() == 1 && beltConveyorDeviceDriverEnd.getMode() == 2) {
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("当前任务号:" + taskDto.getTask_code() + " " + next_device_code + "当前move值为" + beltConveyorDeviceDriverEnd.getMove() + "当前mode值为"+beltConveyorDeviceDriverEnd.getMode())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
}else {
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("当前任务号:" + taskDto.getTask_code() + " " + next_device_code + "当前move值为" + beltConveyorDeviceDriverEnd.getMove() + "当前mode值为"+beltConveyorDeviceDriverEnd.getMode())
.build();
logDto.setLog_level(4);
luceneExecuteLogService.deviceExecuteLog(logDto);
notCreateInstMessage = "universal_notCreateInstMessage2";
return false;
}
}
String taskid = taskDto.getTask_id();
String taskcode = taskDto.getTask_code();
String start_point_code = taskDto.getStart_point_code();

View File

@@ -147,6 +147,8 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
String notCreateInstMessage = "";
String feedMessage = "";
String volume_code;
List<String> getDeviceCodeList = null;
@@ -180,6 +182,19 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
requireSucess = false;
}
if (task > 0) {
inst = checkInst();
if (null != inst) {
TaskDto dto = taskserver.findByCode(inst.getTask_code());
String interaction_json = dto.getInteraction_json();
if (StrUtil.isNotEmpty(interaction_json)) {
JSONObject jsonObject = JSONObject.parseObject(interaction_json);
//子卷号
volume_code = jsonObject.getString("containers");
}
}
}
} catch (Exception var17) {
var17.printStackTrace();
@@ -394,6 +409,7 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
jo.put("notCreateInstMessage",notCreateInstMessage);*/
map.put("feedMessage", LangProcess.msg(feedMessage));
map.put("driver_type", "siemens_conveyor");
map.put("volume_code", this.volume_code);
map.put("is_click", true);
JSONObject jo = new JSONObject(map);
return jo;

View File

@@ -657,7 +657,6 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
try {
updateEXcuteMessage(error.toString());
applyUpdatePointCode(StandarStirageErroEnum.VOIDANCE.getType());
} catch (Exception e) {
throw new RuntimeException(e);
}

View File

@@ -164,6 +164,8 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
String device_code;
String volume_code;
String message = null;
private Date instruction_require_time = new Date();
private int instruction_require_time_out = 3000;
@@ -211,6 +213,19 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
requireSucess = false;
}
if (task > 0) {
inst = checkInst();
if (null != inst) {
TaskDto dto = taskserver.findByCode(inst.getTask_code());
String interaction_json = dto.getInteraction_json();
if (StrUtil.isNotEmpty(interaction_json)) {
JSONObject jsonObject = JSONObject.parseObject(interaction_json);
//子卷号
volume_code = jsonObject.getString("containers");
}
}
}
if (mode == 0) {
this.setIsonline(false);
@@ -904,6 +919,8 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
jo.put("device_name", this.getDevice().getDevice_name());
jo.put("mode", mode);
jo.put("move", move);
// jo.put("task", task);
jo.put("volume_code", this.volume_code);
jo.put("action", action);
jo.put("error", ErrorUtil.getDictDetail("cbj_error_type", String.valueOf(this.getError())));
jo.put("isOnline", this.getIsonline());
@@ -912,6 +929,23 @@ public class PlugPullDeviceSiteDeviceDriver extends AbstractOpcDeviceDriver impl
return jo;
}
public Instruction checkInst() {
if (ObjectUtil.isNotEmpty(this.inst)) {
if (this.task > 0) {
if (this.inst.getInstruction_code().equals(String.valueOf(this.task))) {
return this.inst;
} else {
inst = instructionService.findByCodeFromCache(String.valueOf(task));
return inst;
}
}
} else {
inst = instructionService.findByCodeFromCache(String.valueOf(task));
return inst;
}
return null;
}
@Override
public void setDeviceStatus(JSONObject data) {

View File

@@ -151,6 +151,8 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
String device_code;
String volume_code;
//当前指令
Instruction inst = null;
@@ -199,6 +201,14 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
// 更新指令状态
if (mode == 3 && task > 0) {
inst = checkInst();
if (null != inst) {
TaskDto dto = taskserver.findByCode(inst.getTask_code());
String interaction_json = dto.getInteraction_json();
JSONObject jsonObject = JSONObject.parseObject(interaction_json);
//子卷号
volume_code = jsonObject.getString("containers");
}
Date date = new Date();
if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out);
@@ -940,6 +950,7 @@ public class PullHeadManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
map.put("move", move);
map.put("action", action);
map.put("task", task);
map.put("volume_code", this.volume_code);
map.put("walk_y", walkY);
map.put("isOnline", this.getIsonline());
map.put("isError", this.getIserror());

View File

@@ -147,6 +147,8 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
String device_code;
String volume_code;
//当前指令
Instruction inst = null;
@@ -191,6 +193,19 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
requireSucess = false;
}
if (task > 0) {
inst = checkInst();
if (null != inst) {
TaskDto dto = taskserver.findByCode(inst.getTask_code());
String interaction_json = dto.getInteraction_json();
if (StrUtil.isNotEmpty(interaction_json)) {
JSONObject jsonObject = JSONObject.parseObject(interaction_json);
//子卷号
volume_code = jsonObject.getString("containers");
}
}
}
// 更新指令状态
if (mode == 3 && task > 0) {
Date date = new Date();
@@ -644,6 +659,7 @@ public class PullTailManipulatorDeviceDriver extends AbstractOpcDeviceDriver imp
map.put("mode", mode);
map.put("move", move);
map.put("action", action);
map.put("volume_code", this.volume_code);
map.put("isOnline", this.getIsonline());
map.put("error", ErrorUtil.getDictDetail("bhhj_error_type", String.valueOf(this.getError())));
map.put("isError", this.getIserror());

View File

@@ -126,6 +126,8 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
String device_code;
String volume_code;
//请求超时时间
private int instruction_require_time_out = 3000;
@@ -173,6 +175,14 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
}
if (mode == 3 && task > 0 && !requireSucess) {
inst = checkInst();
if (null != inst) {
TaskDto dto = taskserver.findByCode(inst.getTask_code());
String interaction_json = dto.getInteraction_json();
JSONObject jsonObject = JSONObject.parseObject(interaction_json);
//子卷号
volume_code = jsonObject.getString("containers");
}
update_instruction_status();
}
@@ -847,6 +857,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl
jo.put("walk_y", walk_y);
jo.put("error", ErrorUtil.getDictDetail("fqhj_error_type", String.valueOf(this.getError())));
jo.put("task", this.getTask());
jo.put("volume_code", this.volume_code);
jo.put("isOnline", this.getIsonline());
jo.put("isError", this.getIserror());
jo.put("is_disable1", this.getIs_disable());

View File

@@ -118,7 +118,7 @@ public class SubvolumeWeighingStationDriver extends AbstractOpcDeviceDriver impl
}
@Override
public JSONObject getDeviceStatusName() throws Exception {
public JSONObject getDeviceStatusName() {
JSONObject jo = new JSONObject();
String mode = "";
String move = "";

View File

@@ -55,7 +55,6 @@ public class DeviceStageMonitorServiceImpl implements DeviceStageMonitorService
obj.put("id", js.getString("id"));
arr.add(obj);
}
return arr;
}
}

View File

@@ -54,7 +54,7 @@ https://juejin.cn/post/6844903775631572999
</appender>
<!--异步到文件-->
<appender name="asyncAppenter" class="com.yomahub.tlog.core.enhance.logback.async.AspectLogbackAsyncAppender">
<appender name="asyncFileAppender" class="com.yomahub.tlog.core.enhance.logback.async.AspectLogbackAsyncAppender">
<discardingThreshold>0</discardingThreshold>
<queueSize>500</queueSize>
<appender-ref ref="FILE"/>

View File

@@ -141,7 +141,8 @@ export default {
'The_signal_is_successfully_marked': 'The signal is successfully marked',
'Complement_information': 'Complement information',
'agv_task_type': 'task type',
'vehicle_code2': 'Box number'
'vehicle_code2': 'Box number',
'volume_code': 'Sub volume number'
}
}
}

View File

@@ -141,7 +141,8 @@ export default {
'The_signal_is_successfully_marked': 'Sinyal berhasil ditandai',
'Complement_information': 'Informasi pelengkap',
'agv_task_type': 'Jenis tugas',
'vehicle_code2': 'Nomor kotak kayu'
'vehicle_code2': 'Nomor kotak kayu',
'volume_code': 'Nomor volume sub'
}
}
}

View File

@@ -141,7 +141,8 @@ export default {
'The_signal_is_successfully_marked': '信号成功标记',
'Complement_information': '补码信息',
'agv_task_type': '任务类型',
'vehicle_code2': '木箱号'
'vehicle_code2': '木箱号',
'volume_code': '子卷号'
}
}
}

View File

@@ -808,6 +808,9 @@ export default {
} else if (val === 'vehicle_code2') {
const obj = { name: i18n.t('monitor.click.vehicle_code2'), value: data[val] }
this.arr.push(obj)
} else if (val === 'volume_code') {
const obj = { name: i18n.t('monitor.click.volume_code'), value: data[val] }
this.arr.push(obj)
}
}
}