From 07998cecbbb6acf26d5a796051bbb4da81dd7f27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=97=AD=E6=98=8E=5C73939?= <739390650@QQ.COM> Date: Fri, 16 Jan 2026 17:23:37 +0800 Subject: [PATCH 1/2] =?UTF-8?q?opt:2=E6=A5=BCAGV=E7=9C=8B=E6=9D=BF?= =?UTF-8?q?=EF=BC=8C=E4=BB=A3=E7=A0=81=E6=B2=A1=E6=B5=8B=E8=AF=95=E8=BF=87?= =?UTF-8?q?=EF=BC=8C=E5=9B=A0=E6=AD=A4=E6=98=AF=E5=BC=80=E5=8F=91=E5=88=86?= =?UTF-8?q?=E6=94=AF,=E8=AF=B7=E4=B8=8D=E8=A6=81=E5=90=88=E5=B9=B6?= =?UTF-8?q?=EF=BC=8C=E5=90=8E=E7=BB=AD=E8=AF=84=E5=AE=A1=E8=BF=87=E5=90=8E?= =?UTF-8?q?=E5=86=8D=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agv/contorller/TwoFloorAgvController.java | 38 ++ .../nl/acs/agv/domain/TwoFloorAgvStatus.java | 180 +++++ .../impl/TwoFloorAgvStatusService.java | 178 +++++ .../run/TwoNDCSocketConnectionAutoRun.java | 14 +- .../agv/ndctwo/AgvNdcTwoDeviceDriver.java | 627 +++++++++++++++++- .../src/views/screen/twoFloorAgvScreen.vue | 395 +++++++++++ 6 files changed, 1417 insertions(+), 15 deletions(-) create mode 100644 acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/contorller/TwoFloorAgvController.java create mode 100644 acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/domain/TwoFloorAgvStatus.java create mode 100644 acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/service/impl/TwoFloorAgvStatusService.java create mode 100644 acs2/nladmin-ui/src/views/screen/twoFloorAgvScreen.vue diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/contorller/TwoFloorAgvController.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/contorller/TwoFloorAgvController.java new file mode 100644 index 000000000..5fa11e254 --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/contorller/TwoFloorAgvController.java @@ -0,0 +1,38 @@ +package org.nl.acs.agv.contorller; + +import org.nl.acs.agv.service.impl.TwoFloorAgvStatusService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 二楼AGV状态控制器 + * 提供HTTP接口获取AGV状态信息 + */ +@RestController +@RequestMapping("/api/agv/two-floor") +public class TwoFloorAgvController { + + @Autowired + private TwoFloorAgvStatusService agvStatusService; + + /** + * 获取所有二楼AGV状态 + * @return 所有AGV状态列表 + */ + @GetMapping("/status") + public Object getAllAgvStatus() { + return agvStatusService.getAllAgvStatus(); + } + + /** + * 获取单个AGV状态 + * @param vehicleCode AGV车辆代码 + * @return AGV状态信息 + */ + @GetMapping("/status/{vehicleCode}") + public Object getAgvStatus(String vehicleCode) { + return agvStatusService.getAgvStatus(vehicleCode); + } +} diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/domain/TwoFloorAgvStatus.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/domain/TwoFloorAgvStatus.java new file mode 100644 index 000000000..ab1889e89 --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/domain/TwoFloorAgvStatus.java @@ -0,0 +1,180 @@ +package org.nl.acs.agv.domain; + +import lombok.Data; + +/** + * 二楼AGV状态数据模型 + * 用于存储和传输AGV的实时状态信息 + */ +@Data +public class TwoFloorAgvStatus { + + /** + * AGV车辆代码 + */ + private String vehicle_code; + + /** + * AGV状态 + */ + private String status; + + /** + * AGV状态文本描述 + */ + private String status_text; + + /** + * 当前任务代码 + */ + private String task_code; + + /** + * 当前指令代码 + */ + private String inst_code; + + /** + * 当前阶段值 + */ + private Integer phase; + + /** + * 当前阶段名称 + */ + private String phase_name; + + /** + * 当前位置 + */ + private String address; + + /** + * 物料类型 + */ + private String material_type; + + /** + * 物料数量 + */ + private Integer quantity; + + /** + * 开始设备代码 + */ + private String start_device_code; + + /** + * 下一个设备代码 + */ + private String next_device_code; + + /** + * 是否有错误 + */ + private Boolean is_error; + + /** + * 错误代码 + */ + private String error_code; + + /** + * 错误信息 + */ + private String error_message; + + /** + * 卡住的Action + */ + private String error_action; + + /** + * 卡住的Mode + */ + private String error_mode; + /** + * 卡住的move + */ + private String error_move; + /** + * 卡住的error + */ + private String error_error; + /** + * 设备号 + */ + private String device_code; + /** + * 期望的Action + */ + private String exp_action; + + /** + * 卡住的Mode + */ + private String exp_mode; + /** + * 卡住的move + */ + private String exp_move; + /** + * 卡住的error + */ + private String exp_error; + + /** + * 实际Action + */ + private String action; + + /** + * 实际Mode + */ + private String mode; + /** + * 实际move + */ + private String move; + /** + * 实际error + */ + private String error; + + /** + * 电量 + */ + private Integer electric_qty; + + private String driver; + + /** + * X坐标 + */ + private Integer x; + + /** + * Y坐标 + */ + private Integer y; + + /** + * 角度 + */ + private Integer angle; + + /** + * 区域 + */ + private Integer region; + + /** + * 是否在线 + */ + private Boolean is_online; + + /** + * 三色灯状态 + */ + private Integer status_light; +} diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/service/impl/TwoFloorAgvStatusService.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/service/impl/TwoFloorAgvStatusService.java new file mode 100644 index 000000000..727ec94b1 --- /dev/null +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/service/impl/TwoFloorAgvStatusService.java @@ -0,0 +1,178 @@ +package org.nl.acs.agv.service.impl; + +import org.nl.acs.agv.domain.TwoFloorAgvStatus; +import org.nl.acs.device_driver.agv.utils.TwoAgvPhase; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 二楼AGV状态管理服务 + * 负责管理和更新AGV状态,通过HTTP接口提供状态查询 + */ +@Service +public class TwoFloorAgvStatusService { + + @Autowired + private TwoAgvPhase twoAgvPhase; + + /** + * 存储AGV状态信息,key为AGV车辆代码 + */ + private Map agvStatusMap = new HashMap<>(); + + /** + * 初始化AGV状态 + */ + public TwoFloorAgvStatusService() { + // 初始化二楼的4台AGV + for (int i = 1; i <= 4; i++) { + TwoFloorAgvStatus agvStatus = new TwoFloorAgvStatus(); + String vehicleCode = String.format("AGV%02d", i); + agvStatus.setVehicle_code(vehicleCode); + agvStatus.setStatus("idle"); + agvStatus.setStatus_text("空闲"); + agvStatus.setIs_error(false); + agvStatus.setIs_online(true); + agvStatusMap.put(vehicleCode, agvStatus); + } + } + + /** + * 更新AGV状态 + * @param agvStatus AGV状态信息 + */ + public void updateAgvStatus(TwoFloorAgvStatus agvStatus) { + if (agvStatus == null || agvStatus.getVehicle_code() == null) { + return; + } + + // 处理阶段名称 + if (agvStatus.getPhase() != null) { + String phaseName = twoAgvPhase.getPhaseName(agvStatus.getPhase()); + agvStatus.setPhase_name(phaseName); + } + + // 处理状态文本 + this.handleStatusText(agvStatus); + + // 更新状态 + agvStatusMap.put(agvStatus.getVehicle_code(), agvStatus); + + // 推送状态更新 + this.pushAgvStatusUpdate(); + } + + /** + * 处理AGV状态文本 + */ + private void handleStatusText(TwoFloorAgvStatus agvStatus) { + switch (agvStatus.getStatus()) { + case "running": + agvStatus.setStatus_text("运行中"); + break; + case "idle": + agvStatus.setStatus_text("空闲"); + break; + case "error": + agvStatus.setStatus_text("异常"); + agvStatus.setIs_error(true); + break; + case "charging": + agvStatus.setStatus_text("充电中"); + break; + default: + agvStatus.setStatus_text("未知"); + break; + } + } + + /** + * 获取单个AGV状态 + * @param vehicleCode AGV车辆代码 + * @return AGV状态信息 + */ + public TwoFloorAgvStatus getAgvStatus(String vehicleCode) { + return agvStatusMap.get(vehicleCode); + } + + /** + * 获取所有AGV状态 + * @return 所有AGV状态列表 + */ + public List getAllAgvStatus() { + return new ArrayList<>(agvStatusMap.values()); + } + + /** + * 更新AGV状态后不需要推送,由前端通过HTTP接口主动查询 + */ + public void pushAgvStatusUpdate() { + // 改为HTTP接口后,不再需要主动推送 + // 前端会通过定时请求获取最新状态 + } + + /** + * 更新AGV任务信息 + */ + public void updateAgvTaskInfo(String vehicleCode, String taskCode, String instCode) { + TwoFloorAgvStatus agvStatus = agvStatusMap.get(vehicleCode); + if (agvStatus != null) { + agvStatus.setTask_code(taskCode); + agvStatus.setInst_code(instCode); + this.pushAgvStatusUpdate(); + } + } + + /** + * 更新AGV阶段信息 + */ + public void updateAgvPhase(String vehicleCode, Integer phase) { + TwoFloorAgvStatus agvStatus = agvStatusMap.get(vehicleCode); + if (agvStatus != null) { + agvStatus.setPhase(phase); + agvStatus.setPhase_name(twoAgvPhase.getPhaseName(phase)); + this.pushAgvStatusUpdate(); + } + } + + /** + * 更新AGV错误信息 + */ + public void updateAgvError(String vehicleCode, String errorCode, String errorMessage, String errorAction, String errorMode) { + TwoFloorAgvStatus agvStatus = agvStatusMap.get(vehicleCode); + if (agvStatus != null) { + agvStatus.setIs_error(true); + agvStatus.setError_code(errorCode); + agvStatus.setError_message(errorMessage); + agvStatus.setError_action(errorAction); + agvStatus.setError_mode(errorMode); + agvStatus.setStatus("error"); + agvStatus.setStatus_text("异常"); + this.pushAgvStatusUpdate(); + } + } + + /** + * 清除AGV错误信息 + */ + public void clearAgvError(String vehicleCode) { + TwoFloorAgvStatus agvStatus = agvStatusMap.get(vehicleCode); + if (agvStatus != null) { + agvStatus.setIs_error(false); + agvStatus.setError_code(null); + agvStatus.setError_message(null); + agvStatus.setError_action(null); + agvStatus.setError_mode(null); + if ("error".equals(agvStatus.getStatus())) { + agvStatus.setStatus("idle"); + agvStatus.setStatus_text("空闲"); + } + this.pushAgvStatusUpdate(); + } + } +} \ No newline at end of file diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java index 8a07e33aa..3830d31c8 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java @@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import lombok.extern.slf4j.Slf4j; import org.nl.acs.AcsConfig; +import org.nl.acs.agv.domain.TwoFloorAgvStatus; import org.nl.acs.agv.server.NDCAgvService; import org.nl.acs.device.domain.Device; import org.nl.acs.device.service.DeviceService; @@ -17,6 +18,7 @@ import org.nl.acs.instruction.domain.Instruction; import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.impl.InstructionServiceImpl; import org.nl.acs.log.service.DeviceExecuteLogService; +import org.nl.acs.agv.service.impl.TwoFloorAgvStatusService; import org.nl.acs.opc.DeviceAppService; import org.nl.config.SpringContextHolder; import org.nl.config.lucene.service.LuceneExecuteLogService; @@ -33,10 +35,7 @@ import java.io.DataOutputStream; import java.io.IOException; import java.net.InetSocketAddress; import java.net.Socket; -import java.util.Arrays; -import java.util.Date; -import java.util.LinkedHashMap; -import java.util.Map; +import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ExecutorService; @@ -80,6 +79,10 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { AutoRunService autoRunService; @Autowired LuceneExecuteLogService luceneExecuteLogService; + /** + * 二楼AGV状态管理服务 + */ + private TwoFloorAgvStatusService agvStatusService; @Autowired ISysDictService dictService; @@ -106,7 +109,8 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { DeviceAppService deviceAppService = SpringContextHolder.getBean(DeviceAppService.class); DeviceService deviceService = SpringContextHolder.getBean(DeviceService.class); DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class); - + // 初始化AGV状态管理服务 + agvStatusService = SpringContextHolder.getBean(TwoFloorAgvStatusService.class); try { log.info("2楼1区域AGV系统链接开始"); ip = paramService.findByCode(AcsConfig.AGVURL).getValue(); diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java index 7a5821ed3..0c761be7e 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java @@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject; import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.nl.acs.AcsConfig; import org.nl.acs.agv.server.NDCAgvService; import org.nl.acs.auto.run.TwoNDCSocketConnectionAutoRun; @@ -27,6 +28,8 @@ import org.nl.acs.device_driver.two_conveyor.ranging_stations.RangingStationsDev import org.nl.acs.device_driver.two_conveyor.waste_foil_weighing_station.WasteFoilWeighingStationDriver; import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl; +import org.nl.acs.agv.domain.TwoFloorAgvStatus; +import org.nl.acs.agv.service.impl.TwoFloorAgvStatusService; import org.nl.acs.history.ErrorUtil; import org.nl.acs.history.service.DeviceErrorLogService; import org.nl.acs.history.service.dto.DeviceErrorLogDto; @@ -76,6 +79,11 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic TwoAgvPhase twoAgvPhase = new TwoAgvPhase(); ISysDictService dictService = SpringContextHolder.getBean(ISysDictService.class); + /** + * 二楼AGV状态管理服务 + */ + private TwoFloorAgvStatusService agvStatusService = SpringContextHolder.getBean(TwoFloorAgvStatusService.class); + String error_code = "0"; int agvaddr = 0; int agvaddr_copy = 0; @@ -100,6 +108,148 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic Boolean iserror = false; boolean isCharge = false; + /** + * 更新AGV状态信息到TwoFloorAgvStatusService + * @param arr socket数据数组 + * @param carno 车号 + * @param phase 当前阶段 + * @param ikey 任务号 + * @param agvaddr 站点号 + * @param inst 指令信息 + * @param task 任务信息 + */ + public TwoFloorAgvStatus updateAgvStatusToService(int[] arr, int carno, int phase, int ikey, int agvaddr, Instruction inst, TaskDto task) { + if (carno == 0) { + return null; + } + + try { + // 创建AGV状态对象 + TwoFloorAgvStatus agvStatus = new TwoFloorAgvStatus(); + + // 设置AGV车辆代码 + String vehicleCode = String.format("AGV%02d", carno); + agvStatus.setVehicle_code(vehicleCode); + + // 设置状态 + String status = "running"; + if (iserror) { + status = "error"; + } else if (phase == 0x67 || phase == 0x71 || phase == 0x72 || phase == 0x73 || phase == 0x74 || phase == 0x75) { + status = "idle"; + } + agvStatus.setStatus(status); + + // 设置任务信息 + if (inst != null) { + agvStatus.setTask_code(inst.getTask_code()); + agvStatus.setInst_code(String.valueOf(ikey)); + } + + // 设置阶段信息 + agvStatus.setPhase(phase); + agvStatus.setPhase_name(twoAgvPhase.getPhaseName(phase)); + + // 设置位置信息 + String address = deviceService.queryDeviceCodeByAddress(agvaddr); + agvStatus.setAddress(address); + + // 设置错误信息 + agvStatus.setIs_error(iserror); + agvStatus.setError_code(error_code); + agvStatus.setError_message(error_message); + + // 设置电量 + agvStatus.setElectric_qty(electric_qty); + + // 设置坐标和角度 + agvStatus.setX(x); + agvStatus.setY(y); + agvStatus.setAngle(angle); + + // 设置区域 + agvStatus.setRegion(region); + + // 设置在线状态 + agvStatus.setIs_online(isonline); + + // 更新到服务 + agvStatusService.updateAgvStatus(agvStatus); + return agvStatus; + } catch (Exception e) { + log.error("更新AGV状态到服务失败: {}", e.getMessage()); + } + return null; + } + + + /** + * + * @param carno + * @param agvStatus + * @param device_code + * @param driver + * @param message + * @param expectValue + * @param actualVaue + */ + public void recordTaskStuckReason(int carno,TwoFloorAgvStatus agvStatus, String device_code, String driver, String message,Map expectValue,Map actualVaue) { + try { + // 解析错误信息,提取action和mode不满足的原因 + String act_action = String.valueOf(actualVaue.get("act_action")); + String act_mode = String.valueOf(actualVaue.get("act_mode")); + String act_error = String.valueOf(actualVaue.get("act_error")); + String act_move = String.valueOf(actualVaue.get("act_move")); + String exp_action = String.valueOf(expectValue.get("ept_action")); + String exp_mode = String.valueOf(expectValue.get("ept_mode")); + String exp_error = String.valueOf(expectValue.get("ept_error")); + String exp_move = String.valueOf(expectValue.get("ept_move")); + + // 设置AGV车辆代码 + String vehicleCode = String.format("AGV%02d", carno); + agvStatus.setVehicle_code(vehicleCode); + + // 设置错误信息 + agvStatus.setDriver(driver); + agvStatus.setIs_error(true); + agvStatus.setStatus("error"); + agvStatus.setError_message(message); + agvStatus.setDevice_code(device_code); + agvStatus.setError_action(act_action); + agvStatus.setError_mode(act_mode); + agvStatus.setError_move(act_move); + agvStatus.setError_error(act_error); + agvStatus.setExp_action(exp_action); + agvStatus.setExp_mode(exp_mode); + agvStatus.setExp_move(exp_move); + agvStatus.setExp_error(exp_error); + + StringBuffer messageSb = new StringBuffer(); + messageSb.append("任务异常,phase"+agvStatus.getPhase()); + if(expectValue.get("ept_action")!=null){ + messageSb.append(", 期望action:"+exp_action+" 实际action:"+act_action); + } + if(expectValue.get("ept_mode")!=null){ + messageSb.append(", 期望mode:"+exp_mode+" 实际mode:"+act_mode); + } + if(expectValue.get("ept_error")!=null){ + messageSb.append(", 期望error:"+exp_move+" 实际error:"+act_move); + } + if(expectValue.get("ept_move")!=null){ + messageSb.append(", 期望move:"+exp_error+" 实际move:"+act_error); + } + + + agvStatus.setError_message(messageSb.toString()); + + // 更新到服务 + agvStatusService.updateAgvStatus(agvStatus); + } catch (Exception e) { + log.error("记录任务卡住原因失败: {}", e.getMessage()); + } + } + + private synchronized void setErrorInfo(int error, String error_code, String error_message) { this.error = error; this.error_code = error_code; @@ -186,6 +336,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic //废箔称重位 WasteFoilWeighingStationDriver wasteFoilWeighingStationDriver; + // 更新AGV状态信息到TwoFloorAgvStatusService + TwoFloorAgvStatus agvStatus = updateAgvStatusToService(arr, carno, phase, ikey, agvaddr, inst, task); + if (phase == 0x02) { if (ObjectUtil.isEmpty(inst)) { log.info("未找到指令号{}对应的指令", ikey); @@ -300,7 +453,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); } else { - message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + message = "设备号:" + device_code + "光电信号move:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号action:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",1); + eptMap.put("ept_mode",null); + eptMap.put("ept_error",0); + eptMap.put("ept_move",1); + Map actMap = new HashMap<>(); + actMap.put("act_action",standardInspectSiteDeviceDriver.getAction()); + actMap.put("act_mode",standardInspectSiteDeviceDriver.getMode()); + actMap.put("act_error",standardInspectSiteDeviceDriver.getError()); + actMap.put("act_move",standardInspectSiteDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "standardInspectSiteDeviceDriver", message,eptMap,actMap); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(this.getDeviceCode()) .content(message) @@ -331,6 +496,18 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",1); + eptMap.put("ept_mode",2); + eptMap.put("ept_error",null); + eptMap.put("ept_move",null); + Map actMap = new HashMap<>(); + actMap.put("act_action",manipulatorAgvStationDeviceDriver.getAction()); + actMap.put("act_mode",manipulatorAgvStationDeviceDriver.getMode()); + // actMap.put("act_error",manipulatorAgvStationDeviceDriver.getError()); + // actMap.put("act_move",manipulatorAgvStationDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "manipulatorAgvStationDeviceDriver", message,eptMap,actMap); } } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); @@ -355,6 +532,18 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + // eptMap.put("ept_action",1); + // eptMap.put("ept_mode",null); + // eptMap.put("ept_error",0); + eptMap.put("ept_move",1); + Map actMap = new HashMap<>(); + // actMap.put("act_action",hongXiangStationDeviceDriver.getAction()); + // actMap.put("act_mode",hongXiangStationDeviceDriver.getMode()); + // actMap.put("act_error",hongXiangStationDeviceDriver.getError()); + actMap.put("act_move",hongXiangStationDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "hongXiangStationDeviceDriver", message,eptMap,actMap); } } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); @@ -380,6 +569,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",1); + eptMap.put("ept_mode",2); + eptMap.put("ept_error",0); + eptMap.put("ept_move",null); + Map actMap = new HashMap<>(); + actMap.put("act_action",paperTubePickSiteDeviceDriver.getAction()); + actMap.put("act_mode",paperTubePickSiteDeviceDriver.getMode()); + actMap.put("act_error",paperTubePickSiteDeviceDriver.getError()); + actMap.put("act_move",paperTubePickSiteDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "paperTubePickSiteDeviceDriver", message,eptMap,actMap); } }/* else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) { rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver(); @@ -464,6 +666,20 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",1); + eptMap.put("ept_mode",2); + eptMap.put("ept_error",0); + eptMap.put("ept_move",1); + Map actMap = new HashMap<>(); + actMap.put("act_action",wasteFoilWeighingStationDriver.getAction()); + actMap.put("act_mode",wasteFoilWeighingStationDriver.getMode()); + actMap.put("act_error",wasteFoilWeighingStationDriver.getError()); + actMap.put("act_move",wasteFoilWeighingStationDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "wasteFoilWeighingStationDriver", message,eptMap,actMap); + } } else { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); @@ -591,6 +807,14 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic acsToWmsService.actionFinishRequest2(jsonObject); } } else { + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",0); + eptMap.put("ept_mode",2); + Map actMap = new HashMap<>(); + actMap.put("act_action",manipulatorAgvStationDeviceDriver.getAction()); + actMap.put("act_mode",manipulatorAgvStationDeviceDriver.getMode()); + recordTaskStuckReason(carno,agvStatus, device_code, "manipulatorAgvStationDeviceDriver", message,eptMap,actMap); LuceneLogDto logDto = LuceneLogDto.builder() .device_code(manipulatorAgvStationDeviceDriver.getDevice_code()) .content("未给agv离开信号原因是:" + manipulatorAgvStationDeviceDriver.getDevice_code() + "动作信号不为0,当前的指令号为:" + inst.getInstruction_code()) @@ -621,6 +845,14 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_move",1); + Map actMap = new HashMap<>(); + actMap.put("act_move",hongXiangStationDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "hongXiangStationDeviceDriver", message,eptMap,actMap); + } } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); @@ -645,6 +877,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",0); + eptMap.put("ept_mode",2); + eptMap.put("ept_error",0); + eptMap.put("ept_move",null); + Map actMap = new HashMap<>(); + actMap.put("act_action",paperTubePickSiteDeviceDriver.getAction()); + actMap.put("act_mode",paperTubePickSiteDeviceDriver.getMode()); + actMap.put("act_error",paperTubePickSiteDeviceDriver.getError()); + actMap.put("act_move",paperTubePickSiteDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "paperTubePickSiteDeviceDriver", message,eptMap,actMap); + } } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); @@ -670,6 +915,14 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_error",0); + eptMap.put("ept_move",-1); + Map actMap = new HashMap<>(); + actMap.put("act_error",standardInspectSiteDeviceDriver.getError()); + actMap.put("act_move",standardInspectSiteDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "standardInspectSiteDeviceDriver", message,eptMap,actMap); } } else if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) { wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver(); @@ -697,6 +950,18 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",1); + eptMap.put("ept_mode",2); + eptMap.put("ept_error",0); + eptMap.put("ept_move",0); + Map actMap = new HashMap<>(); + actMap.put("act_action",wasteFoilWeighingStationDriver.getAction()); + actMap.put("act_mode",wasteFoilWeighingStationDriver.getMode()); + actMap.put("act_error",wasteFoilWeighingStationDriver.getError()); + actMap.put("act_move",wasteFoilWeighingStationDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "wasteFoilWeighingStationDriver", message,eptMap,actMap); } } else { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); @@ -820,6 +1085,15 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_mode",2); + eptMap.put("ept_action",1); + Map actMap = new HashMap<>(); + actMap.put("act_mode",manipulatorAgvStationDeviceDriver.getMode()); + actMap.put("act_action",manipulatorAgvStationDeviceDriver.getAction()); + recordTaskStuckReason(carno,agvStatus, device_code, "manipulatorAgvStationDeviceDriver", message,eptMap,actMap); } } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); @@ -845,6 +1119,17 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_error",0); + eptMap.put("ept_mode",2); + eptMap.put("ept_action",1); + Map actMap = new HashMap<>(); + actMap.put("act_error",paperTubePickSiteDeviceDriver.getError()); + actMap.put("act_mode",paperTubePickSiteDeviceDriver.getMode()); + actMap.put("act_action",paperTubePickSiteDeviceDriver.getAction()); + recordTaskStuckReason(carno,agvStatus, device_code, "paperTubePickSiteDeviceDriver", message,eptMap,actMap); } } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); @@ -869,6 +1154,14 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_move",1); + Map actMap = new HashMap<>(); + actMap.put("act_move",hongXiangStationDeviceDriver.getError()); + + recordTaskStuckReason(carno,agvStatus, device_code, "paperTubePickSiteDeviceDriver", message,eptMap,actMap); } } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); @@ -894,6 +1187,20 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",1); + eptMap.put("ept_mode",null); + eptMap.put("ept_error",0); + eptMap.put("ept_move",1); + Map actMap = new HashMap<>(); + actMap.put("act_action",standardInspectSiteDeviceDriver.getAction()); + actMap.put("act_mode",standardInspectSiteDeviceDriver.getMode()); + actMap.put("act_error",standardInspectSiteDeviceDriver.getError()); + actMap.put("act_move",standardInspectSiteDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "standardInspectSiteDeviceDriver", message,eptMap,actMap); + } }/* else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) { rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver(); @@ -1024,7 +1331,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); - } + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",1); + eptMap.put("ept_mode",2); + eptMap.put("ept_error",null); + eptMap.put("ept_move",null); + Map actMap = new HashMap<>(); + actMap.put("act_action",manipulatorAgvStationDeviceDriver.getAction()); + actMap.put("act_mode",manipulatorAgvStationDeviceDriver.getMode()); + // actMap.put("act_error",manipulatorAgvStationDeviceDriver.getError()); + // actMap.put("act_move",manipulatorAgvStationDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "manipulatorAgvStationDeviceDriver", message,eptMap,actMap); } } } else if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, next_device_code)) { if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { @@ -1051,7 +1370,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); - } + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",1); + eptMap.put("ept_mode",2); + eptMap.put("ept_error",null); + eptMap.put("ept_move",null); + Map actMap = new HashMap<>(); + actMap.put("act_action",manipulatorAgvStationDeviceDriver.getAction()); + actMap.put("act_mode",manipulatorAgvStationDeviceDriver.getMode()); + // actMap.put("act_error",manipulatorAgvStationDeviceDriver.getError()); + // actMap.put("act_move",manipulatorAgvStationDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "manipulatorAgvStationDeviceDriver", message,eptMap,actMap); } } } else if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, start_device_code2)) { if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { @@ -1078,7 +1409,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); - } + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",1); + eptMap.put("ept_mode",2); + eptMap.put("ept_error",null); + eptMap.put("ept_move",null); + Map actMap = new HashMap<>(); + actMap.put("act_action",manipulatorAgvStationDeviceDriver.getAction()); + actMap.put("act_mode",manipulatorAgvStationDeviceDriver.getMode()); + // actMap.put("act_error",manipulatorAgvStationDeviceDriver.getError()); + // actMap.put("act_move",manipulatorAgvStationDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "manipulatorAgvStationDeviceDriver", message,eptMap,actMap); } } } else if (ObjectUtil.isNotEmpty(start_device_code) && StrUtil.equals(device_code, next_device_code2)) { if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { @@ -1105,7 +1448,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); - } + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",1); + eptMap.put("ept_mode",2); + eptMap.put("ept_error",null); + eptMap.put("ept_move",null); + Map actMap = new HashMap<>(); + actMap.put("act_action",manipulatorAgvStationDeviceDriver.getAction()); + actMap.put("act_mode",manipulatorAgvStationDeviceDriver.getMode()); + // actMap.put("act_error",manipulatorAgvStationDeviceDriver.getError()); + // actMap.put("act_move",manipulatorAgvStationDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "manipulatorAgvStationDeviceDriver", message,eptMap,actMap); } } } // else { @@ -1220,6 +1575,13 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_move",0); + Map actMap = new HashMap<>(); + actMap.put("act_move",hongXiangStationDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "hongXiangStationDeviceDriver", message,eptMap,actMap); } } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); @@ -1256,7 +1618,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); - } + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",0); + eptMap.put("ept_mode",2); + eptMap.put("ept_error",null); + eptMap.put("ept_move",null); + Map actMap = new HashMap<>(); + actMap.put("act_action",manipulatorAgvStationDeviceDriver.getAction()); + actMap.put("act_mode",manipulatorAgvStationDeviceDriver.getMode()); + // actMap.put("act_error",manipulatorAgvStationDeviceDriver.getError()); + // actMap.put("act_move",manipulatorAgvStationDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "manipulatorAgvStationDeviceDriver", message,eptMap,actMap); } } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); try { @@ -1281,6 +1655,20 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",1); + eptMap.put("ept_mode",2); + eptMap.put("ept_error",0); + eptMap.put("ept_move",null); + Map actMap = new HashMap<>(); + actMap.put("act_action",paperTubePickSiteDeviceDriver.getAction()); + actMap.put("act_mode",paperTubePickSiteDeviceDriver.getMode()); + actMap.put("act_error",paperTubePickSiteDeviceDriver.getError()); + actMap.put("act_move",paperTubePickSiteDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "paperTubePickSiteDeviceDriver", message,eptMap,actMap); + } } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); @@ -1306,6 +1694,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",1); + eptMap.put("ept_mode",null); + eptMap.put("ept_error",0); + eptMap.put("ept_move",1); + Map actMap = new HashMap<>(); + actMap.put("act_action",standardInspectSiteDeviceDriver.getAction()); + actMap.put("act_mode",standardInspectSiteDeviceDriver.getMode()); + actMap.put("act_error",standardInspectSiteDeviceDriver.getError()); + actMap.put("act_move",standardInspectSiteDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "standardInspectSiteDeviceDriver", message,eptMap,actMap); } } else { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); @@ -1431,6 +1832,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",1); + eptMap.put("ept_mode",2); + eptMap.put("ept_error",0); + eptMap.put("ept_move",null); + Map actMap = new HashMap<>(); + actMap.put("act_action",paperTubePickSiteDeviceDriver.getAction()); + actMap.put("act_mode",paperTubePickSiteDeviceDriver.getMode()); + actMap.put("act_error",paperTubePickSiteDeviceDriver.getError()); + actMap.put("act_move",paperTubePickSiteDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "paperTubePickSiteDeviceDriver", message,eptMap,actMap); } } else if (device.getDeviceDriver() instanceof ManipulatorAgvStationDeviceDriver) { manipulatorAgvStationDeviceDriver = (ManipulatorAgvStationDeviceDriver) device.getDeviceDriver(); @@ -1457,7 +1871,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); - } + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",1); + eptMap.put("ept_mode",2); + eptMap.put("ept_error",null); + eptMap.put("ept_move",null); + Map actMap = new HashMap<>(); + actMap.put("act_action",manipulatorAgvStationDeviceDriver.getAction()); + actMap.put("act_mode",manipulatorAgvStationDeviceDriver.getMode()); + // actMap.put("act_error",manipulatorAgvStationDeviceDriver.getError()); + // actMap.put("act_move",manipulatorAgvStationDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "manipulatorAgvStationDeviceDriver", message,eptMap,actMap); } } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); try { @@ -1483,6 +1909,13 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_move",0); + Map actMap = new HashMap<>(); + actMap.put("act_move",hongXiangStationDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "hongXiangStationDeviceDriver", message,eptMap,actMap); } } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); @@ -1509,6 +1942,20 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",1); + eptMap.put("ept_mode",null); + eptMap.put("ept_error",0); + eptMap.put("ept_move",0); + Map actMap = new HashMap<>(); + actMap.put("act_action",standardInspectSiteDeviceDriver.getAction()); + actMap.put("act_mode",standardInspectSiteDeviceDriver.getMode()); + actMap.put("act_error",standardInspectSiteDeviceDriver.getError()); + actMap.put("act_move",standardInspectSiteDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "standardInspectSiteDeviceDriver", message,eptMap,actMap); + } }/* else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) { rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver(); @@ -1589,6 +2036,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",1); + eptMap.put("ept_mode",2); + eptMap.put("ept_error",0); + eptMap.put("ept_move",0); + Map actMap = new HashMap<>(); + actMap.put("act_action",wasteFoilWeighingStationDriver.getAction()); + actMap.put("act_mode",wasteFoilWeighingStationDriver.getMode()); + actMap.put("act_error",wasteFoilWeighingStationDriver.getError()); + actMap.put("act_move",wasteFoilWeighingStationDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "wasteFoilWeighingStationDriver", message,eptMap,actMap); } } else { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); @@ -1686,7 +2146,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); - } + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",0); + eptMap.put("ept_mode",2); + eptMap.put("ept_error",null); + eptMap.put("ept_move",null); + Map actMap = new HashMap<>(); + actMap.put("act_action",manipulatorAgvStationDeviceDriver.getAction()); + actMap.put("act_mode",manipulatorAgvStationDeviceDriver.getMode()); + // actMap.put("act_error",manipulatorAgvStationDeviceDriver.getError()); + // actMap.put("act_move",manipulatorAgvStationDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "manipulatorAgvStationDeviceDriver", message,eptMap,actMap); } } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); try { @@ -1712,6 +2184,13 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_move",1); + Map actMap = new HashMap<>(); + actMap.put("act_move",hongXiangStationDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "hongXiangStationDeviceDriver", message,eptMap,actMap); } } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); @@ -1773,6 +2252,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",0); + eptMap.put("ept_mode",2); + eptMap.put("ept_error",0); + eptMap.put("ept_move",null); + Map actMap = new HashMap<>(); + actMap.put("act_action",paperTubePickSiteDeviceDriver.getAction()); + actMap.put("act_mode",paperTubePickSiteDeviceDriver.getMode()); + actMap.put("act_error",paperTubePickSiteDeviceDriver.getError()); + actMap.put("act_move",paperTubePickSiteDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "paperTubePickSiteDeviceDriver", message,eptMap,actMap); } } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); @@ -1797,6 +2289,17 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_move",1); + Map actMap = new HashMap<>(); + actMap.put("act_action",standardInspectSiteDeviceDriver.getAction()); + actMap.put("act_mode",standardInspectSiteDeviceDriver.getMode()); + actMap.put("act_error",standardInspectSiteDeviceDriver.getError()); + actMap.put("act_move",standardInspectSiteDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "standardInspectSiteDeviceDriver", message,eptMap,actMap); + } } else if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) { wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver(); @@ -1826,6 +2329,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",1); + eptMap.put("ept_mode",2); + eptMap.put("ept_error",0); + eptMap.put("ept_move",1); + Map actMap = new HashMap<>(); + actMap.put("act_action",wasteFoilWeighingStationDriver.getAction()); + actMap.put("act_mode",wasteFoilWeighingStationDriver.getMode()); + actMap.put("act_error",wasteFoilWeighingStationDriver.getError()); + actMap.put("act_move",wasteFoilWeighingStationDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "wasteFoilWeighingStationDriver", message,eptMap,actMap); } } else { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); @@ -1927,7 +2443,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); - } + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",1); + eptMap.put("ept_mode",2); + eptMap.put("ept_error",null); + eptMap.put("ept_move",null); + Map actMap = new HashMap<>(); + actMap.put("act_action",manipulatorAgvStationDeviceDriver.getAction()); + actMap.put("act_mode",manipulatorAgvStationDeviceDriver.getMode()); + // actMap.put("act_error",manipulatorAgvStationDeviceDriver.getError()); + // actMap.put("act_move",manipulatorAgvStationDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "manipulatorAgvStationDeviceDriver", message,eptMap,actMap); } } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); try { @@ -1953,6 +2481,13 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_move",0); + Map actMap = new HashMap<>(); + actMap.put("act_move",hongXiangStationDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "hongXiangStationDeviceDriver", message,eptMap,actMap); } } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); @@ -1980,6 +2515,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",1); + eptMap.put("ept_mode",2); + eptMap.put("ept_error",0); + eptMap.put("ept_move",null); + Map actMap = new HashMap<>(); + actMap.put("act_action",paperTubePickSiteDeviceDriver.getAction()); + actMap.put("act_mode",paperTubePickSiteDeviceDriver.getMode()); + actMap.put("act_error",paperTubePickSiteDeviceDriver.getError()); + actMap.put("act_move",paperTubePickSiteDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "paperTubePickSiteDeviceDriver", message,eptMap,actMap); } } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); @@ -2006,6 +2554,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",1); + eptMap.put("ept_mode",null); + eptMap.put("ept_error",0); + eptMap.put("ept_move",0); + Map actMap = new HashMap<>(); + actMap.put("act_action",standardInspectSiteDeviceDriver.getAction()); + actMap.put("act_mode",standardInspectSiteDeviceDriver.getMode()); + actMap.put("act_error",standardInspectSiteDeviceDriver.getError()); + actMap.put("act_move",standardInspectSiteDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "standardInspectSiteDeviceDriver", message,eptMap,actMap); } }/* else if (device.getDeviceDriver() instanceof RangingStationsDeviceDriver) { rangingStationsDeviceDriver = (RangingStationsDeviceDriver) device.getDeviceDriver(); @@ -2161,7 +2722,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); - } + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",0); + eptMap.put("ept_mode",2); + eptMap.put("ept_error",null); + eptMap.put("ept_move",null); + Map actMap = new HashMap<>(); + actMap.put("act_action",manipulatorAgvStationDeviceDriver.getAction()); + actMap.put("act_mode",manipulatorAgvStationDeviceDriver.getMode()); + // actMap.put("act_error",manipulatorAgvStationDeviceDriver.getError()); + // actMap.put("act_move",manipulatorAgvStationDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "manipulatorAgvStationDeviceDriver", message,eptMap,actMap); } } else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) { paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver(); try { @@ -2188,6 +2761,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",1); + eptMap.put("ept_mode",2); + eptMap.put("ept_error",0); + eptMap.put("ept_move",null); + Map actMap = new HashMap<>(); + actMap.put("act_action",paperTubePickSiteDeviceDriver.getAction()); + actMap.put("act_mode",paperTubePickSiteDeviceDriver.getMode()); + actMap.put("act_error",paperTubePickSiteDeviceDriver.getError()); + actMap.put("act_move",paperTubePickSiteDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "paperTubePickSiteDeviceDriver", message,eptMap,actMap); } } else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) { hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver(); @@ -2214,6 +2800,14 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_move",1); + Map actMap = new HashMap<>(); + actMap.put("act_move",hongXiangStationDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "hongXiangStationDeviceDriver", message,eptMap,actMap); + } } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); @@ -2238,6 +2832,19 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + + // 记录任务卡住原因 + Map eptMap = new HashMap<>(); + eptMap.put("ept_action",1); + eptMap.put("ept_mode",null); + eptMap.put("ept_error",0); + eptMap.put("ept_move",1); + Map actMap = new HashMap<>(); + actMap.put("act_action",standardInspectSiteDeviceDriver.getAction()); + actMap.put("act_mode",standardInspectSiteDeviceDriver.getMode()); + actMap.put("act_error",standardInspectSiteDeviceDriver.getError()); + actMap.put("act_move",standardInspectSiteDeviceDriver.getMove()); + recordTaskStuckReason(carno,agvStatus, device_code, "standardInspectSiteDeviceDriver", message,eptMap,actMap); } } else { data = ndcAgvService.sendAgvTwoModeInst(phase, index, 0, 0, 0); diff --git a/acs2/nladmin-ui/src/views/screen/twoFloorAgvScreen.vue b/acs2/nladmin-ui/src/views/screen/twoFloorAgvScreen.vue new file mode 100644 index 000000000..ed30e65b2 --- /dev/null +++ b/acs2/nladmin-ui/src/views/screen/twoFloorAgvScreen.vue @@ -0,0 +1,395 @@ + + + + + From 01a23d21e03449137536c6b62a3588aacfb8823c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E6=97=AD=E6=98=8E=5C73939?= <739390650@QQ.COM> Date: Mon, 26 Jan 2026 09:39:50 +0800 Subject: [PATCH 2/2] =?UTF-8?q?opt:agv=E7=9C=8B=E6=9D=BF=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/TwoFloorAgvStatusService.java | 98 ++++++------------- .../agv/ndctwo/AgvNdcTwoDeviceDriver.java | 45 +++++++++ 2 files changed, 75 insertions(+), 68 deletions(-) diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/service/impl/TwoFloorAgvStatusService.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/service/impl/TwoFloorAgvStatusService.java index 727ec94b1..25f8fe4f8 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/service/impl/TwoFloorAgvStatusService.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/agv/service/impl/TwoFloorAgvStatusService.java @@ -9,6 +9,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; /** * 二楼AGV状态管理服务 @@ -16,15 +17,15 @@ import java.util.Map; */ @Service public class TwoFloorAgvStatusService { - + @Autowired private TwoAgvPhase twoAgvPhase; - + /** * 存储AGV状态信息,key为AGV车辆代码 */ - private Map agvStatusMap = new HashMap<>(); - + private ConcurrentHashMap agvStatusMap = new ConcurrentHashMap<>(); + /** * 初始化AGV状态 */ @@ -41,32 +42,29 @@ public class TwoFloorAgvStatusService { agvStatusMap.put(vehicleCode, agvStatus); } } - + /** * 更新AGV状态 * @param agvStatus AGV状态信息 */ - public void updateAgvStatus(TwoFloorAgvStatus agvStatus) { + public synchronized void updateAgvStatus(TwoFloorAgvStatus agvStatus) { if (agvStatus == null || agvStatus.getVehicle_code() == null) { return; } - + // 处理阶段名称 if (agvStatus.getPhase() != null) { String phaseName = twoAgvPhase.getPhaseName(agvStatus.getPhase()); agvStatus.setPhase_name(phaseName); } - + // 处理状态文本 this.handleStatusText(agvStatus); - + // 更新状态 agvStatusMap.put(agvStatus.getVehicle_code(), agvStatus); - - // 推送状态更新 - this.pushAgvStatusUpdate(); } - + /** * 处理AGV状态文本 */ @@ -90,7 +88,7 @@ public class TwoFloorAgvStatusService { break; } } - + /** * 获取单个AGV状态 * @param vehicleCode AGV车辆代码 @@ -99,7 +97,7 @@ public class TwoFloorAgvStatusService { public TwoFloorAgvStatus getAgvStatus(String vehicleCode) { return agvStatusMap.get(vehicleCode); } - + /** * 获取所有AGV状态 * @return 所有AGV状态列表 @@ -107,60 +105,12 @@ public class TwoFloorAgvStatusService { public List getAllAgvStatus() { return new ArrayList<>(agvStatusMap.values()); } - - /** - * 更新AGV状态后不需要推送,由前端通过HTTP接口主动查询 - */ - public void pushAgvStatusUpdate() { - // 改为HTTP接口后,不再需要主动推送 - // 前端会通过定时请求获取最新状态 - } - - /** - * 更新AGV任务信息 - */ - public void updateAgvTaskInfo(String vehicleCode, String taskCode, String instCode) { - TwoFloorAgvStatus agvStatus = agvStatusMap.get(vehicleCode); - if (agvStatus != null) { - agvStatus.setTask_code(taskCode); - agvStatus.setInst_code(instCode); - this.pushAgvStatusUpdate(); - } - } - - /** - * 更新AGV阶段信息 - */ - public void updateAgvPhase(String vehicleCode, Integer phase) { - TwoFloorAgvStatus agvStatus = agvStatusMap.get(vehicleCode); - if (agvStatus != null) { - agvStatus.setPhase(phase); - agvStatus.setPhase_name(twoAgvPhase.getPhaseName(phase)); - this.pushAgvStatusUpdate(); - } - } - - /** - * 更新AGV错误信息 - */ - public void updateAgvError(String vehicleCode, String errorCode, String errorMessage, String errorAction, String errorMode) { - TwoFloorAgvStatus agvStatus = agvStatusMap.get(vehicleCode); - if (agvStatus != null) { - agvStatus.setIs_error(true); - agvStatus.setError_code(errorCode); - agvStatus.setError_message(errorMessage); - agvStatus.setError_action(errorAction); - agvStatus.setError_mode(errorMode); - agvStatus.setStatus("error"); - agvStatus.setStatus_text("异常"); - this.pushAgvStatusUpdate(); - } - } - + /** * 清除AGV错误信息 */ - public void clearAgvError(String vehicleCode) { + public void clearAgvError(int carno) { + String vehicleCode = String.format("AGV%02d", carno); TwoFloorAgvStatus agvStatus = agvStatusMap.get(vehicleCode); if (agvStatus != null) { agvStatus.setIs_error(false); @@ -168,11 +118,23 @@ public class TwoFloorAgvStatusService { agvStatus.setError_message(null); agvStatus.setError_action(null); agvStatus.setError_mode(null); + // 设置错误信息 + agvStatus.setDriver(null); + agvStatus.setIs_error(false); + agvStatus.setError_message(null); + agvStatus.setDevice_code(null); + agvStatus.setError_action(null); + agvStatus.setError_mode(null); + agvStatus.setError_move(null); + agvStatus.setError_error(null); + agvStatus.setExp_action(null); + agvStatus.setExp_mode(null); + agvStatus.setExp_move(null); + agvStatus.setExp_error(null); if ("error".equals(agvStatus.getStatus())) { agvStatus.setStatus("idle"); agvStatus.setStatus_text("空闲"); } - this.pushAgvStatusUpdate(); } } -} \ No newline at end of file +} diff --git a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java index 0c761be7e..9056a70ef 100644 --- a/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java +++ b/acs2/nladmin-system/nlsso-server/src/main/java/org/nl/acs/device_driver/agv/ndctwo/AgvNdcTwoDeviceDriver.java @@ -257,6 +257,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic } public synchronized void processSocket(int[] arr) { + + //清空 + device_code = this.getDeviceCode(); byte[] data = null; phase = arr[16] * 256 + arr[17]; @@ -452,6 +455,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + "光电信号move:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号action:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; // 记录任务卡住原因 @@ -488,6 +492,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", manipulatorAgvStationDeviceDriver.getDeviceCode(), manipulatorAgvStationDeviceDriver.getAction(), ikey); LuceneLogDto logDto = LuceneLogDto.builder() @@ -524,6 +529,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + "无货不满足取货条件"; LuceneLogDto logDto = LuceneLogDto.builder() @@ -561,6 +567,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; LuceneLogDto logDto = LuceneLogDto.builder() @@ -655,6 +662,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } catch (Exception e) { e.printStackTrace(); } @@ -806,6 +814,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic luceneExecuteLogService.deviceExecuteLog(logDto1); acsToWmsService.actionFinishRequest2(jsonObject); } + agvStatusService.clearAgvError(carno); } else { // 记录任务卡住原因 Map eptMap = new HashMap<>(); @@ -837,6 +846,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",指令号:" + ikey + "不满足取货条件"; LuceneLogDto logDto = LuceneLogDto.builder() @@ -869,6 +879,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; LuceneLogDto logDto = LuceneLogDto.builder() @@ -907,6 +918,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; LuceneLogDto logDto = LuceneLogDto.builder() @@ -939,6 +951,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } catch (Exception e) { e.printStackTrace(); } @@ -1077,6 +1090,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; LuceneLogDto logDto = LuceneLogDto.builder() @@ -1111,6 +1125,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; LuceneLogDto logDto = LuceneLogDto.builder() @@ -1146,6 +1161,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",指令号:" + ikey + "不满足取货条件"; LuceneLogDto logDto = LuceneLogDto.builder() @@ -1179,6 +1195,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; LuceneLogDto logDto = LuceneLogDto.builder() @@ -1323,6 +1340,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; LuceneLogDto logDto = LuceneLogDto.builder() @@ -1362,6 +1380,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; LuceneLogDto logDto = LuceneLogDto.builder() @@ -1401,6 +1420,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; LuceneLogDto logDto = LuceneLogDto.builder() @@ -1440,6 +1460,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + manipulatorAgvStationDeviceDriver.getDevice_code() + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; LuceneLogDto logDto = LuceneLogDto.builder() @@ -1567,6 +1588,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",指令号:" + ikey + "不满足取货条件"; LuceneLogDto logDto = LuceneLogDto.builder() @@ -1598,6 +1620,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); String task_code = inst.getTask_code(); if (ObjectUtil.isNotEmpty(manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms")) && StrUtil.equals("true", manipulatorAgvStationDeviceDriver.getDevice().getExtraValue().get("feedbackToLms").toString())) { @@ -1647,6 +1670,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; LuceneLogDto logDto = LuceneLogDto.builder() @@ -1686,6 +1710,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; LuceneLogDto logDto = LuceneLogDto.builder() @@ -1822,6 +1847,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},设备状态{},不满足放货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() @@ -1862,6 +1888,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey); @@ -1899,6 +1926,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() @@ -1932,6 +1960,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足放货条件"; log.info("设备{}当前光电信号{},动作信号{} ,报警信号{},不满足放货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction() @@ -2023,6 +2052,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } catch (Exception e) { e.printStackTrace(); } @@ -2139,6 +2169,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { LuceneLogDto logDto = LuceneLogDto.builder() .device_code(manipulatorAgvStationDeviceDriver.getDevice_code()) @@ -2174,6 +2205,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足放货完成反馈,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() @@ -2241,6 +2273,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); paperTubePickSiteDeviceDriver.setFlag(3); } else { message = "设备号:" + device_code + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; @@ -2281,6 +2314,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",指令号:" + ikey + "不满足放货完成条件"; LuceneLogDto logDto = LuceneLogDto.builder() @@ -2316,6 +2350,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } catch (Exception e) { e.printStackTrace(); } @@ -2434,6 +2469,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + ",动作信号:" + manipulatorAgvStationDeviceDriver.getAction() + "报警信号:" + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{},动作信号{} ,不满足取货条件,指令号{}", device_code, manipulatorAgvStationDeviceDriver.getAction(), ikey); @@ -2471,6 +2507,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() @@ -2505,6 +2542,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() @@ -2544,6 +2582,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",动作信号:" + standardInspectSiteDeviceDriver.getAction() + "报警信号:" + standardInspectSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足放货条件"; log.info("设备{}当前光电信号{},动作信号{} ,报警信号{},不满足放货条件,指令号{}", device_code, standardInspectSiteDeviceDriver.getMove(), standardInspectSiteDeviceDriver.getAction() @@ -2715,6 +2754,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { LuceneLogDto logDto = LuceneLogDto.builder() .device_code(manipulatorAgvStationDeviceDriver.getDevice_code()) @@ -2751,6 +2791,9 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); + //清空状态 + } else { message = "设备号:" + device_code + "光电信号:" + paperTubePickSiteDeviceDriver.getMove() + ",动作信号:" + paperTubePickSiteDeviceDriver.getAction() + "报警信号:" + paperTubePickSiteDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, paperTubePickSiteDeviceDriver.getMove(), paperTubePickSiteDeviceDriver.getAction() @@ -2790,6 +2833,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + "光电信号:" + hongXiangStationDeviceDriver.getMove() + ",动作信号:" + hongXiangStationDeviceDriver.getAction() + "报警信号:" + hongXiangStationDeviceDriver.getError() + ",指令号:" + ikey + "不满足取货条件"; log.info("设备{}当前光电信号{},动作信号{} ,错误信号{},不满足取货条件,指令号{}", device_code, hongXiangStationDeviceDriver.getMove(), hongXiangStationDeviceDriver.getAction() @@ -2824,6 +2868,7 @@ public class AgvNdcTwoDeviceDriver extends AbstractDeviceDriver implements Devic .build(); logDto.setLog_level(4); luceneExecuteLogService.deviceExecuteLog(logDto); + agvStatusService.clearAgvError(carno); } else { message = "设备号:" + device_code + "光电信号:" + standardInspectSiteDeviceDriver.getMove() + ",指令号:" + ikey + "不满足放货完成条件"; LuceneLogDto logDto = LuceneLogDto.builder()