This commit is contained in:
USER-20220102CG\noblelift
2023-02-03 21:15:09 +08:00
parent 0a9161f770
commit 6f8fed7ea2
3 changed files with 16 additions and 8 deletions

View File

@@ -891,6 +891,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
this.instruction_require_time = date;
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
Instruction instruction = instructionService.findByCode(String.valueOf(task));
if(ObjectUtil.isEmpty(instruction)){
message = "指令号"+task+"未找到对应指令";
return;
}
message = "申请AGV搬运任务中...";
JSONObject apply = new JSONObject();
apply.put("device_code", device_code);

View File

@@ -5,13 +5,15 @@ import org.nl.acs.device_driver.DeviceDriver;
public interface ExecutableDeviceDriver extends DeviceDriver {
default void executeAuto() {
try {
// try {
// this.execute();
// } catch (Throwable var6) {
// String message = "线程调用异常:" + var6.getMessage();
// Log.error(message);
// } finally {
// }
this.execute();
} catch (Throwable var6) {
String message = "线程调用异常:" + var6.getMessage();
Log.error(message);
} finally {
}
}
void execute();

View File

@@ -2,6 +2,7 @@
package org.nl.acs.instruction.service.impl;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
@@ -55,6 +56,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@@ -68,7 +70,7 @@ import java.util.stream.Collectors;
@Slf4j
public class InstructionServiceImpl implements InstructionService, ApplicationAutoInitial {
List<Instruction> instructions = new ArrayList();
List<Instruction> instructions = new CopyOnWriteArrayList();
@Autowired
DeviceAppService deviceAppService;
@@ -1218,7 +1220,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
public Instruction findByDeviceCodeFromCache(String devicecode) {
List<Instruction> instructionList = instructions;
Collections.sort(instructionList, new Comparator<Instruction>() {
ListUtil.sort(instructionList, new Comparator<Instruction>() {
@Override
public int compare(Instruction o1, Instruction o2) {
return o1.getCreate_time().compareTo(o2.getCreate_time());