This commit is contained in:
2023-03-09 18:03:14 +08:00
parent e937a59165
commit 8e5e73b41b
2 changed files with 20 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
package org.nl.acs.agv.server.impl;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
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.task.service.TaskService;
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.wql.util.SpringContextHolder;
import org.springframework.stereotype.Service;
@@ -271,6 +273,9 @@ public class ZheDaAgvServiceImpl implements ZheDaAgvService {
JSONObject respjson = JSONObject.parseObject(resp);
if (StrUtil.equals(inst.getInstruction_type(), "3")) {
if (ObjectUtil.isNotEmpty(respjson) && respjson.getInteger("status") != 200) {
throw new BadRequestException(respjson.getString("message"));
}
//2楼AGV起点追加任务
String start_device_code = respjson.getString("device_code");
String next_device_code = inst.getNext_device_code();

View File

@@ -339,11 +339,16 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
throw new BadRequestException("设备:" + nextdevice.getDevice_code() + "未设置楼层!");
}
cargoLiftConveyorDeviceDriver.writing(1, 0);
cargoLiftConveyorDeviceDriver.writing(1, 1);
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(4, Integer.parseInt(door));
cargoLiftConveyorDeviceDriver.writing(4, Integer.parseInt(door));
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) {
@@ -364,11 +369,17 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
throw new BadRequestException("设备:" + nextdevice.getDevice_code() + "未设置楼层!");
}
cargoLiftConveyorDeviceDriver.writing(1, 0);
standardCoveyorControlWithScannerDeviceDriver.writing(1, 1);
standardCoveyorControlWithScannerDeviceDriver.writing(2, Integer.parseInt(address));
cargoLiftConveyorDeviceDriver.writing(1, 0);
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(5, Integer.parseInt(floor));
standardCoveyorControlWithScannerDeviceDriver.writing(5, Integer.parseInt(floor));
standardCoveyorControlWithScannerDeviceDriver.writing(1, 1);
standardCoveyorControlWithScannerDeviceDriver.writing(1, 1);
}
}
if (startdevice.getDeviceDriver() instanceof HaoKaiAutoConveyorDeviceDriver) {
@@ -429,7 +440,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
if (nextdevice.getDeviceDriver() instanceof EmptyVehicleStackingPositionDeviceDriver) {
log.info("创建指令:任务号:{},起点:{},终点:{},message:{}", 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());
log.info("创建指令:任务号:{},起点:{},终点:{},message:{}", task_code, start_device_code, next_device_code, "查询到同一终点任务已经生成指令的搬运托盘的数量为:" + emptyNum);