Browse Source

接口fix

master
pangshenghao 1 year ago
parent
commit
63ce1f0110
  1. 8
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java
  2. 20
      acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/ToAgvDevice.java

8
acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java

@ -8,6 +8,7 @@ import cn.hutool.http.HttpResponse;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.AcsConfig;
@ -239,11 +240,12 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
String methods_url = addressDto.getMethods_url();
String url = wmsUrl + methods_url;
HttpResponse result = null;
log.info("feedbackAgv----请求参数{}", from);
String formString =from.toJSONString(from, SerializerFeature.DisableCircularReferenceDetect);
System.out.println(formString);
log.info("feedbackAgv----请求参数{}", formString);
try {
result = HttpRequest.post(url)
.body(String.valueOf(from))
.body(formString)
.execute();
System.out.println(result);
log.info("feedbackAgv----返回参数{}", result);

20
acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/ToAgvDevice.java

@ -4,20 +4,15 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.agv.server.AgvService;
import org.nl.acs.agv.server.dto.AgvDto;
import org.nl.acs.device_driver.basedriver.agv.ndcone.AgvNdcOneDeviceDriver;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.opc.Device;
import org.nl.acs.opc.DeviceAppService;
import org.nl.acs.opc.DeviceType;
import org.nl.modules.mnt.websocket.MsgType;
import org.nl.modules.mnt.websocket.SocketMsg;
import org.nl.modules.mnt.websocket.WebSocketServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
/**
* 查询AGV设备状态
@ -42,8 +37,8 @@ public class ToAgvDevice {
for(Device device:deviceList) {
if (device.getDeviceDriver() instanceof AgvNdcOneDeviceDriver) {
agvNdcOneDeviceDriver = (AgvNdcOneDeviceDriver) device.getDeviceDriver();
row.put("device_code", agvNdcOneDeviceDriver.getDevice_code());
row.put("energyLevel", agvNdcOneDeviceDriver.getElectric_qty());
row.put("device_code", String.valueOf(device.getDevice_code()));
row.put("energyLevel", String.valueOf(agvNdcOneDeviceDriver.getElectric_qty()));
// 车状态:
// 1:关机
// 2:运行中
@ -75,10 +70,10 @@ public class ToAgvDevice {
// row.put("status_name", "低电量");
}
row.put("transportOrder", agvNdcOneDeviceDriver.getOrder());
row.put("positionX", agvNdcOneDeviceDriver.getX());
row.put("positionY", agvNdcOneDeviceDriver.getY());
row.put("positionAngle", agvNdcOneDeviceDriver.getAngle());
row.put("transportOrder", String.valueOf(agvNdcOneDeviceDriver.getOrder()));
row.put("positionX", String.valueOf(agvNdcOneDeviceDriver.getX()));
row.put("positionY", String.valueOf(agvNdcOneDeviceDriver.getY()));
row.put("positionAngle", String.valueOf(agvNdcOneDeviceDriver.getAngle()));
agv_rows.add(row);
}
@ -87,9 +82,6 @@ public class ToAgvDevice {
}catch (Exception e){
System.out.println(e.getMessage());
}
System.out.println(agv_rows.toString());
acsToWmsService.feedbackAgv(agv_rows);
}

Loading…
Cancel
Save