Merge branch 'master' of http://121.40.234.130:8899/root/lanzhouhailiang_one
This commit is contained in:
@@ -248,10 +248,15 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
} else {
|
} else {
|
||||||
device = deviceAppService.findDeviceByCode(Integer.toString(arr[20]));
|
device = deviceAppService.findDeviceByCode(Integer.toString(arr[20]));
|
||||||
}
|
}
|
||||||
if (device.getDeviceDriver() instanceof AgvNdcTwoDeviceDriver) {
|
if(ObjectUtil.isNotEmpty(device)){
|
||||||
agvNdcTwoDeviceDriver = (AgvNdcTwoDeviceDriver) device.getDeviceDriver();
|
if (device.getDeviceDriver() instanceof AgvNdcTwoDeviceDriver) {
|
||||||
agvNdcTwoDeviceDriver.processSocket(arr);
|
agvNdcTwoDeviceDriver = (AgvNdcTwoDeviceDriver) device.getDeviceDriver();
|
||||||
|
agvNdcTwoDeviceDriver.processSocket(arr);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
log.info("当前phase:"+ phase +"未找到对应设备");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (!ObjectUtil.isEmpty(data)) {
|
if (!ObjectUtil.isEmpty(data)) {
|
||||||
write(data);
|
write(data);
|
||||||
|
|||||||
@@ -75,6 +75,9 @@ public class DeviceStatusDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
String alarm = "";
|
String alarm = "";
|
||||||
String task_id = "";
|
String task_id = "";
|
||||||
|
|
||||||
|
Boolean iserror = false;
|
||||||
|
Boolean hasGoods = false;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setDeviceStatus(JSONObject data) {
|
public void setDeviceStatus(JSONObject data) {
|
||||||
String flag = data.getString("option");
|
String flag = data.getString("option");
|
||||||
@@ -108,6 +111,8 @@ public class DeviceStatusDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
jo.put("alarm", alarm);
|
jo.put("alarm", alarm);
|
||||||
jo.put("task_id", task_id);
|
jo.put("task_id", task_id);
|
||||||
jo.put("isOnline", this.getIsonline());
|
jo.put("isOnline", this.getIsonline());
|
||||||
|
jo.put("isError",this.getIserror());
|
||||||
|
jo.put("hasGoods", this.getHasGoods());
|
||||||
return jo;
|
return jo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,4 +29,7 @@ public class DeviceStatusData {
|
|||||||
//任务号
|
//任务号
|
||||||
String taskId;
|
String taskId;
|
||||||
|
|
||||||
|
//楼层
|
||||||
|
String floor;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -667,7 +667,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("task_code", task_code);
|
json.put("task_code", task_code);
|
||||||
json.put("ext_task_id", ext_task_id);
|
json.put("ext_task_id", ext_task_id);
|
||||||
json.put("message", "已存在任务id为"+taskDto.getTask_id()+"相同的任务号:" + task_code);
|
json.put("message", "存在相同的任务号:" + task_code);
|
||||||
errArr.add(json);
|
errArr.add(json);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -677,7 +677,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("task_code", task_code);
|
json.put("task_code", task_code);
|
||||||
json.put("ext_task_id", ext_task_id);
|
json.put("ext_task_id", ext_task_id);
|
||||||
json.put("message", "已存在任务id为"+vehicle_dto.getTask_id()+"托盘号:" + vehicle_code);
|
json.put("message", "已存在任务编号为"+vehicle_dto.getTask_code()+"托盘号:" + vehicle_code);
|
||||||
errArr.add(json);
|
errArr.add(json);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,20 +89,24 @@ public class OpcServerServiceImpl implements OpcServerService, ApplicationAutoIn
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
Server server = (Server)this.servers.get(code);
|
// Server server = (Server)this.servers.get(code);
|
||||||
boolean needcreate = false;
|
// boolean needcreate = false;
|
||||||
String groupName = code;
|
// String groupName = code;
|
||||||
if (server == null) {
|
// if (server == null) {
|
||||||
needcreate = true;
|
// needcreate = true;
|
||||||
} else {
|
// } else {
|
||||||
try {
|
// try {
|
||||||
group = server.findGroup(groupName);
|
// group = server.findGroup(groupName);
|
||||||
} catch (UnknownHostException | JIException | UnknownGroupException | NotConnectedException | IllegalArgumentException var13) {
|
// } catch (UnknownHostException | JIException | UnknownGroupException | NotConnectedException | IllegalArgumentException var13) {
|
||||||
log.error(code, var13);
|
// log.error(code, var13);
|
||||||
needcreate = true;
|
// needcreate = true;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
boolean needcreate = false;
|
||||||
|
needcreate = true;
|
||||||
|
String groupName = code;
|
||||||
|
Server server = null;
|
||||||
if (needcreate) {
|
if (needcreate) {
|
||||||
OpcServerManageDto dto = (OpcServerManageDto)this.opcServerManageDtos.get(code);
|
OpcServerManageDto dto = (OpcServerManageDto)this.opcServerManageDtos.get(code);
|
||||||
if (dto == null) {
|
if (dto == null) {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package org.nl.modules.quartz.task;
|
package org.nl.modules.quartz.task;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.acs.device_driver.basedriver.device_status.DeviceStatusDeviceDriver;
|
import org.nl.acs.device_driver.basedriver.device_status.DeviceStatusDeviceDriver;
|
||||||
@@ -10,6 +11,7 @@ import org.nl.acs.ext.wms.liKuData.Resp;
|
|||||||
import org.nl.acs.ext.wms.service.AcsToLiKuService;
|
import org.nl.acs.ext.wms.service.AcsToLiKuService;
|
||||||
import org.nl.acs.opc.Device;
|
import org.nl.acs.opc.Device;
|
||||||
import org.nl.acs.opc.DeviceAppService;
|
import org.nl.acs.opc.DeviceAppService;
|
||||||
|
import org.nl.modules.common.utils.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@@ -46,6 +48,7 @@ public class QueryLKDeviceStatus {
|
|||||||
DeviceStatusData deviceStatusData=deviceStatusDataList.get(i);
|
DeviceStatusData deviceStatusData=deviceStatusDataList.get(i);
|
||||||
String deviceId="LK" + deviceStatusData.getDeviceId();
|
String deviceId="LK" + deviceStatusData.getDeviceId();
|
||||||
PackageDriver(deviceStatusData, deviceId);
|
PackageDriver(deviceStatusData, deviceId);
|
||||||
|
|
||||||
}
|
}
|
||||||
//提升机
|
//提升机
|
||||||
Resp<DeviceStatusResponse> tsjResp = acsToLiKuService.queryTsjDeviceStatus(deviceStatusRequest);
|
Resp<DeviceStatusResponse> tsjResp = acsToLiKuService.queryTsjDeviceStatus(deviceStatusRequest);
|
||||||
@@ -64,13 +67,27 @@ public class QueryLKDeviceStatus {
|
|||||||
deviceStatusDeviceDriver.setDevice_id(deviceId);
|
deviceStatusDeviceDriver.setDevice_id(deviceId);
|
||||||
deviceStatusDeviceDriver.setX(deviceStatusData.getX());
|
deviceStatusDeviceDriver.setX(deviceStatusData.getX());
|
||||||
deviceStatusDeviceDriver.setY(deviceStatusData.getY());
|
deviceStatusDeviceDriver.setY(deviceStatusData.getY());
|
||||||
deviceStatusDeviceDriver.setMap_id(deviceStatusData.getMapId());
|
if(!ObjectUtil.isEmpty(deviceStatusData.getMapId())) {
|
||||||
|
deviceStatusDeviceDriver.setMap_id(deviceStatusData.getMapId());
|
||||||
|
}else if (!ObjectUtil.isEmpty(deviceStatusData.getFloor())){
|
||||||
|
deviceStatusDeviceDriver.setMap_id(deviceStatusData.getFloor());
|
||||||
|
}
|
||||||
deviceStatusDeviceDriver.setPower(deviceStatusData.getPower());
|
deviceStatusDeviceDriver.setPower(deviceStatusData.getPower());
|
||||||
deviceStatusDeviceDriver.setPallet(deviceStatusData.getPallet());
|
deviceStatusDeviceDriver.setPallet(deviceStatusData.getPallet());
|
||||||
deviceStatusDeviceDriver.setLoad(deviceStatusData.getLoad());
|
deviceStatusDeviceDriver.setLoad(deviceStatusData.getLoad());
|
||||||
deviceStatusDeviceDriver.setAlarm(deviceStatusData.getAlarm());
|
deviceStatusDeviceDriver.setAlarm(deviceStatusData.getAlarm());
|
||||||
deviceStatusDeviceDriver.setTask_id(deviceStatusData.getTaskId());
|
deviceStatusDeviceDriver.setTask_id(deviceStatusData.getTaskId());
|
||||||
deviceStatusDeviceDriver.setIsonline(true);
|
deviceStatusDeviceDriver.setIsonline(true);
|
||||||
|
if(!"0".equals(deviceStatusData.getAlarm())) {
|
||||||
|
deviceStatusDeviceDriver.setIserror(true);
|
||||||
|
}else{
|
||||||
|
deviceStatusDeviceDriver.setIserror(false);
|
||||||
|
}
|
||||||
|
if(!"0".equals(deviceStatusData.getLoad())) {
|
||||||
|
deviceStatusDeviceDriver.setHasGoods(true);
|
||||||
|
}else{
|
||||||
|
deviceStatusDeviceDriver.setHasGoods(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user