fix: 堆垛机清点位校验、开始线程不判断状态

This commit is contained in:
ls
2025-06-24 10:29:05 +08:00
parent 1e82417a81
commit eecb2ea9e7
2 changed files with 16 additions and 15 deletions

View File

@@ -34,17 +34,18 @@ public class AutoRunServiceImpl implements AutoRunService, ApplicationAutoInitia
*/
private List<AbstractAutoRunnable> thread_autoRun = new ArrayList();
/**
* key
* key
*/
private List<String> autoRun_code_index = new ArrayList();
/**
* 运行线程
* 运行线程
*/
private List<Thread> threads = new ArrayList();
/**
* key
* key
*/
private List<String> thread_code_index = new ArrayList();
@Override
public synchronized void startThread(String threadCode) {
Thread thread = this.getThreadByCode(threadCode);
@@ -65,24 +66,23 @@ public class AutoRunServiceImpl implements AutoRunService, ApplicationAutoInitia
Thread thread = this.getThreadByCode(threadCode);
if (thread == null) {
throw new BadRequestException(LangProcess.msg("error_isNull", threadCode));
} else if (!thread.isAlive()) {
throw new BadRequestException(LangProcess.msg("error_status", threadCode));
} else {
}
try {
AbstractAutoRunnable runable = this.getRunablebyCode(threadCode);
runable.stop();
thread.stop();
thread.interrupt();
try {
thread.join();
} catch (InterruptedException arg4) {
arg4.printStackTrace();
}
thread.join();
runable.setStopMessage("人工停止");
runable.setStopTime(new Date());
} catch (Exception arg4) {
arg4.printStackTrace();
throw new BadRequestException(LangProcess.msg("error_status", threadCode));
}
}
@Override

View File

@@ -358,7 +358,8 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
if (!command.equals(last_command)) {
requireSucess = false;
if (command == 0) {
Instruction byCodeFromCache = instructionService.findByCodeFromCache(String.valueOf(task));
if (command == 0 && byCodeFromCache==null) {
clearWrite();
}
}