add: bug修改

This commit is contained in:
ls
2026-01-29 16:28:51 +08:00
parent 04de617a12
commit 60e61f1d99
2 changed files with 26 additions and 32 deletions

View File

@@ -262,7 +262,7 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
requireSucess = false;
}
if (move != 0 && Integer.parseInt(to_task) > 0) {
if (move != 0 && task > 0) {
CompletableFuture.runAsync(() -> {
// 异步更新指令状态
try {

View File

@@ -29,10 +29,7 @@ import org.nl.common.utils.SecurityUtils;
import org.nl.config.SpringContextHolder;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.*;
@Slf4j
@Component
@@ -116,6 +113,30 @@ public class CreateDDJInst {
String start_height = taskDto.getStart_height();
String next_height = taskDto.getNext_height();
//如果是换标任务判断终点1003和1002点位的有无货判断
if (StrUtil.isNotEmpty(taskDto.getStorage_task_type())&& Objects.equals(taskDto.getStorage_task_type(), "1")){
//关联站点判断
BeltConveyorDeviceDriver beltConveyorDeviceDriver;
if (nextDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
beltConveyorDeviceDriver = (BeltConveyorDeviceDriver) nextDevice.getDeviceDriver();
//判断对接位和关联站点光电信号
List<String> getDeviceCodeList = beltConveyorDeviceDriver.getExtraDeviceCodes("link_device_code");
if (CollUtil.isNotEmpty(getDeviceCodeList)) {
String linkDeviceCode = getDeviceCodeList.get(0);
Device linkDevice = appService.findDeviceByCode(linkDeviceCode);
BeltConveyorDeviceDriver linkDeviceDriver;
if (linkDevice.getDeviceDriver() instanceof BeltConveyorDeviceDriver) {
linkDeviceDriver = (BeltConveyorDeviceDriver) linkDevice.getDeviceDriver();
if ((beltConveyorDeviceDriver.getMode() == 0 || beltConveyorDeviceDriver.getMove() == 1) || (linkDeviceDriver.getMode() == 0 || linkDeviceDriver.getMove() == 1)) {
((StandardStackerDeviceDriver) deviceByCode.getDeviceDriver()).setNotCreateInstMessage("无法创建堆垛机指令的原因:换标位" + next_device_code + "条件不满足!");
continue;
}
}
}
}
}
//同排的货位移库任务
if (StrUtil.equals(taskDto.getStart_device_code(), taskDto.getNext_device_code())) {
//通过起点找路由
@@ -385,33 +406,6 @@ public class CreateDDJInst {
instdto.setTo_z(taskDto.getTo_z());
instdto.setTo_y(taskDto.getTo_y());
}
//判断agv系统
//1、1楼叉车系统
//2、2楼1区域AGV系统
//3、2楼2区域AGV系统 -已废弃
if (!StrUtil.equals(agv_system_type, CommonFinalParam.ONE)) {
// task_type
//1、生箔 Itype=1:取空,取满,放空,放满;
//2、分切 Itype=3取满、取空、放满、放空
//3、普通任务 Itype=2:取货、放货;
//4、叉车任务
//5、输送任务
//6、行架
//7、立库
if (StrUtil.equals(task_type, CommonFinalParam.ONE)) {
instdto.setAgv_inst_type(CommonFinalParam.ONE);
} else if (StrUtil.equals(task_type, "3")) {
instdto.setAgv_inst_type("2");
} else if (StrUtil.equals(task_type, "2")) {
instdto.setAgv_inst_type("3");
} else if (StrUtil.equals(task_type, "8")) {
instdto.setAgv_inst_type("2");
} else {
log.info("未找到对应的AGV指令类型任务号:" + taskDto.getTask_code() + ",task_type:" + taskDto.getTask_type());
}
} else {
instdto.setAgv_inst_type("4");
}
try {
instructionService.create(instdto);
} catch (Exception e) {