From 9b2b2bfd0f369526596e48a8e0f5dab492a8b154 Mon Sep 17 00:00:00 2001 From: liuxy Date: Wed, 8 Jan 2025 08:55:06 +0800 Subject: [PATCH] =?UTF-8?q?rev=EF=BC=9Aagv=E6=80=A5=E5=81=9C=E5=90=8E?= =?UTF-8?q?=E5=A4=8D=E4=BD=8D=EF=BC=9A=E5=85=89=E6=A0=85=E5=A4=8D=E4=BD=8D?= =?UTF-8?q?=E5=90=8E=E6=88=91=E8=AF=BB=E4=BF=A1=E5=8F=B7=E4=B8=BA5?= =?UTF-8?q?=E5=90=8E=E8=BF=94=E5=9B=9E=E5=85=89=E6=A0=85=E4=BF=A1=E5=8F=B7?= =?UTF-8?q?5=E5=90=8C=E6=97=B6=E5=91=8A=E8=AF=89agv=E5=8F=AF=E7=BB=A7?= =?UTF-8?q?=E7=BB=AD=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nl/acs/agv/server/XianGongAgvService.java | 9 ++++++++ .../server/impl/XianGongAgvServiceImpl.java | 6 +++++ .../LampThreecolorDeviceDriver.java | 22 +++++++++++++++++++ 3 files changed, 37 insertions(+) diff --git a/acs2/nladmin-system/src/main/java/org/nl/acs/agv/server/XianGongAgvService.java b/acs2/nladmin-system/src/main/java/org/nl/acs/agv/server/XianGongAgvService.java index f817781..9c0f21a 100644 --- a/acs2/nladmin-system/src/main/java/org/nl/acs/agv/server/XianGongAgvService.java +++ b/acs2/nladmin-system/src/main/java/org/nl/acs/agv/server/XianGongAgvService.java @@ -174,6 +174,15 @@ public interface XianGongAgvService { */ public UnifiedResponse sendOrderStopToXZ(JSONObject requestParam); + /** + * 下发运单继续 + * + * @param requestParam + * @return + * @throws Exception + */ + public UnifiedResponse sendOrderContinueToXZ(JSONObject requestParam); + /** * 请求开/关自动门 * @param requestParam { diff --git a/acs2/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java b/acs2/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java index 980d1e5..d721545 100644 --- a/acs2/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java +++ b/acs2/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java @@ -996,6 +996,12 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { return xgHttpUtil.sendPostRequest(path, json); } + @Override + public UnifiedResponse sendOrderContinueToXZ(JSONObject json) { + String path = "/gotoSiteResume"; + return xgHttpUtil.sendPostRequest(path, json); + } + @Override public JSONObject controlDoor(JSONObject requestParam) { log.info("仙工AGV请求开/关自动门,请求参数 - {}", requestParam); diff --git a/acs2/nladmin-system/src/main/java/org/nl/acs/device_driver/lamp_three_color/LampThreecolorDeviceDriver.java b/acs2/nladmin-system/src/main/java/org/nl/acs/device_driver/lamp_three_color/LampThreecolorDeviceDriver.java index 896ed56..267d19c 100644 --- a/acs2/nladmin-system/src/main/java/org/nl/acs/device_driver/lamp_three_color/LampThreecolorDeviceDriver.java +++ b/acs2/nladmin-system/src/main/java/org/nl/acs/device_driver/lamp_three_color/LampThreecolorDeviceDriver.java @@ -6,6 +6,7 @@ import lombok.Getter; import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.extern.slf4j.Slf4j; +import org.nl.acs.agv.XgAgvEnum; import org.nl.acs.agv.server.impl.XianGongAgvServiceImpl; import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.DeviceDriverBaseReader; @@ -20,6 +21,8 @@ import org.nl.modules.lucene.service.LuceneExecuteLogService; import org.nl.modules.lucene.service.dto.LuceneLogDto; import org.nl.modules.wql.util.SpringContextHolder; +import java.util.Arrays; + @Slf4j @Getter @Setter @@ -144,6 +147,7 @@ public class LampThreecolorDeviceDriver extends AbstractOpcDeviceDriver implemen } private void executeLogicBefore() { + // 告诉agv急停 if (error == 1 && ObjectUtil.isNotEmpty(car_no)) { String[] carArr = {car_no}; JSONObject json = new JSONObject(); @@ -153,6 +157,24 @@ public class LampThreecolorDeviceDriver extends AbstractOpcDeviceDriver implemen //创建订单序列 xianGongAgv.sendOrderStopToXZ(json); } + + // 给光栅下发命令5 + if (error == 5) { + String[] key = {"toCommand"}; + Integer[] value = {5}; + writing(Arrays.asList(key),Arrays.asList(value)); + + // 如果车号不为空则告诉agv继续作业 + if (ObjectUtil.isNotEmpty(car_no)) { + String[] carArr = {car_no}; + JSONObject json = new JSONObject(); + json.put("vehicles", carArr); + // 请求下发agv继续 + XianGongAgvServiceImpl xianGongAgv = SpringContextHolder.getBean(XianGongAgvServiceImpl.class); + //创建订单序列 + xianGongAgv.sendOrderContinueToXZ(json); + } + } } @Override