rev queryDevice接口

This commit is contained in:
张江玮
2023-08-21 17:54:42 +08:00
parent 1039a62ee7
commit 468739ecf3

View File

@@ -25,9 +25,14 @@ import org.nl.acs.device_driver.basedriver.empty_vehicle_stacking_position.Empty
import org.nl.acs.device_driver.basedriver.hongxiang_conveyor.HongXiangStationDeviceDriver;
import org.nl.acs.device_driver.basedriver.hongxiang_device.HongXiangConveyorDeviceDriver;
import org.nl.acs.device_driver.basedriver.lamp_three_color.LampThreecolorDeviceDriver;
import org.nl.acs.device_driver.basedriver.oven_manipulator.OvenGantryManipulatorDeviceDriver;
import org.nl.acs.device_driver.basedriver.paper_tube_device.PaperTubeConveyorDeviceDriver;
import org.nl.acs.device_driver.basedriver.plug_pull_device_site.PlugPullDeviceSiteDeviceDriver;
import org.nl.acs.device_driver.basedriver.siemens_conveyor.SiemensConveyorDeviceDriver;
import org.nl.acs.device_driver.basedriver.siemens_conveyor_ckk.SiemensConveyorCkkDeviceDriver;
import org.nl.acs.device_driver.basedriver.siemens_conveyor_labeling.SiemensConveyorLabelingDeviceDriver;
import org.nl.acs.device_driver.basedriver.siemens_onefloor_agv_conveyor.SiemensOneFloorAGVConveyorDeviceDriver;
import org.nl.acs.device_driver.basedriver.slit_two_manipulator.SlitTwoManipulatorDeviceDriver;
import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver;
import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDefination;
import org.nl.acs.device_driver.basedriver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
@@ -261,6 +266,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) device.getDeviceDriver();
jo.put("device_code", parent_device_code);
jo.put("mode", hongXiangConveyorDeviceDriver.getMode());
jo.put("status", Math.min(3, hongXiangConveyorDeviceDriver.getMode()));
jo.put("move", hongXiangConveyorDeviceDriver.getMove());
jo.put("countdown_house", hongXiangConveyorDeviceDriver.getCountdown_house());
jo.put("countdown_min", hongXiangConveyorDeviceDriver.getCountdown_min());
@@ -273,6 +279,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
jo.put("finish", hongXiangConveyorDeviceDriver.getFinish());
jo.put("task", hongXiangConveyorDeviceDriver.getTask());
jo.put("error", hongXiangConveyorDeviceDriver.getError());
jo.put("isError", hongXiangConveyorDeviceDriver.getError());
} else if (device.getDeviceDriver() instanceof StandardCoveyorControlWithScannerDeviceDriver) {
standardCoveyorControlWithScannerDeviceDriver = (StandardCoveyorControlWithScannerDeviceDriver) device.getDeviceDriver();
jo.put("device_code", parent_device_code);
@@ -297,12 +304,68 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
jo.put("y", deviceStatusDeviceDriver.getY());
jo.put("power", deviceStatusDeviceDriver.getPower());
jo.put("error", deviceStatusDeviceDriver.getAlarm());
jo.put("error_name", ErrorUtil.getDictDetail("rgv_error_type", String.valueOf(deviceStatusDeviceDriver.getAlarm())));
String errorInfo = ErrorUtil.getDictDetail("rgv_error_type", String.valueOf(deviceStatusDeviceDriver.getAlarm()));
jo.put("error_name", errorInfo);
jo.put("error_msg", errorInfo);
//楼层
jo.put("map_id", deviceStatusDeviceDriver.getMap_id());
jo.put("z", deviceStatusDeviceDriver.getMap_id());
jo.put("pallet", deviceStatusDeviceDriver.getPallet());
jo.put("move", deviceStatusDeviceDriver.getHasGoods()==false?0:1);
jo.put("move", deviceStatusDeviceDriver.getHasGoods() == false ? 0 : 1);
jo.put("status", StrUtil.isBlank(deviceStatusDeviceDriver.getTask_id()) ? 2 : 3);
} else if (device.getDeviceDriver() instanceof AgvNdcOneDeviceDriver) {
AgvNdcOneDeviceDriver driver = (AgvNdcOneDeviceDriver) device.getDeviceDriver();
jo.put("device_code", driver.getDevice().getDevice_code());
jo.put("device_name", driver.getDevice().getDevice_name());
jo.put("status", driver.getStatus());
jo.put("power", driver.getElectric_qty());
jo.put("error", driver.getError());
jo.put("error_msg", driver.getError() == 0 ? "" : driver.getError_message());
} else if (device.getDeviceDriver() instanceof OvenGantryManipulatorDeviceDriver) {
OvenGantryManipulatorDeviceDriver driver = (OvenGantryManipulatorDeviceDriver) device.getDeviceDriver();
jo.put("device_code", driver.getDevice().getDevice_code());
jo.put("device_name", driver.getDevice().getDevice_name());
jo.put("status", Math.min(3, driver.getMode()));
jo.put("y", driver.getWalk_y());
jo.put("error", driver.getError());
jo.put("error_msg", driver.getError() == 0 ? "" : ErrorUtil.getDictDetail("hxhj_error_type", String.valueOf(driver.getError())));
} else if (device.getDeviceDriver() instanceof SlitTwoManipulatorDeviceDriver) {
SlitTwoManipulatorDeviceDriver driver = (SlitTwoManipulatorDeviceDriver) device.getDeviceDriver();
jo.put("device_code", driver.getDevice().getDevice_code());
jo.put("device_name", driver.getDevice().getDevice_name());
jo.put("status", Math.min(3, driver.getMode()));
jo.put("y", driver.getWalk_y());
jo.put("error", driver.getError());
jo.put("error_msg", driver.getError() == 0 ? "" : ErrorUtil.getDictDetail("fqhj_error_type", String.valueOf(driver.getError())));
} else if (device.getDeviceDriver() instanceof SiemensConveyorDeviceDriver) {
SiemensConveyorDeviceDriver driver = (SiemensConveyorDeviceDriver) device.getDeviceDriver();
jo.put("device_code", driver.getDevice().getDevice_code());
jo.put("device_name", driver.getDevice().getDevice_name());
jo.put("status", Math.min(3, driver.getMode()));
jo.put("error", driver.getError());
jo.put("error_msg", driver.getError() == 0 ? "" : ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(driver.getError())));
} else if (device.getDeviceDriver() instanceof SiemensConveyorCkkDeviceDriver) {
SiemensConveyorCkkDeviceDriver driver = (SiemensConveyorCkkDeviceDriver) device.getDeviceDriver();
jo.put("device_code", driver.getDevice().getDevice_code());
jo.put("device_name", driver.getDevice().getDevice_name());
jo.put("status", Math.min(3, driver.getMode()));
jo.put("error", driver.getError());
jo.put("error_msg", driver.getError() == 0 ? "" : ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(driver.getError())));
} else if (device.getDeviceDriver() instanceof SiemensConveyorLabelingDeviceDriver) {
SiemensConveyorLabelingDeviceDriver driver = (SiemensConveyorLabelingDeviceDriver) device.getDeviceDriver();
jo.put("device_code", driver.getDevice().getDevice_code());
jo.put("device_name", driver.getDevice().getDevice_name());
jo.put("status", Math.min(3, driver.getMode()));
jo.put("error", driver.getError());
jo.put("error_msg", driver.getError() == 0 ? "" : ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(driver.getError())));
} else if (device.getDeviceDriver() instanceof SiemensOneFloorAGVConveyorDeviceDriver) {
SiemensOneFloorAGVConveyorDeviceDriver driver = (SiemensOneFloorAGVConveyorDeviceDriver) device.getDeviceDriver();
jo.put("device_code", driver.getDevice().getDevice_code());
jo.put("device_name", driver.getDevice().getDevice_name());
jo.put("status", Math.min(3, driver.getMode()));
jo.put("error", driver.getError());
jo.put("error_msg", driver.getError() == 0 ? "" : ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(driver.getError())));
} else {
jo.put("device_code", parent_device_code);
}
@@ -695,7 +758,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
JSONObject json = new JSONObject();
json.put("task_code", task_code);
json.put("ext_task_id", ext_task_id);
json.put("message", "已存在任务编号为"+vehicle_dto.getTask_code()+"托盘号:" + vehicle_code);
json.put("message", "已存在任务编号为" + vehicle_dto.getTask_code() + "托盘号:" + vehicle_code);
errArr.add(json);
continue;
}
@@ -884,15 +947,15 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
//1-允许取放; 2-允许离开
String option = jsonObject.getString("option");
Instruction inst = instructionService.findByTaskcode(task_code);
if(ObjectUtil.isEmpty(inst)){
if (ObjectUtil.isEmpty(inst)) {
JSONObject jo = new JSONObject();
jo.put("task_code",task_code);
jo.put("message","未找到对应任务");
jo.put("task_code", task_code);
jo.put("message", "未找到对应任务");
errArr.add(jo);
continue;
} else {
String carNo = inst.getCarno();
if(ObjectUtil.isEmpty(carNo)) {
if (ObjectUtil.isEmpty(carNo)) {
JSONObject jo = new JSONObject();
jo.put("task_code", task_code);
jo.put("message", "未找到任务对应车号");
@@ -901,11 +964,10 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
} else {
Device device = deviceAppService.findDeviceByCode(carNo);
AgvNdcTwoDeviceDriver agvNdcTwoDeviceDriver;
if(device.getDeviceDriver() instanceof AgvNdcTwoDeviceDriver ){
agvNdcTwoDeviceDriver = (AgvNdcTwoDeviceDriver)device.getDeviceDriver();
if (device.getDeviceDriver() instanceof AgvNdcTwoDeviceDriver) {
agvNdcTwoDeviceDriver = (AgvNdcTwoDeviceDriver) device.getDeviceDriver();
int phase = agvNdcTwoDeviceDriver.getPhase();
if(phase == 0x03 || phase == 0x05 || phase == 0x08)
{
if (phase == 0x03 || phase == 0x05 || phase == 0x08) {
StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver;
Device device_k = deviceAppService.findDeviceByCode(device_code + "_K");
Device device_m = deviceAppService.findDeviceByCode(device_code + "_M");