rev:页面优化

This commit is contained in:
2024-10-22 18:30:18 +08:00
parent d60e4e09c3
commit 8eaf155dd6
11 changed files with 64 additions and 18 deletions

View File

@@ -0,0 +1,31 @@
package org.nl.acs.agv;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
@Getter
@RequiredArgsConstructor
public enum XgAgvEnum {
APPLY_GET(1, "申请取货"),
APPLY_GET_SUCCESS(2, "取货完成"),
APPLY_PUT(3, "申请放货"),
APPLY_PUT_SUCCESS(4, "放货完成"),
SSX_MOVE_YES(0, "无货"),
SSX_MOVE_NO(1, "有货"),
SSX_ACTION_NOT_GET_PUT(0,"不允许取放"),
SSX_ACTION_GET(1,"允许取货"),
SSX_ACTION_PUT(2,"允许放货"),
GS_ACTION_YES(1,"允许"),
GS_ACTION_NOT(0,"不允许"),
GS_COMMAND_OUT(0,"离开"),
GS_COMMAND_IN(1,"进入"),
GS_COLOR_GREEN(4,"绿灯"),
GS_COLOR_RED(3,"红灯"),
;
private final int code;
private final String name;
}

View File

@@ -1,13 +1,19 @@
package org.nl.acs.agv.rest;
import cn.dev33.satoken.annotation.SaIgnore;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.unit.DataUnit;
import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.agv.server.XianGongAgvService;
import org.nl.modules.common.utils.SecurityUtils;
import org.nl.modules.logging.annotation.Log;
import org.nl.modules.wql.core.bean.WQLObject;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;

View File

@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.agv.XgAgvEnum;
import org.nl.acs.device_driver.basedriver.standard_conveyor_control.StandardCoveyorControlDeviceDriver;
import org.nl.acs.device_driver.sdk.PhotoelectricDetectionDeviceDriver;
import org.nl.acs.log.service.DeviceExecuteLogService;
@@ -44,9 +45,9 @@ public class AgvWaitUtil {
// 标准版输送线驱动
StandardCoveyorControlDeviceDriver driver = (StandardCoveyorControlDeviceDriver) device.getDeviceDriver();
// 通知输送线申请取货-1
driver.writing("toCommand",1);
driver.writing("toCommand",XgAgvEnum.APPLY_GET.getCode());
// 判断是否满足条件action = 1允许取货 && move = 1有货
if (driver.getMove() == 1 && driver.getAction() == 1) {
if (driver.getMove() == XgAgvEnum.SSX_ACTION_GET.getCode() && driver.getAction() == XgAgvEnum.SSX_MOVE_NO.getCode()) {
String message = "允许AGV取货。";
driver.setMessage(message);
this.deviceExecuteLogService.deviceExecuteLog(deviceCode, "", "", message);
@@ -83,8 +84,8 @@ public class AgvWaitUtil {
// 标准版输送线驱动
StandardCoveyorControlDeviceDriver driver = (StandardCoveyorControlDeviceDriver) device.getDeviceDriver();
// 通知输送线取货完成-2
driver.writing("toCommand",2);
if (driver.getMove() == 0) {
driver.writing("toCommand",XgAgvEnum.APPLY_GET_SUCCESS.getCode());
if (driver.getMove() == XgAgvEnum.SSX_MOVE_YES.getCode()) {
String message = "允许AGV取货后离开。";
driver.setMessage(message);
this.deviceExecuteLogService.deviceExecuteLog(deviceCode, "", "", message);
@@ -123,9 +124,9 @@ public class AgvWaitUtil {
// 标准版输送线驱动
StandardCoveyorControlDeviceDriver driver = (StandardCoveyorControlDeviceDriver) device.getDeviceDriver();
// 通知输送线申请放货-3
driver.writing("toCommand",3);
driver.writing("toCommand",XgAgvEnum.APPLY_PUT.getCode());
// 判断是否满足条件action = 2允许放货 && move = 0无货
if (driver.getMove() == 0 && driver.getAction() == 2) {
if (driver.getMove() == XgAgvEnum.SSX_MOVE_YES.getCode() && driver.getAction() == XgAgvEnum.SSX_ACTION_PUT.getCode()) {
String message = "允许AGV放货。";
driver.setMessage(message);
this.deviceExecuteLogService.deviceExecuteLog(deviceCode, "", "", message);
@@ -170,8 +171,8 @@ public class AgvWaitUtil {
// 标准版输送线驱动
StandardCoveyorControlDeviceDriver driver = (StandardCoveyorControlDeviceDriver) device.getDeviceDriver();
// 通知输送线放货完成-4
driver.writing("toCommand",4);
if (driver.getMove() == 1) {
driver.writing("toCommand",XgAgvEnum.APPLY_PUT_SUCCESS.getCode());
if (driver.getMove() == XgAgvEnum.SSX_MOVE_NO.getCode()) {
String message = "允许AGV放货后离开。";
driver.setMessage(message);
this.deviceExecuteLogService.deviceExecuteLog(deviceCode, "", "", message);

View File

@@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.agv.AgvUtil;
import org.nl.acs.agv.XgAgvEnum;
import org.nl.acs.agv.server.AgvWaitUtil;
import org.nl.acs.agv.server.XianGongAgvService;
import org.nl.acs.agv.server.dto.AgvDto;
@@ -148,11 +149,11 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
LampThreecolorDeviceDriver driver = (LampThreecolorDeviceDriver) device.getDeviceDriver();
// 给三色灯写入进入命令0-离开1-进入
String[] key = {"toCommand","toColor"};
Integer[] value = {1,3};
Integer[] value = {XgAgvEnum.GS_COMMAND_IN.getCode(),XgAgvEnum.GS_COLOR_RED.getCode()};
driver.writing(Arrays.asList(key),Arrays.asList(value));
// 判断是否允许进入 1-允许0-不允许
if (driver.getAction() == 1) {
// 判断是否允许进入 1-允许0-不允许 1
if (driver.getAction() == XgAgvEnum.GS_ACTION_YES.getCode()) {
// 记录车号
driver.setCar_no(reqParam.getString("robot_name"));
@@ -187,11 +188,11 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
LampThreecolorDeviceDriver driver = (LampThreecolorDeviceDriver) device.getDeviceDriver();
// 给三色灯写入进入命令0-离开1-进入
String[] key = {"toCommand","toColor"};
Integer[] value = {0,Integer.parseInt(device.getExtraValue().get("color").toString())};
Integer[] value = {XgAgvEnum.GS_COMMAND_OUT.getCode(),Integer.parseInt(device.getExtraValue().get("color").toString())};
driver.writing(Arrays.asList(key),Arrays.asList(value));
// 判断是否允许离开 1-允许0-不允许
if (driver.getAction() == 1) {
if (driver.getAction() == XgAgvEnum.GS_ACTION_YES.getCode()) {
// 判断是否清楚车号
if (device.getExtraValue().get("is_clean").toString().equals("1")) {
driver.setCar_no("");