Browse Source

更新

master
gengby 2 years ago
parent
commit
871688ba8e
  1. 11
      acs/nladmin-system/src/main/java/org/nl/acs/agv/server/impl/XianGongAgvServiceImpl.java
  2. 6
      acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/QueryXZAgvDeviceStatus.java

11
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;
}

6
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();

Loading…
Cancel
Save