This commit is contained in:
2023-06-27 14:24:12 +08:00
5 changed files with 56 additions and 24 deletions

View File

@@ -91,6 +91,10 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
int count = dis.read(b);
if (count == -1) {
log.error("agv连接出现异常:服务端被关闭");
if (ObjectUtil.isNotEmpty(s)) {
s.close();
}
break;
}
@@ -202,11 +206,18 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
} else {
device = deviceAppService.findDeviceByCode(Integer.toString(arr[20]));
}
if (ObjectUtil.isNotEmpty(device)) {
if (device.getDeviceDriver() instanceof AgvNdcOneDeviceDriver) {
agvNdcOneDeviceDriver = (AgvNdcOneDeviceDriver) device.getDeviceDriver();
agvNdcOneDeviceDriver.processSocket(arr);
try{
if (ObjectUtil.isNotEmpty(device)) {
if (device.getDeviceDriver() instanceof AgvNdcOneDeviceDriver) {
agvNdcOneDeviceDriver = (AgvNdcOneDeviceDriver) device.getDeviceDriver();
agvNdcOneDeviceDriver.processSocket(arr);
}
} else {
log.info("当前phase"+ phase +"未找到对应设备");
}
} catch (Exception e){
log.info("processSocket出错:" + e.getMessage());
e.printStackTrace();
}
}
@@ -233,7 +244,6 @@ public class OneNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
} finally {
}
}

View File

@@ -95,6 +95,10 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
int count = dis.read(b);
if (count == -1) {
log.error("agv连接出现异常:服务端被关闭");
if (ObjectUtil.isNotEmpty(s)) {
s.close();
}
break;
}
@@ -254,15 +258,19 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
} else {
device = deviceAppService.findDeviceByCode(Integer.toString(arr[20]));
}
if(ObjectUtil.isNotEmpty(device)){
if (device.getDeviceDriver() instanceof AgvNdcTwoDeviceDriver) {
agvNdcTwoDeviceDriver = (AgvNdcTwoDeviceDriver) device.getDeviceDriver();
agvNdcTwoDeviceDriver.processSocket(arr);
try{
if(ObjectUtil.isNotEmpty(device)){
if (device.getDeviceDriver() instanceof AgvNdcTwoDeviceDriver) {
agvNdcTwoDeviceDriver = (AgvNdcTwoDeviceDriver) device.getDeviceDriver();
agvNdcTwoDeviceDriver.processSocket(arr);
}
} else {
log.info("当前phase"+ phase +"未找到对应设备");
}
} else {
log.info("当前phase"+ phase +"未找到对应设备");
} catch (Exception e){
log.info("processSocket出错:" + e.getMessage());
e.printStackTrace();
}
}
if (!ObjectUtil.isEmpty(data)) {
write(data);

View File

@@ -940,10 +940,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
message = "申请空盘入库任务中...";
if(taskserver.querySameOriginTask(this.device_code) > 0 ){
message = "已存在空盘出库任务不再请求";
return;
}
// if(taskserver.querySameOriginTask(this.device_code) > 0 ){
// message = "已存在空盘出库任务不再请求";
// return;
// }
JSONObject apply = new JSONObject();
apply.put("device_code", device_code);
@@ -1075,10 +1075,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
} else {
this.require_empty_out_time = date;
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
if (taskserver.querySameDestinationTask(this.device_code) > 0) {
message = "已存在空盘出库任务不再请求";
return;
}
// if (taskserver.querySameDestinationTask(this.device_code) > 0) {
// message = "已存在空盘出库任务不再请求";
// return;
// }
message = "申请空盘出库任务中...";
JSONObject apply = new JSONObject();
apply.put("device_code", device_code);

View File

@@ -20,6 +20,7 @@ import org.nl.acs.device_driver.FeedLmsRealFailed;
import org.nl.acs.device_driver.basedriver.agv.ndcone.AgvNdcOneDeviceDriver;
import org.nl.acs.device_driver.basedriver.agv.ndctwo.AgvNdcTwoDeviceDriver;
import org.nl.acs.device_driver.basedriver.cargo_lift_conveyor.CargoLiftConveyorDeviceDriver;
import org.nl.acs.device_driver.basedriver.device_status.DeviceStatusDeviceDriver;
import org.nl.acs.device_driver.basedriver.empty_vehicle_stacking_position.EmptyVehicleStackingPositionDeviceDriver;
import org.nl.acs.device_driver.basedriver.hongxiang_conveyor.HongXiangStationDeviceDriver;
import org.nl.acs.device_driver.basedriver.hongxiang_device.HongXiangConveyorDeviceDriver;
@@ -229,6 +230,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
StandardCoveyorControlWithScannerDeviceDriver standardCoveyorControlWithScannerDeviceDriver;
//纸管库
PaperTubeConveyorDeviceDriver paperTubeConveyorDeviceDriver;
//立库设备
DeviceStatusDeviceDriver deviceStatusDeviceDriver;
if (datas.size() == 0) {
throw new BadRequestException("缺少输入参数!");
}
@@ -285,6 +288,19 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
jo.put("material_code", ObjectUtil.isEmpty(paperTubeConveyorDeviceDriver.getMaterial()) ? "" : paperTubeConveyorDeviceDriver.getMaterial());
jo.put("out_finish", paperTubeConveyorDeviceDriver.getOut_finish());
} else if (device.getDeviceDriver() instanceof DeviceStatusDeviceDriver) {
deviceStatusDeviceDriver = (DeviceStatusDeviceDriver) device.getDeviceDriver();
jo.put("device_code", deviceStatusDeviceDriver.getDevice().getDevice_code());
jo.put("device_code", deviceStatusDeviceDriver.getDevice().getDevice_name());
jo.put("x", deviceStatusDeviceDriver.getX());
jo.put("y", deviceStatusDeviceDriver.getY());
jo.put("power", deviceStatusDeviceDriver.getPower());
jo.put("error", deviceStatusDeviceDriver.getAlarm());
//楼层
jo.put("map_id", deviceStatusDeviceDriver.getMap_id());
jo.put("pallet", deviceStatusDeviceDriver.getPallet());
jo.put("move", deviceStatusDeviceDriver.getHasGoods()==false?0:1);
} else {
jo.put("device_code", parent_device_code);
}

View File

@@ -197,14 +197,12 @@ public class InbillServiceImpl {
param.put("rows", rows);
try {
bean.uploadMES(param);
} catch (Exception e) {
System.out.println(e.getMessage());
log.info(e.getMessage());
} finally {
mst_jo.put("is_upload", "1");
mst_jo.put("upload_mes", "1");
mst_jo.put("upload_optid", SecurityUtils.getCurrentUserId());
mst_jo.put("upload_time", DateUtil.now());
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(mst_jo);
}
}