立库更新
This commit is contained in:
@@ -417,6 +417,9 @@ public class AgvServiceImpl implements AgvService {
|
|||||||
if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.FORKAGV).toString(), "1")) {
|
if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.FORKAGV).toString(), "1")) {
|
||||||
String instcode = inst.getInstruction_code();
|
String instcode = inst.getInstruction_code();
|
||||||
int type = Integer.parseInt(inst.getInstruction_type());
|
int type = Integer.parseInt(inst.getInstruction_type());
|
||||||
|
if (type == 3) {
|
||||||
|
type = 1;
|
||||||
|
}
|
||||||
int priority = Integer.parseInt(inst.getPriority()) + 128;
|
int priority = Integer.parseInt(inst.getPriority()) + 128;
|
||||||
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
||||||
DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class);
|
DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class);
|
||||||
|
|||||||
@@ -829,6 +829,10 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
TaskDto taskDto = taskService.findByCode(inst.getTask_code());
|
TaskDto taskDto = taskService.findByCode(inst.getTask_code());
|
||||||
|
boolean tag = false;
|
||||||
|
if (!StrUtil.startWith(inst.getTask_code(), "-") || StrUtil.equals(taskDto.getTask_type(),"3")) {
|
||||||
|
tag = true;
|
||||||
|
}
|
||||||
|
|
||||||
//开始任务/上报订单号(无车id及状态)
|
//开始任务/上报订单号(无车id及状态)
|
||||||
if (phase == 0x01) {
|
if (phase == 0x01) {
|
||||||
@@ -879,17 +883,24 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
}
|
}
|
||||||
if (device.getDeviceDriver() instanceof StorageConveyorDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StorageConveyorDeviceDriver) {
|
||||||
storageConveyorDeviceDriver = (StorageConveyorDeviceDriver) device.getDeviceDriver();
|
storageConveyorDeviceDriver = (StorageConveyorDeviceDriver) device.getDeviceDriver();
|
||||||
HttpResponse response = acsToXrlkService.isTakePermission(device.getDevice_code());
|
|
||||||
if (response.getStatus() == 200) {
|
//如果为acs创建的任务并且任务类型为3,那么就不需要调用立库接口
|
||||||
JSONObject jo = JSONObject.fromObject(response.body());
|
if (!tag) {
|
||||||
if (StrUtil.equals(jo.get("result").toString(), "1")) {
|
HttpResponse response = acsToXrlkService.isTakePermission(device.getDevice_code());
|
||||||
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
if (response.getStatus() == 200) {
|
||||||
|
JSONObject jo = JSONObject.fromObject(response.body());
|
||||||
|
if (StrUtil.equals(jo.get("result").toString(), "1")) {
|
||||||
|
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
|
} else {
|
||||||
|
log.info("AGV请求取货设备{},立库WMS不允许取货", device_code);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("AGV请求取货设备{},立库WMS不允许取货", device_code);
|
log.info("AGV请求取货设备{},接口请求立库WMS失败", device_code);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("AGV请求取货设备{},接口请求立库WMS失败", device_code);
|
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (device.getDeviceDriver() instanceof StandardEmptyPalletSiteDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardEmptyPalletSiteDeviceDriver) {
|
||||||
standardEmptyPalletSiteDeviceDriver = (StandardEmptyPalletSiteDeviceDriver) device.getDeviceDriver();
|
standardEmptyPalletSiteDeviceDriver = (StandardEmptyPalletSiteDeviceDriver) device.getDeviceDriver();
|
||||||
@@ -947,18 +958,23 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
}
|
}
|
||||||
if (device.getDeviceDriver() instanceof StorageConveyorDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StorageConveyorDeviceDriver) {
|
||||||
storageConveyorDeviceDriver = (StorageConveyorDeviceDriver) device.getDeviceDriver();
|
storageConveyorDeviceDriver = (StorageConveyorDeviceDriver) device.getDeviceDriver();
|
||||||
HttpResponse response = acsToXrlkService.AGVWorkStatus(device.getDevice_code(), "2");
|
|
||||||
if (response.getStatus() == 200) {
|
//如果为acs创建的任务并且任务类型为3,那么就不需要调用立库接口
|
||||||
JSONObject jo = JSONObject.fromObject(response.body());
|
if (!tag) {
|
||||||
if (StrUtil.equals(jo.get("result").toString(), "1")) {
|
HttpResponse response = acsToXrlkService.AGVWorkStatus(device.getDevice_code(), "2");
|
||||||
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
if (response.getStatus() == 200) {
|
||||||
|
JSONObject jo = JSONObject.fromObject(response.body());
|
||||||
|
if (StrUtil.equals(jo.get("result").toString(), "1")) {
|
||||||
|
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
|
} else {
|
||||||
|
log.info("AGV取货完成反馈设备{},{}", device_code, jo.getString("message"));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("AGV取货完成反馈设备{},{}", device_code, jo.getString("message"));
|
log.info("AGV取货完成反馈设备{},接口请求立库WMS失败", device_code);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("AGV取货完成反馈设备{},接口请求立库WMS失败", device_code);
|
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
|
||||||
@@ -1100,16 +1116,22 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
}
|
}
|
||||||
if (device.getDeviceDriver() instanceof StorageConveyorDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StorageConveyorDeviceDriver) {
|
||||||
storageConveyorDeviceDriver = (StorageConveyorDeviceDriver) device.getDeviceDriver();
|
storageConveyorDeviceDriver = (StorageConveyorDeviceDriver) device.getDeviceDriver();
|
||||||
HttpResponse response = acsToXrlkService.isPutPermission(device.getDevice_code());
|
|
||||||
if (response.getStatus() == 200) {
|
//如果为acs创建的任务并且任务类型为3,那么就不需要调用立库接口
|
||||||
JSONObject jo = JSONObject.fromObject(response.body());
|
if (!tag) {
|
||||||
if (StrUtil.equals(jo.get("result").toString(), "1")) {
|
HttpResponse response = acsToXrlkService.isPutPermission(device.getDevice_code());
|
||||||
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
if (response.getStatus() == 200) {
|
||||||
|
JSONObject jo = JSONObject.fromObject(response.body());
|
||||||
|
if (StrUtil.equals(jo.get("result").toString(), "1")) {
|
||||||
|
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
|
} else {
|
||||||
|
log.info("AGV请求放货设备{},立库WMS不允许放货", device_code);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("AGV请求放货设备{},立库WMS不允许放货", device_code);
|
log.info("AGV请求放货设备{},接口请求立库WMS失败", device_code);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("AGV请求放货设备{},接口请求立库WMS失败", device_code);
|
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||||
@@ -1272,18 +1294,23 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
}
|
}
|
||||||
if (device.getDeviceDriver() instanceof StorageConveyorDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StorageConveyorDeviceDriver) {
|
||||||
storageConveyorDeviceDriver = (StorageConveyorDeviceDriver) device.getDeviceDriver();
|
storageConveyorDeviceDriver = (StorageConveyorDeviceDriver) device.getDeviceDriver();
|
||||||
HttpResponse response = acsToXrlkService.AGVWorkStatus(device.getDevice_code(), "1");
|
|
||||||
if (response.getStatus() == 200) {
|
//如果为acs创建的任务并且任务类型为3,那么就不需要调用立库接口
|
||||||
JSONObject jo = JSONObject.fromObject(response.body());
|
if (!tag) {
|
||||||
if (StrUtil.equals(jo.get("result").toString(), "1")) {
|
HttpResponse response = acsToXrlkService.AGVWorkStatus(device.getDevice_code(), "1");
|
||||||
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
if (response.getStatus() == 200) {
|
||||||
|
JSONObject jo = JSONObject.fromObject(response.body());
|
||||||
|
if (StrUtil.equals(jo.get("result").toString(), "1")) {
|
||||||
|
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
|
} else {
|
||||||
|
log.info("AGV放货完成反馈设备{},{}", device_code, jo.getString("message"));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("AGV放货完成反馈设备{},{}", device_code, jo.getString("message"));
|
log.info("AGV放货完成反馈设备{},接口请求立库WMS失败", device_code);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("AGV放货完成反馈设备{},接口请求立库WMS失败", device_code);
|
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//任务完毕
|
//任务完毕
|
||||||
@@ -1336,17 +1363,23 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
}
|
}
|
||||||
if (relevance_device.getDeviceDriver() instanceof StorageConveyorDeviceDriver) {
|
if (relevance_device.getDeviceDriver() instanceof StorageConveyorDeviceDriver) {
|
||||||
storageConveyorDeviceDriver = (StorageConveyorDeviceDriver) device.getDeviceDriver();
|
storageConveyorDeviceDriver = (StorageConveyorDeviceDriver) device.getDeviceDriver();
|
||||||
HttpResponse response = acsToXrlkService.invokeDoor(device.getDevice_code());
|
//如果为acs创建的任务并且任务类型为3,那么就不需要调用立库接口
|
||||||
if (response.getStatus() == 200) {
|
if (!tag) {
|
||||||
JSONObject jo = JSONObject.fromObject(response.body());
|
HttpResponse response = acsToXrlkService.invokeDoor(device.getDevice_code());
|
||||||
if (StrUtil.equals(jo.get("result").toString(), "1")) {
|
if (response.getStatus() == 200) {
|
||||||
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
JSONObject jo = JSONObject.fromObject(response.body());
|
||||||
|
if (StrUtil.equals(jo.get("result").toString(), "1")) {
|
||||||
|
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
|
} else {
|
||||||
|
log.info("AGV请求进入{},{}", device_code, jo.getString("message"));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("AGV请求进入{},{}", device_code, jo.getString("message"));
|
log.info("AGV请求进入设备{},接口请求立库WMS失败", device_code);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("AGV请求进入设备{},接口请求立库WMS失败", device_code);
|
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user