Merge remote-tracking branch 'origin/acs_dev' into acs_dev

This commit is contained in:
2025-09-04 17:42:12 +08:00
4 changed files with 256 additions and 2 deletions

View File

@@ -125,6 +125,8 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
//行架机械手申请任务成功标识
boolean requireSucess = false;
boolean barcodeRequireSucess = false;
private int instruction_finished_time_out;
int branchProtocol = 0;
@@ -182,6 +184,10 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
requireSucess = false;
}
if (!StrUtil.equals(this.barcode,this.last_barcode) && StrUtil.isNotEmpty(this.barcode)){
this.barcodeRequireSucess = false;
}
if (task > 0) {
inst = checkInst();
if (null != inst) {
@@ -218,7 +224,7 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr
List toInstructions;
//拔轴完成RGV工位上有货申请行架任务
if (mode == 4 && move == 1 && !requireSucess) {
if (mode == 4 && move == 1 && !requireSucess && !barcodeRequireSucess) {
applyTask();
} else {
if (mode == 4) {

View File

@@ -3,6 +3,7 @@ package org.nl.acs.ext.wms.rest;
import cn.dev33.satoken.annotation.SaIgnore;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
@@ -127,4 +128,11 @@ public class WmsToAcsController {
}
@PostMapping("/getDeviceErrorInfo")
@SaIgnore
public ResponseEntity<Object> getDeviceErrorInfo(@RequestBody JSONArray params) {
return new ResponseEntity<>(wmstoacsService.getDeviceErrorInfo(params), HttpStatus.OK);
}
}

View File

@@ -1,6 +1,7 @@
package org.nl.acs.ext.wms.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.nl.acs.ext.wms.data.PutWeightActionRequest;
import org.nl.acs.ext.wms.data.PutWeightActionResponse;
@@ -120,4 +121,6 @@ public interface WmsToAcsService {
Map<String, Object> getTubeMes(String whereJson) throws Exception;
JSONObject returnBox(JSONObject param);
JSONObject getDeviceErrorInfo(JSONArray params);
}

View File

@@ -21,20 +21,37 @@ import org.nl.acs.device_driver.agv.ndctwo.AgvNdcTwoDeviceDriver;
import org.nl.acs.device_driver.conveyor.belt_conveyor.BeltConveyorDeviceDriver;
import org.nl.acs.device_driver.conveyor.siemens_conveyor.SiemensConveyorDeviceDriver;
import org.nl.acs.device_driver.conveyor.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
import org.nl.acs.device_driver.one_conveyor.box_storage_out_conveyor.BoxStorageOutConveyorDeviceDriver;
import org.nl.acs.device_driver.one_conveyor.box_subvolumes_conveyor.BoxSubvolumesConveyorDeviceDriver;
import org.nl.acs.device_driver.one_conveyor.finished_product_out_with_bind_lable_conveyor.FinishedProductOutBindLableDeviceDriver;
import org.nl.acs.device_driver.one_conveyor.fold_disc_site.FoldDiscSiteDeviceDriver;
import org.nl.acs.device_driver.one_conveyor.manipulator_cache.ManipulatorCacheDeviceDriver;
import org.nl.acs.device_driver.one_conveyor.scanner_weight_conveyor.ConveyorWithScannerWeightDeviceDriver;
import org.nl.acs.device_driver.one_conveyor.un_box_lable_conveyor.UnBoxLableConveyorDeviceDriver;
import org.nl.acs.device_driver.one_manipulator.box_package_manipulator.BoxPackageManipulatorDeviceDriver;
import org.nl.acs.device_driver.conveyor.box_palletizing_manipulator.BoxPalletizingManipulatorDeviceDriver;
import org.nl.acs.device_driver.one_manipulator.box_storage_manipulator.BoxStorageManipulatorDeviceDriver;
import org.nl.acs.device_driver.one_manipulator.return_good_manipulator.ReturnGoodManipulatorDeviceDriver;
import org.nl.acs.device_driver.one_manipulator.rgv.OneRgvDeviceDriver;
import org.nl.acs.device_driver.one_manipulator.standard_manipulator.StandardManipulatoDeviceDriver;
import org.nl.acs.device_driver.one_manipulator.trapped_manipulator.TrappedManipulatorManipulatorDeviceDriver;
import org.nl.acs.device_driver.one_manipulator.volume_two_manipulator.VolumeTwoManipulatorManipulatorDeviceDriver;
import org.nl.acs.device_driver.paper_tube_device2.PaperTubeConveyor2DeviceDriver;
import org.nl.acs.device_driver.paper_tube_pick_site.PaperTubePickSiteDeviceDriver;
import org.nl.acs.device_driver.rgv.RgvDeviceDriver;
import org.nl.acs.device_driver.stacker.standard_stacker.StandardStackerDeviceDriver;
import org.nl.acs.device_driver.two_conveyor.blank_manipulator.BlankManipulatorDeviceDriver;
import org.nl.acs.device_driver.two_conveyor.die_manipulator.DieManipulatorDriver;
import org.nl.acs.device_driver.two_conveyor.hongxiang_conveyor.HongXiangStationDeviceDriver;
import org.nl.acs.device_driver.two_conveyor.hongxiang_device.HongXiangConveyorDeviceDriver;
import org.nl.acs.device_driver.two_conveyor.inflatable_shaft_library.InflatableShaftLibraryDeviceDriver;
import org.nl.acs.device_driver.two_conveyor.lamp_three_color.LampThreecolorDeviceDriver;
import org.nl.acs.device_driver.two_conveyor.manipulator_agv_station.ManipulatorAgvStationDeviceDriver;
import org.nl.acs.device_driver.two_conveyor.oven_manipulator.OvenGantryManipulatorDeviceDriver;
import org.nl.acs.device_driver.two_conveyor.plug_pull_device_site.PlugPullDeviceSiteDeviceDriver;
import org.nl.acs.device_driver.two_conveyor.pull_head_manipulator.PullHeadManipulatorDeviceDriver;
import org.nl.acs.device_driver.two_conveyor.pull_tail_manipulator.PullTailManipulatorDeviceDriver;
import org.nl.acs.device_driver.two_conveyor.slit_two_manipulator.SlitTwoManipulatorDeviceDriver;
import org.nl.acs.device_driver.two_conveyor.subvolume_weighing_station.SubvolumeWeighingStationDriver;
import org.nl.acs.device_driver.two_conveyor.waste_foil_weighing_station.WasteFoilWeighingStationDriver;
import org.nl.acs.ext.wms.data.*;
@@ -43,6 +60,7 @@ import org.nl.acs.ext.wms.liKuData.Resp;
import org.nl.acs.ext.wms.service.AcsToLiKuService;
import org.nl.acs.ext.wms.service.WmsToAcsService;
import org.nl.acs.history.ErrorUtil;
import org.nl.acs.instruction.domain.Instruction;
import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.opc.DeviceAppService;
@@ -53,6 +71,7 @@ import org.nl.acs.task.service.dto.TaskDto;
import org.nl.common.enums.LogTypeEnum;
import org.nl.common.exception.BadRequestException;
import org.nl.config.SpringContextHolder;
import org.nl.config.language.LangProcess;
import org.nl.config.lucene.service.LuceneExecuteLogService;
import org.nl.config.lucene.service.dto.LuceneLogDto;
import org.nl.config.lucene.service.impl.LuceneExecuteLogServiceImpl;
@@ -63,6 +82,7 @@ import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
@Service
@RequiredArgsConstructor
@@ -399,7 +419,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
errArr.add(json);
continue;
}
if ("RK1002".equals(task_dto.getStart_device_code())){
if ("RK1002".equals(task_dto.getStart_device_code())) {
Device device = deviceAppService.findDeviceByCode("RK1003");
BeltConveyorDeviceDriver beltConveyorDeviceDriver1;
if (device.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
@@ -1080,4 +1100,221 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
}
@Override
public JSONObject getDeviceErrorInfo(JSONArray params) {
JSONObject resp = new JSONObject();
JSONArray respData = new JSONArray();
for (int i = 0; i < params.size(); i++) {
String deviceCode = params.getString(i);
Device device = deviceAppService.findDeviceByCode(deviceCode);
if (device != null) {
JSONObject errorInfo = new JSONObject();
if (device.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
BeltConveyorDeviceDriver beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", beltConveyorDeviceDriver.getDevice().getDevice_name());
errorInfo.put("error_code", beltConveyorDeviceDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(beltConveyorDeviceDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof BoxStorageOutConveyorDeviceDriver) {
BoxStorageOutConveyorDeviceDriver boxStorageOutConveyorDeviceDriver = (BoxStorageOutConveyorDeviceDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", boxStorageOutConveyorDeviceDriver.getDevice().getDevice_name());
errorInfo.put("error_code", boxStorageOutConveyorDeviceDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(boxStorageOutConveyorDeviceDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof BoxSubvolumesConveyorDeviceDriver) {
BoxSubvolumesConveyorDeviceDriver boxSubvolumesConveyorDeviceDriver = (BoxSubvolumesConveyorDeviceDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", boxSubvolumesConveyorDeviceDriver.getDevice().getDevice_name());
errorInfo.put("error_code", boxSubvolumesConveyorDeviceDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(boxSubvolumesConveyorDeviceDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof FinishedProductOutBindLableDeviceDriver) {
FinishedProductOutBindLableDeviceDriver finishedProductOutBindLableDeviceDriver = (FinishedProductOutBindLableDeviceDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", finishedProductOutBindLableDeviceDriver.getDevice().getDevice_name());
errorInfo.put("error_code", finishedProductOutBindLableDeviceDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(finishedProductOutBindLableDeviceDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof FoldDiscSiteDeviceDriver) {
FoldDiscSiteDeviceDriver foldDiscSiteDeviceDriver = (FoldDiscSiteDeviceDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", foldDiscSiteDeviceDriver.getDevice().getDevice_name());
errorInfo.put("error_code", foldDiscSiteDeviceDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(foldDiscSiteDeviceDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof ConveyorWithScannerWeightDeviceDriver) {
ConveyorWithScannerWeightDeviceDriver conveyorWithScannerWeightDeviceDriver = (ConveyorWithScannerWeightDeviceDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", conveyorWithScannerWeightDeviceDriver.getDevice().getDevice_name());
errorInfo.put("error_code", conveyorWithScannerWeightDeviceDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(conveyorWithScannerWeightDeviceDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof UnBoxLableConveyorDeviceDriver) {
UnBoxLableConveyorDeviceDriver unBoxLableConveyorDeviceDriver = (UnBoxLableConveyorDeviceDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", unBoxLableConveyorDeviceDriver.getDevice().getDevice_name());
errorInfo.put("error_code", unBoxLableConveyorDeviceDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("ssx_error_type", String.valueOf(unBoxLableConveyorDeviceDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof BoxPackageManipulatorDeviceDriver) {
BoxPackageManipulatorDeviceDriver boxPackageManipulatorDeviceDriver = (BoxPackageManipulatorDeviceDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", boxPackageManipulatorDeviceDriver.getDevice().getDevice_name());
errorInfo.put("error_code", boxPackageManipulatorDeviceDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("zjzxhj_error_type", String.valueOf(boxPackageManipulatorDeviceDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof BoxStorageManipulatorDeviceDriver) {
BoxStorageManipulatorDeviceDriver boxStorageManipulatorDeviceDriver = (BoxStorageManipulatorDeviceDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", boxStorageManipulatorDeviceDriver.getDevice().getDevice_name());
errorInfo.put("error_code", boxStorageManipulatorDeviceDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("mxrkhj_error_type", String.valueOf(boxStorageManipulatorDeviceDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof ReturnGoodManipulatorDeviceDriver) {
ReturnGoodManipulatorDeviceDriver returnGoodManipulatorDeviceDriver = (ReturnGoodManipulatorDeviceDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", returnGoodManipulatorDeviceDriver.getDevice().getDevice_name());
errorInfo.put("error_code", returnGoodManipulatorDeviceDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("thrkhj_error_type", String.valueOf(returnGoodManipulatorDeviceDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof OneRgvDeviceDriver) {
OneRgvDeviceDriver oneRgvDeviceDriver = (OneRgvDeviceDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", oneRgvDeviceDriver.getDevice().getDevice_name());
errorInfo.put("error_code", oneRgvDeviceDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("rgv_error_type", String.valueOf(oneRgvDeviceDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof TrappedManipulatorManipulatorDeviceDriver) {
TrappedManipulatorManipulatorDeviceDriver trappedManipulatorManipulatorDeviceDriver = (TrappedManipulatorManipulatorDeviceDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", trappedManipulatorManipulatorDeviceDriver.getDevice().getDevice_name());
errorInfo.put("error_code", trappedManipulatorManipulatorDeviceDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("mxddhj_error_type", String.valueOf(trappedManipulatorManipulatorDeviceDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof VolumeTwoManipulatorManipulatorDeviceDriver) {
VolumeTwoManipulatorManipulatorDeviceDriver volumeTwoManipulatorManipulatorDeviceDriver = (VolumeTwoManipulatorManipulatorDeviceDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", volumeTwoManipulatorManipulatorDeviceDriver.getDevice().getDevice_name());
errorInfo.put("error_code", volumeTwoManipulatorManipulatorDeviceDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("zjxxhj_error_type", String.valueOf(volumeTwoManipulatorManipulatorDeviceDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof PaperTubePickSiteDeviceDriver) {
PaperTubePickSiteDeviceDriver paperTubePickSiteDeviceDriver = (PaperTubePickSiteDeviceDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", paperTubePickSiteDeviceDriver.getDevice().getDevice_name());
errorInfo.put("error_code", paperTubePickSiteDeviceDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("zgzqw_error_type", String.valueOf(paperTubePickSiteDeviceDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", hongXiangConveyorDeviceDriver.getDevice().getDevice_name());
errorInfo.put("error_code", hongXiangConveyorDeviceDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("hx_error_type", String.valueOf(hongXiangConveyorDeviceDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof HongXiangStationDeviceDriver) {
HongXiangStationDeviceDriver hongXiangStationDeviceDriver = (HongXiangStationDeviceDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", hongXiangStationDeviceDriver.getDevice().getDevice_name());
errorInfo.put("error_code", hongXiangStationDeviceDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("hxdjw_error_type", String.valueOf(hongXiangStationDeviceDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof InflatableShaftLibraryDeviceDriver) {
InflatableShaftLibraryDeviceDriver inflatableShaftLibraryDeviceDriver = (InflatableShaftLibraryDeviceDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", inflatableShaftLibraryDeviceDriver.getDevice().getDevice_name());
errorInfo.put("error_code", inflatableShaftLibraryDeviceDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("qzzhcw_error_type", String.valueOf(inflatableShaftLibraryDeviceDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof OvenGantryManipulatorDeviceDriver) {
OvenGantryManipulatorDeviceDriver ovenGantryManipulatorDeviceDriver = (OvenGantryManipulatorDeviceDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", ovenGantryManipulatorDeviceDriver.getDevice().getDevice_name());
errorInfo.put("error_code", ovenGantryManipulatorDeviceDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("hxhj_error_type", String.valueOf(ovenGantryManipulatorDeviceDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof PlugPullDeviceSiteDeviceDriver) {
PlugPullDeviceSiteDeviceDriver plugPullDeviceSiteDeviceDriver = (PlugPullDeviceSiteDeviceDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", plugPullDeviceSiteDeviceDriver.getDevice().getDevice_name());
errorInfo.put("error_code", plugPullDeviceSiteDeviceDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("cbj_error_type", String.valueOf(plugPullDeviceSiteDeviceDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof PullHeadManipulatorDeviceDriver) {
PullHeadManipulatorDeviceDriver pullHeadManipulatorDeviceDriver = (PullHeadManipulatorDeviceDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", pullHeadManipulatorDeviceDriver.getDevice().getDevice_name());
errorInfo.put("error_code", pullHeadManipulatorDeviceDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("bqhj_error_type", String.valueOf(pullHeadManipulatorDeviceDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof PullTailManipulatorDeviceDriver) {
PullTailManipulatorDeviceDriver pullTailManipulatorDeviceDriver = (PullTailManipulatorDeviceDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", pullTailManipulatorDeviceDriver.getDevice().getDevice_name());
errorInfo.put("error_code", pullTailManipulatorDeviceDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("bhhj_error_type", String.valueOf(pullTailManipulatorDeviceDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof SlitTwoManipulatorDeviceDriver) {
SlitTwoManipulatorDeviceDriver slitTwoManipulatorDeviceDriver = (SlitTwoManipulatorDeviceDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", slitTwoManipulatorDeviceDriver.getDevice().getDevice_name());
errorInfo.put("error_code", slitTwoManipulatorDeviceDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("fqhj_error_type", String.valueOf(slitTwoManipulatorDeviceDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof SubvolumeWeighingStationDriver) {
SubvolumeWeighingStationDriver subvolumeWeighingStationDriver = (SubvolumeWeighingStationDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", subvolumeWeighingStationDriver.getDevice().getDevice_name());
errorInfo.put("error_code", subvolumeWeighingStationDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("zjczw_error_type", String.valueOf(subvolumeWeighingStationDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof WasteFoilWeighingStationDriver) {
WasteFoilWeighingStationDriver wasteFoilWeighingStationDriver = (WasteFoilWeighingStationDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", wasteFoilWeighingStationDriver.getDevice().getDevice_name());
errorInfo.put("error_code", wasteFoilWeighingStationDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("fbczw_error_type", String.valueOf(wasteFoilWeighingStationDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof RgvDeviceDriver) {
RgvDeviceDriver rgvDeviceDriver = (RgvDeviceDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", rgvDeviceDriver.getDevice().getDevice_name());
errorInfo.put("error_code", rgvDeviceDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("cbj_error_type", String.valueOf(rgvDeviceDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof StandardStackerDeviceDriver) {
StandardStackerDeviceDriver standardStackerDeviceDriver = (StandardStackerDeviceDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", standardStackerDeviceDriver.getDevice().getDevice_name());
errorInfo.put("error_code", standardStackerDeviceDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("ddj_error_type", String.valueOf(standardStackerDeviceDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof BlankManipulatorDeviceDriver) {
BlankManipulatorDeviceDriver blankManipulatorDeviceDriver = (BlankManipulatorDeviceDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", blankManipulatorDeviceDriver.getDevice().getDevice_name());
errorInfo.put("error_code", blankManipulatorDeviceDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("bcxlhj_error_type", String.valueOf(blankManipulatorDeviceDriver.getError())));
respData.add(errorInfo);
} else if (device.getDeviceDriver() instanceof DieManipulatorDriver) {
DieManipulatorDriver dieManipulatorDriver = (DieManipulatorDriver) device.getDeviceDriver();
errorInfo.put("device_code", deviceCode);
errorInfo.put("device_name", dieManipulatorDriver.getDevice().getDevice_name());
errorInfo.put("error_code", dieManipulatorDriver.getError());
errorInfo.put("error_message", ErrorUtil.getDictDetail("gxhj_error_type", String.valueOf(dieManipulatorDriver.getError())));
}
}
}
respData = respData.stream()
.map(obj -> (JSONObject) obj)
.filter(json -> json.getInteger("error_code") != 0)
.collect(Collectors.toCollection(JSONArray::new));
resp.put("status", 200);
resp.put("message", "查询成功");
resp.put("data", respData);
return resp;
}
}