更新
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package org.nl.acs.agv.server.impl;
|
package org.nl.acs.agv.server.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.http.HttpRequest;
|
import cn.hutool.http.HttpRequest;
|
||||||
import cn.hutool.http.HttpResponse;
|
import cn.hutool.http.HttpResponse;
|
||||||
@@ -28,6 +29,7 @@ import org.nl.acs.opc.DeviceAppService;
|
|||||||
import org.nl.acs.opc.DeviceAppServiceImpl;
|
import org.nl.acs.opc.DeviceAppServiceImpl;
|
||||||
import org.nl.acs.task.service.TaskService;
|
import org.nl.acs.task.service.TaskService;
|
||||||
import org.nl.acs.task.service.dto.TaskDto;
|
import org.nl.acs.task.service.dto.TaskDto;
|
||||||
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.modules.system.service.ParamService;
|
import org.nl.modules.system.service.ParamService;
|
||||||
import org.nl.modules.wql.util.SpringContextHolder;
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -271,6 +273,9 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
|
|||||||
JSONObject respjson = JSONObject.parseObject(resp);
|
JSONObject respjson = JSONObject.parseObject(resp);
|
||||||
|
|
||||||
if (StrUtil.equals(inst.getInstruction_type(), "3")) {
|
if (StrUtil.equals(inst.getInstruction_type(), "3")) {
|
||||||
|
if (ObjectUtil.isNotEmpty(respjson) && respjson.getInteger("status") != 200) {
|
||||||
|
throw new BadRequestException(respjson.getString("message"));
|
||||||
|
}
|
||||||
//2楼AGV起点追加任务
|
//2楼AGV起点追加任务
|
||||||
String start_device_code = respjson.getString("device_code");
|
String start_device_code = respjson.getString("device_code");
|
||||||
String next_device_code = inst.getNext_device_code();
|
String next_device_code = inst.getNext_device_code();
|
||||||
|
|||||||
@@ -339,11 +339,16 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
throw new BadRequestException("设备:" + nextdevice.getDevice_code() + "未设置楼层!");
|
throw new BadRequestException("设备:" + nextdevice.getDevice_code() + "未设置楼层!");
|
||||||
}
|
}
|
||||||
cargoLiftConveyorDeviceDriver.writing(1, 0);
|
cargoLiftConveyorDeviceDriver.writing(1, 0);
|
||||||
cargoLiftConveyorDeviceDriver.writing(1, 1);
|
cargoLiftConveyorDeviceDriver.writing(2, Integer.parseInt(address));
|
||||||
cargoLiftConveyorDeviceDriver.writing(2, Integer.parseInt(address));
|
cargoLiftConveyorDeviceDriver.writing(2, Integer.parseInt(address));
|
||||||
cargoLiftConveyorDeviceDriver.writing(3, Integer.parseInt(dto.getInstruction_code()));
|
cargoLiftConveyorDeviceDriver.writing(3, Integer.parseInt(dto.getInstruction_code()));
|
||||||
|
cargoLiftConveyorDeviceDriver.writing(3, Integer.parseInt(dto.getInstruction_code()));
|
||||||
|
cargoLiftConveyorDeviceDriver.writing(4, Integer.parseInt(door));
|
||||||
cargoLiftConveyorDeviceDriver.writing(4, Integer.parseInt(door));
|
cargoLiftConveyorDeviceDriver.writing(4, Integer.parseInt(door));
|
||||||
cargoLiftConveyorDeviceDriver.writing(5, Integer.parseInt(floor));
|
cargoLiftConveyorDeviceDriver.writing(5, Integer.parseInt(floor));
|
||||||
|
cargoLiftConveyorDeviceDriver.writing(5, Integer.parseInt(floor));
|
||||||
|
cargoLiftConveyorDeviceDriver.writing(1, 1);
|
||||||
|
cargoLiftConveyorDeviceDriver.writing(1, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (startdevice.getDeviceDriver() instanceof StandardCoveyorControlWithScannerDeviceDriver) {
|
if (startdevice.getDeviceDriver() instanceof StandardCoveyorControlWithScannerDeviceDriver) {
|
||||||
@@ -364,11 +369,17 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
throw new BadRequestException("设备:" + nextdevice.getDevice_code() + "未设置楼层!");
|
throw new BadRequestException("设备:" + nextdevice.getDevice_code() + "未设置楼层!");
|
||||||
}
|
}
|
||||||
cargoLiftConveyorDeviceDriver.writing(1, 0);
|
cargoLiftConveyorDeviceDriver.writing(1, 0);
|
||||||
standardCoveyorControlWithScannerDeviceDriver.writing(1, 1);
|
cargoLiftConveyorDeviceDriver.writing(1, 0);
|
||||||
standardCoveyorControlWithScannerDeviceDriver.writing(2, Integer.parseInt(address));
|
|
||||||
standardCoveyorControlWithScannerDeviceDriver.writing(3, Integer.parseInt(dto.getInstruction_code()));
|
standardCoveyorControlWithScannerDeviceDriver.writing(3, Integer.parseInt(dto.getInstruction_code()));
|
||||||
|
standardCoveyorControlWithScannerDeviceDriver.writing(3, Integer.parseInt(dto.getInstruction_code()));
|
||||||
|
standardCoveyorControlWithScannerDeviceDriver.writing(2, Integer.parseInt(address));
|
||||||
|
standardCoveyorControlWithScannerDeviceDriver.writing(2, Integer.parseInt(address));
|
||||||
|
standardCoveyorControlWithScannerDeviceDriver.writing(4, Integer.parseInt(door));
|
||||||
standardCoveyorControlWithScannerDeviceDriver.writing(4, Integer.parseInt(door));
|
standardCoveyorControlWithScannerDeviceDriver.writing(4, Integer.parseInt(door));
|
||||||
standardCoveyorControlWithScannerDeviceDriver.writing(5, Integer.parseInt(floor));
|
standardCoveyorControlWithScannerDeviceDriver.writing(5, Integer.parseInt(floor));
|
||||||
|
standardCoveyorControlWithScannerDeviceDriver.writing(5, Integer.parseInt(floor));
|
||||||
|
standardCoveyorControlWithScannerDeviceDriver.writing(1, 1);
|
||||||
|
standardCoveyorControlWithScannerDeviceDriver.writing(1, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (startdevice.getDeviceDriver() instanceof HaoKaiAutoConveyorDeviceDriver) {
|
if (startdevice.getDeviceDriver() instanceof HaoKaiAutoConveyorDeviceDriver) {
|
||||||
@@ -429,7 +440,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
if (nextdevice.getDeviceDriver() instanceof EmptyVehicleStackingPositionDeviceDriver) {
|
if (nextdevice.getDeviceDriver() instanceof EmptyVehicleStackingPositionDeviceDriver) {
|
||||||
log.info("创建指令:任务号:{},起点:{},终点:{},message:{}", task_code, start_device_code, next_device_code, "开始创建放叠盘架指令~");
|
log.info("创建指令:任务号:{},起点:{},终点:{},message:{}", task_code, start_device_code, next_device_code, "开始创建放叠盘架指令~");
|
||||||
logServer.createInstInfo("创建指令", task_code, start_device_code, next_device_code, "开始创建放叠盘架指令~");
|
logServer.createInstInfo("创建指令", task_code, start_device_code, next_device_code, "开始创建放叠盘架指令~");
|
||||||
emptyVehicleStackingPositionDeviceDriver = (EmptyVehicleStackingPositionDeviceDriver) startdevice.getDeviceDriver();
|
emptyVehicleStackingPositionDeviceDriver = (EmptyVehicleStackingPositionDeviceDriver) nextdevice.getDeviceDriver();
|
||||||
//已经生成指令得放空托盘数量
|
//已经生成指令得放空托盘数量
|
||||||
Integer emptyNum = taskService.queryEndNum(dto.getStart_device_code(), dto.getNext_device_code());
|
Integer emptyNum = taskService.queryEndNum(dto.getStart_device_code(), dto.getNext_device_code());
|
||||||
log.info("创建指令:任务号:{},起点:{},终点:{},message:{}", task_code, start_device_code, next_device_code, "查询到同一终点任务已经生成指令的搬运托盘的数量为:" + emptyNum);
|
log.info("创建指令:任务号:{},起点:{},终点:{},message:{}", task_code, start_device_code, next_device_code, "查询到同一终点任务已经生成指令的搬运托盘的数量为:" + emptyNum);
|
||||||
|
|||||||
Reference in New Issue
Block a user