From 871688ba8e76ee536c580b337843875bbcec8d4b Mon Sep 17 00:00:00 2001 From: gengby <858962040@qq.com> Date: Thu, 22 Dec 2022 11:31:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../acs/agv/server/impl/XianGongAgvServiceImpl.java | 11 ++++++----- .../modules/quartz/task/QueryXZAgvDeviceStatus.java | 6 ++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java index 6bf2c6f..a833e57 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java @@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpResponse; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; @@ -455,21 +456,21 @@ public class XianGongAgvServiceImpl implements XianGongAgvService { String agvurl = paramService.findByCode(AcsConfig.AGVURL).getValue(); String agvport = paramService.findByCode(AcsConfig.AGVPORT).getValue(); agvurl = agvurl + ":" + agvport + "/blockGroupStatus"; - log.info("获取互斥组参数:{},请求路径:{}", String.valueOf(param), agvurl); + log.info("获取互斥组参数:{},请求路径:{},请求参数:{}", String.valueOf(param), agvurl, String.valueOf(param)); try { - HttpResponse result = HttpRequest.get(agvurl) - .body(String.valueOf(param))//表单内容 + HttpResponse result = HttpRequest.post(agvurl) + .body(JSON.toJSONString(param))//表单内容 .timeout(20000)//超时,毫秒 .execute(); String body = result.body(); if (StrUtil.isNotEmpty(body)) { JSONArray jsonArray = JSONArray.parseArray(result.body()); - log.info("获取互斥组参数:{},请求路径:{},响应参数{}", String.valueOf(param), agvurl, String.valueOf(jsonArray)); + log.info("获取互斥组参数:{},请求路径:{},请求参数:{},响应参数{}", String.valueOf(param), agvurl, String.valueOf(param), String.valueOf(jsonArray)); return jsonArray; } return null; } catch (Exception e) { - log.info("获取互斥组参数:{},请求路径:{},响应参数{}", String.valueOf(param), agvurl, e.getMessage()); + log.error("获取互斥组参数:{},请求路径:{},请求参数:{},响应参数{}", String.valueOf(param), agvurl, String.valueOf(param), e.getMessage()); return null; } diff --git a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXZAgvDeviceStatus.java b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXZAgvDeviceStatus.java index a905807..5a01e58 100644 --- a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXZAgvDeviceStatus.java +++ b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXZAgvDeviceStatus.java @@ -129,6 +129,9 @@ public class QueryXZAgvDeviceStatus { if (status) { String name = jsonObject.getString("name"); Device device = deviceAppService.findDeviceByCode(name); + if (ObjectUtil.isEmpty(device)) { + continue; + } MaGangLedDeviceDriver maGangLedDeviceDriver; if (device.getDeviceDriver() instanceof MaGangLedDeviceDriver) { maGangLedDeviceDriver = (MaGangLedDeviceDriver) device.getDeviceDriver(); @@ -137,6 +140,9 @@ public class QueryXZAgvDeviceStatus { } else { String name = jsonObject.getString("name"); Device device = deviceAppService.findDeviceByCode(name); + if (ObjectUtil.isEmpty(device)) { + continue; + } MaGangLedDeviceDriver maGangLedDeviceDriver; if (device.getDeviceDriver() instanceof MaGangLedDeviceDriver) { maGangLedDeviceDriver = (MaGangLedDeviceDriver) device.getDeviceDriver();